|
@@ -27,8 +27,7 @@
|
|
|
#include <wlan_cfg80211.h>
|
|
|
#include "wlan_cfg80211_cm_util.h"
|
|
|
|
|
|
-static void wlan_osif_free_wep_key_params(
|
|
|
- struct wlan_cm_connect_req *connect_req)
|
|
|
+static void osif_cm_free_wep_key_params(struct wlan_cm_connect_req *connect_req)
|
|
|
{
|
|
|
if (connect_req->crypto.wep_keys.key) {
|
|
|
qdf_mem_free(connect_req->crypto.wep_keys.key);
|
|
@@ -40,7 +39,7 @@ static void wlan_osif_free_wep_key_params(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static QDF_STATUS wlan_osif_set_wep_key_params(
|
|
|
+static QDF_STATUS osif_cm_set_wep_key_params(
|
|
|
struct wlan_cm_connect_req *connect_req,
|
|
|
struct cfg80211_connect_params *req)
|
|
|
{
|
|
@@ -76,8 +75,8 @@ static QDF_STATUS wlan_osif_set_wep_key_params(
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-static void wlan_osif_set_auth_type(struct wlan_cm_connect_req *connect_req,
|
|
|
- struct cfg80211_connect_params *req)
|
|
|
+static void osif_cm_set_auth_type(struct wlan_cm_connect_req *connect_req,
|
|
|
+ struct cfg80211_connect_params *req)
|
|
|
{
|
|
|
wlan_crypto_auth_mode crypto_auth_type =
|
|
|
osif_nl_to_crypto_auth_type(req->auth_type);
|
|
@@ -97,8 +96,8 @@ static void wlan_osif_set_auth_type(struct wlan_cm_connect_req *connect_req,
|
|
|
}
|
|
|
|
|
|
static
|
|
|
-QDF_STATUS wlan_osif_set_crypto_params(struct wlan_cm_connect_req *connect_req,
|
|
|
- struct cfg80211_connect_params *req)
|
|
|
+QDF_STATUS osif_cm_set_crypto_params(struct wlan_cm_connect_req *connect_req,
|
|
|
+ struct cfg80211_connect_params *req)
|
|
|
{
|
|
|
uint32_t i = 0;
|
|
|
QDF_STATUS status;
|
|
@@ -107,7 +106,7 @@ QDF_STATUS wlan_osif_set_crypto_params(struct wlan_cm_connect_req *connect_req,
|
|
|
|
|
|
connect_req->crypto.wpa_versions = req->crypto.wpa_versions;
|
|
|
|
|
|
- wlan_osif_set_auth_type(connect_req, req);
|
|
|
+ osif_cm_set_auth_type(connect_req, req);
|
|
|
|
|
|
if (req->crypto.cipher_group)
|
|
|
cipher = osif_nl_to_crypto_cipher_type(cipher);
|
|
@@ -142,7 +141,7 @@ QDF_STATUS wlan_osif_set_crypto_params(struct wlan_cm_connect_req *connect_req,
|
|
|
}
|
|
|
|
|
|
/* Fill WEP Key information */
|
|
|
- status = wlan_osif_set_wep_key_params(connect_req, req);
|
|
|
+ status = osif_cm_set_wep_key_params(connect_req, req);
|
|
|
if (QDF_IS_STATUS_ERROR(status))
|
|
|
osif_err("set wep key params failed");
|
|
|
|
|
@@ -150,7 +149,7 @@ QDF_STATUS wlan_osif_set_crypto_params(struct wlan_cm_connect_req *connect_req,
|
|
|
}
|
|
|
|
|
|
#ifdef WLAN_FEATURE_FILS_SK
|
|
|
-static bool wlan_osif_is_fils_auth_type(enum nl80211_auth_type auth_type)
|
|
|
+static bool osif_cm_is_fils_auth_type(enum nl80211_auth_type auth_type)
|
|
|
{
|
|
|
switch (auth_type) {
|
|
|
case NL80211_AUTHTYPE_FILS_SK:
|
|
@@ -162,7 +161,7 @@ static bool wlan_osif_is_fils_auth_type(enum nl80211_auth_type auth_type)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static bool wlan_osif_is_akm_suite_fils(uint32_t key_mgmt)
|
|
|
+static bool osif_cm_is_akm_suite_fils(uint32_t key_mgmt)
|
|
|
{
|
|
|
switch (key_mgmt) {
|
|
|
case WLAN_AKM_SUITE_FILS_SHA256:
|
|
@@ -175,12 +174,12 @@ static bool wlan_osif_is_akm_suite_fils(uint32_t key_mgmt)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static bool wlan_osif_is_conn_type_fils(struct cfg80211_connect_params *req)
|
|
|
+static bool osif_cm_is_conn_type_fils(struct cfg80211_connect_params *req)
|
|
|
{
|
|
|
int num_akm_suites = req->crypto.n_akm_suites;
|
|
|
uint32_t key_mgmt = req->crypto.akm_suites[0];
|
|
|
bool is_fils_auth_type =
|
|
|
- wlan_osif_is_fils_auth_type(req->auth_type);
|
|
|
+ osif_cm_is_fils_auth_type(req->auth_type);
|
|
|
|
|
|
if (num_akm_suites <= 0)
|
|
|
return false;
|
|
@@ -192,7 +191,7 @@ static bool wlan_osif_is_conn_type_fils(struct cfg80211_connect_params *req)
|
|
|
req->auth_type != NL80211_AUTHTYPE_OPEN_SYSTEM)
|
|
|
return false;
|
|
|
|
|
|
- if (!wlan_osif_is_akm_suite_fils(key_mgmt))
|
|
|
+ if (!osif_cm_is_akm_suite_fils(key_mgmt))
|
|
|
return false;
|
|
|
|
|
|
osif_debug("Fils Auth %d AKM %d", req->auth_type, key_mgmt);
|
|
@@ -200,12 +199,11 @@ static bool wlan_osif_is_conn_type_fils(struct cfg80211_connect_params *req)
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-static QDF_STATUS wlan_osif_set_fils_info(
|
|
|
- struct wlan_cm_connect_req *connect_req,
|
|
|
- struct cfg80211_connect_params *req)
|
|
|
+static QDF_STATUS osif_cm_set_fils_info(struct wlan_cm_connect_req *connect_req,
|
|
|
+ struct cfg80211_connect_params *req)
|
|
|
{
|
|
|
connect_req->fils_info.is_fils_connection =
|
|
|
- wlan_osif_is_conn_type_fils(req);
|
|
|
+ osif_cm_is_conn_type_fils(req);
|
|
|
connect_req->fils_info.username_len = req->fils_erp_username_len;
|
|
|
|
|
|
if (connect_req->fils_info.username_len >
|
|
@@ -243,24 +241,24 @@ static QDF_STATUS wlan_osif_set_fils_info(
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
#else
|
|
|
-static inline QDF_STATUS wlan_osif_set_fils_info(
|
|
|
- struct wlan_cm_connect_req *connect_req,
|
|
|
- struct cfg80211_connect_params *req)
|
|
|
+static inline
|
|
|
+QDF_STATUS osif_cm_set_fils_info(struct wlan_cm_connect_req *connect_req,
|
|
|
+ struct cfg80211_connect_params *req)
|
|
|
{
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
|
|
|
-static inline void wlan_osif_set_prev_bssid(
|
|
|
- struct wlan_cm_connect_req *connect_req,
|
|
|
- struct cfg80211_connect_params *req)
|
|
|
+static inline void
|
|
|
+osif_cm_set_prev_bssid(struct wlan_cm_connect_req *connect_req,
|
|
|
+ struct cfg80211_connect_params *req)
|
|
|
{
|
|
|
qdf_mem_copy(connect_req->prev_bssid.bytes, req->prev_bssid,
|
|
|
QDF_MAC_ADDR_SIZE);
|
|
|
}
|
|
|
|
|
|
-static inline void osif_dump_prev_bssid(struct cfg80211_connect_params *req)
|
|
|
+static inline void osif_cm_dump_prev_bssid(struct cfg80211_connect_params *req)
|
|
|
{
|
|
|
if (req->prev_bssid)
|
|
|
osif_nofl_debug("prev BSSID "QDF_MAC_ADDR_FMT,
|
|
@@ -268,19 +266,19 @@ static inline void osif_dump_prev_bssid(struct cfg80211_connect_params *req)
|
|
|
}
|
|
|
|
|
|
#else
|
|
|
-static inline void wlan_osif_set_prev_bssid(
|
|
|
- struct wlan_cm_connect_req *connect_req,
|
|
|
- struct cfg80211_connect_params *req);
|
|
|
+static inline void
|
|
|
+osif_cm_set_prev_bssid(struct wlan_cm_connect_req *connect_req,
|
|
|
+ struct cfg80211_connect_params *req);
|
|
|
|
|
|
-static inline void osif_dump_prev_bssid(struct cfg80211_connect_params *req)
|
|
|
+static inline void osif_cm_dump_prev_bssid(struct cfg80211_connect_params *req)
|
|
|
{
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
-static inline void osif_dump_connect_req(struct net_device *dev,
|
|
|
- uint8_t vdev_id,
|
|
|
- struct cfg80211_connect_params *req)
|
|
|
+static inline void osif_cm_dump_connect_req(struct net_device *dev,
|
|
|
+ uint8_t vdev_id,
|
|
|
+ struct cfg80211_connect_params *req)
|
|
|
{
|
|
|
uint32_t i;
|
|
|
|
|
@@ -299,7 +297,7 @@ static inline void osif_dump_connect_req(struct net_device *dev,
|
|
|
if (req->bssid_hint)
|
|
|
osif_nofl_debug("BSSID hint "QDF_MAC_ADDR_FMT,
|
|
|
QDF_MAC_ADDR_REF(req->bssid_hint));
|
|
|
- osif_dump_prev_bssid(req);
|
|
|
+ osif_cm_dump_prev_bssid(req);
|
|
|
|
|
|
for (i = 0; i < req->crypto.n_akm_suites; i++)
|
|
|
osif_nofl_debug("akm[%d] = %x", i, req->crypto.akm_suites[i]);
|
|
@@ -309,16 +307,15 @@ static inline void osif_dump_connect_req(struct net_device *dev,
|
|
|
req->crypto.ciphers_pairwise[i]);
|
|
|
}
|
|
|
|
|
|
-int wlan_osif_cfg80211_connect(struct net_device *dev,
|
|
|
- struct wlan_objmgr_vdev *vdev,
|
|
|
- struct cfg80211_connect_params *req)
|
|
|
+int osif_cm_connect(struct net_device *dev, struct wlan_objmgr_vdev *vdev,
|
|
|
+ struct cfg80211_connect_params *req)
|
|
|
{
|
|
|
struct wlan_cm_connect_req *connect_req;
|
|
|
const u8 *bssid_hint = req->bssid_hint;
|
|
|
uint8_t vdev_id = vdev->vdev_objmgr.vdev_id;
|
|
|
QDF_STATUS status;
|
|
|
|
|
|
- osif_dump_connect_req(dev, vdev_id, req);
|
|
|
+ osif_cm_dump_connect_req(dev, vdev_id, req);
|
|
|
|
|
|
status = osif_cm_reset_id_and_src(vdev);
|
|
|
if (QDF_IS_STATUS_ERROR(status))
|
|
@@ -337,7 +334,7 @@ int wlan_osif_cfg80211_connect(struct net_device *dev,
|
|
|
qdf_mem_copy(connect_req->bssid.bytes, req->bssid_hint,
|
|
|
QDF_MAC_ADDR_SIZE);
|
|
|
|
|
|
- wlan_osif_set_prev_bssid(connect_req, req);
|
|
|
+ osif_cm_set_prev_bssid(connect_req, req);
|
|
|
|
|
|
connect_req->ssid.length = req->ssid_len;
|
|
|
if (connect_req->ssid.length > WLAN_SSID_MAX_LEN) {
|
|
@@ -356,7 +353,7 @@ int wlan_osif_cfg80211_connect(struct net_device *dev,
|
|
|
else
|
|
|
connect_req->chan_freq = 0;
|
|
|
|
|
|
- status = wlan_osif_set_crypto_params(connect_req, req);
|
|
|
+ status = osif_cm_set_crypto_params(connect_req, req);
|
|
|
if (QDF_IS_STATUS_ERROR(status))
|
|
|
goto connect_start_fail;
|
|
|
|
|
@@ -376,11 +373,11 @@ int wlan_osif_cfg80211_connect(struct net_device *dev,
|
|
|
qdf_mem_copy(connect_req->assoc_ie.ptr, req->ie,
|
|
|
connect_req->assoc_ie.len);
|
|
|
|
|
|
- status = wlan_osif_set_fils_info(connect_req, req);
|
|
|
+ status = osif_cm_set_fils_info(connect_req, req);
|
|
|
if (QDF_IS_STATUS_ERROR(status))
|
|
|
goto connect_start_fail;
|
|
|
|
|
|
- status = ucfg_wlan_cm_start_connect(vdev, connect_req);
|
|
|
+ status = ucfg_cm_start_connect(vdev, connect_req);
|
|
|
if (QDF_IS_STATUS_ERROR(status))
|
|
|
osif_err("Connect failed with status %d", status);
|
|
|
|
|
@@ -389,15 +386,14 @@ connect_start_fail:
|
|
|
qdf_mem_free(connect_req->assoc_ie.ptr);
|
|
|
connect_req->assoc_ie.ptr = NULL;
|
|
|
}
|
|
|
- wlan_osif_free_wep_key_params(connect_req);
|
|
|
+ osif_cm_free_wep_key_params(connect_req);
|
|
|
qdf_mem_free(connect_req);
|
|
|
|
|
|
return qdf_status_to_os_return(status);
|
|
|
}
|
|
|
|
|
|
-int wlan_osif_cfg80211_disconnect(struct net_device *dev,
|
|
|
- struct wlan_objmgr_vdev *vdev,
|
|
|
- uint16_t reason)
|
|
|
+int osif_cm_disconnect(struct net_device *dev, struct wlan_objmgr_vdev *vdev,
|
|
|
+ uint16_t reason)
|
|
|
{
|
|
|
struct wlan_cm_disconnect_req *req;
|
|
|
uint8_t vdev_id = vdev->vdev_objmgr.vdev_id;
|
|
@@ -418,7 +414,7 @@ int wlan_osif_cfg80211_disconnect(struct net_device *dev,
|
|
|
req->vdev_id = vdev_id;
|
|
|
req->source = CM_OSIF_DISCONNECT;
|
|
|
req->reason_code = reason;
|
|
|
- status = ucfg_wlan_cm_start_disconnect(vdev, req);
|
|
|
+ status = ucfg_cm_start_disconnect(vdev, req);
|
|
|
if (QDF_IS_STATUS_ERROR(status))
|
|
|
osif_err("Disconnect failed with status %d", status);
|
|
|
|