瀏覽代碼

qcacld-3.0: Skip 2GHz off channels when TDLS base channel is in 5GHz

qcacld-2.0 to qcacld-3.0 propagation

In antenna sharing platform, if TDLS operates in the 5G band base
channel with NSS 2x2, it cannot accommodate 2G off channels in
TDLS operation. So in that scenario, 2G channels should be
skipped from TDLS off channels list.
Update driver to remove 2G band channels from supported off
channel list, when TDLS operates in 5G band base channel
with NSS 2x2.

Change-Id: I04aa00e1cecfae86570aa89d1743b54d55b2dc84
CRs-Fixed: 968206
Archana Ramachandran 9 年之前
父節點
當前提交
080404c945
共有 3 個文件被更改,包括 62 次插入7 次删除
  1. 1 0
      core/cds/inc/cds_reg_service.h
  2. 33 0
      core/cds/src/cds_reg_service.c
  3. 28 7
      core/mac/src/pe/lim/lim_process_tdls.c

+ 1 - 0
core/cds/inc/cds_reg_service.h

@@ -374,5 +374,6 @@ void cds_set_channel_params(uint16_t oper_ch, uint16_t ht_offset_2g,
 QDF_STATUS cds_set_reg_domain(void *client_ctxt, v_REGDOMAIN_t reg_domain);
 QDF_STATUS cds_put_default_country(uint8_t *def_country);
 uint16_t cds_bw_value(enum phy_ch_width bw);
+uint8_t cds_skip_dfs_and_2g(uint32_t rf_channel);
 
 #endif /* __CDS_REG_SERVICE_H */

+ 33 - 0
core/cds/src/cds_reg_service.c

@@ -645,6 +645,39 @@ bool cds_is_dsrc_channel(uint16_t center_freq)
 	return false;
 }
 
+/**
+ * cds_skip_dfs_and_2g() - skip dfs and 2g band channels
+ * @rf_channel: input channel enum to know, whether to skip or add the channel
+ *
+ * Return: true or false
+ */
+uint8_t cds_skip_dfs_and_2g(uint32_t rf_channel)
+{
+	uint32_t channel_loop;
+	enum channel_enum channel = INVALID_CHANNEL;
+	uint8_t ret = false;
+
+	for (channel_loop = CHAN_ENUM_36;
+	      channel_loop <= CHAN_ENUM_184; channel_loop++) {
+		if (CDS_CHANNEL_NUM(channel_loop) == rf_channel) {
+			channel = (enum channel_enum)channel_loop;
+			break;
+		}
+	}
+
+	if (INVALID_CHANNEL == channel) {
+		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
+			  "Invalid channel %d", rf_channel);
+		ret = true;
+		goto exit_ok;
+	}
+
+	if (CHANNEL_STATE_DFS == CDS_CHANNEL_STATE(channel))
+		ret = true;
+exit_ok:
+	return ret;
+}
+
 /**
  * cds_set_reg_domain() - set regulatory domain
  * @client_ctxt: client context

+ 28 - 7
core/mac/src/pe/lim/lim_process_tdls.c

@@ -2647,6 +2647,10 @@ void populate_dot11f_tdls_offchannel_params(tpAniSirGlobal pMac,
 	uint8_t op_class;
 	uint8_t numClasses;
 	uint8_t classes[CDS_MAX_SUPP_OPER_CLASSES];
+	uint32_t band;
+	uint8_t nss_2g;
+	uint8_t nss_5g;
+
 	if (wlan_cfg_get_str(pMac, WNI_CFG_VALID_CHANNEL_LIST,
 			     validChan, &numChans) != eSIR_SUCCESS) {
 		/**
@@ -2658,15 +2662,32 @@ void populate_dot11f_tdls_offchannel_params(tpAniSirGlobal pMac,
 		return;
 	}
 
-	/* validating the channel list for DFS channels */
+	if (IS_5G_CH(psessionEntry->currentOperChannel))
+		band = eCSR_BAND_5G;
+	else
+		band = eCSR_BAND_24;
+
+	nss_5g = QDF_MIN(pMac->vdev_type_nss_5g.tdls,
+			 pMac->user_configured_nss);
+	nss_2g = QDF_MIN(pMac->vdev_type_nss_2g.tdls,
+			 pMac->user_configured_nss);
+
+	/* validating the channel list for DFS and 2G channels */
 	for (i = 0U; i < numChans; i++) {
-		if (CHANNEL_STATE_DFS ==
-		    cds_get_channel_state(validChan[i])) {
+		if (band == eCSR_BAND_24) {
+			if (CHANNEL_STATE_DFS ==
+			    cds_get_channel_state(validChan[i])) {
+				lim_log(pMac, LOG1,
+					FL("skipping DFS channel %d from the valid channel list"),
+					validChan[i]);
+				continue;
+			}
+		} else if ((NSS_2x2_MODE == nss_5g) &&
+			   (NSS_1x1_MODE == nss_2g) &&
+			   (true == cds_skip_dfs_and_2g(validChan[i]))) {
 			lim_log(pMac, LOG1,
-				FL(
-				   "skipping DFS channel %d from the valid channel list"
-				  ),
-				validChan[i]);
+				FL("skipping channel %d, nss_5g: %d, nss_2g: %d"),
+				validChan[i], nss_5g, nss_2g);
 			continue;
 		}