From 6025c701f74c5b407e6e01a51efef7b948a09d8b Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Wed, 20 Mar 2019 18:48:49 +0530 Subject: [PATCH] qcacld-3.0: Cache supported mode of connected STA for SAP Currently in case of SAP, supported mode of station received in assoc request is not getting cached. Add support to cache the supported mode of station received in assoc request request in sta_info. Change-Id: I9820ae2d65fc529a1ab16424f6732fd273da3ae0 CRs-fixed: 2419957 --- core/hdd/inc/wlan_hdd_main.h | 3 +++ core/hdd/src/wlan_hdd_hostapd.c | 13 +++++++++++++ core/hdd/src/wlan_hdd_station_info.c | 10 +++++++--- core/mac/inc/sir_api.h | 1 + core/mac/src/pe/lim/lim_process_assoc_req_frame.c | 1 + core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c | 1 + core/mac/src/pe/lim/lim_types.h | 1 + core/sap/inc/sap_api.h | 1 + core/sap/src/sap_fsm.c | 2 ++ core/sme/inc/csr_api.h | 2 ++ core/sme/src/csr/csr_api_roam.c | 4 ++++ 11 files changed, 36 insertions(+), 3 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 70e51ac6c8ef..bf96fbb7bece 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -891,6 +891,8 @@ enum dhcp_nego_status { * @reason_code: Disconnection reason code for current station * @rssi: RSSI of the current station reported from F/W * @capability: Capability information of current station + * @support_mode: Max supported mode of a station currently + * connected to sap */ struct hdd_station_info { bool in_use; @@ -935,6 +937,7 @@ struct hdd_station_info { enum dhcp_phase dhcp_phase; enum dhcp_nego_status dhcp_nego_status; uint16_t capability; + uint8_t support_mode; }; /** diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 91e78ff98f7b..401a07f428da 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -93,6 +93,13 @@ #define ACS_SCAN_EXPIRY_TIMEOUT_S 4 +/* Defines the BIT position of HT caps is support mode field of stainfo */ +#define HDD_HT_CAPS_PRESENT 0 +/* Defines the BIT position of VHT caps is support mode field of stainfo */ +#define HDD_VHT_CAPS_PRESENT 1 +/* Defines the BIT position of HE caps is support mode field of stainfo */ +#define HDD_HE_CAPS_PRESENT 2 + /* * 11B, 11G Rate table include Basic rate and Extended rate * The IDX field is the rate index @@ -1481,11 +1488,17 @@ static void hdd_fill_station_info(struct hdd_adapter *adapter, if (event->vht_caps.present) { stainfo->vht_present = true; hdd_copy_vht_caps(&stainfo->vht_caps, &event->vht_caps); + stainfo->support_mode |= + (stainfo->vht_present << HDD_VHT_CAPS_PRESENT); } if (event->ht_caps.present) { stainfo->ht_present = true; hdd_copy_ht_caps(&stainfo->ht_caps, &event->ht_caps); + stainfo->support_mode |= + (stainfo->ht_present << HDD_HT_CAPS_PRESENT); } + stainfo->support_mode |= + (event->he_caps_present << HDD_HE_CAPS_PRESENT); /* Initialize DHCP info */ stainfo->dhcp_phase = DHCP_PHASE_ACK; diff --git a/core/hdd/src/wlan_hdd_station_info.c b/core/hdd/src/wlan_hdd_station_info.c index e84e3804a3c0..0790434b27b4 100644 --- a/core/hdd/src/wlan_hdd_station_info.c +++ b/core/hdd/src/wlan_hdd_station_info.c @@ -946,7 +946,8 @@ static int hdd_get_cached_station_remote(struct hdd_context *hdd_ctx, (sizeof(stainfo->dot11_mode) + NLA_HDRLEN) + (sizeof(stainfo->ch_width) + NLA_HDRLEN) + (sizeof(stainfo->tx_rate) + NLA_HDRLEN) + - (sizeof(stainfo->rx_rate) + NLA_HDRLEN); + (sizeof(stainfo->rx_rate) + NLA_HDRLEN) + + (sizeof(stainfo->support_mode) + NLA_HDRLEN); skb = cfg80211_vendor_cmd_alloc_reply_skb(hdd_ctx->wiphy, nl_buf_len); if (!skb) { @@ -970,8 +971,7 @@ static int hdd_get_cached_station_remote(struct hdd_context *hdd_ctx, channel_width = hdd_decode_ch_width(stainfo->ch_width); if (nla_put_u32(skb, REMOTE_SUPPORTED_MODE, - hdd_convert_dot11mode( - stainfo->mode)) || + stainfo->support_mode) || nla_put_u8(skb, REMOTE_CH_WIDTH, channel_width)) { hdd_err("remote ch put fail"); goto fail; @@ -984,6 +984,10 @@ static int hdd_get_cached_station_remote(struct hdd_context *hdd_ctx, hdd_err("rx rate put fail"); goto fail; } + if (nla_put_u32(skb, WLAN802_11_MODE, stainfo->dot11_mode)) { + hdd_err("dot11 mode put fail"); + goto fail; + } qdf_mem_zero(stainfo, sizeof(*stainfo)); diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 3ab7214beabb..fea396f077c2 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -1082,6 +1082,7 @@ struct assoc_ind { uint8_t ecsa_capable; tDot11fIEHTCaps HTCaps; tDot11fIEVHTCaps VHTCaps; + bool he_caps_present; tSirMacCapabilityInfo capability_info; bool is_sae_authenticated; const uint8_t *owe_ie; diff --git a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c index db0a17d42acf..dc7f71c54bbc 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c @@ -2735,6 +2735,7 @@ void lim_send_mlm_assoc_ind(struct mac_context *mac_ctx, sizeof(tDot11fIEVHTCaps)); lim_fill_assoc_ind_vht_info(mac_ctx, session_entry, assoc_req, assoc_ind, sta_ds); + assoc_ind->he_caps_present = assoc_req->he_cap.present; assoc_ind->is_sae_authenticated = assoc_req->is_sae_authenticated; lim_post_sme_message(mac_ctx, LIM_MLM_ASSOC_IND, diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index b76294d9f7b8..aa81771eec39 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -756,6 +756,7 @@ lim_fill_assoc_ind_params(struct mac_context *mac_ctx, if (assoc_ind->vht_caps.present) sme_assoc_ind->VHTCaps = assoc_ind->vht_caps; sme_assoc_ind->capability_info = assoc_ind->capabilityInfo; + sme_assoc_ind->he_caps_present = assoc_ind->he_caps_present; sme_assoc_ind->is_sae_authenticated = assoc_ind->is_sae_authenticated; } diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index 3d9c7e5edbd4..4a1b362f5c46 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -230,6 +230,7 @@ typedef struct sLimMlmAssocInd { tDot11fIEHTCaps ht_caps; tDot11fIEVHTCaps vht_caps; + bool he_caps_present; bool is_sae_authenticated; } tLimMlmAssocInd, *tpLimMlmAssocInd; diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index d663c4eb91c9..18bdb6620f06 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -284,6 +284,7 @@ typedef struct sap_StationAssocReassocCompleteEvent_s { tDot11fIEHTCaps ht_caps; tDot11fIEVHTCaps vht_caps; tSirMacCapabilityInfo capability_info; + bool he_caps_present; } tSap_StationAssocReassocCompleteEvent; typedef struct sap_StationDisassocCompleteEvent_s { diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 3c0c01b24d2d..27a2ea88a0ed 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -1675,6 +1675,8 @@ QDF_STATUS sap_signal_hdd_event(struct sap_context *sap_ctx, reassoc_complete->ht_caps = csr_roaminfo->ht_caps; if (csr_roaminfo->vht_caps.present) reassoc_complete->vht_caps = csr_roaminfo->vht_caps; + reassoc_complete->he_caps_present = + csr_roaminfo->he_caps_present; reassoc_complete->capability_info = csr_roaminfo->capability_info; diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index e7615413f4a0..ae54d1c3f689 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1151,6 +1151,7 @@ struct csr_roam_info { #endif tDot11fIEHTCaps ht_caps; tDot11fIEVHTCaps vht_caps; + bool he_caps_present; tDot11fIEhs20vendor_ie hs20vendor_ie; tDot11fIEVHTOperation vht_operation; tDot11fIEHTInfo ht_operation; @@ -1219,6 +1220,7 @@ typedef struct sSirSmeAssocIndToUpperLayerCnf { tDot11fIEHTCaps ht_caps; tDot11fIEVHTCaps vht_caps; tSirMacCapabilityInfo capability_info; + bool he_caps_present; } tSirSmeAssocIndToUpperLayerCnf, *tpSirSmeAssocIndToUpperLayerCnf; typedef struct tagCsrSummaryStatsInfo { diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index a993d26a82c6..8cdb88971ef7 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -9760,6 +9760,8 @@ void csr_roam_joined_state_msg_processor(struct mac_context *mac, void *pMsgBuf) roam_info->vht_caps = pUpperLayerAssocCnf->vht_caps; roam_info->capability_info = pUpperLayerAssocCnf->capability_info; + roam_info->he_caps_present = + pUpperLayerAssocCnf->he_caps_present; if (CSR_IS_INFRA_AP(roam_info->u.pConnectedProfile)) { if (pUpperLayerAssocCnf->ies_len > 0) { @@ -10876,6 +10878,7 @@ csr_send_assoc_ind_to_upper_layer_cnf_msg(struct mac_context *mac, if (ind->VHTCaps.present) cnf->vht_caps = ind->VHTCaps; cnf->capability_info = ind->capability_info; + cnf->he_caps_present = ind->he_caps_present; if (ind->assocReqPtr) { if (ind->assocReqLength < MAX_ASSOC_REQ_IE_LEN) { cnf->ies = qdf_mem_malloc(ind->assocReqLength); @@ -10966,6 +10969,7 @@ csr_roam_chk_lnk_assoc_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr) &pAssocInd->VHTCaps, sizeof(tDot11fIEVHTCaps)); roam_info->capability_info = pAssocInd->capability_info; + roam_info->he_caps_present = pAssocInd->he_caps_present; if (CSR_IS_INFRA_AP(roam_info->u.pConnectedProfile)) { if (session->pCurRoamProfile &&