From 8b5e8f7397f21b609d066c00e312f3d4cac0b0fe Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 16 Oct 2017 12:36:09 -0700 Subject: [PATCH] qcacld-3.0: Remove obsolete MIC failure logic At one time the predecessor to the current driver was managed via wireless extensions, but now the driver is managed by cfg80211. However the driver still has obsolete logic to notify MIC failure via wireless_send_event(). Remove that logic. Change-Id: I6c36cb626e46fd319c264b4c7621fe29c5996f6c CRs-Fixed: 2128999 --- core/hdd/inc/wlan_hdd_assoc.h | 2 -- core/hdd/inc/wlan_hdd_wext.h | 3 -- core/hdd/src/wlan_hdd_assoc.c | 66 +++++++++-------------------------- 3 files changed, 16 insertions(+), 55 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_assoc.h b/core/hdd/inc/wlan_hdd_assoc.h index d0745180e0b2..ec2f09773e54 100644 --- a/core/hdd/inc/wlan_hdd_assoc.h +++ b/core/hdd/inc/wlan_hdd_assoc.h @@ -47,8 +47,6 @@ #define TDLS_STA_INDEX_VALID(staId) \ (((staId) >= 0) && ((staId) < 0xFF)) #endif -#define TKIP_COUNTER_MEASURE_STARTED 1 -#define TKIP_COUNTER_MEASURE_STOPED 0 /* Timeout (in ms) for Link to Up before Registering Station */ #define ASSOC_LINKUP_TIMEOUT 60 diff --git a/core/hdd/inc/wlan_hdd_wext.h b/core/hdd/inc/wlan_hdd_wext.h index 97643ff93ef4..caf952a8e453 100644 --- a/core/hdd/inc/wlan_hdd_wext.h +++ b/core/hdd/inc/wlan_hdd_wext.h @@ -221,9 +221,6 @@ struct hdd_wext_state { /* qdf event */ qdf_event_t hdd_qdf_event; - - /**Counter measure state, Started/Stopped*/ - bool mTKIPCounterMeasures; }; struct ccp_freq_chan_map { diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index a4928d25443a..f3c82eabf21b 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -3550,56 +3550,27 @@ static QDF_STATUS roam_ibss_connect_handler(struct hdd_adapter *adapter, * * This function indicates the Mic failure to the supplicant * - * Return: QDF_STATUS enumeration + * Return: None */ -static QDF_STATUS +static void hdd_roam_mic_error_indication_handler(struct hdd_adapter *adapter, - tCsrRoamInfo *roam_info, - uint32_t roamId, - eRoamCmdStatus roamStatus, - eCsrRoamResult roamResult) + tCsrRoamInfo *roam_info) { struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); + tSirMicFailureInfo *mic_failure_info; - if (eConnectionState_Associated == sta_ctx->conn_info.connState && - TKIP_COUNTER_MEASURE_STOPED == - sta_ctx->WextState.mTKIPCounterMeasures) { - struct iw_michaelmicfailure msg; - union iwreq_data wreq; + if (eConnectionState_Associated != sta_ctx->conn_info.connState) + return; - memset(&msg, '\0', sizeof(msg)); - msg.src_addr.sa_family = ARPHRD_ETHER; - memcpy(msg.src_addr.sa_data, - roam_info->u.pMICFailureInfo->taMacAddr, - sizeof(roam_info->u.pMICFailureInfo->taMacAddr)); - hdd_debug("MIC MAC " MAC_ADDRESS_STR, - MAC_ADDR_ARRAY(msg.src_addr.sa_data)); - - if (roam_info->u.pMICFailureInfo->multicast == true) - msg.flags = IW_MICFAILURE_GROUP; - else - msg.flags = IW_MICFAILURE_PAIRWISE; - memset(&wreq, 0, sizeof(wreq)); - wreq.data.length = sizeof(msg); - wireless_send_event(adapter->dev, IWEVMICHAELMICFAILURE, &wreq, - (char *)&msg); - /* inform mic failure to nl80211 */ - cfg80211_michael_mic_failure(adapter->dev, - roam_info->u.pMICFailureInfo-> - taMacAddr, - ((roam_info->u.pMICFailureInfo-> - multicast == - true) ? - NL80211_KEYTYPE_GROUP : - NL80211_KEYTYPE_PAIRWISE), - roam_info->u.pMICFailureInfo-> - keyId, - roam_info->u.pMICFailureInfo->TSC, - GFP_KERNEL); - - } - - return QDF_STATUS_SUCCESS; + mic_failure_info = roam_info->u.pMICFailureInfo; + cfg80211_michael_mic_failure(adapter->dev, + mic_failure_info->taMacAddr, + mic_failure_info->multicast ? + NL80211_KEYTYPE_GROUP : + NL80211_KEYTYPE_PAIRWISE, + mic_failure_info->keyId, + mic_failure_info->TSC, + GFP_KERNEL); } /** @@ -4577,12 +4548,7 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *roam_info, uint32_t roamId, break; case eCSR_ROAM_MIC_ERROR_IND: - qdf_ret_status = - hdd_roam_mic_error_indication_handler(adapter, - roam_info, - roamId, - roamStatus, - roamResult); + hdd_roam_mic_error_indication_handler(adapter, roam_info); break; case eCSR_ROAM_SET_KEY_COMPLETE: