Explorar el Código

qcacld-3.0: Remove legacy usage of channels in WMA layer

Remove legacy usage of channels in WMA layer and
use frequencies instead to incorporate 6ghz
frequencies as well.

Change-Id: Iba4a9ea723d5c03a4deeaffc5fbdf628f435eb67
CRs-Fixed: 2563924
gaurank kathpalia hace 5 años
padre
commit
cc3e2fd338
Se han modificado 3 ficheros con 8 adiciones y 19 borrados
  1. 1 3
      core/wma/src/wma_features.c
  2. 3 11
      core/wma/src/wma_mgmt.c
  3. 4 5
      core/wma/src/wma_scan_roam.c

+ 1 - 3
core/wma/src/wma_features.c

@@ -535,7 +535,6 @@ enum wlan_phymode wma_chan_phy_mode(uint32_t freq, enum phy_ch_width chan_width,
 	enum wlan_phymode phymode = WLAN_PHYMODE_AUTO;
 	uint16_t bw_val = wlan_reg_get_bw_value(chan_width);
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
-	uint16_t chan;
 
 	if (!wma) {
 		WMA_LOGE("%s : wma_handle is NULL", __func__);
@@ -547,7 +546,6 @@ enum wlan_phymode wma_chan_phy_mode(uint32_t freq, enum phy_ch_width chan_width,
 		return WLAN_PHYMODE_AUTO;
 	}
 
-	chan = wlan_reg_freq_to_chan(wma->pdev, freq);
 	if (wlan_reg_is_24ghz_ch_freq(freq)) {
 		if (((CH_WIDTH_5MHZ == chan_width) ||
 		     (CH_WIDTH_10MHZ == chan_width)) &&
@@ -598,7 +596,7 @@ enum wlan_phymode wma_chan_phy_mode(uint32_t freq, enum phy_ch_width chan_width,
 				break;
 			}
 		}
-	} else if (wlan_reg_is_dsrc_chan(wma->pdev, chan))
+	} else if (wlan_reg_is_dsrc_freq(freq))
 		phymode = WLAN_PHYMODE_11A;
 	else {
 		if (((CH_WIDTH_5MHZ == chan_width) ||

+ 3 - 11
core/wma/src/wma_mgmt.c

@@ -4505,17 +4505,9 @@ static int wma_mgmt_rx_process(void *handle, uint8_t *data,
 		 * is not there as BAND_6G works only on frequencies and channel
 		 * numbers can be treated as unique.
 		 */
-		if (mgmt_rx_params->channel >= WLAN_REG_MIN_24GHZ_CH_NUM &&
-		    mgmt_rx_params->channel <= WLAN_REG_MAX_24GHZ_CH_NUM)
-			mgmt_rx_params->chan_freq =
-					wlan_reg_chan_to_freq(
-						wma_handle->pdev,
-						mgmt_rx_params->channel);
-		else
-			mgmt_rx_params->chan_freq =
-					wlan_reg_chan_to_freq(
-						wma_handle->pdev,
-						mgmt_rx_params->channel);
+		mgmt_rx_params->chan_freq = wlan_reg_legacy_chan_to_freq(
+					    wma_handle->pdev,
+					    mgmt_rx_params->channel);
 	}
 
 	mgmt_rx_params->pdev_id = 0;

+ 4 - 5
core/wma/src/wma_scan_roam.c

@@ -131,7 +131,6 @@ QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
 	int i, len;
 	struct scan_chan_list_params *scan_ch_param;
 	struct channel_param *chan_p;
-	uint16_t channel;
 	struct ch_params ch_params;
 
 	len = sizeof(struct channel_param) * chan_list->numChan +
@@ -153,8 +152,6 @@ QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
 		chan_p->mhz = chan_list->chanParam[i].freq;
 		chan_p->cfreq1 = chan_p->mhz;
 		chan_p->cfreq2 = 0;
-		channel = wlan_reg_freq_to_chan(wma_handle->pdev,
-						chan_list->chanParam[i].freq);
 		wma_handle->saved_chan.ch_freq_list[i] =
 					chan_list->chanParam[i].freq;
 
@@ -199,8 +196,10 @@ QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
 		chan_p->maxregpower = chan_list->chanParam[i].pwr;
 
 		ch_params.ch_width = CH_WIDTH_160MHZ;
-		wlan_reg_set_channel_params(wma_handle->pdev, channel, 0,
-					    &ch_params);
+		wlan_reg_set_channel_params_for_freq(wma_handle->pdev,
+						     chan_p->mhz, 0,
+						     &ch_params);
+
 		chan_p->max_bw_supported =
 		     wma_map_phy_ch_bw_to_wmi_channel_width(ch_params.ch_width);
 		chan_p++;