From c2524faf6736ee13b7a9678b14d04e02314adcad Mon Sep 17 00:00:00 2001 From: Balaji Pothunoori Date: Mon, 24 Apr 2023 21:55:25 +0530 Subject: [PATCH 01/10] qcacld-3.0: Fill proper SGI for VHT Rx data packet Due to limitation uCode always filling SGI as long in rx_msdu_start_tlv. This change is to update SGI for VHT Rx data packet which is extracted from WMI_VDEV_SMART_MONITOR_EVENTID. Change-Id: I5fcdc463ea2a6d83253e39cc377a2471aeb4e133 CRs-Fixed: 3459106 --- components/pkt_capture/core/inc/wlan_pkt_capture_priv.h | 6 +++--- .../pkt_capture/core/src/wlan_pkt_capture_data_txrx.c | 3 +++ .../dispatcher/inc/wlan_pkt_capture_public_structs.h | 2 +- .../pkt_capture/dispatcher/src/wlan_pkt_capture_tgt_api.c | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/components/pkt_capture/core/inc/wlan_pkt_capture_priv.h b/components/pkt_capture/core/inc/wlan_pkt_capture_priv.h index 93ab1eac698b..820de82a18bd 100644 --- a/components/pkt_capture/core/inc/wlan_pkt_capture_priv.h +++ b/components/pkt_capture/core/inc/wlan_pkt_capture_priv.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -59,12 +59,12 @@ struct pkt_capture_cb_context { * @cb_ctx: pointer to packet capture mon callback context * @frame_filter: config filter set by vendor command * @cfg_params: packet capture config params - * @rx_avg_rssi: avg rssi of rx data packets * @ppdu_stats_q: list used for storing smu related ppdu stats * @lock_q: spinlock for ppdu_stats q * @tx_nss: nss of tx data packets received from ppdu stats * @last_freq: Last connected freq * @curr_freq: current connected freq + * @rx_vht_sgi: guard interval of vht rx packet */ struct pkt_capture_vdev_priv { struct wlan_objmgr_vdev *vdev; @@ -72,12 +72,12 @@ struct pkt_capture_vdev_priv { struct pkt_capture_cb_context *cb_ctx; struct pkt_capture_frame_filter frame_filter; struct pkt_capture_cfg cfg_params; - int32_t rx_avg_rssi; qdf_list_t ppdu_stats_q; qdf_spinlock_t lock_q; uint8_t tx_nss; qdf_freq_t last_freq; qdf_freq_t curr_freq; + uint8_t rx_vht_sgi; }; /** diff --git a/components/pkt_capture/core/src/wlan_pkt_capture_data_txrx.c b/components/pkt_capture/core/src/wlan_pkt_capture_data_txrx.c index e8c8682737c3..7170c423a6fc 100644 --- a/components/pkt_capture/core/src/wlan_pkt_capture_data_txrx.c +++ b/components/pkt_capture/core/src/wlan_pkt_capture_data_txrx.c @@ -687,6 +687,7 @@ static void pkt_capture_rx_get_phy_info(void *context, void *psoc, struct dp_soc *soc = psoc; hal_soc_handle_t hal_soc; struct wlan_objmgr_vdev *vdev = context; + struct pkt_capture_vdev_priv *vdev_priv; hal_soc = soc->hal_soc; preamble_type = hal_rx_msdu_start_get_pkt_type(rx_tlv_hdr); @@ -694,6 +695,7 @@ static void pkt_capture_rx_get_phy_info(void *context, void *psoc, bw = hal_rx_msdu_start_bw_get(rx_tlv_hdr); mcs = hal_rx_msdu_start_rate_mcs_get(rx_tlv_hdr); sgi = hal_rx_msdu_start_sgi_get(rx_tlv_hdr); + vdev_priv = pkt_capture_vdev_get_priv(vdev); switch (preamble_type) { case HAL_RX_PKT_TYPE_11A: @@ -712,6 +714,7 @@ static void pkt_capture_rx_get_phy_info(void *context, void *psoc, rx_status->ht_mcs = mcs; break; case HAL_RX_PKT_TYPE_11AC: + sgi = vdev_priv->rx_vht_sgi; rx_status->vht_flags = 1; rx_status->vht_flag_values3[0] = mcs << 0x4 | nss; bw = vdev->vdev_mlme.des_chan->ch_width; diff --git a/components/pkt_capture/dispatcher/inc/wlan_pkt_capture_public_structs.h b/components/pkt_capture/dispatcher/inc/wlan_pkt_capture_public_structs.h index f4e637ca1994..7607f9432d1e 100644 --- a/components/pkt_capture/dispatcher/inc/wlan_pkt_capture_public_structs.h +++ b/components/pkt_capture/dispatcher/inc/wlan_pkt_capture_public_structs.h @@ -83,7 +83,7 @@ struct mgmt_offload_event_params { struct smu_event_params { uint32_t vdev_id; - int32_t rx_avg_rssi; + uint8_t rx_vht_sgi; }; /** diff --git a/components/pkt_capture/dispatcher/src/wlan_pkt_capture_tgt_api.c b/components/pkt_capture/dispatcher/src/wlan_pkt_capture_tgt_api.c index 859fba623c13..1300b8aba176 100644 --- a/components/pkt_capture/dispatcher/src/wlan_pkt_capture_tgt_api.c +++ b/components/pkt_capture/dispatcher/src/wlan_pkt_capture_tgt_api.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021, 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -222,7 +222,7 @@ tgt_pkt_capture_smu_event(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } - vdev_priv->rx_avg_rssi = param->rx_avg_rssi; + vdev_priv->rx_vht_sgi = param->rx_vht_sgi; pkt_capture_vdev_put_ref(vdev); From 6c43030bad3179a2b1fa736c39631488f170e6a2 Mon Sep 17 00:00:00 2001 From: Rahul Choudhary Date: Tue, 1 Aug 2023 11:58:19 -0700 Subject: [PATCH 02/10] Release 2.0.8.33N Release 2.0.8.33N Change-Id: Id906820680f9b0a30101bc8597dcb30b4d33046e CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 8f7b64080e47..c3da38fb3ef4 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "M" +#define QWLAN_VERSION_EXTRA "N" #define QWLAN_VERSION_BUILD 33 -#define QWLAN_VERSIONSTR "2.0.8.33M" +#define QWLAN_VERSIONSTR "2.0.8.33N" #endif /* QWLAN_VERSION_H */ From 31539d898b9cea03f60bc8c8c99c120640a090a0 Mon Sep 17 00:00:00 2001 From: Surya Prakash Sivaraj Date: Mon, 24 Jul 2023 15:20:04 +0530 Subject: [PATCH 03/10] qcacld-3.0: Update VHT Channel width in assoc resp The AP adds OMN IE in the assoc response, and changes its operating channel width during association. The STA must move to this new channel width and update it to the firmware during peer assoc. Since, the STA doesn't update the channel width properly, it leads to retries in the higher bandwidth where the AP is not currently operating. The VHT channel width calculation in the host driver is not equipped to handle the new VHT OP IE definition. Differentiate the VHT operating channel width field in the VHTOP IE based on the ccf1. Change-Id: Ibc3dc91ecc091a307244e3e1359dfe9e4520f277 CRs-Fixed: 3205020 --- core/mac/src/cfg/cfgUtil/dot11f.frms | 3 + core/mac/src/include/dot11f.h | 5 +- core/mac/src/include/parser_api.h | 3 +- core/mac/src/pe/lim/lim_assoc_utils.c | 71 +++++----- .../mac/src/pe/lim/lim_process_action_frame.c | 91 +----------- .../src/pe/lim/lim_process_assoc_rsp_frame.c | 26 +++- core/mac/src/pe/lim/lim_utils.c | 126 +++++++++++++++++ core/mac/src/pe/lim/lim_utils.h | 45 ++++++ core/mac/src/pe/sch/sch_beacon_process.c | 131 +----------------- .../mac/src/sys/legacy/src/utils/src/dot11f.c | 11 +- .../src/sys/legacy/src/utils/src/parser_api.c | 6 +- 11 files changed, 265 insertions(+), 253 deletions(-) diff --git a/core/mac/src/cfg/cfgUtil/dot11f.frms b/core/mac/src/cfg/cfgUtil/dot11f.frms index ac7ba3959c7a..a3bbbbbf6297 100644 --- a/core/mac/src/cfg/cfgUtil/dot11f.frms +++ b/core/mac/src/cfg/cfgUtil/dot11f.frms @@ -1,6 +1,7 @@ /* * Copyright (c) 2006-2007, 2014-2018, 2020-2021 The Linux Foundation. * All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -3861,6 +3862,7 @@ FRAME AssocResponse // 7.2.3.5 OPTIE P2PAssocRes; OPTIE VHTCaps; OPTIE VHTOperation; + OPTIE OperatingMode; OPTIE ExtCap; OPTIE OBSSScanParameters; OPTIE QosMapSet; @@ -3950,6 +3952,7 @@ FRAME ReAssocResponse // 7.2.3.7 OPTIE P2PAssocRes; OPTIE VHTCaps; OPTIE VHTOperation; + OPTIE OperatingMode; OPTIE ExtCap; OPTIE OBSSScanParameters; OPTIE QosMapSet; diff --git a/core/mac/src/include/dot11f.h b/core/mac/src/include/dot11f.h index 5f89bd74caa9..7b0afc593596 100644 --- a/core/mac/src/include/dot11f.h +++ b/core/mac/src/include/dot11f.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -26,7 +27,7 @@ * * * This file was automatically generated by 'framesc' - * Wed Sep 29 13:23:21 2021 from the following file(s): + * Mon May 30 20:50:39 2022 from the following file(s): * * dot11f.frms * @@ -10110,6 +10111,7 @@ typedef struct sDot11fAssocResponse{ tDot11fIEP2PAssocRes P2PAssocRes; tDot11fIEVHTCaps VHTCaps; tDot11fIEVHTOperation VHTOperation; + tDot11fIEOperatingMode OperatingMode; tDot11fIEExtCap ExtCap; tDot11fIEOBSSScanParameters OBSSScanParameters; tDot11fIEQosMapSet QosMapSet; @@ -11061,6 +11063,7 @@ typedef struct sDot11fReAssocResponse{ tDot11fIEP2PAssocRes P2PAssocRes; tDot11fIEVHTCaps VHTCaps; tDot11fIEVHTOperation VHTOperation; + tDot11fIEOperatingMode OperatingMode; tDot11fIEExtCap ExtCap; tDot11fIEOBSSScanParameters OBSSScanParameters; tDot11fIEQosMapSet QosMapSet; diff --git a/core/mac/src/include/parser_api.h b/core/mac/src/include/parser_api.h index ee86d543bfa5..bb67022d828c 100644 --- a/core/mac/src/include/parser_api.h +++ b/core/mac/src/include/parser_api.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -471,6 +471,7 @@ typedef struct sSirAssocRsp { tDot11fIEVHTCaps VHTCaps; tDot11fIEVHTOperation VHTOperation; tDot11fIEExtCap ExtCap; + tDot11fIEOperatingMode oper_mode_ntf; struct qos_map_set QosMapSet; #ifdef WLAN_FEATURE_11W tDot11fIETimeoutInterval TimeoutInterval; diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index 57f661db9fb5..e2f269c9f81a 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -3410,30 +3410,30 @@ void lim_update_vhtcaps_assoc_resp(struct mac_context *mac_ctx, * lim_update_vht_oper_assoc_resp : Update VHT Operations in assoc response. * @mac_ctx Pointer to Global MAC structure * @pAddBssParams: parameters required for add bss params. + * @vht_caps: VHT CAP IE to update. * @vht_oper: VHT Operations to update. + * @ht_info: HT Info IE to update. * @pe_session : session entry. * * Return : void */ static void lim_update_vht_oper_assoc_resp(struct mac_context *mac_ctx, struct bss_params *pAddBssParams, - tDot11fIEVHTOperation *vht_oper, struct pe_session *pe_session) + tDot11fIEVHTCaps *vht_caps, tDot11fIEVHTOperation *vht_oper, + tDot11fIEHTInfo *ht_info, struct pe_session *pe_session) { - int16_t ccfs0 = vht_oper->chan_center_freq_seg0; - int16_t ccfs1 = vht_oper->chan_center_freq_seg1; - int16_t offset = abs((ccfs0 - ccfs1)); uint8_t ch_width; ch_width = pAddBssParams->ch_width; - if (vht_oper->chanWidth && pe_session->ch_width) { - ch_width = CH_WIDTH_80MHZ; - if (ccfs1 && offset == 8) - ch_width = CH_WIDTH_160MHZ; - else if (ccfs1 && offset > 16) - ch_width = CH_WIDTH_80P80MHZ; - } + + if (vht_oper->chanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ && + pe_session->ch_width) + ch_width = + lim_get_vht_ch_width(vht_caps, vht_oper, ht_info) + 1; + if (ch_width > pe_session->ch_width) ch_width = pe_session->ch_width; + pAddBssParams->ch_width = ch_width; pAddBssParams->staContext.ch_width = ch_width; } @@ -3529,11 +3529,34 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp lim_get_ht_capability(mac, eHT_SUPPORTED_CHANNEL_WIDTH_SET, pe_session); + lim_sta_add_bss_update_ht_parameter(bssDescription->chan_freq, &pAssocRsp->HTCaps, &pAssocRsp->HTInfo, chan_width_support, pAddBssParams); + /** + * in limExtractApCapability function intersection of FW + * advertised channel width and AP advertised channel + * width has been taken into account for calculating + * pe_session->ch_width + */ + + if (chan_width_support && + ((pAssocRsp->HTCaps.present && + pAssocRsp->HTCaps.supportedChannelWidthSet) || + (pBeaconStruct->HTCaps.present && + pBeaconStruct->HTCaps.supportedChannelWidthSet))) { + pAddBssParams->ch_width = + pe_session->ch_width; + pAddBssParams->staContext.ch_width = + pe_session->ch_width; + } else { + pAddBssParams->ch_width = CH_WIDTH_20MHZ; + pAddBssParams->staContext.ch_width = CH_WIDTH_20MHZ; + if (!vht_cap_info->enable_txbf_20mhz) + pAddBssParams->staContext.vhtTxBFCapable = 0; + } } if (pe_session->vhtCapability && (pAssocRsp->VHTCaps.present)) { @@ -3553,7 +3576,9 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp if (pAddBssParams->vhtCapable) { if (vht_oper) lim_update_vht_oper_assoc_resp(mac, pAddBssParams, - vht_oper, pe_session); + vht_caps, vht_oper, + &pAssocRsp->HTInfo, + pe_session); if (vht_caps) lim_update_vhtcaps_assoc_resp(mac, pAddBssParams, vht_caps, pe_session); @@ -3664,26 +3689,6 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp sta); } - /* - * in limExtractApCapability function intersection of FW - * advertised channel width and AP advertised channel - * width has been taken into account for calculating - * pe_session->ch_width - */ - if (chan_width_support && - ((pAssocRsp->HTCaps.supportedChannelWidthSet) || - (pBeaconStruct->HTCaps.supportedChannelWidthSet))) { - pAddBssParams->ch_width = - pe_session->ch_width; - pAddBssParams->staContext.ch_width = - pe_session->ch_width; - } else { - pAddBssParams->ch_width = CH_WIDTH_20MHZ; - sta_context->ch_width = CH_WIDTH_20MHZ; - if (!vht_cap_info->enable_txbf_20mhz) - sta_context->vhtTxBFCapable = 0; - } - pAddBssParams->staContext.mimoPS = (tSirMacHTMIMOPowerSaveState) pAssocRsp->HTCaps.mimoPowerSave; diff --git a/core/mac/src/pe/lim/lim_process_action_frame.c b/core/mac/src/pe/lim/lim_process_action_frame.c index 09e65cfb444b..35840952fd01 100644 --- a/core/mac/src/pe/lim/lim_process_action_frame.c +++ b/core/mac/src/pe/lim/lim_process_action_frame.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -244,10 +244,7 @@ static void __lim_process_operating_mode_action_frame(struct mac_context *mac_ct uint32_t status; tpDphHashNode sta_ptr; uint16_t aid; - uint8_t oper_mode; - uint8_t cb_mode; uint8_t ch_bw = 0; - uint8_t skip_opmode_update = false; mac_hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info); body_ptr = WMA_GET_RX_MPDU_DATA(rx_pkt_info); @@ -287,87 +284,13 @@ static void __lim_process_operating_mode_action_frame(struct mac_context *mac_ct goto end; } - if (wlan_reg_is_24ghz_ch_freq(session->curr_op_freq)) - cb_mode = mac_ctx->roam.configParam.channelBondingMode24GHz; - else - cb_mode = mac_ctx->roam.configParam.channelBondingMode5GHz; - /* - * Do not update the channel bonding mode if channel bonding - * mode is disabled in INI. - */ - if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE == cb_mode) { - pe_debug("channel bonding disabled"); - goto update_nss; - } + lim_update_nss(mac_ctx, sta_ptr, + operating_mode_frm->OperatingMode.rxNSS, + session); - if (sta_ptr->htSupportedChannelWidthSet) { - if (WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ < - sta_ptr->vhtSupportedChannelWidthSet) - oper_mode = eHT_CHANNEL_WIDTH_160MHZ; - else - oper_mode = sta_ptr->vhtSupportedChannelWidthSet + 1; - } else { - oper_mode = eHT_CHANNEL_WIDTH_20MHZ; - } - - if ((oper_mode == eHT_CHANNEL_WIDTH_80MHZ) && - (operating_mode_frm->OperatingMode.chanWidth > - eHT_CHANNEL_WIDTH_80MHZ)) - skip_opmode_update = true; - - if (!skip_opmode_update && (oper_mode != - operating_mode_frm->OperatingMode.chanWidth)) { - uint32_t fw_vht_ch_wd = wma_get_vht_ch_width(); - - pe_debug("received Chanwidth: %d", - operating_mode_frm->OperatingMode.chanWidth); - - pe_debug(" MAC: %0x:%0x:%0x:%0x:%0x:%0x", - mac_hdr->sa[0], mac_hdr->sa[1], mac_hdr->sa[2], - mac_hdr->sa[3], mac_hdr->sa[4], mac_hdr->sa[5]); - - if (operating_mode_frm->OperatingMode.chanWidth >= - eHT_CHANNEL_WIDTH_160MHZ - && (fw_vht_ch_wd >= eHT_CHANNEL_WIDTH_160MHZ)) { - sta_ptr->vhtSupportedChannelWidthSet = - WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ; - sta_ptr->htSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_40MHZ; - ch_bw = eHT_CHANNEL_WIDTH_160MHZ; - } else if (operating_mode_frm->OperatingMode.chanWidth >= - eHT_CHANNEL_WIDTH_80MHZ) { - sta_ptr->vhtSupportedChannelWidthSet = - WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ; - sta_ptr->htSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_40MHZ; - ch_bw = eHT_CHANNEL_WIDTH_80MHZ; - } else if (operating_mode_frm->OperatingMode.chanWidth == - eHT_CHANNEL_WIDTH_40MHZ) { - sta_ptr->vhtSupportedChannelWidthSet = - WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; - sta_ptr->htSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_40MHZ; - ch_bw = eHT_CHANNEL_WIDTH_40MHZ; - } else if (operating_mode_frm->OperatingMode.chanWidth == - eHT_CHANNEL_WIDTH_20MHZ) { - sta_ptr->vhtSupportedChannelWidthSet = - WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; - sta_ptr->htSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_20MHZ; - ch_bw = eHT_CHANNEL_WIDTH_20MHZ; - } - lim_check_vht_op_mode_change(mac_ctx, session, ch_bw, - mac_hdr->sa); - } - -update_nss: - if (sta_ptr->vhtSupportedRxNss != - (operating_mode_frm->OperatingMode.rxNSS + 1)) { - sta_ptr->vhtSupportedRxNss = - operating_mode_frm->OperatingMode.rxNSS + 1; - lim_set_nss_change(mac_ctx, session, sta_ptr->vhtSupportedRxNss, - mac_hdr->sa); - } + lim_update_channel_width(mac_ctx, sta_ptr, session, + operating_mode_frm->OperatingMode.chanWidth, + &ch_bw); end: qdf_mem_free(operating_mode_frm); diff --git a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c index 1e024f023c73..ab6c8639ab72 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -139,6 +139,7 @@ void lim_update_assoc_sta_datas(struct mac_context *mac_ctx, tDot11fIEVHTCaps *vht_caps = NULL; tDot11fIEhe_cap *he_cap = NULL; struct bss_description *bss_desc = NULL; + tDot11fIEVHTOperation *vht_oper = NULL; lim_get_phy_mode(mac_ctx, &phy_mode, session_entry); sta_ds->staType = STA_ENTRY_SELF; @@ -155,10 +156,13 @@ void lim_update_assoc_sta_datas(struct mac_context *mac_ctx, lim_update_stads_htcap(mac_ctx, sta_ds, assoc_rsp, session_entry); - if (assoc_rsp->VHTCaps.present) + if (assoc_rsp->VHTCaps.present) { vht_caps = &assoc_rsp->VHTCaps; - else if (assoc_rsp->vendor_vht_ie.VHTCaps.present) + vht_oper = &assoc_rsp->VHTOperation; + } else if (assoc_rsp->vendor_vht_ie.VHTCaps.present) { vht_caps = &assoc_rsp->vendor_vht_ie.VHTCaps; + vht_oper = &assoc_rsp->vendor_vht_ie.VHTOperation; + } if (session_entry->vhtCapability && (vht_caps && vht_caps->present)) { sta_ds->mlmStaContext.vhtCapability = @@ -171,13 +175,16 @@ void lim_update_assoc_sta_datas(struct mac_context *mac_ctx, */ sta_ds->htMaxRxAMpduFactor = vht_caps->maxAMPDULenExp; if (session_entry->htSupportedChannelWidthSet) { - if (assoc_rsp->VHTOperation.present) + if (vht_oper && vht_oper->present) sta_ds->vhtSupportedChannelWidthSet = - assoc_rsp->VHTOperation.chanWidth; + lim_get_vht_ch_width(vht_caps, + vht_oper, + &assoc_rsp->HTInfo); else sta_ds->vhtSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_40MHZ; + WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; } + sta_ds->vht_mcs_10_11_supp = 0; if (mac_ctx->mlme_cfg->vht_caps.vht_cap_info. vht_mcs_10_11_supp && @@ -289,6 +296,13 @@ void lim_update_assoc_sta_datas(struct mac_context *mac_ctx, if (session_entry->limRmfEnabled) sta_ds->rmfEnabled = 1; #endif + if (session_entry->vhtCapability && assoc_rsp->oper_mode_ntf.present) { + /** + * OMN IE is present in the Assoc response, but the channel + * width/Rx NSS update will happen through the peer_assoc cmd. + */ + pe_debug("OMN IE is present in the assoc response frame"); + } } /** diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 1922b487c16a..55a46dcd2144 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -9301,3 +9301,129 @@ QDF_STATUS lim_pre_vdev_start(struct mac_context *mac, return lim_set_ch_phy_mode(mlme_obj->vdev, session->dot11mode); } + +void lim_update_nss(struct mac_context *mac_ctx, tpDphHashNode sta_ds, + uint8_t rx_nss, struct pe_session *session) +{ + if (sta_ds->vhtSupportedRxNss != (rx_nss + 1)) { + if (session->nss_forced_1x1) { + pe_debug("Not Updating NSS for special AP"); + return; + } + sta_ds->vhtSupportedRxNss = rx_nss + 1; + lim_set_nss_change(mac_ctx, session, + sta_ds->vhtSupportedRxNss, + sta_ds->staAddr); + } +} + +bool lim_update_channel_width(struct mac_context *mac_ctx, + tpDphHashNode sta_ptr, + struct pe_session *session, + uint8_t ch_width, uint8_t *new_ch_width) +{ + uint8_t cb_mode, oper_mode; + uint32_t fw_vht_ch_wd; + + if (wlan_reg_is_24ghz_ch_freq(session->curr_op_freq)) + cb_mode = mac_ctx->roam.configParam.channelBondingMode24GHz; + else + cb_mode = mac_ctx->roam.configParam.channelBondingMode5GHz; + /* + * Do not update the channel bonding mode if channel bonding + * mode is disabled in INI. + */ + if (cb_mode == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) { + pe_debug("channel bonding disabled"); + return false; + } + + if (sta_ptr->htSupportedChannelWidthSet) { + if (sta_ptr->vhtSupportedChannelWidthSet > + WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) + oper_mode = eHT_CHANNEL_WIDTH_160MHZ; + else + oper_mode = sta_ptr->vhtSupportedChannelWidthSet + 1; + } else { + oper_mode = eHT_CHANNEL_WIDTH_20MHZ; + } + + if (((oper_mode == eHT_CHANNEL_WIDTH_80MHZ) && + (ch_width > eHT_CHANNEL_WIDTH_80MHZ)) || + (oper_mode == ch_width)) + return false; + + fw_vht_ch_wd = wma_get_vht_ch_width(); + + pe_debug("ChannelWidth - Current : %d, New: %d mac : " QDF_MAC_ADDR_FMT, + oper_mode, ch_width, QDF_MAC_ADDR_REF(sta_ptr->staAddr)); + + if (ch_width >= eHT_CHANNEL_WIDTH_160MHZ && + (fw_vht_ch_wd >= eHT_CHANNEL_WIDTH_160MHZ)) { + sta_ptr->vhtSupportedChannelWidthSet = + WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ; + sta_ptr->htSupportedChannelWidthSet = + eHT_CHANNEL_WIDTH_40MHZ; + *new_ch_width = eHT_CHANNEL_WIDTH_160MHZ; + } else if (ch_width >= eHT_CHANNEL_WIDTH_80MHZ) { + sta_ptr->vhtSupportedChannelWidthSet = + WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ; + sta_ptr->htSupportedChannelWidthSet = + eHT_CHANNEL_WIDTH_40MHZ; + *new_ch_width = eHT_CHANNEL_WIDTH_80MHZ; + } else if (ch_width == eHT_CHANNEL_WIDTH_40MHZ) { + sta_ptr->vhtSupportedChannelWidthSet = + WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; + sta_ptr->htSupportedChannelWidthSet = + eHT_CHANNEL_WIDTH_40MHZ; + *new_ch_width = eHT_CHANNEL_WIDTH_40MHZ; + } else if (ch_width == eHT_CHANNEL_WIDTH_20MHZ) { + sta_ptr->vhtSupportedChannelWidthSet = + WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; + sta_ptr->htSupportedChannelWidthSet = + eHT_CHANNEL_WIDTH_20MHZ; + *new_ch_width = eHT_CHANNEL_WIDTH_20MHZ; + } + + lim_check_vht_op_mode_change(mac_ctx, session, *new_ch_width, + sta_ptr->staAddr); + return true; +} + +uint8_t lim_get_vht_ch_width(tDot11fIEVHTCaps *vht_cap, + tDot11fIEVHTOperation *vht_op, + tDot11fIEHTInfo *ht_info) +{ + uint8_t ccfs0, ccfs1, offset; + uint8_t ch_width; + + ccfs0 = vht_op->chan_center_freq_seg0; + ccfs1 = vht_op->chan_center_freq_seg1; + ch_width = vht_op->chanWidth; + + if (ch_width > WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ) { + pe_err("Invalid ch width in vht operation IE %d", ch_width); + return WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; + } + + if (vht_cap->vht_extended_nss_bw_cap && + vht_cap->extended_nss_bw_supp && ht_info && ht_info->present) + ccfs1 = ht_info->chan_center_freq_seg2; + + /* According to new VHTOP IE definition, vht ch_width will + * be 1 for 80MHz, 160MHz and 80+80MHz. + * + * To get the correct operation ch_width, find center + * frequency difference. + */ + if (ch_width == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ && ccfs1) { + offset = abs(ccfs0 - ccfs1); + + if (offset == 8) + ch_width = WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ; + else if (offset > 16) + ch_width = WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ; + } + pe_debug("The VHT Operation channel width is %d", ch_width); + return ch_width; +} diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h index b97bb75871da..4cf1acd04d2f 100644 --- a/core/mac/src/pe/lim/lim_utils.h +++ b/core/mac/src/pe/lim/lim_utils.h @@ -2261,4 +2261,49 @@ static inline void lim_process_sae_msg(struct mac_context *mac, void *body); {} #endif +/** + * lim_update_nss() - Function to update NSS + * @mac_ctx: pointer to Global Mac structure + * @sta_ds: pointer to tpDphHashNode + * @rx_nss: Rx NSS in operating mode notification + * @session: pointer to pe_session + * + * function to update NSS + * + * Return: None + */ +void lim_update_nss(struct mac_context *mac_ctx, tpDphHashNode sta_ds, + uint8_t rx_nss, struct pe_session *session); + +/** + * lim_update_channel_width() - Function to update channel width + * @mac_ctx: pointer to Global Mac structure + * @sta_ptr: pointer to tpDphHashNode + * @session: pointer to pe_session + * @ch_width: Channel width in operating mode notification + * @new_ch_width: Final channel bandwifdth + * + * function to update channel width + * + * Return: Success or Failure + */ +bool lim_update_channel_width(struct mac_context *mac_ctx, + tpDphHashNode sta_ptr, + struct pe_session *session, + uint8_t ch_width, + uint8_t *new_ch_width); + +/** + * lim_get_vht_ch_width() - Function to get the VHT + * operating channel width based on frequency params + * + * @vht_cap: Pointer to VHT Caps IE. + * @vht_op: Pointer to VHT Operation IE. + * @ht_info: Pointer to HT Info IE. + * + * Return: VHT channel width + */ +uint8_t lim_get_vht_ch_width(tDot11fIEVHTCaps *vht_cap, + tDot11fIEVHTOperation *vht_op, + tDot11fIEHTInfo *ht_info); #endif /* __LIM_UTILS_H */ diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index fc0dffe910e5..b8f150f5aa08 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -241,36 +241,6 @@ ap_beacon_process(struct mac_context *mac_ctx, uint8_t *rx_pkt_info, /* -------------------------------------------------------------------- */ -/** - * get_operating_channel_width() - Get operating channel width - * @stads - station entry. - * - * This function returns the operating channel width based on - * the supported channel width entry. - * - * Return: tSirMacHTChannelWidth on success - */ -static tSirMacHTChannelWidth get_operating_channel_width(tpDphHashNode stads) -{ - tSirMacHTChannelWidth ch_width = eHT_CHANNEL_WIDTH_20MHZ; - - if (stads->vhtSupportedChannelWidthSet == - WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ) - ch_width = eHT_CHANNEL_WIDTH_160MHZ; - else if (stads->vhtSupportedChannelWidthSet == - WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ) - ch_width = eHT_CHANNEL_WIDTH_160MHZ; - else if (stads->vhtSupportedChannelWidthSet == - WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) - ch_width = eHT_CHANNEL_WIDTH_80MHZ; - else if (stads->htSupportedChannelWidthSet) - ch_width = eHT_CHANNEL_WIDTH_40MHZ; - else - ch_width = eHT_CHANNEL_WIDTH_20MHZ; - - return ch_width; -} - /* * sch_bcn_process_sta() - Process the received beacon frame for sta * @mac_ctx: mac_ctx @@ -415,35 +385,6 @@ sch_bcn_process_sta(struct mac_context *mac_ctx, return true; } -/** - * update_nss() - Function to update NSS - * @mac_ctx: pointer to Global Mac structure - * @sta_ds: pointer to tpDphHashNode - * @beacon: pointer to tpSchBeaconStruct - * @session_entry: pointer to struct pe_session * - * @mgmt_hdr: pointer to tpSirMacMgmtHdr - * - * function to update NSS - * - * Return: none - */ -static void update_nss(struct mac_context *mac_ctx, tpDphHashNode sta_ds, - tpSchBeaconStruct beacon, struct pe_session *session_entry, - tpSirMacMgmtHdr mgmt_hdr) -{ - if (sta_ds->vhtSupportedRxNss != (beacon->OperatingMode.rxNSS + 1)) { - if (session_entry->nss_forced_1x1) { - pe_debug("Not Updating NSS for special AP"); - return; - } - sta_ds->vhtSupportedRxNss = - beacon->OperatingMode.rxNSS + 1; - lim_set_nss_change(mac_ctx, session_entry, - sta_ds->vhtSupportedRxNss, - mgmt_hdr->sa); - } -} - #ifdef WLAN_FEATURE_11AX_BSS_COLOR static void sch_bcn_update_he_ies(struct mac_context *mac_ctx, tpDphHashNode sta_ds, @@ -499,7 +440,7 @@ sch_bcn_update_opmode_change(struct mac_context *mac_ctx, tpDphHashNode sta_ds, bool skip_opmode_update = false; uint8_t oper_mode; uint32_t fw_vht_ch_wd = wma_get_vht_ch_width(); - uint8_t ch_width = 0; + uint8_t ch_width = 0, ch_bw; /* * Ignore opmode change during channel change The opmode will be updated @@ -511,72 +452,10 @@ sch_bcn_update_opmode_change(struct mac_context *mac_ctx, tpDphHashNode sta_ds, } if (session->vhtCapability && bcn->OperatingMode.present) { - update_nss(mac_ctx, sta_ds, bcn, session, mac_hdr); - oper_mode = get_operating_channel_width(sta_ds); - if ((oper_mode == eHT_CHANNEL_WIDTH_80MHZ) && - (bcn->OperatingMode.chanWidth > eHT_CHANNEL_WIDTH_80MHZ)) - skip_opmode_update = true; - - if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE == cb_mode) { - /* - * if channel bonding is disabled from INI do not - * update the chan width - */ - pe_debug_rl("CB disabled skip bw update: old[%d] new[%d]", - oper_mode, - bcn->OperatingMode.chanWidth); - return; - } - - if (!skip_opmode_update && - ((oper_mode != bcn->OperatingMode.chanWidth) || - (sta_ds->vhtSupportedRxNss != - (bcn->OperatingMode.rxNSS + 1)))) { - pe_debug("received OpMode Chanwidth %d", - bcn->OperatingMode.chanWidth); - pe_debug("MAC - %0x:%0x:%0x:%0x:%0x:%0x", - mac_hdr->sa[0], mac_hdr->sa[1], - mac_hdr->sa[2], mac_hdr->sa[3], - mac_hdr->sa[4], mac_hdr->sa[5]); - - if ((bcn->OperatingMode.chanWidth >= - eHT_CHANNEL_WIDTH_160MHZ) && - (fw_vht_ch_wd > eHT_CHANNEL_WIDTH_80MHZ)) { - pe_debug("Updating the CH Width to 160MHz"); - sta_ds->vhtSupportedChannelWidthSet = - WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ; - sta_ds->htSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_40MHZ; - ch_width = eHT_CHANNEL_WIDTH_160MHZ; - } else if (bcn->OperatingMode.chanWidth >= - eHT_CHANNEL_WIDTH_80MHZ) { - pe_debug("Updating the CH Width to 80MHz"); - sta_ds->vhtSupportedChannelWidthSet = - WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ; - sta_ds->htSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_40MHZ; - ch_width = eHT_CHANNEL_WIDTH_80MHZ; - } else if (bcn->OperatingMode.chanWidth == - eHT_CHANNEL_WIDTH_40MHZ) { - pe_debug("Updating the CH Width to 40MHz"); - sta_ds->vhtSupportedChannelWidthSet = - WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; - sta_ds->htSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_40MHZ; - ch_width = eHT_CHANNEL_WIDTH_40MHZ; - } else if (bcn->OperatingMode.chanWidth == - eHT_CHANNEL_WIDTH_20MHZ) { - pe_debug("Updating the CH Width to 20MHz"); - sta_ds->vhtSupportedChannelWidthSet = - WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; - sta_ds->htSupportedChannelWidthSet = - eHT_CHANNEL_WIDTH_20MHZ; - ch_width = eHT_CHANNEL_WIDTH_20MHZ; - } - lim_check_vht_op_mode_change(mac_ctx, session, - ch_width, mac_hdr->sa); - update_nss(mac_ctx, sta_ds, bcn, session, mac_hdr); - } + lim_update_nss(mac_ctx, sta_ds, bcn->OperatingMode.rxNSS, + session); + lim_update_channel_width(mac_ctx, sta_ds, session, + bcn->OperatingMode.chanWidth, &ch_bw); return; } diff --git a/core/mac/src/sys/legacy/src/utils/src/dot11f.c b/core/mac/src/sys/legacy/src/utils/src/dot11f.c index 721bb54919b0..ec2f7ff8be51 100644 --- a/core/mac/src/sys/legacy/src/utils/src/dot11f.c +++ b/core/mac/src/sys/legacy/src/utils/src/dot11f.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -24,7 +25,7 @@ * * * This file was automatically generated by 'framesc' - * Wed Sep 29 13:23:21 2021 from the following file(s): + * Mon May 30 20:50:39 2022 from the following file(s): * * dot11f.frms * @@ -10202,6 +10203,10 @@ static const tIEDefn IES_AssocResponse[] = { offsetof(tDot11fIEVHTOperation, present), 0, "VHTOperation", 0, 7, 7, SigIeVHTOperation, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTOPERATION, 0, 0, }, + { offsetof(tDot11fAssocResponse, OperatingMode), + offsetof(tDot11fIEOperatingMode, present), 0, "OperatingMode", + 0, 3, 3, SigIeOperatingMode, {0, 0, 0, 0, 0}, + 0, DOT11F_EID_OPERATINGMODE, 0, 0, }, { offsetof(tDot11fAssocResponse, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap", 0, 3, 17, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, 0, }, @@ -12055,6 +12060,10 @@ static const tIEDefn IES_ReAssocResponse[] = { offsetof(tDot11fIEVHTOperation, present), 0, "VHTOperation", 0, 7, 7, SigIeVHTOperation, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTOPERATION, 0, 0, }, + { offsetof(tDot11fReAssocResponse, OperatingMode), + offsetof(tDot11fIEOperatingMode, present), 0, "OperatingMode", + 0, 3, 3, SigIeOperatingMode, {0, 0, 0, 0, 0}, + 0, DOT11F_EID_OPERATINGMODE, 0, 0, }, { offsetof(tDot11fReAssocResponse, ExtCap), offsetof(tDot11fIEExtCap, present), 0, "ExtCap", 0, 3, 17, SigIeExtCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_EXTCAP, 0, 0, }, diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index 7577ecb44541..e617d4567659 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -3512,6 +3512,10 @@ sir_convert_assoc_resp_frame2_struct(struct mac_context *mac, ext_cap->fine_time_meas_responder); } + if (ar->OperatingMode.present) { + qdf_mem_copy(&pAssocRsp->oper_mode_ntf, &ar->OperatingMode, + sizeof(tDot11fIEOperatingMode)); + } if (ar->QosMapSet.present) { pAssocRsp->QosMapSet.present = 1; convert_qos_mapset_frame(mac, &pAssocRsp->QosMapSet, From f8e71e1d58dee620d10a4e9df6ecf7413a34e160 Mon Sep 17 00:00:00 2001 From: Rahul Choudhary Date: Wed, 2 Aug 2023 04:26:00 -0700 Subject: [PATCH 04/10] Release 2.0.8.33O Release 2.0.8.33O Change-Id: I15d8290dc92070cfd380639c8119c179038d59a6 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index c3da38fb3ef4..7ee3405c98db 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "N" +#define QWLAN_VERSION_EXTRA "O" #define QWLAN_VERSION_BUILD 33 -#define QWLAN_VERSIONSTR "2.0.8.33N" +#define QWLAN_VERSIONSTR "2.0.8.33O" #endif /* QWLAN_VERSION_H */ From cf6155cdc3ce1e35d40895cdf7ee1c4799ac3d24 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Wed, 21 Jun 2023 04:51:21 -0700 Subject: [PATCH 05/10] qcacld-3.0: Issue disconnect on STA while start/stop SAP For STA+SAP/GO concurrency support from GUI, In case if START/STOP AP/GO request comes just before the SAE authentication completion on STA, SAE AUTH REQ waits for START/STOP AP RSP and START/STOP AP RSP waits to complete SAE AUTH REQ. Driver completes START/STOP AP RSP only upon SAE AUTH REQ timeout(5 sec) as start/stop ap will be in serialization pending queue, and SAE auth sequence cannot complete as hostap thread is blocked in start/stop ap cfg80211 ops. To avoid above deadlock until SAE timeout, abort the SAE connection immediately and complete START/STOP AP/GO asap so that the upper layer can trigger a fresh connection after START/STOP AP/GO completion. Change-Id: I96de1bb27dfc669ccf920a90cf86a3cb54e68354 CRs-Fixed: 3452943 --- core/hdd/inc/wlan_hdd_assoc.h | 12 ++++++++++ core/hdd/src/wlan_hdd_assoc.c | 41 +++++++++++++++++++++++++++++++++ core/hdd/src/wlan_hdd_hostapd.c | 30 ++++++++++++++++++++++++ 3 files changed, 83 insertions(+) diff --git a/core/hdd/inc/wlan_hdd_assoc.h b/core/hdd/inc/wlan_hdd_assoc.h index e98a4fd686f2..d17093869a3e 100644 --- a/core/hdd/inc/wlan_hdd_assoc.h +++ b/core/hdd/inc/wlan_hdd_assoc.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -273,6 +274,17 @@ struct hdd_adapter *hdd_get_sta_connection_in_progress( */ void hdd_abort_ongoing_sta_connection(struct hdd_context *hdd_ctx); +/** + * hdd_abort_ongoing_sta_sae_connection() - Disconnect the sta for which the + * sae connection is in progress. + * @hdd_ctx: hdd context + * @adapter: pointer to the adapter + * + * Return: none + */ +void hdd_abort_ongoing_sta_sae_connection(struct hdd_context *hdd_ctx, + struct hdd_adapter *adapter); + /** * hdd_is_any_sta_connected() - check if any sta in connected state * @hdd_ctx: hdd context diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 7fd32192150a..e02c72eadb1e 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -460,6 +460,47 @@ void hdd_abort_ongoing_sta_connection(struct hdd_context *hdd_ctx) } } +void hdd_abort_ongoing_sta_sae_connection(struct hdd_context *hdd_ctx, + struct hdd_adapter *adapter) +{ + struct hdd_adapter *sta_adapter; + struct wlan_objmgr_vdev *vdev; + int32_t key_mgmt; + QDF_STATUS status; + + sta_adapter = hdd_get_sta_connection_in_progress(hdd_ctx); + if (!sta_adapter) { + hdd_err("sta_adapter is NULL"); + return; + } + + vdev = hdd_objmgr_get_vdev(adapter); + if (!vdev) { + hdd_err("vdev is NULL"); + return; + } + + key_mgmt = wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_KEY_MGMT); + hdd_objmgr_put_vdev(vdev); + + if (key_mgmt < 0) { + hdd_debug_rl("Invalid key_mgmt: %d", key_mgmt); + return; + } + + if (QDF_HAS_PARAM(key_mgmt, WLAN_CRYPTO_KEY_MGMT_SAE) || + QDF_HAS_PARAM(key_mgmt, WLAN_CRYPTO_KEY_MGMT_FT_SAE)) { + hdd_debug("Disconnecting STA on vdev: %d", + sta_adapter->vdev_id); + status = wlan_hdd_disconnect(sta_adapter, + eCSR_DISCONNECT_REASON_DEAUTH, + REASON_DISASSOC_NETWORK_LEAVING); + if (QDF_IS_STATUS_ERROR(status)) + hdd_err("wlan_hdd_disconnect failed, status: %d", + status); + } +} + bool hdd_is_any_sta_connected(struct hdd_context *hdd_ctx) { struct hdd_adapter *adapter = NULL, *next_adapter = NULL; diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index d1d8318f2802..075de779d2d5 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -5274,6 +5274,21 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, } } + /* + * For STA+SAP/GO concurrency support from GUI, In case if + * START AP/GO request comes just before the SAE authentication + * completion on STA, SAE AUTH REQ waits for START AP RSP and + * START AP RSP waits to complete SAE AUTH REQ. + * Driver completes START AP RSP only upon SAE AUTH REQ timeout(5 sec) + * as start ap will be in serialization pending queue, and SAE auth + * sequence cannot complete as hostap thread is blocked in start ap + * cfg80211 ops. + * To avoid above deadlock until SAE timeout, abort the SAE connection + * immediately and complete START AP/GO asap so that the upper layer + * can trigger a fresh connection after START AP/GO completion. + */ + hdd_abort_ongoing_sta_sae_connection(hdd_ctx, adapter); + mac_handle = hdd_ctx->mac_handle; sme_config = qdf_mem_malloc(sizeof(*sme_config)); @@ -6043,6 +6058,21 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy, goto exit; } + /* + * For STA+SAP/GO concurrency support from GUI, In case if + * STOP AP/GO request comes just before the SAE authentication + * completion on STA, SAE AUTH REQ waits for STOP AP RSP and + * STOP AP RSP waits to complete SAE AUTH REQ. + * Driver completes STOP AP RSP only upon SAE AUTH REQ timeout(5 sec) + * as stop ap will be in serialization pending queue, and SAE auth + * sequence cannot complete as hostap thread is blocked in stop ap + * cfg80211 ops. + * To avoid above deadlock until SAE timeout, abort the SAE connection + * immediately and complete STOP AP/GO asap so that the upper layer + * can trigger a fresh connection after STOP AP/GO completion. + */ + hdd_abort_ongoing_sta_sae_connection(hdd_ctx, adapter); + /* Clear SOFTAP_INIT_DONE flag to mark stop_ap deinit. So that we do * not restart SAP after SSR as SAP is already stopped from user space. * This update is moved to start of this function to resolve stop_ap From 9db74b24de8384955ec3ece2aa298c0a175872a3 Mon Sep 17 00:00:00 2001 From: Rahul Choudhary Date: Mon, 7 Aug 2023 13:15:45 -0700 Subject: [PATCH 06/10] Release 2.0.8.33P Release 2.0.8.33P Change-Id: I01ebe6afe8464bd52c45d091d7da5916e5927cd2 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 7ee3405c98db..a3ab289e55e8 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "O" +#define QWLAN_VERSION_EXTRA "P" #define QWLAN_VERSION_BUILD 33 -#define QWLAN_VERSIONSTR "2.0.8.33O" +#define QWLAN_VERSIONSTR "2.0.8.33P" #endif /* QWLAN_VERSION_H */ From 5dd1ccf1488b877046e5ea0df35588e443d5c2e3 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Myadam Date: Wed, 14 Jun 2023 11:12:28 +0530 Subject: [PATCH 07/10] qcacld-3.0: Fix read current country code In populate_dot_11_f_ext_chann_switch_ann API, will read current country code from mac context which is not have the updated country code. So, read the current country code directly from regulatory API, wlan_reg_read_current_country. Remove unused variables mac->scan.countryCodeCurrent, mac_ptr->scan.countryCodeDefault and tagCsr11dinfo->countryCode. Change-Id: Ice64ef1be5b775125ff3bcacfcab7684c6833cad CRs-Fixed: 3529808 --- core/hdd/src/wlan_hdd_main.c | 1 - core/mac/src/pe/lim/lim_process_tdls.c | 8 ++-- .../src/pe/lim/lim_send_management_frames.c | 5 +- core/mac/src/pe/lim/lim_send_messages.c | 5 +- .../src/sys/legacy/src/utils/src/parser_api.c | 4 +- core/sme/inc/csr_api.h | 1 - core/sme/inc/csr_internal.h | 6 +-- core/sme/inc/sme_api.h | 4 +- core/sme/src/common/sme_api.c | 19 ++++---- core/sme/src/csr/csr_api_roam.c | 47 ++++++------------- core/sme/src/csr/csr_api_scan.c | 16 ++++--- core/sme/src/csr/csr_inside_api.h | 3 +- 12 files changed, 51 insertions(+), 68 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index b7f2353b28e8..a641e3b6fd7e 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9696,7 +9696,6 @@ void hdd_prevent_suspend_timeout(uint32_t timeout, uint32_t reason) QDF_STATUS hdd_set_sme_chan_list(struct hdd_context *hdd_ctx) { return sme_init_chan_list(hdd_ctx->mac_handle, - hdd_ctx->reg.alpha2, hdd_ctx->reg.cc_src); } diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index 3e20732b7174..acb1ee398587 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -205,6 +205,7 @@ static void populate_dot11f_tdls_offchannel_params( uint8_t nss_2g; uint8_t nss_5g; qdf_freq_t ch_freq; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; numChans = mac->mlme_cfg->reg.valid_channel_list_num; @@ -270,13 +271,14 @@ static void populate_dot11f_tdls_offchannel_params( break; } + wlan_reg_read_current_country(mac->psoc, reg_cc); op_class = wlan_reg_dmn_get_opclass_from_channel( - mac->scan.countryCodeCurrent, + reg_cc, wlan_reg_freq_to_chan(mac->pdev, pe_session->curr_op_freq), chanOffset); pe_debug("countryCodeCurrent: %s, curr_op_freq: %d, htSecondaryChannelOffset: %d, chanOffset: %d op class: %d", - mac->scan.countryCodeCurrent, + reg_cc, pe_session->curr_op_freq, pe_session->htSecondaryChannelOffset, chanOffset, op_class); diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c index ea07afe0a7cb..d9d92767aed6 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -4288,6 +4288,7 @@ lim_send_extended_chan_switch_action_frame(struct mac_context *mac_ctx, uint8_t vdev_id = 0; uint8_t ch_spacing; tLimWiderBWChannelSwitchInfo *wide_bw_ie; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; if (!session_entry) { pe_err("Session entry is NULL!!!"); @@ -4306,9 +4307,9 @@ lim_send_extended_chan_switch_action_frame(struct mac_context *mac_ctx, frm.ext_chan_switch_ann_action.new_channel = new_channel; frm.ext_chan_switch_ann_action.switch_count = count; + wlan_reg_read_current_country(mac_ctx->psoc, reg_cc); ch_spacing = wlan_reg_dmn_get_chanwidth_from_opclass( - mac_ctx->scan.countryCodeCurrent, new_channel, - new_op_class); + reg_cc, new_channel, new_op_class); if ((ch_spacing == 80) || (ch_spacing == 160)) { wide_bw_ie = &session_entry->gLimWiderBWChannelSwitch; diff --git a/core/mac/src/pe/lim/lim_send_messages.c b/core/mac/src/pe/lim/lim_send_messages.c index 5b7c3a96832a..8958e8c4b1b8 100644 --- a/core/mac/src/pe/lim/lim_send_messages.c +++ b/core/mac/src/pe/lim/lim_send_messages.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -477,6 +478,7 @@ QDF_STATUS lim_send_ht40_obss_scanind(struct mac_context *mac_ctx, uint32_t channelnum, chan_freq; struct scheduler_msg msg = {0}; uint8_t channel24gnum, count; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; ht40_obss_scanind = qdf_mem_malloc(sizeof(struct obss_ht40_scanind)); if (!ht40_obss_scanind) @@ -485,6 +487,7 @@ QDF_STATUS lim_send_ht40_obss_scanind(struct mac_context *mac_ctx, "OBSS Scan Indication bssid " QDF_MAC_ADDR_FMT, QDF_MAC_ADDR_REF(session->bssId)); + wlan_reg_read_current_country(mac_ctx->psoc, reg_cc); ht40_obss_scanind->cmd = HT40_OBSS_SCAN_PARAM_START; ht40_obss_scanind->scan_type = eSIR_ACTIVE_SCAN; ht40_obss_scanind->obss_passive_dwelltime = @@ -503,7 +506,7 @@ QDF_STATUS lim_send_ht40_obss_scanind(struct mac_context *mac_ctx, session->obss_ht40_scanparam.obss_activity_threshold; ht40_obss_scanind->current_operatingclass = wlan_reg_dmn_get_opclass_from_channel( - mac_ctx->scan.countryCodeCurrent, + reg_cc, wlan_reg_freq_to_chan( mac_ctx->pdev, session->curr_op_freq), session->ch_width); diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index e617d4567659..f9100c3d0228 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -185,6 +185,7 @@ void populate_dot_11_f_ext_chann_switch_ann(struct mac_context *mac_ptr, uint32_t sw_target_freq; uint8_t primary_channel; enum phy_ch_width ch_width; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; ch_width = session_entry->gLimChannelSwitch.ch_width; ch_offset = session_entry->gLimChannelSwitch.sec_ch_offset; @@ -201,8 +202,9 @@ void populate_dot_11_f_ext_chann_switch_ann(struct mac_context *mac_ptr, session_entry->gLimChannelSwitch.switchCount; dot_11_ptr->present = 1; + wlan_reg_read_current_country(mac_ptr->psoc, reg_cc); pe_debug("country:%s chan:%d freq %d width:%d reg:%d off:%d", - mac_ptr->scan.countryCodeCurrent, + reg_cc, session_entry->gLimChannelSwitch.primaryChannel, sw_target_freq, session_entry->gLimChannelSwitch.ch_width, diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 72da90d303ef..d4b648198485 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -274,7 +274,6 @@ typedef struct sCsrChnPower_ { typedef struct tagCsr11dinfo { sCsrChannel Channels; - uint8_t countryCode[REG_ALPHA2_LEN + 1]; /* max power channel list */ sCsrChnPower ChnPower[CFG_VALID_CHANNEL_LIST_LEN]; } tCsr11dinfo; diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index b06016c19949..89415d42b2bf 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -399,8 +399,6 @@ struct csr_scanstruct { tDblLinkList channelPowerInfoList5G; uint32_t nLastAgeTimeOut; uint32_t nAgingCountDown; - uint8_t countryCodeDefault[REG_ALPHA2_LEN + 1]; - uint8_t countryCodeCurrent[REG_ALPHA2_LEN + 1]; uint8_t countryCode11d[REG_ALPHA2_LEN + 1]; v_REGDOMAIN_t domainIdDefault; /* default regulatory domain */ v_REGDOMAIN_t domainIdCurrent; /* current regulatory domain */ @@ -895,7 +893,7 @@ QDF_STATUS csr_change_default_config_param(struct mac_context *mac, struct csr_config_params *pParam); QDF_STATUS csr_msg_processor(struct mac_context *mac, void *msg_buf); QDF_STATUS csr_open(struct mac_context *mac); -QDF_STATUS csr_init_chan_list(struct mac_context *mac, uint8_t *alpha2); +QDF_STATUS csr_init_chan_list(struct mac_context *mac); QDF_STATUS csr_close(struct mac_context *mac); QDF_STATUS csr_start(struct mac_context *mac); QDF_STATUS csr_stop(struct mac_context *mac); diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 6386522603a3..863dfd5bc45e 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -256,8 +257,7 @@ enum { Function declarations and documenation ------------------------------------------------------------------------*/ QDF_STATUS sme_open(mac_handle_t mac_handle); -QDF_STATUS sme_init_chan_list(mac_handle_t mac_handle, uint8_t *alpha2, - enum country_src cc_src); +QDF_STATUS sme_init_chan_list(mac_handle_t mac_handle, enum country_src cc_src); QDF_STATUS sme_close(mac_handle_t mac_handle); QDF_STATUS sme_start(mac_handle_t mac_handle); diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index c6e3757eec5f..73941cf9f2f6 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -861,8 +861,7 @@ QDF_STATUS sme_open(mac_handle_t mac_handle) /* * sme_init_chan_list, triggers channel setup based on country code. */ -QDF_STATUS sme_init_chan_list(mac_handle_t mac_handle, uint8_t *alpha2, - enum country_src cc_src) +QDF_STATUS sme_init_chan_list(mac_handle_t mac_handle, enum country_src cc_src) { struct mac_context *pmac = MAC_CONTEXT(mac_handle); @@ -871,7 +870,7 @@ QDF_STATUS sme_init_chan_list(mac_handle_t mac_handle, uint8_t *alpha2, pmac->mlme_cfg->gen.enabled_11d = false; } - return csr_init_chan_list(pmac, alpha2); + return csr_init_chan_list(pmac); } /* @@ -13090,7 +13089,9 @@ void sme_get_opclass(mac_handle_t mac_handle, uint8_t channel, uint8_t bw_offset, uint8_t *opclass) { struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle); + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; + wlan_reg_read_current_country(mac_ctx->psoc, reg_cc); /* redgm opclass table contains opclass for 40MHz low primary, * 40MHz high primary and 20MHz. No support for 80MHz yet. So * first we will check if bit for 40MHz is set and if so find @@ -13100,21 +13101,17 @@ void sme_get_opclass(mac_handle_t mac_handle, uint8_t channel, */ if (bw_offset & (1 << BW_40_OFFSET_BIT)) { *opclass = wlan_reg_dmn_get_opclass_from_channel( - mac_ctx->scan.countryCodeCurrent, - channel, BW40_LOW_PRIMARY); + reg_cc, channel, BW40_LOW_PRIMARY); if (!(*opclass)) { *opclass = wlan_reg_dmn_get_opclass_from_channel( - mac_ctx->scan.countryCodeCurrent, - channel, BW40_HIGH_PRIMARY); + reg_cc, channel, BW40_HIGH_PRIMARY); } } else if (bw_offset & (1 << BW_20_OFFSET_BIT)) { *opclass = wlan_reg_dmn_get_opclass_from_channel( - mac_ctx->scan.countryCodeCurrent, - channel, BW20); + reg_cc, channel, BW20); } else { *opclass = wlan_reg_dmn_get_opclass_from_channel( - mac_ctx->scan.countryCodeCurrent, - channel, BWALL); + reg_cc, channel, BWALL); } } #endif diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 9aa6882b0864..341758495b38 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -637,23 +637,19 @@ QDF_STATUS csr_open(struct mac_context *mac) return status; } -QDF_STATUS csr_init_chan_list(struct mac_context *mac, uint8_t *alpha2) +QDF_STATUS csr_init_chan_list(struct mac_context *mac) { QDF_STATUS status; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; - mac->scan.countryCodeDefault[0] = alpha2[0]; - mac->scan.countryCodeDefault[1] = alpha2[1]; - mac->scan.countryCodeDefault[2] = alpha2[2]; - - sme_debug("init time country code %.2s", mac->scan.countryCodeDefault); + wlan_reg_read_current_country(mac->psoc, reg_cc); + sme_debug("init time country code %.2s", reg_cc); mac->scan.domainIdDefault = 0; mac->scan.domainIdCurrent = 0; - qdf_mem_copy(mac->scan.countryCodeCurrent, - mac->scan.countryCodeDefault, REG_ALPHA2_LEN + 1); qdf_mem_copy(mac->scan.countryCodeElected, - mac->scan.countryCodeDefault, REG_ALPHA2_LEN + 1); + reg_cc, REG_ALPHA2_LEN + 1); status = csr_get_channel_and_power_list(mac); return status; @@ -665,8 +661,6 @@ QDF_STATUS csr_set_channels(struct mac_context *mac, QDF_STATUS status = QDF_STATUS_SUCCESS; uint8_t index = 0; - qdf_mem_copy(pParam->Csr11dinfo.countryCode, - mac->scan.countryCodeCurrent, REG_ALPHA2_LEN + 1); for (index = 0; index < mac->scan.base_channels.numChannels; index++) { pParam->Csr11dinfo.Channels.channel_freq_list[index] = @@ -2796,8 +2790,7 @@ QDF_STATUS csr_apply_channel_and_power_list(struct mac_context *mac) csr_save_channel_power_for_band(mac, false); csr_save_channel_power_for_band(mac, true); csr_apply_channel_power_info_to_fw(mac, - &mac->scan.base_channels, - mac->scan.countryCodeCurrent); + &mac->scan.base_channels); csr_init_operating_classes(mac); return status; @@ -2829,17 +2822,6 @@ static QDF_STATUS csr_init11d_info(struct mac_context *mac, tCsr11dinfo *ps11din } /* legacy maintenance */ - qdf_mem_copy(mac->scan.countryCodeDefault, ps11dinfo->countryCode, - REG_ALPHA2_LEN + 1); - - /* Tush: at csropen get this initialized with default, - * during csr reset if this already set with some value - * no need initilaize with default again - */ - if (0 == mac->scan.countryCodeCurrent[0]) { - qdf_mem_copy(mac->scan.countryCodeCurrent, - ps11dinfo->countryCode, REG_ALPHA2_LEN + 1); - } /* need to add the max power channel list */ pChanInfo = qdf_mem_malloc(sizeof(tSirMacChanInfo) * @@ -2881,9 +2863,7 @@ static QDF_STATUS csr_init11d_info(struct mac_context *mac, tCsr11dinfo *ps11din */ csr_apply_channel_power_info_to_fw(mac, &mac->scan. - base_channels, - mac->scan. - countryCodeCurrent); + base_channels); } } return status; @@ -15050,6 +15030,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId, uint8_t programmed_country[REG_ALPHA2_LEN + 1]; enum reg_6g_ap_type power_type_6g; bool ctry_code_match; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; if (!pSession) { sme_err("session %d not found", sessionId); @@ -15136,8 +15117,9 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId, qdf_mem_copy(&csr_join_req->self_mac_addr, &pSession->self_mac_addr, sizeof(tSirMacAddr)); + wlan_reg_read_current_country(mac->psoc, reg_cc); sme_nofl_info("vdev-%d: Connecting to %.*s " QDF_MAC_ADDR_FMT - " rssi: %d freq: %d akm %d cipher: uc %d mc %d, CC: %c%c", + " rssi: %d freq: %d akm %d cipher: uc %d mc %d, CC: %s", sessionId, csr_join_req->ssId.length, csr_join_req->ssId.ssId, QDF_MAC_ADDR_REF(pBssDescription->bssId), @@ -15145,8 +15127,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId, pProfile->negotiatedAuthType, pProfile->negotiatedUCEncryptionType, pProfile->negotiatedMCEncryptionType, - mac->scan.countryCodeCurrent[0], - mac->scan.countryCodeCurrent[1]); + reg_cc); wlan_rec_conn_info(sessionId, DEBUG_CONN_CONNECTING, pBssDescription->bssId, pProfile->negotiatedAuthType, @@ -20311,10 +20292,10 @@ static void csr_init_operating_classes(struct mac_context *mac) uint8_t swap = 0; uint8_t numClasses = 0; uint8_t opClasses[REG_MAX_SUPP_OPER_CLASSES] = {0,}; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; - sme_debug("Current Country = %c%c", - mac->scan.countryCodeCurrent[0], - mac->scan.countryCodeCurrent[1]); + wlan_reg_read_current_country(mac->psoc, reg_cc); + sme_debug("Current Country = %s", reg_cc); csr_update_op_class_array(mac, opClasses, &mac->scan.base_channels, "20MHz", &i); diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index e98e39512c71..8ba4ef61b6a1 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -566,8 +566,7 @@ void csr_apply_power2_current(struct mac_context *mac) } void csr_apply_channel_power_info_to_fw(struct mac_context *mac_ctx, - struct csr_channel *ch_lst, - uint8_t *countryCode) + struct csr_channel *ch_lst) { int i; uint8_t num_ch = 0; @@ -598,6 +597,7 @@ static void csr_diag_reset_country_information(struct mac_context *mac) host_log_802_11d_pkt_type *p11dLog; int Index; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; WLAN_HOST_DIAG_LOG_ALLOC(p11dLog, host_log_802_11d_pkt_type, LOG_WLAN_80211D_C); @@ -605,7 +605,8 @@ static void csr_diag_reset_country_information(struct mac_context *mac) return; p11dLog->eventId = WLAN_80211D_EVENT_RESET; - qdf_mem_copy(p11dLog->countryCode, mac->scan.countryCodeCurrent, 3); + wlan_reg_read_current_country(mac->psoc, reg_cc); + qdf_mem_copy(p11dLog->countryCode, reg_cc, 3); p11dLog->numChannel = mac->scan.base_channels.numChannels; if (p11dLog->numChannel <= HOST_LOG_MAX_NUM_CHANNEL) { for (Index = 0; @@ -640,8 +641,7 @@ void csr_apply_channel_power_info_wrapper(struct mac_context *mac) csr_save_channel_power_for_band(mac, false); csr_save_channel_power_for_band(mac, true); /* apply the channel list, power settings, and the country code. */ - csr_apply_channel_power_info_to_fw(mac, - &mac->scan.base_channels, mac->scan.countryCodeCurrent); + csr_apply_channel_power_info_to_fw(mac, &mac->scan.base_channels); /* clear the 11d channel list */ qdf_mem_zero(&mac->scan.channels11d, sizeof(mac->scan.channels11d)); } @@ -846,6 +846,7 @@ bool csr_learn_11dcountry_information(struct mac_context *mac, v_REGDOMAIN_t domainId; tDot11fBeaconIEs *pIesLocal = pIes; bool useVoting = false; + uint8_t reg_cc[REG_ALPHA2_LEN + 1]; if ((!pSirBssDesc) && (!pIes)) useVoting = true; @@ -877,10 +878,11 @@ bool csr_learn_11dcountry_information(struct mac_context *mac, else pCountryCodeSelected = mac->scan.countryCodeElected; - if (qdf_mem_cmp(pCountryCodeSelected, mac->scan.countryCodeCurrent, + wlan_reg_read_current_country(mac->psoc, reg_cc); + if (qdf_mem_cmp(pCountryCodeSelected, reg_cc, CDS_COUNTRY_CODE_LEN) == 0) { qdf_mem_copy(mac->scan.countryCode11d, - mac->scan.countryCodeCurrent, + reg_cc, CDS_COUNTRY_CODE_LEN); goto free_ie; } diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h index d9f9d701cc4c..e900f6e5d6c3 100644 --- a/core/sme/src/csr/csr_inside_api.h +++ b/core/sme/src/csr/csr_inside_api.h @@ -337,8 +337,7 @@ uint32_t csr_translate_to_wni_cfg_dot11_mode(struct mac_context *mac, enum csr_cfgdot11mode csrDot11Mode); void csr_save_channel_power_for_band(struct mac_context *mac, bool fPopulate5GBand); void csr_apply_channel_power_info_to_fw(struct mac_context *mac, - struct csr_channel *pChannelList, - uint8_t *countryCode); + struct csr_channel *pChannelList); void csr_apply_power2_current(struct mac_context *mac); /* return a bool to indicate whether roaming completed or continue. */ From f8c186a9fb43574064248a7d46fe38736db4197c Mon Sep 17 00:00:00 2001 From: Rahul Choudhary Date: Mon, 14 Aug 2023 07:21:20 -0700 Subject: [PATCH 08/10] Release 2.0.8.33Q Release 2.0.8.33Q Change-Id: I55bbf3fe31ac6c742e73410efd703abe1342ebef CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index a3ab289e55e8..9b2ae00ec456 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "P" +#define QWLAN_VERSION_EXTRA "Q" #define QWLAN_VERSION_BUILD 33 -#define QWLAN_VERSIONSTR "2.0.8.33P" +#define QWLAN_VERSIONSTR "2.0.8.33Q" #endif /* QWLAN_VERSION_H */ From c73dbe2305036fe4f2bbfe6812dba4ab671361c8 Mon Sep 17 00:00:00 2001 From: Venkateswara Naralasetty Date: Wed, 2 Aug 2023 15:56:08 +0530 Subject: [PATCH 09/10] qcacld-3.0: Skip FISA aggregation if RDI is zero Skip the FISA aggregation and drop the frame if the reo destination indication is zero in the packet TLVs. Change-Id: I9bd02652bf321202f6b59e6da98fc6959ab93413 CRs-Fixed: 3426355 --- core/dp/txrx3.0/dp_fisa_rx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/dp/txrx3.0/dp_fisa_rx.c b/core/dp/txrx3.0/dp_fisa_rx.c index 690962cb3d7d..83d48b50c989 100644 --- a/core/dp/txrx3.0/dp_fisa_rx.c +++ b/core/dp/txrx3.0/dp_fisa_rx.c @@ -1901,6 +1901,7 @@ QDF_STATUS dp_fisa_rx(struct dp_soc *soc, struct dp_vdev *vdev, struct dp_fisa_rx_sw_ft *fisa_flow; int fisa_ret; uint8_t rx_ctx_id = QDF_NBUF_CB_RX_CTX_ID(nbuf_list); + uint32_t tlv_reo_dest_ind; head_nbuf = nbuf_list; @@ -1929,6 +1930,17 @@ QDF_STATUS dp_fisa_rx(struct dp_soc *soc, struct dp_vdev *vdev, qdf_nbuf_push_head(head_nbuf, RX_PKT_TLVS_LEN + QDF_NBUF_CB_RX_PACKET_L3_HDR_PAD(head_nbuf)); + hal_rx_msdu_get_reo_destination_indication(soc->hal_soc, + (uint8_t *)qdf_nbuf_data(head_nbuf), + &tlv_reo_dest_ind); + /* Skip FISA aggregation and drop the frame if RDI is REO2TCL */ + if (qdf_unlikely(tlv_reo_dest_ind == REO_REMAP_TCL)) { + qdf_nbuf_free(head_nbuf); + head_nbuf = next_nbuf; + DP_STATS_INC(dp_fisa_rx_hdl, incorrect_rdi, 1); + continue; + } + /* Add new flow if the there is no ongoing flow */ fisa_flow = dp_rx_get_fisa_flow(dp_fisa_rx_hdl, vdev, head_nbuf); From 1d1c2e7f9ae5cc9a6630a7fd89cc60d2a22e6af2 Mon Sep 17 00:00:00 2001 From: Rahul Choudhary Date: Fri, 25 Aug 2023 01:07:54 -0700 Subject: [PATCH 10/10] Release 2.0.8.33R Release 2.0.8.33R Change-Id: I673afac62e29584c17105ba45784afcfde0348ab CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 9b2ae00ec456..10588c7b94a5 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "Q" +#define QWLAN_VERSION_EXTRA "R" #define QWLAN_VERSION_BUILD 33 -#define QWLAN_VERSIONSTR "2.0.8.33Q" +#define QWLAN_VERSIONSTR "2.0.8.33R" #endif /* QWLAN_VERSION_H */