From e2ec0a713e48e8b049e061685ecdb2704262ba19 Mon Sep 17 00:00:00 2001 From: Shudan Liu Date: Mon, 16 Oct 2023 16:41:19 +0800 Subject: [PATCH 01/10] qcacld-3.0: Modify condition to cover 5G+160MHz Add a condition to avoid closing SAP automatically when set 5g_160Mhz mode Change-Id: I712a588558874c2c86144e7e729a242007eccf77 --- core/sap/src/sap_fsm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 81ab4af7735a..db80ce6aa8a4 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -2019,8 +2019,8 @@ static QDF_STATUS sap_cac_start_notify(mac_handle_t mac_handle) /* Don't start CAC for non-dfs channel, its violation */ profile = &sap_context->csr_roamProfile; ch_freq = profile->op_freq; - if (!wlan_reg_is_dfs_for_freq(mac->pdev, - ch_freq)) + if (!wlan_reg_is_dfs_for_freq(mac->pdev, ch_freq) && + wlan_reg_get_5g_bonded_channel_state_for_freq(mac->pdev, ch_freq, profile->ch_params.ch_width) != CHANNEL_STATE_DFS) continue; sap_debug("sapdfs: Signaling eSAP_DFS_CAC_START to HDD for sapctx[%pK]", sap_context); From 541869fab1656d851452a0f7e7753115731509c5 Mon Sep 17 00:00:00 2001 From: Surya Prakash Sivaraj Date: Wed, 11 Oct 2023 11:52:10 +0530 Subject: [PATCH 02/10] qcacld-3.0: Restart SAP if current channel is disabled Currently when host receives disable channels command, it disables the channels and if SAP is on it checks if SAP is on one of the disabled channels in that case host stops the SAP. Based on current requirement host should restart the SAP, with this change add support to restart the SAP if it is operating on disabled channel. Change-Id: I89ce21a8707e2c0af0737116b883be13503044e0 CRs-Fixed: 2885308 --- core/hdd/src/wlan_hdd_ioctl.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 5b2c199488bf..9c3d6738625d 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -6619,19 +6619,18 @@ static bool check_disable_channels(struct hdd_context *hdd_ctx, } /** - * disconnect_sta_and_stop_sap() - Disconnect STA and stop SAP + * disconnect_sta_and_restart_sap() - Disconnect STA and restart SAP * * @hdd_ctx: Pointer to hdd context * @reason: Disconnect reason code as per @enum wlan_reason_code * * Disable channels provided by user and disconnect STA if it is - * connected to any AP, stop SAP and send deauthentication request - * to STAs connected to SAP. + * connected to any AP, restart SAP. * * Return: None */ -static void disconnect_sta_and_stop_sap(struct hdd_context *hdd_ctx, - enum wlan_reason_code reason) +static void disconnect_sta_and_restart_sap(struct hdd_context *hdd_ctx, + enum wlan_reason_code reason) { struct hdd_adapter *adapter, *next = NULL; QDF_STATUS status; @@ -6648,7 +6647,8 @@ static void disconnect_sta_and_stop_sap(struct hdd_context *hdd_ctx, if (check_disable_channels( hdd_ctx, adapter->session.ap.operating_chan_freq)) - wlan_hdd_stop_sap(adapter); + policy_mgr_check_sap_restart(hdd_ctx->psoc, + adapter->vdev_id); } status = hdd_get_next_adapter(hdd_ctx, adapter, &next); @@ -6877,8 +6877,9 @@ mem_alloc_failed: ret = wlan_hdd_disable_channels(hdd_ctx); if (ret) return ret; - disconnect_sta_and_stop_sap(hdd_ctx, - REASON_OPER_CHANNEL_BAND_CHANGE); + disconnect_sta_and_restart_sap( + hdd_ctx, + REASON_OPER_CHANNEL_BAND_CHANGE); } hdd_exit(); From 95bf309c3e2bad5d22b0273e0fdd2c69d5c64170 Mon Sep 17 00:00:00 2001 From: Surya Prakash Sivaraj Date: Wed, 11 Oct 2023 11:57:53 +0530 Subject: [PATCH 03/10] qcacld-3.0: Stop SAP if all channels are disabled User disables all the channels when the SAP is in operation, and policy manager restart sap functionality cannot get any valid channels and SAP also doesn't stop. Later, kernel stops the SAP, since it is operating on an invalid channel. To fix this, restart the SAP on a valid channel only if atleast one valid channel is available. Otherwise, stop the SAP instead of waiting for kernel to stop the SAP. CRs-Fixed: 3617706 Change-Id: Ia613b8e9585ff19aae9bf97ea5d0fc230ae41c5f --- core/hdd/src/wlan_hdd_ioctl.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 9c3d6738625d..c5bcd6328c9e 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -6634,17 +6634,28 @@ static void disconnect_sta_and_restart_sap(struct hdd_context *hdd_ctx, { struct hdd_adapter *adapter, *next = NULL; QDF_STATUS status; + uint32_t ch_list[NUM_CHANNELS]; + uint32_t ch_count = 0; + bool is_valid_chan_present = true; if (!hdd_ctx) return; hdd_check_and_disconnect_sta_on_invalid_channel(hdd_ctx, reason); + status = policy_mgr_get_valid_chans(hdd_ctx->psoc, ch_list, &ch_count); + if (QDF_IS_STATUS_ERROR(status) || !ch_count) { + hdd_debug("No valid channels present, stop the SAPs"); + is_valid_chan_present = false; + } + status = hdd_get_front_adapter(hdd_ctx, &adapter); while (adapter && (status == QDF_STATUS_SUCCESS)) { if (!hdd_validate_adapter(adapter) && adapter->device_mode == QDF_SAP_MODE) { - if (check_disable_channels( + if (!is_valid_chan_present) + wlan_hdd_stop_sap(adapter); + else if (check_disable_channels( hdd_ctx, adapter->session.ap.operating_chan_freq)) policy_mgr_check_sap_restart(hdd_ctx->psoc, From f16f18986ffa7e7ea194e65bb9e4cad36961b7ad Mon Sep 17 00:00:00 2001 From: Ravindra Konda Date: Wed, 25 Oct 2023 07:10:56 -0700 Subject: [PATCH 04/10] Release 2.0.8.34C Release 2.0.8.34C Change-Id: I502f9af75299521e429406acc54a46801d36fb46 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 fb335506e5f6..d375d57e58fa 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 "B" +#define QWLAN_VERSION_EXTRA "C" #define QWLAN_VERSION_BUILD 34 -#define QWLAN_VERSIONSTR "2.0.8.34B" +#define QWLAN_VERSIONSTR "2.0.8.34C" #endif /* QWLAN_VERSION_H */ From 48d936e8dc1f058167ef0dd76228e077a654bc0d Mon Sep 17 00:00:00 2001 From: Shudan Liu Date: Fri, 27 Oct 2023 17:55:51 +0800 Subject: [PATCH 05/10] qcacld-3.0: Free HE op element memory for change interface Currently host driver does not free the memory for HE operation from cache connection info when it receives change interface from STA to SAP mode which results in mem leak. To address above issue, free HE operation element memory on STA to SAP interface change. Change-Id: I837640814459a62d819e606fc44adc9bfc60fe5c CRs-Fixed: 3045848 --- core/hdd/src/wlan_hdd_cfg80211.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 77dd8d175f62..297ea8fd24d6 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -18339,6 +18339,9 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, policy_mgr_clear_concurrency_mode(hdd_ctx->psoc, adapter->device_mode); if (hdd_is_client_mode(adapter->device_mode)) { + if (adapter->device_mode == QDF_STA_MODE) + hdd_cleanup_conn_info(adapter); + if (hdd_is_client_mode(new_mode)) { errno = hdd_change_adapter_mode(adapter, new_mode); if (errno) { From 4014002552af5eaac436e861579c1814c72d41e7 Mon Sep 17 00:00:00 2001 From: Ravindra Konda Date: Wed, 1 Nov 2023 03:08:19 -0700 Subject: [PATCH 06/10] Release 2.0.8.34D Release 2.0.8.34D Change-Id: I1364ce5410b7ddcdad849538192c72508641e655 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 d375d57e58fa..40fa9f5db3b8 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 "C" +#define QWLAN_VERSION_EXTRA "D" #define QWLAN_VERSION_BUILD 34 -#define QWLAN_VERSIONSTR "2.0.8.34C" +#define QWLAN_VERSIONSTR "2.0.8.34D" #endif /* QWLAN_VERSION_H */ From 83d1f7a4b02b7090138b7139788b3ee162e962a7 Mon Sep 17 00:00:00 2001 From: Surya Prakash Sivaraj Date: Fri, 3 Jun 2022 12:58:46 +0530 Subject: [PATCH 07/10] qcacld-3.0: Fix incorrect channel width downgrade After the connection is established with HE160/VHT160 AP, the STA downgrades the channel width to VHT80/HE80, leading to 50% TPUT reduction. The associated beacon processing doesn't consider the new VHT OP IE definition while parsing the channel width. Fix the channel width processing in the beacon processing. Change-Id: Icd7d36a8352be7574474fb5f37fa9b4ca291aa04 CRs-Fixed: 3211833 --- core/mac/src/pe/sch/sch_beacon_process.c | 32 +++++++++++++++++------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index e8201f66e67f..3fde7e7540c3 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -441,6 +441,9 @@ sch_bcn_update_opmode_change(struct mac_context *mac_ctx, tpDphHashNode sta_ds, uint8_t oper_mode; uint32_t fw_vht_ch_wd = wma_get_vht_ch_width(); uint8_t ch_width = 0, ch_bw; + tDot11fIEVHTCaps *vht_caps; + tDot11fIEVHTOperation *vht_op; + uint8_t bcn_vht_chwidth = 0; /* * Ignore opmode change during channel change The opmode will be updated @@ -459,12 +462,24 @@ sch_bcn_update_opmode_change(struct mac_context *mac_ctx, tpDphHashNode sta_ds, return; } - if (!(session->vhtCapability && bcn->VHTOperation.present)) + if (bcn->VHTCaps.present) { + vht_caps = &bcn->VHTCaps; + vht_op = &bcn->VHTOperation; + } else if (bcn->vendor_vht_ie.VHTCaps.present) { + vht_caps = &bcn->vendor_vht_ie.VHTCaps; + vht_op = &bcn->vendor_vht_ie.VHTOperation; + } + + if (!(session->vhtCapability && vht_op->present)) return; + bcn_vht_chwidth = lim_get_vht_ch_width(&bcn->VHTCaps, + &bcn->VHTOperation, + &bcn->HTInfo); + oper_mode = sta_ds->vhtSupportedChannelWidthSet; if ((oper_mode == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) && - (oper_mode < bcn->VHTOperation.chanWidth)) + (oper_mode < bcn_vht_chwidth)) skip_opmode_update = true; if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE == cb_mode) { @@ -479,24 +494,23 @@ sch_bcn_update_opmode_change(struct mac_context *mac_ctx, tpDphHashNode sta_ds, } if (!skip_opmode_update && - (oper_mode != bcn->VHTOperation.chanWidth)) { - pe_debug("received VHTOP CHWidth %d", - bcn->VHTOperation.chanWidth); + (oper_mode != bcn_vht_chwidth)) { + pe_debug("received VHTOP CHWidth %d", bcn_vht_chwidth); 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->VHTOperation.chanWidth >= + if ((bcn_vht_chwidth >= WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ) && (fw_vht_ch_wd > eHT_CHANNEL_WIDTH_80MHZ)) { pe_debug("Updating the CH Width to 160MHz"); sta_ds->vhtSupportedChannelWidthSet = - bcn->VHTOperation.chanWidth; + bcn_vht_chwidth; sta_ds->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ; ch_width = eHT_CHANNEL_WIDTH_160MHZ; - } else if (bcn->VHTOperation.chanWidth >= + } else if (bcn_vht_chwidth >= WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) { pe_debug("Updating the CH Width to 80MHz"); sta_ds->vhtSupportedChannelWidthSet = @@ -504,7 +518,7 @@ sch_bcn_update_opmode_change(struct mac_context *mac_ctx, tpDphHashNode sta_ds, sta_ds->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ; ch_width = eHT_CHANNEL_WIDTH_80MHZ; - } else if (bcn->VHTOperation.chanWidth == + } else if (bcn_vht_chwidth == WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ) { sta_ds->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; From 03236a2f253a0bf5a9e7513359502fc131e4418e Mon Sep 17 00:00:00 2001 From: Ravindra Konda Date: Thu, 2 Nov 2023 07:05:38 -0700 Subject: [PATCH 08/10] Release 2.0.8.34E Release 2.0.8.34E Change-Id: Ie185686a49c71ec51f4fb616a4894c309b326908 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 40fa9f5db3b8..57a29e64e844 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 "D" +#define QWLAN_VERSION_EXTRA "E" #define QWLAN_VERSION_BUILD 34 -#define QWLAN_VERSIONSTR "2.0.8.34D" +#define QWLAN_VERSIONSTR "2.0.8.34E" #endif /* QWLAN_VERSION_H */ From c2ccd06e39de40a9427479087b618a94d4074689 Mon Sep 17 00:00:00 2001 From: Surya Prakash Sivaraj Date: Sat, 4 Jun 2022 11:35:45 +0530 Subject: [PATCH 09/10] qcacld-3.0: Initialize vhtcap and vhtop IE variables Initialize vht_cap and vht_op pointers in the sch_bcn_update_opmode_change API. Change-Id: If57723978d4c1dcced6b1fac4b50b541cc5bab04 CRs-Fixed: 3213123 --- core/mac/src/pe/sch/sch_beacon_process.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index 3fde7e7540c3..5adda9196469 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -441,8 +441,8 @@ sch_bcn_update_opmode_change(struct mac_context *mac_ctx, tpDphHashNode sta_ds, uint8_t oper_mode; uint32_t fw_vht_ch_wd = wma_get_vht_ch_width(); uint8_t ch_width = 0, ch_bw; - tDot11fIEVHTCaps *vht_caps; - tDot11fIEVHTOperation *vht_op; + tDot11fIEVHTCaps *vht_caps = NULL; + tDot11fIEVHTOperation *vht_op = NULL; uint8_t bcn_vht_chwidth = 0; /* @@ -470,7 +470,7 @@ sch_bcn_update_opmode_change(struct mac_context *mac_ctx, tpDphHashNode sta_ds, vht_op = &bcn->vendor_vht_ie.VHTOperation; } - if (!(session->vhtCapability && vht_op->present)) + if (!(session->vhtCapability && (vht_op && vht_op->present))) return; bcn_vht_chwidth = lim_get_vht_ch_width(&bcn->VHTCaps, From 50f4e8971b841e0d7560012075b94e552a92f457 Mon Sep 17 00:00:00 2001 From: Ravindra Konda Date: Fri, 3 Nov 2023 07:12:29 -0700 Subject: [PATCH 10/10] Release 2.0.8.34F Release 2.0.8.34F Change-Id: Ia6f0d6c68610c30d84064e26e50e342c85cfb642 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 57a29e64e844..2c3d3538966a 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 "E" +#define QWLAN_VERSION_EXTRA "F" #define QWLAN_VERSION_BUILD 34 -#define QWLAN_VERSIONSTR "2.0.8.34E" +#define QWLAN_VERSIONSTR "2.0.8.34F" #endif /* QWLAN_VERSION_H */