Skip to content

Commit 8ef742a

Browse files
authored
Merge pull request #11370 from u-blox/ublox_odin_driver_os_5_v3.7.1_rc1
Driver Updates + ARMC6 driver support + WIFI fixes
2 parents 98c0fd0 + 7f36fbc commit 8ef742a

File tree

9 files changed

+211
-179
lines changed

9 files changed

+211
-179
lines changed

features/netsocket/emac-drivers/TARGET_STM_EMAC/TARGET_STM32F4/TARGET_MODULE_UBLOX_ODIN_W2/wifi_emac/wifi_emac.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ OdinWiFiEMAC::OdinWiFiEMAC()
204204

205205
void send_wlan_packet(void *buf)
206206
{
207-
cbWLAN_sendPacket(buf);
207+
cbWLAN_sendPacket(cbWLAN_DEFAULT_HANDLE, buf);
208208
}
209209

210210
bool OdinWiFiEMAC::link_out(emac_mem_buf_t *buf)
@@ -264,7 +264,7 @@ void OdinWiFiEMAC::set_link_input_cb(emac_link_input_cb_t input_cb)
264264
emac_link_input_cb = input_cb;
265265

266266
cbMAIN_driverLock();
267-
cbWLAN_registerPacketIndicationCallback(handleWlanPacketIndication, NULL);
267+
cbWLAN_registerPacketIndicationCallback(cbWLAN_DEFAULT_HANDLE, handleWlanPacketIndication, NULL);
268268
cbMAIN_driverUnlock();
269269
}
270270

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.cpp

Lines changed: 137 additions & 122 deletions
Large diffs are not rendered by default.

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ class OdinWiFiInterface : public WiFiInterface, public EMACInterface
346346
cbWLAN_MACAddress bssid[ODIN_WIFI_SCAN_CACHE_SIZE];
347347
};
348348

349+
cbWLAN_Handle handle = cbWLAN_INVALID_HANDLE;
349350
OdinWifiState entry_connect_fail_wait_disconnect();
350351
OdinWifiState entry_wait_connect();
351352
OdinWifiState entry_wait_disconnect();
@@ -430,10 +431,10 @@ class OdinWiFiInterface : public WiFiInterface, public EMACInterface
430431
friend struct wlan_callb_s;
431432

432433
Mutex _mutex;
433-
Queue<odin_wifi_msg_s, 6> _in_queue;
434+
Queue<odin_wifi_msg_s, 10> _in_queue;
434435
Queue<odin_wifi_msg_s, 1> _out_queue;
435436
Queue<odin_wifi_msg_s, 1> _cache_queue;
436-
MemoryPool<odin_wifi_msg_s, 7> *_msg_pool;
437+
MemoryPool<odin_wifi_msg_s, 11> *_msg_pool;
437438
Thread _thread;
438439
Timer _timer;
439440

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/cb_wlan.h

Lines changed: 67 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ extern "C" {
8383
#define cbWLAN_RSNIE_SIZE 44
8484
#define cbWLAN_MDIE_SIZE 5
8585

86+
#define cbWLAN_DEFAULT_HANDLE ((cbWLAN_Handle)1)
87+
#define cbWLAN_INVALID_HANDLE (cb_UINT32_MAX)
8688
/*===========================================================================
8789
* TYPES
8890
*=========================================================================*/
89-
91+
typedef cb_uint32 cbWLAN_Handle;
9092
/**
9193
* Start parameters passed to WLAN driver.
9294
*
@@ -282,12 +284,13 @@ typedef enum {
282284
* @ingroup wlan
283285
*/
284286
typedef enum {
285-
cbWLAN_STATUS_DISCONNECTED_UNKNOWN,
287+
cbWLAN_STATUS_DISCONNECTED_UNKNOWN = 0x00,
286288
cbWLAN_STATUS_DISCONNECTED_NO_BSSID_FOUND,
287-
cbWLAN_STATUS_DISCONNECTED_AUTH_TIMEOUT,
288-
cbWLAN_STATUS_DISCONNECTED_MIC_FAILURE,
289+
cbWLAN_STATUS_DISCONNECTED_ASSOC_FAILURE,
290+
cbWLAN_STATUS_DISCONNECTED_AUTH_FAILURE,
291+
cbWLAN_STATUS_DISCONNECTED_MIC_FAILURE,
289292
cbWLAN_STATUS_DISCONNECTED_ROAMING,
290-
} cbWLAN_StatusDisconnectedInfo;
293+
} cbWLAN_StatusDisconnectedReason;
291294

292295
/**
293296
* IOCTL parameters @ref cbWLAN_ioctl
@@ -312,14 +315,26 @@ typedef struct cbWLAN_StatusStartedInfo {
312315
} cbWLAN_StatusStartedInfo;
313316

314317
/**
315-
* Connected parameters indicated from WLAN driver for status indication
318+
* Disconnected parameters indicated from WLAN driver for status indication
319+
* @ref cbWLAN_STATUS_DISCONNECTED.
320+
*
321+
* @ingroup wlan
322+
*/
323+
typedef struct cbWLAN_StatusDisconnectedInfo {
324+
cbWLAN_Handle handle; /**< Handle returned by cbWLAN_connectXXX */
325+
cbWLAN_StatusDisconnectedReason reason;
326+
} cbWLAN_StatusDisconnectedInfo;
327+
328+
/**
329+
* Connected parameters indicated from WLAN driver for status indication
316330
* @ref cbWLAN_STATUS_CONNECTED.
317331
*
318332
* @ingroup wlan
319333
*/
320334
typedef struct cbWLAN_StatusConnectedInfo {
321-
cbWLAN_MACAddress bssid; /**< BSSID of the BSS connected to. */
322-
cbWLAN_Channel channel; /**< Operating channels of the BSS connected to. */
335+
cbWLAN_Handle handle; /**< Handle returned by cbWLAN_connectXXX */
336+
cbWLAN_MACAddress bssid; /**< BSSID of the BSS connected to. */
337+
cbWLAN_Channel channel; /**< Operating channels of the BSS connected to. */
323338
cb_uint16 mobilityDomainId;
324339
} cbWLAN_StatusConnectedInfo;
325340

@@ -385,51 +400,51 @@ cbRTSL_Status cbWLAN_init();
385400
cbRTSL_Status cbWLAN_stop(void);
386401

387402
/**
388-
* Connect to access point in open mode (no encryption).
389-
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
390-
*
391-
* @param commonParams Connection parameters.
392-
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
393-
*/
394-
cbRTSL_Status cbWLAN_connectOpen(cbWLAN_CommonConnectParameters *commonParams);
403+
* Connect to access point in open mode (no encryption).
404+
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
405+
*
406+
* @param commonParams Connection parameters.
407+
* @return @ref cbWLAN_Handle if call successful, otherwise -1.
408+
*/
409+
cbWLAN_Handle cbWLAN_connectOpen(cbWLAN_CommonConnectParameters *commonParams);
395410

396411
/**
397-
* Connect to access point in open mode with WEP encryption.
398-
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
399-
*
400-
* @param commonParams Connection parameters.
401-
* @param wepParams WEP specific connection parameters.
402-
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
403-
*/
404-
cbRTSL_Status cbWLAN_connectWEP(cbWLAN_CommonConnectParameters *commonParams, cbWLAN_WEPConnectParameters *wepParams);
412+
* Connect to access point in open mode with WEP encryption.
413+
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
414+
*
415+
* @param commonParams Connection parameters.
416+
* @param wepParams WEP specific connection parameters.
417+
* @return @ref cbWLAN_Handle if call successful, otherwise -1.
418+
*/
419+
cbWLAN_Handle cbWLAN_connectWEP(cbWLAN_CommonConnectParameters *commonParams, cbWLAN_WEPConnectParameters *wepParams);
405420

406421
/**
407-
* Connect to access point with WPA PSK authentication.
408-
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
409-
*
410-
* @param commonParams Connection parameters.
411-
* @param wpaParams WPA PSK specific connection parameters.
412-
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
413-
*/
414-
cbRTSL_Status cbWLAN_connectWPAPSK(cbWLAN_CommonConnectParameters *commonParams, cbWLAN_WPAPSKConnectParameters *wpaParams);
422+
* Connect to access point with WPA PSK authentication.
423+
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
424+
*
425+
* @param commonParams Connection parameters.
426+
* @param wpaParams WPA PSK specific connection parameters.
427+
* @return @ref cbWLAN_Handle if call successful, otherwise -1.
428+
*/
429+
cbWLAN_Handle cbWLAN_connectWPAPSK(cbWLAN_CommonConnectParameters *commonParams, cbWLAN_WPAPSKConnectParameters *wpaParams);
415430

416431
/**
417-
* Connect to access point with WPA Enterprise authentication.
418-
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
419-
*
420-
* @param commonParams Connection parameters.
421-
* @param enterpriseParams WPA Enterprise specific connection parameters.
422-
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
423-
*/
424-
cbRTSL_Status cbWLAN_connectEnterprise(cbWLAN_CommonConnectParameters *commonParams, cbWLAN_EnterpriseConnectParameters *enterpriseParams);
432+
* Connect to access point with WPA Enterprise authentication.
433+
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
434+
*
435+
* @param commonParams Connection parameters.
436+
* @param enterpriseParams WPA Enterprise specific connection parameters.
437+
* @return @ref cbWLAN_Handle if call successful, otherwise -1.
438+
*/
439+
cbWLAN_Handle cbWLAN_connectEnterprise(cbWLAN_CommonConnectParameters *commonParams, cbWLAN_EnterpriseConnectParameters *enterpriseParams);
425440

426441
/**
427442
* Disconnect from access point or stop ongoing connection attempt.
428443
* Disconnection progress is reported as @ref cbWLAN_statusIndication callback.
429444
*
430445
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
431446
*/
432-
cbRTSL_Status cbWLAN_disconnect(void);
447+
cbRTSL_Status cbWLAN_disconnect(cbWLAN_Handle handle);
433448

434449
/**
435450
* Initiate BSS scan.
@@ -459,38 +474,38 @@ cbRTSL_Status cbWLAN_scan(cbWLAN_ScanParameters *params, cbWLAN_scanIndication s
459474
cb_int16 cbWLAN_STA_getRSSI();
460475

461476
/**
462-
* Start access point in open mode (no encryption).
463-
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
464-
*
465-
* @param commonParams Common Accesspoint parameters.
466-
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
467-
*/
468-
cbRTSL_Status cbWLAN_apStartOpen(cbWLAN_CommonApParameters *commonParams);
477+
* Start access point in open mode (no encryption).
478+
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
479+
*
480+
* @param commonParams Common Accesspoint parameters.
481+
* @return @ref cbWLAN_Handle if call successful, otherwise -1.
482+
*/
483+
cbWLAN_Handle cbWLAN_apStartOpen(cbWLAN_CommonApParameters *commonParams);
469484

470485
/**
471486
* Start access point with WPA PSK authentication.
472487
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
473488
*
474489
* @param commonParams Common Accesspoint parameters.
475490
* @param wpaParams WPA PSK specific parameters.
476-
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
491+
* @return @ref cbWLAN_Handle if call successful, otherwise -1.
477492
*/
478-
cbRTSL_Status cbWLAN_apStartWPAPSK(cbWLAN_CommonApParameters *commonParams, cbWLAN_WPAPSKApParameters *wpaParams);
493+
cbWLAN_Handle cbWLAN_apStartWPAPSK(cbWLAN_CommonApParameters *commonParams, cbWLAN_WPAPSKApParameters *wpaParams);
479494

480495
/**
481496
* Stop access point.
482497
*
483498
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
484499
*/
485-
cbRTSL_Status cbWLAN_apStop(void);
500+
cbRTSL_Status cbWLAN_apStop(cbWLAN_Handle handle);
486501

487502
/**
488503
* Send an Ethernet data packet.
489504
* @note Data send when not in connected state is just dropped.
490505
*
491506
* @param txData Pointer to the port specific Ethernet data type containing transmit data
492507
*/
493-
void cbWLAN_sendPacket(void *txData);
508+
void cbWLAN_sendPacket(cbWLAN_Handle handle, void *txData);
494509

495510
/**
496511
* Register a status indication callback.
@@ -510,7 +525,7 @@ cbRTSL_Status cbWLAN_registerStatusCallback(cbWLAN_statusIndication statusIndica
510525
* @param callbackContext Context pointer, will be sent back in callback.
511526
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
512527
*/
513-
cbRTSL_Status cbWLAN_registerPacketIndicationCallback(cbWLAN_packetIndication packetIndication, void *callbackContext);
528+
cbRTSL_Status cbWLAN_registerPacketIndicationCallback(cbWLAN_Handle handle, cbWLAN_packetIndication packetIndication, void *callbackContext);
514529

515530
/**
516531
* Deregister the specified status indication callback.

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/enterprise_handle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ extern "C" {
6262
* @param enterpriseParams Enterprise parameters.
6363
* @return 0 on success, or error code on failure
6464
*/
65-
cbRTSL_Status cb_eap_conn_handler(cb_char const* cert, cb_char const* pvt_key, cbWLAN_CommonConnectParameters *commonParams, cbWLAN_EnterpriseConnectParameters *enterpriseParams);
65+
cbWLAN_Handle cb_eap_conn_handler(cb_char const* cert, cb_char const* pvt_key, cbWLAN_CommonConnectParameters *commonParams, cbWLAN_EnterpriseConnectParameters *enterpriseParams);
6666

6767
#ifdef __cplusplus
6868
}

targets/targets.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4647,6 +4647,7 @@
46474647
"WLAN_ENABLED",
46484648
"CB_FEATURE_802DOT11W",
46494649
"CB_FEATURE_802DOT11R",
4650+
"CB_FEATURE_PMKCACHING",
46504651
"MBEDTLS_ARC4_C",
46514652
"MBEDTLS_DES_C",
46524653
"MBEDTLS_MD4_C",

0 commit comments

Comments
 (0)