瀏覽代碼

qcacld-3.0: Check tdls off-channel passed is not a DFS channel

qcacld-2.0 to qcacld-3.0 propagation

Add check to validate if non-DFS channel is passed as
TDLS off channel via driver command and INI config.

Change-Id: I6696c47d438bdcc1b8733241e60ca5c52fb1022f
CRs-Fixed: 915972
Krishna Kumaar Natarajan 9 年之前
父節點
當前提交
4d090352a5
共有 2 個文件被更改,包括 24 次插入0 次删除
  1. 6 0
      core/hdd/src/wlan_hdd_ioctl.c
  2. 18 0
      core/hdd/src/wlan_hdd_tdls.c

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

@@ -5300,6 +5300,12 @@ static int drv_cmd_tdls_off_channel(hdd_adapter_t *adapter,
 	if (ret != 1)
 		return -EINVAL;
 
+	if (CDS_IS_DFS_CH(set_value)) {
+		hdd_err("DFS channel %d is passed for hdd_set_tdls_offchannel",
+		    set_value);
+		return -EINVAL;
+	}
+
 	hddLog(LOG1, FL("Tdls offchannel num: %d"), set_value);
 
 	ret = hdd_set_tdls_offchannel(hdd_ctx, set_value);

+ 18 - 0
core/hdd/src/wlan_hdd_tdls.c

@@ -4015,6 +4015,14 @@ int wlan_hdd_tdls_extctrl_config_peer(hdd_adapter_t *pAdapter,
 				MAC_ADDR_ARRAY(peer));
 		return -EINVAL;
 	}
+
+	/* validate if off channel is DFS channel */
+	if (CDS_IS_DFS_CH(chan)) {
+		hdd_err("Resetting TDLS off-channel from %d to %d",
+		       chan, CFG_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEFAULT);
+		chan = CFG_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEFAULT;
+	}
+
 	if (0 != wlan_hdd_tdls_set_extctrl_param(pAdapter, peer,
 						 chan, max_latency,
 						 op_class, min_bandwidth)) {
@@ -4265,6 +4273,16 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
 						pTdlsPeer->
 						op_class_for_pref_off_chan;
 
+				if (CDS_IS_DFS_CH(smeTdlsPeerStateParams.
+					peerCap.prefOffChanNum)) {
+					hdd_err("Resetting TDLS off-channel from %d to %d",
+					       smeTdlsPeerStateParams.peerCap.
+						prefOffChanNum,
+					       CFG_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEFAULT);
+					smeTdlsPeerStateParams.peerCap.prefOffChanNum =
+						CFG_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEFAULT;
+				}
+
 				CDF_TRACE(CDF_MODULE_ID_HDD,
 					  CDF_TRACE_LEVEL_INFO,
 					  "%s: Peer " MAC_ADDRESS_STR