mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-26 06:33:19 -04:00
qcacld-3.0: Update auth key mgmt semantics
Currently HDD maintains an auth key management bitmap as field authKeyMgmt in struct hdd_wext_state utilizing bitmaps defined by wireless.h. This current implementation suffers from the following issues: - The implementation is independent of wireless extensions so it should not use wireless.h definitons or be stored in a wext-related data structure. - The name uses camelCase which is inconsistent with the Linux coding style. To address these issues define a new set of bitmps along with a properly named field located in struct hdd_station_ctx. Change-Id: I0d1c66236f88b7e6486b2d03c3383ef38f80c134 CRs-Fixed: 2207904
This commit is contained in:
parent
daeb4014d4
commit
37ecea4381
5 changed files with 63 additions and 67 deletions
|
|
@ -385,6 +385,18 @@ extern struct mutex hdd_init_deinit_lock;
|
|||
#define NUM_TX_RX_HISTOGRAM 128
|
||||
#define NUM_TX_RX_HISTOGRAM_MASK (NUM_TX_RX_HISTOGRAM - 1)
|
||||
|
||||
/**
|
||||
* enum hdd_auth_key_mgmt - auth key mgmt protocols
|
||||
* @HDD_AUTH_KEY_MGMT_802_1X: 802.1x
|
||||
* @HDD_AUTH_KEY_MGMT_PSK: PSK
|
||||
* @HDD_AUTH_KEY_MGMT_CCKM: CCKM
|
||||
*/
|
||||
enum hdd_auth_key_mgmt {
|
||||
HDD_AUTH_KEY_MGMT_802_1X = BIT(0),
|
||||
HDD_AUTH_KEY_MGMT_PSK = BIT(1),
|
||||
HDD_AUTH_KEY_MGMT_CCKM = BIT(2)
|
||||
};
|
||||
|
||||
/**
|
||||
* struct hdd_tx_rx_histogram - structure to keep track of tx and rx packets
|
||||
* received over 100ms intervals
|
||||
|
|
@ -683,6 +695,7 @@ struct hdd_mon_set_ch_info {
|
|||
* struct hdd_station_ctx -- STA-specific information
|
||||
* @wext_state: wireless extensions state
|
||||
* @wpa_versions: bitmap of supported WPA versions
|
||||
* @auth_key_mgmt: bitmap of supported auth key mgmt protocols
|
||||
* @requested_bssid: Specific BSSID to which to connect
|
||||
* @conn_info: current connection information
|
||||
* @roam_info: current roaming information
|
||||
|
|
@ -705,6 +718,7 @@ struct hdd_mon_set_ch_info {
|
|||
struct hdd_station_ctx {
|
||||
struct hdd_wext_state wext_state;
|
||||
enum nl80211_wpa_versions wpa_versions;
|
||||
enum hdd_auth_key_mgmt auth_key_mgmt;
|
||||
struct qdf_mac_addr requested_bssid;
|
||||
struct hdd_connection_info conn_info;
|
||||
struct hdd_connection_info cache_conn_info;
|
||||
|
|
|
|||
|
|
@ -212,9 +212,6 @@ struct hdd_wext_state {
|
|||
|
||||
/**Additional IE for assoc */
|
||||
tSirAddie assocAddIE;
|
||||
|
||||
/**auth key mgmt */
|
||||
int32_t authKeyMgmt;
|
||||
};
|
||||
|
||||
struct ccp_freq_chan_map {
|
||||
|
|
|
|||
|
|
@ -5292,10 +5292,9 @@ int hdd_set_csr_auth_type(struct hdd_adapter *adapter,
|
|||
eCsrAuthType RSNAuthType)
|
||||
{
|
||||
struct csr_roam_profile *roam_profile;
|
||||
struct hdd_wext_state *pWextState =
|
||||
WLAN_HDD_GET_WEXT_STATE_PTR(adapter);
|
||||
struct hdd_station_ctx *sta_ctx =
|
||||
WLAN_HDD_GET_STATION_CTX_PTR(adapter);
|
||||
enum hdd_auth_key_mgmt key_mgmt = sta_ctx->auth_key_mgmt;
|
||||
|
||||
roam_profile = hdd_roam_profile(adapter);
|
||||
roam_profile->AuthType.numEntries = 1;
|
||||
|
|
@ -5317,8 +5316,8 @@ int hdd_set_csr_auth_type(struct hdd_adapter *adapter,
|
|||
|
||||
#ifdef FEATURE_WLAN_ESE
|
||||
if ((RSNAuthType == eCSR_AUTH_TYPE_CCKM_WPA) &&
|
||||
((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)
|
||||
== IW_AUTH_KEY_MGMT_802_1X)) {
|
||||
((key_mgmt & HDD_AUTH_KEY_MGMT_802_1X)
|
||||
== HDD_AUTH_KEY_MGMT_802_1X)) {
|
||||
hdd_debug("set authType to CCKM WPA. AKM also 802.1X.");
|
||||
roam_profile->AuthType.authType[0] =
|
||||
eCSR_AUTH_TYPE_CCKM_WPA;
|
||||
|
|
@ -5328,14 +5327,13 @@ int hdd_set_csr_auth_type(struct hdd_adapter *adapter,
|
|||
eCSR_AUTH_TYPE_CCKM_WPA;
|
||||
} else
|
||||
#endif
|
||||
if ((pWextState->
|
||||
authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)
|
||||
== IW_AUTH_KEY_MGMT_802_1X) {
|
||||
if ((key_mgmt & HDD_AUTH_KEY_MGMT_802_1X)
|
||||
== HDD_AUTH_KEY_MGMT_802_1X) {
|
||||
roam_profile->AuthType.authType[0] =
|
||||
eCSR_AUTH_TYPE_WPA;
|
||||
} else
|
||||
if ((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_PSK)
|
||||
== IW_AUTH_KEY_MGMT_PSK) {
|
||||
if ((key_mgmt & HDD_AUTH_KEY_MGMT_PSK)
|
||||
== HDD_AUTH_KEY_MGMT_PSK) {
|
||||
roam_profile->AuthType.authType[0] =
|
||||
eCSR_AUTH_TYPE_WPA_PSK;
|
||||
} else {
|
||||
|
|
@ -5346,8 +5344,8 @@ int hdd_set_csr_auth_type(struct hdd_adapter *adapter,
|
|||
if (sta_ctx->wpa_versions & NL80211_WPA_VERSION_2) {
|
||||
#ifdef FEATURE_WLAN_ESE
|
||||
if ((RSNAuthType == eCSR_AUTH_TYPE_CCKM_RSN) &&
|
||||
((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)
|
||||
== IW_AUTH_KEY_MGMT_802_1X)) {
|
||||
((key_mgmt & HDD_AUTH_KEY_MGMT_802_1X)
|
||||
== HDD_AUTH_KEY_MGMT_802_1X)) {
|
||||
hdd_debug("set authType to CCKM RSN. AKM also 802.1X.");
|
||||
roam_profile->AuthType.authType[0] =
|
||||
eCSR_AUTH_TYPE_CCKM_RSN;
|
||||
|
|
@ -5361,16 +5359,14 @@ int hdd_set_csr_auth_type(struct hdd_adapter *adapter,
|
|||
roam_profile->AuthType.authType[0] =
|
||||
eCSR_AUTH_TYPE_DPP_RSN;
|
||||
} else if ((RSNAuthType == eCSR_AUTH_TYPE_FT_RSN) &&
|
||||
((pWextState->
|
||||
authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)
|
||||
== IW_AUTH_KEY_MGMT_802_1X)) {
|
||||
((key_mgmt & HDD_AUTH_KEY_MGMT_802_1X)
|
||||
== HDD_AUTH_KEY_MGMT_802_1X)) {
|
||||
roam_profile->AuthType.authType[0] =
|
||||
eCSR_AUTH_TYPE_FT_RSN;
|
||||
} else if ((RSNAuthType == eCSR_AUTH_TYPE_FT_RSN_PSK)
|
||||
&&
|
||||
((pWextState->
|
||||
authKeyMgmt & IW_AUTH_KEY_MGMT_PSK)
|
||||
== IW_AUTH_KEY_MGMT_PSK)) {
|
||||
((key_mgmt & HDD_AUTH_KEY_MGMT_PSK)
|
||||
== HDD_AUTH_KEY_MGMT_PSK)) {
|
||||
roam_profile->AuthType.authType[0] =
|
||||
eCSR_AUTH_TYPE_FT_RSN_PSK;
|
||||
} else
|
||||
|
|
@ -5393,36 +5389,32 @@ int hdd_set_csr_auth_type(struct hdd_adapter *adapter,
|
|||
RSNAuthType);
|
||||
|
||||
} else if ((RSNAuthType == eCSR_AUTH_TYPE_OWE) &&
|
||||
((pWextState->
|
||||
authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)
|
||||
== IW_AUTH_KEY_MGMT_802_1X)) {
|
||||
((key_mgmt & HDD_AUTH_KEY_MGMT_802_1X)
|
||||
== HDD_AUTH_KEY_MGMT_802_1X)) {
|
||||
/* OWE case */
|
||||
roam_profile->AuthType.authType[0] =
|
||||
eCSR_AUTH_TYPE_OWE;
|
||||
} else if ((RSNAuthType ==
|
||||
eCSR_AUTH_TYPE_SUITEB_EAP_SHA256) &&
|
||||
((pWextState->
|
||||
authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)
|
||||
== IW_AUTH_KEY_MGMT_802_1X)) {
|
||||
((key_mgmt & HDD_AUTH_KEY_MGMT_802_1X)
|
||||
== HDD_AUTH_KEY_MGMT_802_1X)) {
|
||||
/* Suite B EAP SHA 256 */
|
||||
roam_profile->AuthType.authType[0] =
|
||||
eCSR_AUTH_TYPE_SUITEB_EAP_SHA256;
|
||||
} else if ((RSNAuthType ==
|
||||
eCSR_AUTH_TYPE_SUITEB_EAP_SHA384) &&
|
||||
((pWextState->
|
||||
authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)
|
||||
== IW_AUTH_KEY_MGMT_802_1X)) {
|
||||
((key_mgmt & HDD_AUTH_KEY_MGMT_802_1X)
|
||||
== HDD_AUTH_KEY_MGMT_802_1X)) {
|
||||
/* Suite B EAP SHA 384 */
|
||||
roam_profile->AuthType.authType[0] =
|
||||
eCSR_AUTH_TYPE_SUITEB_EAP_SHA384;
|
||||
} else if ((pWextState->
|
||||
authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)
|
||||
== IW_AUTH_KEY_MGMT_802_1X) {
|
||||
} else if ((key_mgmt & HDD_AUTH_KEY_MGMT_802_1X)
|
||||
== HDD_AUTH_KEY_MGMT_802_1X) {
|
||||
roam_profile->AuthType.authType[0] =
|
||||
eCSR_AUTH_TYPE_RSN;
|
||||
} else
|
||||
if ((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_PSK)
|
||||
== IW_AUTH_KEY_MGMT_PSK) {
|
||||
if ((key_mgmt & HDD_AUTH_KEY_MGMT_PSK)
|
||||
== HDD_AUTH_KEY_MGMT_PSK) {
|
||||
roam_profile->AuthType.authType[0] =
|
||||
eCSR_AUTH_TYPE_RSN_PSK;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -16607,8 +16607,6 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
|
|||
|
||||
} else if ((adapter->device_mode == QDF_STA_MODE) ||
|
||||
(adapter->device_mode == QDF_P2P_CLIENT_MODE)) {
|
||||
struct hdd_wext_state *pWextState =
|
||||
WLAN_HDD_GET_WEXT_STATE_PTR(adapter);
|
||||
struct hdd_station_ctx *sta_ctx =
|
||||
WLAN_HDD_GET_STATION_CTX_PTR(adapter);
|
||||
struct csr_roam_profile *roam_profile;
|
||||
|
|
@ -16662,8 +16660,8 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
|
|||
* group key with correct value
|
||||
*/
|
||||
if ((eCSR_BSS_TYPE_START_IBSS == roam_profile->BSSType) &&
|
||||
!((IW_AUTH_KEY_MGMT_802_1X ==
|
||||
(pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X))
|
||||
!((HDD_AUTH_KEY_MGMT_802_1X ==
|
||||
(sta_ctx->auth_key_mgmt & HDD_AUTH_KEY_MGMT_802_1X))
|
||||
&& (eCSR_AUTH_TYPE_OPEN_SYSTEM ==
|
||||
sta_ctx->conn_info.authType)
|
||||
)
|
||||
|
|
@ -18351,8 +18349,7 @@ static bool wlan_hdd_is_conn_type_fils(struct cfg80211_connect_params *req)
|
|||
*/
|
||||
static int wlan_hdd_set_akm_suite(struct hdd_adapter *adapter, u32 key_mgmt)
|
||||
{
|
||||
struct hdd_wext_state *pWextState =
|
||||
WLAN_HDD_GET_WEXT_STATE_PTR(adapter);
|
||||
struct hdd_station_ctx *sta_ctx;
|
||||
struct csr_roam_profile *roam_profile;
|
||||
|
||||
roam_profile = hdd_roam_profile(adapter);
|
||||
|
|
@ -18366,6 +18363,9 @@ static int wlan_hdd_set_akm_suite(struct hdd_adapter *adapter, u32 key_mgmt)
|
|||
#ifndef WLAN_AKM_SUITE_PSK_SHA256
|
||||
#define WLAN_AKM_SUITE_PSK_SHA256 0x000FAC06
|
||||
#endif
|
||||
|
||||
sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
|
||||
|
||||
/*set key mgmt type */
|
||||
switch (key_mgmt) {
|
||||
case WLAN_AKM_SUITE_PSK:
|
||||
|
|
@ -18373,21 +18373,20 @@ static int wlan_hdd_set_akm_suite(struct hdd_adapter *adapter, u32 key_mgmt)
|
|||
case WLAN_AKM_SUITE_FT_PSK:
|
||||
case WLAN_AKM_SUITE_DPP_RSN:
|
||||
hdd_debug("setting key mgmt type to PSK");
|
||||
pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_PSK;
|
||||
sta_ctx->auth_key_mgmt |= HDD_AUTH_KEY_MGMT_PSK;
|
||||
break;
|
||||
|
||||
case WLAN_AKM_SUITE_8021X_SHA256:
|
||||
case WLAN_AKM_SUITE_8021X:
|
||||
case WLAN_AKM_SUITE_FT_8021X:
|
||||
hdd_debug("setting key mgmt type to 8021x");
|
||||
pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
|
||||
sta_ctx->auth_key_mgmt |= HDD_AUTH_KEY_MGMT_802_1X;
|
||||
break;
|
||||
#ifdef FEATURE_WLAN_ESE
|
||||
#define WLAN_AKM_SUITE_CCKM 0x00409600 /* Should be in ieee802_11_defs.h */
|
||||
#define IW_AUTH_KEY_MGMT_CCKM 8 /* Should be in linux/wireless.h */
|
||||
case WLAN_AKM_SUITE_CCKM:
|
||||
hdd_debug("setting key mgmt type to CCKM");
|
||||
pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_CCKM;
|
||||
sta_ctx->auth_key_mgmt |= HDD_AUTH_KEY_MGMT_CCKM;
|
||||
break;
|
||||
#endif
|
||||
#ifndef WLAN_AKM_SUITE_OSEN
|
||||
|
|
@ -18395,35 +18394,35 @@ static int wlan_hdd_set_akm_suite(struct hdd_adapter *adapter, u32 key_mgmt)
|
|||
#endif
|
||||
case WLAN_AKM_SUITE_OSEN:
|
||||
hdd_debug("setting key mgmt type to OSEN");
|
||||
pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
|
||||
sta_ctx->auth_key_mgmt |= HDD_AUTH_KEY_MGMT_802_1X;
|
||||
break;
|
||||
#if defined(WLAN_FEATURE_FILS_SK) && \
|
||||
(defined(CFG80211_FILS_SK_OFFLOAD_SUPPORT) || \
|
||||
(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)))
|
||||
case WLAN_AKM_SUITE_FILS_SHA256:
|
||||
hdd_debug("setting key mgmt type to FILS SHA256");
|
||||
pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
|
||||
sta_ctx->auth_key_mgmt |= HDD_AUTH_KEY_MGMT_802_1X;
|
||||
roam_profile->fils_con_info->akm_type =
|
||||
eCSR_AUTH_TYPE_FILS_SHA256;
|
||||
break;
|
||||
|
||||
case WLAN_AKM_SUITE_FILS_SHA384:
|
||||
hdd_debug("setting key mgmt type to FILS SHA384");
|
||||
pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
|
||||
sta_ctx->auth_key_mgmt |= HDD_AUTH_KEY_MGMT_802_1X;
|
||||
roam_profile->fils_con_info->akm_type =
|
||||
eCSR_AUTH_TYPE_FILS_SHA384;
|
||||
break;
|
||||
|
||||
case WLAN_AKM_SUITE_FT_FILS_SHA256:
|
||||
hdd_debug("setting key mgmt type to FILS FT SHA256");
|
||||
pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
|
||||
sta_ctx->auth_key_mgmt |= HDD_AUTH_KEY_MGMT_802_1X;
|
||||
roam_profile->fils_con_info->akm_type =
|
||||
eCSR_AUTH_TYPE_FT_FILS_SHA256;
|
||||
break;
|
||||
|
||||
case WLAN_AKM_SUITE_FT_FILS_SHA384:
|
||||
hdd_debug("setting key mgmt type to FILS FT SHA384");
|
||||
pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
|
||||
sta_ctx->auth_key_mgmt |= HDD_AUTH_KEY_MGMT_802_1X;
|
||||
roam_profile->fils_con_info->akm_type =
|
||||
eCSR_AUTH_TYPE_FT_FILS_SHA384;
|
||||
break;
|
||||
|
|
@ -18431,21 +18430,21 @@ static int wlan_hdd_set_akm_suite(struct hdd_adapter *adapter, u32 key_mgmt)
|
|||
|
||||
case WLAN_AKM_SUITE_OWE:
|
||||
hdd_debug("setting key mgmt type to OWE");
|
||||
pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
|
||||
sta_ctx->auth_key_mgmt |= HDD_AUTH_KEY_MGMT_802_1X;
|
||||
break;
|
||||
|
||||
case WLAN_AKM_SUITE_EAP_SHA256:
|
||||
hdd_debug("setting key mgmt type to EAP_SHA256");
|
||||
pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
|
||||
sta_ctx->auth_key_mgmt |= HDD_AUTH_KEY_MGMT_802_1X;
|
||||
break;
|
||||
case WLAN_AKM_SUITE_EAP_SHA384:
|
||||
hdd_debug("setting key mgmt type to EAP_SHA384");
|
||||
pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
|
||||
sta_ctx->auth_key_mgmt |= HDD_AUTH_KEY_MGMT_802_1X;
|
||||
break;
|
||||
|
||||
case WLAN_AKM_SUITE_SAE:
|
||||
hdd_debug("setting key mgmt type to SAE");
|
||||
pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
|
||||
sta_ctx->auth_key_mgmt |= HDD_AUTH_KEY_MGMT_802_1X;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -19028,8 +19027,6 @@ static int wlan_hdd_cfg80211_set_privacy(struct hdd_adapter *adapter,
|
|||
struct cfg80211_connect_params *req)
|
||||
{
|
||||
int status = 0;
|
||||
struct hdd_wext_state *pWextState =
|
||||
WLAN_HDD_GET_WEXT_STATE_PTR(adapter);
|
||||
struct hdd_station_ctx *sta_ctx;
|
||||
struct csr_roam_profile *roam_profile;
|
||||
|
||||
|
|
@ -19109,15 +19106,14 @@ static int wlan_hdd_cfg80211_set_privacy(struct hdd_adapter *adapter,
|
|||
if (req->key && req->key_len) {
|
||||
u8 key_len = req->key_len;
|
||||
u8 key_idx = req->key_idx;
|
||||
u32 cipher = req->crypto.ciphers_pairwise[0];
|
||||
|
||||
if ((WLAN_CIPHER_SUITE_WEP40 == req->crypto.ciphers_pairwise[0])
|
||||
|| (WLAN_CIPHER_SUITE_WEP104 ==
|
||||
req->crypto.ciphers_pairwise[0])
|
||||
) {
|
||||
if (IW_AUTH_KEY_MGMT_802_1X
|
||||
==
|
||||
(pWextState->
|
||||
authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)) {
|
||||
if ((WLAN_CIPHER_SUITE_WEP40 == cipher) ||
|
||||
(WLAN_CIPHER_SUITE_WEP104 == cipher)) {
|
||||
enum hdd_auth_key_mgmt key_mgmt =
|
||||
sta_ctx->auth_key_mgmt;
|
||||
|
||||
if (key_mgmt & HDD_AUTH_KEY_MGMT_802_1X) {
|
||||
hdd_err("Dynamic WEP not supported");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4086,8 +4086,6 @@ int wlan_hdd_get_peer_info(struct hdd_adapter *adapter,
|
|||
void hdd_clear_roam_profile_ie(struct hdd_adapter *adapter)
|
||||
{
|
||||
struct hdd_station_ctx *sta_ctx;
|
||||
struct hdd_wext_state *pWextState =
|
||||
WLAN_HDD_GET_WEXT_STATE_PTR(adapter);
|
||||
struct csr_roam_profile *roam_profile;
|
||||
|
||||
hdd_enter();
|
||||
|
|
@ -4132,8 +4130,6 @@ void hdd_clear_roam_profile_ie(struct hdd_adapter *adapter)
|
|||
roam_profile->MFPCapable = 0;
|
||||
#endif
|
||||
|
||||
pWextState->authKeyMgmt = 0;
|
||||
|
||||
qdf_mem_zero(roam_profile->Keys.KeyLength, CSR_MAX_NUM_KEY);
|
||||
|
||||
#ifdef FEATURE_WLAN_WAPI
|
||||
|
|
@ -4142,6 +4138,7 @@ void hdd_clear_roam_profile_ie(struct hdd_adapter *adapter)
|
|||
#endif
|
||||
|
||||
sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
|
||||
sta_ctx->auth_key_mgmt = 0;
|
||||
qdf_zero_macaddr(&sta_ctx->requested_bssid);
|
||||
hdd_exit();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue