Parcourir la source

qcacld-3.0: Enable channels 12 & 13 when SET_FCC_CHANNEL is set

qcacld-2.0 to qcacld-3.0 propagation

Currently Ch 12/13 are disabled when SET_FCC_CHANNEL is issued by
framework. To meet FCC rules and to meet requirement for
other countries regulatory reduce TxPower for channel 12/13.

Change-Id: Ie833804e565f40e28845160452d3245334a34308
CRs-Fixed: 961580
Amar Singhal il y a 9 ans
Parent
commit
7c1e898b61

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

@@ -6777,7 +6777,7 @@ static int drv_cmd_set_fcc_channel(hdd_adapter_t *adapter,
 		return -EINVAL;
 	}
 
-	status = sme_disable_non_fcc_channel(hdd_ctx->hHal, !fcc_constraint);
+	status = sme_handle_set_fcc_channel(hdd_ctx->hHal, !fcc_constraint);
 	if (status != QDF_STATUS_SUCCESS) {
 		hdd_err("sme disable fn. returned err");
 		ret = -EPERM;

+ 2 - 2
core/sme/inc/sme_api.h

@@ -1010,8 +1010,8 @@ QDF_STATUS sme_soc_set_antenna_mode(tHalHandle hal,
 void sme_set_scan_disable(tHalHandle h_hal, int value);
 void sme_setdef_dot11mode(tHalHandle hal);
 
-QDF_STATUS sme_disable_non_fcc_channel(tHalHandle hHal,
-				       bool fcc_constraint);
+QDF_STATUS sme_handle_set_fcc_channel(tHalHandle hHal,
+				      bool fcc_constraint);
 
 QDF_STATUS sme_update_roam_scan_hi_rssi_scan_params(tHalHandle hal_handle,
 	uint8_t session_id,

+ 2 - 2
core/sme/src/common/sme_api.c

@@ -15172,13 +15172,13 @@ QDF_STATUS sme_set_peer_authorized(uint8_t *peer_addr,
 }
 
 /*
- * sme_disable_non_fcc_channel() - non-fcc channel disable request
+ * sme_handle_set_fcc_channel() - set spec. tx power for non-fcc channel
  * @hal: HAL pointer
  * @fcc_constraint: true: disable, false; enable
  *
  * Return: QDF_STATUS
  */
-QDF_STATUS sme_disable_non_fcc_channel(tHalHandle hal, bool fcc_constraint)
+QDF_STATUS sme_handle_set_fcc_channel(tHalHandle hal, bool fcc_constraint)
 {
 	QDF_STATUS status;
 	tpAniSirGlobal mac_ptr  = PMAC_STRUCT(hal);

+ 23 - 6
core/sme/src/csr/csr_api_roam.c

@@ -55,6 +55,9 @@
 #include "wma.h"
 #include "cds_concurrency.h"
 
+#define MAX_PWR_FCC_CHAN_12 8
+#define MAX_PWR_FCC_CHAN_13 2
+
 #define CSR_NUM_IBSS_START_CHANNELS_50      4
 #define CSR_NUM_IBSS_START_CHANNELS_24      3
 /* 5 seconds, for WPA, WPA2, CCKM */
@@ -683,12 +686,7 @@ QDF_STATUS csr_update_channel_list(tpAniSirGlobal pMac)
 		/* Scan is not performed on DSRC channels*/
 		if (pScan->base_channels.channelList[i] >= CDS_MIN_11P_CHANNEL)
 			continue;
-		if (pScan->fcc_constraint) {
-			if (pScan->base_channels.channelList[i] == 12)
-				continue;
-			if (pScan->base_channels.channelList[i] == 13)
-				continue;
-		}
+
 		channel_state =
 			cds_get_channel_state(
 				pScan->base_channels.channelList[i]);
@@ -699,6 +697,25 @@ QDF_STATUS csr_update_channel_list(tpAniSirGlobal pMac)
 			pChanList->chanParam[num_channel].pwr =
 				csr_find_channel_pwr(pScan->defaultPowerTable,
 						  pChanList->chanParam[num_channel].chanId);
+
+			if (pScan->fcc_constraint) {
+				if (12 == pChanList->chanParam[num_channel].chanId) {
+					pChanList->chanParam[num_channel].pwr =
+						MAX_PWR_FCC_CHAN_12;
+					QDF_TRACE(QDF_MODULE_ID_SME,
+						  QDF_TRACE_LEVEL_INFO,
+					       "txpower for channel 12 is 8db");
+				}
+				if (13 == pChanList->chanParam[num_channel].chanId) {
+					pChanList->chanParam[num_channel].pwr =
+						MAX_PWR_FCC_CHAN_13;
+					QDF_TRACE(QDF_MODULE_ID_SME,
+						  QDF_TRACE_LEVEL_INFO,
+					       "txpower for channel 13 is 2db");
+				}
+			}
+
+
 			if (CHANNEL_STATE_ENABLE == channel_state)
 				pChanList->chanParam[num_channel].dfsSet =
 					false;