瀏覽代碼

qcacld-3.0: Add support to accept frequency for ch switch command

Currently channel switch command accepts only channel number as
parameter but with 6GHz changes channel switch can come for the
6GHz channel as well and to support 6GHz channel switch frequency
needs to be accepted as parameter.

To address above issue add support to accept frequency as
parameter for channel switch command.

Change-Id: I38978348c0d70e3e860d4644b4664f8775ecb777
CRs-Fixed: 2931485
Ashish Kumar Dhanotiya 4 年之前
父節點
當前提交
41e3dfc713
共有 2 個文件被更改,包括 14 次插入6 次删除
  1. 8 3
      core/hdd/src/wlan_hdd_hostapd_wext.c
  2. 6 3
      core/hdd/src/wlan_hdd_ioctl.c

+ 8 - 3
core/hdd/src/wlan_hdd_hostapd_wext.c

@@ -404,9 +404,14 @@ static __iw_softap_setparam(struct net_device *dev,
 						    CSA_REASON_USER_INITIATED);
 			hdd_debug("SET Channel Change to new channel= %d",
 			       set_value);
-			ret = hdd_softap_set_channel_change(dev,
-							    wlan_reg_legacy_chan_to_freq(hdd_ctx->pdev, set_value),
-							    CH_WIDTH_MAX, false);
+			if (set_value <= wlan_reg_max_5ghz_ch_num())
+				set_value = wlan_reg_legacy_chan_to_freq(
+								hdd_ctx->pdev,
+								set_value);
+
+			ret = hdd_softap_set_channel_change(dev, set_value,
+							    CH_WIDTH_MAX,
+							    false);
 		} else {
 			hdd_err("Channel Change Failed, Device in test mode");
 			ret = -EINVAL;

+ 6 - 3
core/hdd/src/wlan_hdd_ioctl.c

@@ -6551,9 +6551,12 @@ static int drv_cmd_set_channel_switch(struct hdd_adapter *adapter,
 
 	wlan_hdd_set_sap_csa_reason(hdd_ctx->psoc, adapter->vdev_id,
 				    CSA_REASON_USER_INITIATED);
-	status = hdd_softap_set_channel_change(dev,
-					       wlan_reg_legacy_chan_to_freq(hdd_ctx->pdev, chan_number),
-					       width, true);
+
+	if (chan_number <= wlan_reg_max_5ghz_ch_num())
+		chan_number = wlan_reg_legacy_chan_to_freq(hdd_ctx->pdev,
+							   chan_number);
+
+	status = hdd_softap_set_channel_change(dev, chan_number, width, true);
 	if (status) {
 		hdd_err("Set channel change fail");
 		return status;