diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index ba003721d4b6..f836b31ac7b1 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -655,6 +655,7 @@ struct hdd_mon_set_ch_info { * struct hdd_station_ctx -- STA-specific information * @WextState: wireless extensions state * @wpa_versions: bitmap of supported WPA versions + * @requested_bssid: Specific BSSID to which to connect * @conn_info: current connection information * @roam_info: current roaming information * @ft_carrier_on: is carrier on @@ -676,6 +677,7 @@ struct hdd_mon_set_ch_info { struct hdd_station_ctx { struct hdd_wext_state WextState; enum nl80211_wpa_versions wpa_versions; + struct qdf_mac_addr requested_bssid; struct hdd_connection_info conn_info; struct hdd_roaming_info roam_info; int ft_carrier_on; diff --git a/core/hdd/inc/wlan_hdd_wext.h b/core/hdd/inc/wlan_hdd_wext.h index 481b6796e9bf..25edc13622c7 100644 --- a/core/hdd/inc/wlan_hdd_wext.h +++ b/core/hdd/inc/wlan_hdd_wext.h @@ -207,9 +207,6 @@ struct hdd_wext_state { /** The CSR "desired" Profile */ tCsrRoamProfile roamProfile; - /** BSSID to which connect request is received */ - struct qdf_mac_addr req_bssId; - /**WPA or RSN IE*/ uint8_t WPARSNIE[MAX_WPA_RSN_IE_LEN]; diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 934d3c0682e5..ab3847f3e738 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -3053,8 +3053,6 @@ hdd_association_completion_handler(struct hdd_adapter *adapter, #endif } else { bool connect_timeout = false; - struct hdd_wext_state *pWextState = - WLAN_HDD_GET_WEXT_STATE_PTR(adapter); if (roam_info) hdd_err("wlan: connection failed with " MAC_ADDRESS_STR " result: %d and Status: %d", @@ -3063,7 +3061,7 @@ hdd_association_completion_handler(struct hdd_adapter *adapter, else hdd_err("wlan: connection failed with " MAC_ADDRESS_STR " result: %d and Status: %d", - MAC_ADDR_ARRAY(pWextState->req_bssId.bytes), + MAC_ADDR_ARRAY(sta_ctx->requested_bssid.bytes), roamResult, roamStatus); if ((eCSR_ROAM_RESULT_SCAN_FOR_SSID_FAILURE == roamResult) || @@ -3077,11 +3075,11 @@ hdd_association_completion_handler(struct hdd_adapter *adapter, wlan_hdd_cfg80211_update_bss_list(adapter, roam_info ? roam_info->bssid.bytes : - pWextState->req_bssId.bytes); + sta_ctx->requested_bssid.bytes); sme_remove_bssid_from_scan_list(hdd_ctx->hHal, roam_info ? roam_info->bssid.bytes : - pWextState->req_bssId.bytes); + sta_ctx->requested_bssid.bytes); connect_timeout = true; } @@ -3104,7 +3102,7 @@ hdd_association_completion_handler(struct hdd_adapter *adapter, hdd_err("connect failed: for bssid " MAC_ADDRESS_STR " result: %d and status: %d ", - MAC_ADDR_ARRAY(pWextState->req_bssId.bytes), + MAC_ADDR_ARRAY(sta_ctx->requested_bssid.bytes), roamResult, roamStatus); } hdd_debug("Invoking packetdump deregistration API"); @@ -3123,7 +3121,7 @@ hdd_association_completion_handler(struct hdd_adapter *adapter, roam_info->statusCode); else hdd_connect_result(dev, - pWextState->req_bssId.bytes, + sta_ctx->requested_bssid.bytes, NULL, NULL, 0, NULL, 0, WLAN_STATUS_ASSOC_DENIED_UNSPEC, GFP_KERNEL, @@ -3142,7 +3140,7 @@ hdd_association_completion_handler(struct hdd_adapter *adapter, roam_info->statusCode); else hdd_connect_result(dev, - pWextState->req_bssId.bytes, + sta_ctx->requested_bssid.bytes, NULL, NULL, 0, NULL, 0, WLAN_STATUS_UNSPECIFIED_FAILURE, GFP_KERNEL, @@ -3153,7 +3151,7 @@ hdd_association_completion_handler(struct hdd_adapter *adapter, } else if ((eCSR_ROAM_CANCELLED == roamStatus && !hddDisconInProgress)) { hdd_connect_result(dev, - pWextState->req_bssId.bytes, + sta_ctx->requested_bssid.bytes, NULL, NULL, 0, NULL, 0, WLAN_STATUS_UNSPECIFIED_FAILURE, GFP_KERNEL, diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 296e7910440c..392a9bd2bb8b 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -15447,8 +15447,8 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter, * association process. In case of join failure * we should send valid BSSID to supplicant */ - qdf_mem_copy((void *)(pWextState->req_bssId.bytes), - bssid, QDF_MAC_ADDR_SIZE); + qdf_mem_copy(sta_ctx->requested_bssid.bytes, + bssid, QDF_MAC_ADDR_SIZE); hdd_debug("bssid is given by upper layer %pM", bssid); } else if (bssid_hint) { qdf_mem_copy(pRoamProfile->bssid_hint.bytes, @@ -15459,7 +15459,7 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter, * association process. In case of join failure * we should send valid BSSID to supplicant */ - qdf_mem_copy((void *)(pWextState->req_bssId.bytes), + qdf_mem_copy(sta_ctx->requested_bssid.bytes, bssid_hint, QDF_MAC_ADDR_SIZE); hdd_debug("bssid_hint is given by upper layer %pM", bssid_hint); @@ -16702,8 +16702,7 @@ static bool wlan_hdd_reassoc_bssid_hint(struct hdd_adapter *adapter, bool reassoc = false; const uint8_t *bssid = NULL; uint16_t channel = 0; - struct hdd_wext_state *wext_state = - WLAN_HDD_GET_WEXT_STATE_PTR(adapter); + struct hdd_station_ctx *sta_ctx; if (req->bssid) bssid = req->bssid; @@ -16725,7 +16724,8 @@ static bool wlan_hdd_reassoc_bssid_hint(struct hdd_adapter *adapter, * association process. In case of join failure * we should send valid BSSID to supplicant */ - qdf_mem_copy(wext_state->req_bssId.bytes, bssid, + sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); + qdf_mem_copy(sta_ctx->requested_bssid.bytes, bssid, QDF_MAC_ADDR_SIZE); *status = hdd_reassoc(adapter, bssid, channel, diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 4009b7c31a1b..0cc241a52be5 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -4208,6 +4208,7 @@ static void hdd_statistics_cb(void *pStats, void *pContext) */ 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); @@ -4261,7 +4262,8 @@ void hdd_clear_roam_profile_ie(struct hdd_adapter *adapter) adapter->wapi_info.nWapiMode = 0; #endif - qdf_zero_macaddr(&pWextState->req_bssId); + sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); + qdf_zero_macaddr(&sta_ctx->requested_bssid); EXIT(); }