Skip to content

Commit

Permalink
Merge pull request #11370 from u-blox/ublox_odin_driver_os_5_v3.7.1_rc1
Browse files Browse the repository at this point in the history
Driver Updates + ARMC6 driver support + WIFI fixes
  • Loading branch information
0xc0170 authored Aug 29, 2019
2 parents 98c0fd0 + 7f36fbc commit 8ef742a
Show file tree
Hide file tree
Showing 9 changed files with 211 additions and 179 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ OdinWiFiEMAC::OdinWiFiEMAC()

void send_wlan_packet(void *buf)
{
cbWLAN_sendPacket(buf);
cbWLAN_sendPacket(cbWLAN_DEFAULT_HANDLE, buf);
}

bool OdinWiFiEMAC::link_out(emac_mem_buf_t *buf)
Expand Down Expand Up @@ -264,7 +264,7 @@ void OdinWiFiEMAC::set_link_input_cb(emac_link_input_cb_t input_cb)
emac_link_input_cb = input_cb;

cbMAIN_driverLock();
cbWLAN_registerPacketIndicationCallback(handleWlanPacketIndication, NULL);
cbWLAN_registerPacketIndicationCallback(cbWLAN_DEFAULT_HANDLE, handleWlanPacketIndication, NULL);
cbMAIN_driverUnlock();
}

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ class OdinWiFiInterface : public WiFiInterface, public EMACInterface
cbWLAN_MACAddress bssid[ODIN_WIFI_SCAN_CACHE_SIZE];
};

cbWLAN_Handle handle = cbWLAN_INVALID_HANDLE;
OdinWifiState entry_connect_fail_wait_disconnect();
OdinWifiState entry_wait_connect();
OdinWifiState entry_wait_disconnect();
Expand Down Expand Up @@ -430,10 +431,10 @@ class OdinWiFiInterface : public WiFiInterface, public EMACInterface
friend struct wlan_callb_s;

Mutex _mutex;
Queue<odin_wifi_msg_s, 6> _in_queue;
Queue<odin_wifi_msg_s, 10> _in_queue;
Queue<odin_wifi_msg_s, 1> _out_queue;
Queue<odin_wifi_msg_s, 1> _cache_queue;
MemoryPool<odin_wifi_msg_s, 7> *_msg_pool;
MemoryPool<odin_wifi_msg_s, 11> *_msg_pool;
Thread _thread;
Timer _timer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ extern "C" {
#define cbWLAN_RSNIE_SIZE 44
#define cbWLAN_MDIE_SIZE 5

#define cbWLAN_DEFAULT_HANDLE ((cbWLAN_Handle)1)
#define cbWLAN_INVALID_HANDLE (cb_UINT32_MAX)
/*===========================================================================
* TYPES
*=========================================================================*/

typedef cb_uint32 cbWLAN_Handle;
/**
* Start parameters passed to WLAN driver.
*
Expand Down Expand Up @@ -282,12 +284,13 @@ typedef enum {
* @ingroup wlan
*/
typedef enum {
cbWLAN_STATUS_DISCONNECTED_UNKNOWN,
cbWLAN_STATUS_DISCONNECTED_UNKNOWN = 0x00,
cbWLAN_STATUS_DISCONNECTED_NO_BSSID_FOUND,
cbWLAN_STATUS_DISCONNECTED_AUTH_TIMEOUT,
cbWLAN_STATUS_DISCONNECTED_MIC_FAILURE,
cbWLAN_STATUS_DISCONNECTED_ASSOC_FAILURE,
cbWLAN_STATUS_DISCONNECTED_AUTH_FAILURE,
cbWLAN_STATUS_DISCONNECTED_MIC_FAILURE,
cbWLAN_STATUS_DISCONNECTED_ROAMING,
} cbWLAN_StatusDisconnectedInfo;
} cbWLAN_StatusDisconnectedReason;

/**
* IOCTL parameters @ref cbWLAN_ioctl
Expand All @@ -312,14 +315,26 @@ typedef struct cbWLAN_StatusStartedInfo {
} cbWLAN_StatusStartedInfo;

/**
* Connected parameters indicated from WLAN driver for status indication
* Disconnected parameters indicated from WLAN driver for status indication
* @ref cbWLAN_STATUS_DISCONNECTED.
*
* @ingroup wlan
*/
typedef struct cbWLAN_StatusDisconnectedInfo {
cbWLAN_Handle handle; /**< Handle returned by cbWLAN_connectXXX */
cbWLAN_StatusDisconnectedReason reason;
} cbWLAN_StatusDisconnectedInfo;

/**
* Connected parameters indicated from WLAN driver for status indication
* @ref cbWLAN_STATUS_CONNECTED.
*
* @ingroup wlan
*/
typedef struct cbWLAN_StatusConnectedInfo {
cbWLAN_MACAddress bssid; /**< BSSID of the BSS connected to. */
cbWLAN_Channel channel; /**< Operating channels of the BSS connected to. */
cbWLAN_Handle handle; /**< Handle returned by cbWLAN_connectXXX */
cbWLAN_MACAddress bssid; /**< BSSID of the BSS connected to. */
cbWLAN_Channel channel; /**< Operating channels of the BSS connected to. */
cb_uint16 mobilityDomainId;
} cbWLAN_StatusConnectedInfo;

Expand Down Expand Up @@ -385,51 +400,51 @@ cbRTSL_Status cbWLAN_init();
cbRTSL_Status cbWLAN_stop(void);

/**
* Connect to access point in open mode (no encryption).
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
*
* @param commonParams Connection parameters.
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
*/
cbRTSL_Status cbWLAN_connectOpen(cbWLAN_CommonConnectParameters *commonParams);
* Connect to access point in open mode (no encryption).
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
*
* @param commonParams Connection parameters.
* @return @ref cbWLAN_Handle if call successful, otherwise -1.
*/
cbWLAN_Handle cbWLAN_connectOpen(cbWLAN_CommonConnectParameters *commonParams);

/**
* Connect to access point in open mode with WEP encryption.
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
*
* @param commonParams Connection parameters.
* @param wepParams WEP specific connection parameters.
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
*/
cbRTSL_Status cbWLAN_connectWEP(cbWLAN_CommonConnectParameters *commonParams, cbWLAN_WEPConnectParameters *wepParams);
* Connect to access point in open mode with WEP encryption.
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
*
* @param commonParams Connection parameters.
* @param wepParams WEP specific connection parameters.
* @return @ref cbWLAN_Handle if call successful, otherwise -1.
*/
cbWLAN_Handle cbWLAN_connectWEP(cbWLAN_CommonConnectParameters *commonParams, cbWLAN_WEPConnectParameters *wepParams);

/**
* Connect to access point with WPA PSK authentication.
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
*
* @param commonParams Connection parameters.
* @param wpaParams WPA PSK specific connection parameters.
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
*/
cbRTSL_Status cbWLAN_connectWPAPSK(cbWLAN_CommonConnectParameters *commonParams, cbWLAN_WPAPSKConnectParameters *wpaParams);
* Connect to access point with WPA PSK authentication.
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
*
* @param commonParams Connection parameters.
* @param wpaParams WPA PSK specific connection parameters.
* @return @ref cbWLAN_Handle if call successful, otherwise -1.
*/
cbWLAN_Handle cbWLAN_connectWPAPSK(cbWLAN_CommonConnectParameters *commonParams, cbWLAN_WPAPSKConnectParameters *wpaParams);

/**
* Connect to access point with WPA Enterprise authentication.
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
*
* @param commonParams Connection parameters.
* @param enterpriseParams WPA Enterprise specific connection parameters.
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
*/
cbRTSL_Status cbWLAN_connectEnterprise(cbWLAN_CommonConnectParameters *commonParams, cbWLAN_EnterpriseConnectParameters *enterpriseParams);
* Connect to access point with WPA Enterprise authentication.
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
*
* @param commonParams Connection parameters.
* @param enterpriseParams WPA Enterprise specific connection parameters.
* @return @ref cbWLAN_Handle if call successful, otherwise -1.
*/
cbWLAN_Handle cbWLAN_connectEnterprise(cbWLAN_CommonConnectParameters *commonParams, cbWLAN_EnterpriseConnectParameters *enterpriseParams);

/**
* Disconnect from access point or stop ongoing connection attempt.
* Disconnection progress is reported as @ref cbWLAN_statusIndication callback.
*
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
*/
cbRTSL_Status cbWLAN_disconnect(void);
cbRTSL_Status cbWLAN_disconnect(cbWLAN_Handle handle);

/**
* Initiate BSS scan.
Expand Down Expand Up @@ -459,38 +474,38 @@ cbRTSL_Status cbWLAN_scan(cbWLAN_ScanParameters *params, cbWLAN_scanIndication s
cb_int16 cbWLAN_STA_getRSSI();

/**
* Start access point in open mode (no encryption).
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
*
* @param commonParams Common Accesspoint parameters.
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
*/
cbRTSL_Status cbWLAN_apStartOpen(cbWLAN_CommonApParameters *commonParams);
* Start access point in open mode (no encryption).
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
*
* @param commonParams Common Accesspoint parameters.
* @return @ref cbWLAN_Handle if call successful, otherwise -1.
*/
cbWLAN_Handle cbWLAN_apStartOpen(cbWLAN_CommonApParameters *commonParams);

/**
* Start access point with WPA PSK authentication.
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
*
* @param commonParams Common Accesspoint parameters.
* @param wpaParams WPA PSK specific parameters.
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
* @return @ref cbWLAN_Handle if call successful, otherwise -1.
*/
cbRTSL_Status cbWLAN_apStartWPAPSK(cbWLAN_CommonApParameters *commonParams, cbWLAN_WPAPSKApParameters *wpaParams);
cbWLAN_Handle cbWLAN_apStartWPAPSK(cbWLAN_CommonApParameters *commonParams, cbWLAN_WPAPSKApParameters *wpaParams);

/**
* Stop access point.
*
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
*/
cbRTSL_Status cbWLAN_apStop(void);
cbRTSL_Status cbWLAN_apStop(cbWLAN_Handle handle);

/**
* Send an Ethernet data packet.
* @note Data send when not in connected state is just dropped.
*
* @param txData Pointer to the port specific Ethernet data type containing transmit data
*/
void cbWLAN_sendPacket(void *txData);
void cbWLAN_sendPacket(cbWLAN_Handle handle, void *txData);

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

/**
* Deregister the specified status indication callback.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ extern "C" {
* @param enterpriseParams Enterprise parameters.
* @return 0 on success, or error code on failure
*/
cbRTSL_Status cb_eap_conn_handler(cb_char const* cert, cb_char const* pvt_key, cbWLAN_CommonConnectParameters *commonParams, cbWLAN_EnterpriseConnectParameters *enterpriseParams);
cbWLAN_Handle cb_eap_conn_handler(cb_char const* cert, cb_char const* pvt_key, cbWLAN_CommonConnectParameters *commonParams, cbWLAN_EnterpriseConnectParameters *enterpriseParams);

#ifdef __cplusplus
}
Expand Down
1 change: 1 addition & 0 deletions targets/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -4647,6 +4647,7 @@
"WLAN_ENABLED",
"CB_FEATURE_802DOT11W",
"CB_FEATURE_802DOT11R",
"CB_FEATURE_PMKCACHING",
"MBEDTLS_ARC4_C",
"MBEDTLS_DES_C",
"MBEDTLS_MD4_C",
Expand Down

0 comments on commit 8ef742a

Please sign in to comment.