From a776486ba597ba26d4ac14653eff3b9f9fc92a4e Mon Sep 17 00:00:00 2001 From: Ganesh Kondabattini Date: Thu, 12 Nov 2015 19:48:35 +0530 Subject: qcacld: Set default key index after bss start. In AP+AP scenario, it is possible that hostapd can set default key index before there is a session associated with pAdapter. So save wep default key index in pHddApCtx and set it after bss start. Change-Id: I1c27ad8984cb1ece266405fb5c427e59dd01db3a CRs-Fixed: 938522 --- CORE/HDD/inc/wlan_hdd_main.h | 3 +++ CORE/HDD/src/wlan_hdd_cfg80211.c | 6 ++---- CORE/HDD/src/wlan_hdd_hostapd.c | 10 ++++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h index 360d67fae6e5..748c1fdaa6a5 100644 --- a/CORE/HDD/inc/wlan_hdd_main.h +++ b/CORE/HDD/inc/wlan_hdd_main.h @@ -807,6 +807,9 @@ struct hdd_ap_ctx_s // This will have WEP key data, if it is received before start bss tCsrRoamSetKey wepKey[CSR_MAX_NUM_KEY]; + /* WEP default key index */ + uint8_t wep_def_key_idx; + beacon_data_t *beacon; v_BOOL_t bApActive; diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 62abf9330e8d..78ea9d934cc9 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -14692,11 +14692,9 @@ static int __wlan_hdd_cfg80211_set_default_key( struct wiphy *wiphy, /* Saving key direction for default key index to TX default */ hdd_ap_ctx_t *pAPCtx = WLAN_HDD_GET_AP_CTX_PTR(pAdapter); pAPCtx->wepKey[key_index].keyDirection = eSIR_TX_DEFAULT; - hddLog(LOG1, - FL("key index passed for sme_RoamSetDefaultKeyIndex %d"), + hddLog(LOG1, FL("WEP default key index set to SAP context %d"), key_index); - sme_roam_set_default_key_index(WLAN_HDD_GET_HAL_CTX(pAdapter), - pAdapter->sessionId, key_index); + pAPCtx->wep_def_key_idx = key_index; } } diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c index da0f53c58f5b..63d7209eb70c 100644 --- a/CORE/HDD/src/wlan_hdd_hostapd.c +++ b/CORE/HDD/src/wlan_hdd_hostapd.c @@ -1336,6 +1336,16 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa // Send current operating channel of SoftAP to BTC-ES send_btc_nlink_msg(WLAN_BTC_SOFTAP_BSS_START, 0); + /* Set default key index */ + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: default key index %hu", __func__, + pHddApCtx->wep_def_key_idx); + + sme_roam_set_default_key_index( + WLAN_HDD_GET_HAL_CTX(pHostapdAdapter), + pHostapdAdapter->sessionId, + pHddApCtx->wep_def_key_idx); + //Set group key / WEP key every time when BSS is restarted if( pHddApCtx->groupKey.keyLength ) { -- cgit v1.2.3