diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 94f1eb0dbe3b..a2738f368061 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -763,6 +763,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; bool bApActive; diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 91f550486b42..a2ec1b5e16d6 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -9611,11 +9611,9 @@ static int __wlan_hdd_cfg80211_set_default_key(struct wiphy *wiphy, WLAN_HDD_GET_AP_CTX_PTR(pAdapter); pAPCtx->wepKey[key_index].keyDirection = eSIR_TX_DEFAULT; - hdd_info("key index passed for sme_roam_set_default_key_index %d", + hdd_info("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 3ed0e4a0829e..50effdaf96c5 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -1126,6 +1126,16 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, pHostapdState->bssState = BSS_START; hdd_wlan_green_ap_start_bss(pHddCtx); + /* Set default key index */ + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_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) { status = wlansap_set_key_sta(