Procházet zdrojové kódy

qcacld-3.0: Fix cb mode enabled wrongly

Channel bonding is enabled wrongly after sta disconnected for max channel
width is larger than 20 MHz even gChannelBondingMode24GHz=0.

To fix it, when restore max channel width after sta disconnected,
restore to ini gChannelBondingMode24GHz value.

Change-Id: I72cae0360bf51a2c914d1bfec069abae6a03b337
CRs-Fixed: 3618677
Jianmin Zhu před 1 rokem
rodič
revize
f2bff53320

+ 3 - 1
core/hdd/inc/wlan_hdd_cfg.h

@@ -494,10 +494,12 @@ int hdd_set_rx_stbc(struct wlan_hdd_link_info *link_info, int value);
  * @chwidth: new channel width of enum eSirMacHTChannelWidth
  * @bonding_mode: channel bonding mode of the new channel width
  * @link_id: mlo link id
+ * @is_restore: is restore
  *
  * Return: 0 on success, negative errno on failure
  */
 int hdd_update_channel_width(struct hdd_adapter *adapter,
 			     enum eSirMacHTChannelWidth chwidth,
-			     uint32_t bonding_mode, uint8_t link_id);
+			     uint32_t bonding_mode, uint8_t link_id,
+			     bool is_restore);
 #endif /* end #if !defined(HDD_CONFIG_H__) */

+ 13 - 3
core/hdd/src/wlan_hdd_cfg.c

@@ -2443,7 +2443,8 @@ static QDF_STATUS hdd_update_bss_rate_flags(struct hdd_adapter *adapter,
 
 int hdd_update_channel_width(struct hdd_adapter *adapter,
 			     enum eSirMacHTChannelWidth chwidth,
-			     uint32_t bonding_mode, uint8_t link_id)
+			     uint32_t bonding_mode, uint8_t link_id,
+			     bool is_restore)
 {
 	struct hdd_context *hdd_ctx;
 	struct sme_config_params *sme_config;
@@ -2484,8 +2485,17 @@ int hdd_update_channel_width(struct hdd_adapter *adapter,
 		goto free_config;
 
 	sme_get_config_param(hdd_ctx->mac_handle, sme_config);
-	sme_config->csr_config.channelBondingMode5GHz = bonding_mode;
-	sme_config->csr_config.channelBondingMode24GHz = bonding_mode;
+	if (is_restore) {
+		sme_config->csr_config.channelBondingMode5GHz =
+			cfg_get(adapter->hdd_ctx->psoc,
+				CFG_CHANNEL_BONDING_MODE_5GHZ);
+		sme_config->csr_config.channelBondingMode24GHz =
+			cfg_get(adapter->hdd_ctx->psoc,
+				CFG_CHANNEL_BONDING_MODE_24GHZ);
+	} else {
+		sme_config->csr_config.channelBondingMode5GHz = bonding_mode;
+		sme_config->csr_config.channelBondingMode24GHz = bonding_mode;
+	}
 	sme_update_config(hdd_ctx->mac_handle, sme_config);
 	sme_set_he_bw_cap(hdd_ctx->mac_handle,
 			  adapter->deflink->vdev_id, chwidth);

+ 8 - 6
core/hdd/src/wlan_hdd_cfg80211.c

@@ -10982,14 +10982,15 @@ static uint32_t hdd_mac_chwidth_to_bonding_mode(
 
 int hdd_set_mac_chan_width(struct hdd_adapter *adapter,
 			   enum eSirMacHTChannelWidth chwidth,
-			   uint8_t link_id)
+			   uint8_t link_id,
+			   bool is_restore)
 {
 	uint32_t bonding_mode;
 
 	bonding_mode = hdd_mac_chwidth_to_bonding_mode(chwidth);
 
 	return hdd_update_channel_width(adapter, chwidth,
-					bonding_mode, link_id);
+					bonding_mode, link_id, is_restore);
 }
 
 /**
@@ -11064,7 +11065,7 @@ skip_mlo:
 	}
 set_chan_width:
 	return hdd_set_mac_chan_width(link_info->adapter,
-				      chwidth, link_id);
+				      chwidth, link_id, false);
 }
 
 /**
@@ -13965,7 +13966,7 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy,
 			hdd_update_channel_width(
 					adapter, eHT_CHANNEL_WIDTH_20MHZ,
 					WNI_CFG_CHANNEL_BONDING_MODE_DISABLE,
-					link_id);
+					link_id, false);
 	}
 
 	cmd_id = QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_ER_SU_PPDU_TYPE;
@@ -13976,7 +13977,7 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy,
 			hdd_update_channel_width(
 					adapter, eHT_CHANNEL_WIDTH_20MHZ,
 					WNI_CFG_CHANNEL_BONDING_MODE_DISABLE,
-					link_id);
+					link_id, false);
 			hdd_set_tx_stbc(link_info, 0);
 			hdd_set_11ax_rate(adapter, 0x400, NULL);
 			status = wma_cli_set_command(
@@ -13997,7 +13998,8 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy,
 			hdd_update_channel_width(
 					adapter, eHT_CHANNEL_WIDTH_160MHZ,
 					link_id,
-					WNI_CFG_CHANNEL_BONDING_MODE_ENABLE);
+					WNI_CFG_CHANNEL_BONDING_MODE_ENABLE,
+					false);
 			hdd_set_tx_stbc(link_info, 1);
 			hdd_set_11ax_rate(adapter, 0xFFFF, NULL);
 			status = wma_cli_set_command(

+ 3 - 1
core/hdd/src/wlan_hdd_cfg80211.h

@@ -978,12 +978,14 @@ int hdd_set_phy_mode(struct hdd_adapter *adapter,
  * @adapter: Handle to hdd_adapter
  * @chwidth: given channel width
  * @link_id: mlo link id
+ * @is_restore: is restore
  *
  * Return: 0 on success, negative errno on failure
  */
 int hdd_set_mac_chan_width(struct hdd_adapter *adapter,
 			   enum eSirMacHTChannelWidth chwidth,
-			   uint8_t link_id);
+			   uint8_t link_id,
+			   bool is_restore);
 
 /**
  * hdd_is_legacy_connection() - Is adapter connection is legacy

+ 1 - 1
core/hdd/src/wlan_hdd_cm_disconnect.c

@@ -534,7 +534,7 @@ static void hdd_cm_restore_ch_width(struct wlan_objmgr_vdev *vdev,
 	cm_update_associated_ch_info(vdev, false);
 
 	max_bw = get_max_bw();
-	ret = hdd_set_mac_chan_width(adapter, max_bw, link_id);
+	ret = hdd_set_mac_chan_width(adapter, max_bw, link_id, true);
 	if (ret) {
 		hdd_err("vdev %d : fail to set max ch width", vdev_id);
 		return;

+ 2 - 1
core/hdd/src/wlan_hdd_main.c

@@ -21571,7 +21571,8 @@ int hdd_we_set_ch_width(struct wlan_hdd_link_info *link_info, int ch_width)
 
 		return hdd_update_channel_width(link_info->adapter, ch_width,
 						chwidth_info[i].bonding_mode,
-						link_id);
+						link_id,
+						false);
 	}
 
 	hdd_err("Invalid ch_width %d", ch_width);

+ 1 - 1
core/hdd/src/wlan_hdd_son.c

@@ -160,7 +160,7 @@ static int hdd_son_set_chwidth(struct wlan_objmgr_vdev *vdev,
 
 	chwidth = hdd_son_chan_width_to_chan_width(son_chwidth);
 
-	return hdd_set_mac_chan_width(link_info->adapter, chwidth, link_id);
+	return hdd_set_mac_chan_width(link_info->adapter, chwidth, link_id, false);
 }
 
 /**

+ 3 - 0
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -1039,6 +1039,9 @@ populate_dot11f_ht_caps(struct mac_context *mac,
 			pDot11f->supportedChannelWidthSet =
 				pe_session->htSupportedChannelWidthSet;
 		}
+		pe_debug("cb mode %d scws %d session cw %d",
+			 cb_mode, pDot11f->supportedChannelWidthSet,
+			 pe_session->ch_width);
 
 		pDot11f->advCodingCap = pe_session->ht_config.adv_coding_cap;
 		pDot11f->txSTBC = pe_session->ht_config.tx_stbc;

+ 3 - 0
core/sme/src/csr/csr_api_roam.c

@@ -1936,6 +1936,9 @@ QDF_STATUS csr_change_default_config_param(struct mac_context *mac,
 		mac->roam.configParam.channelBondingMode5GHz =
 			csr_convert_cb_ini_value_to_phy_cb_state(pParam->
 							channelBondingMode5GHz);
+		sme_debug("cb mode 2g %d 5g %d",
+			  mac->roam.configParam.channelBondingMode24GHz,
+			  mac->roam.configParam.channelBondingMode5GHz);
 		mac->roam.configParam.phyMode = pParam->phyMode;
 		mac->roam.configParam.HeartbeatThresh50 =
 			pParam->HeartbeatThresh50;