Ver código fonte

qcacld-3.0: Don't use wlan_freq_to_chan

As part of regulatory cleanup, wlan_freq_to_chan() is removed.

Use wlan_reg_freq_to_chan() instead of wlan_freq_to_chan()

Change-Id: I18d7996a0b117de90cd32f2208702d01655ceeb9
CRs-Fixed: 2926114
Jyoti Kumari 4 anos atrás
pai
commit
e9a700f4aa

+ 1 - 1
components/pkt_capture/core/src/wlan_pkt_capture_mgmt_txrx.c

@@ -290,7 +290,7 @@ pkt_capture_process_mgmt_tx_data(struct wlan_objmgr_pdev *pdev,
 	}
 
 	txrx_status.tsft = (u_int64_t)params->tsf_l32;
-	txrx_status.chan_num = wlan_freq_to_chan(params->chan_freq);
+	txrx_status.chan_num = wlan_reg_freq_to_chan(pdev, params->chan_freq);
 	txrx_status.chan_freq = params->chan_freq;
 	/* params->rate is in Kbps, convert into Mbps */
 	txrx_status.rate = (params->rate_kbps / 1000);

+ 2 - 2
components/pkt_capture/core/src/wlan_pkt_capture_mon_thread.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -51,7 +51,7 @@ void pkt_capture_mon(struct pkt_capture_cb_context *cb_ctx, qdf_nbuf_t msdu,
 
 	if ((type == IEEE80211_FC0_TYPE_MGT) &&
 	    (sub_type == MGMT_SUBTYPE_AUTH)) {
-		uint8_t chan = wlan_freq_to_chan(ch_freq);
+		uint8_t chan = wlan_reg_freq_to_chan(pdev, ch_freq);
 
 		val.cdp_pdev_param_monitor_chan = chan;
 		cdp_txrx_set_pdev_param(soc, wlan_objmgr_pdev_get_pdev_id(pdev),

+ 7 - 5
components/tdls/core/src/wlan_tdls_peer.c

@@ -389,6 +389,8 @@ static void tdls_determine_channel_opclass(struct tdls_soc_priv_obj *soc_obj,
 {
 	uint32_t vdev_id;
 	enum QDF_OPMODE opmode;
+	struct wlan_objmgr_pdev *pdev = NULL;
+
 	/*
 	 * If tdls offchannel is not enabled then we provide base channel
 	 * and in that case pass opclass as 0 since opclass is mainly needed
@@ -399,12 +401,12 @@ static void tdls_determine_channel_opclass(struct tdls_soc_priv_obj *soc_obj,
 	      soc_obj->tdls_fw_off_chan_mode != ENABLE_CHANSWITCH) {
 		vdev_id = wlan_vdev_get_id(vdev_obj->vdev);
 		opmode = wlan_vdev_mlme_get_opmode(vdev_obj->vdev);
+		pdev = wlan_vdev_get_pdev(vdev_obj->vdev);
 
-		*channel = wlan_freq_to_chan(
-			policy_mgr_get_channel(
-			soc_obj->soc,
-			policy_mgr_convert_device_mode_to_qdf_type(opmode),
-			&vdev_id));
+		*channel = wlan_reg_freq_to_chan(pdev, policy_mgr_get_channel(
+						 soc_obj->soc,
+						 policy_mgr_convert_device_mode_to_qdf_type(opmode),
+						 &vdev_id));
 		*opclass = 0;
 	} else {
 		*channel = peer->pref_off_chan_num;

+ 3 - 3
core/hdd/src/wlan_hdd_p2p.c

@@ -1362,9 +1362,9 @@ static uint32_t set_second_connection_operating_channel(
 {
 	uint8_t operating_channel;
 
-	operating_channel = wlan_freq_to_chan(
-				policy_mgr_get_mcc_operating_channel(
-				hdd_ctx->psoc, vdev_id));
+	operating_channel = wlan_reg_freq_to_chan(hdd_ctx->pdev,
+						  policy_mgr_get_mcc_operating_channel(
+						  hdd_ctx->psoc, vdev_id));
 
 	if (operating_channel == 0) {
 		hdd_err("Second adapter operating channel is invalid");

+ 7 - 5
core/sap/src/sap_ch_select.c

@@ -1020,15 +1020,16 @@ static void sap_interference_rssi_count_5G(tSapSpectChInfo *spect_ch,
  */
 
 static void sap_interference_rssi_count(tSapSpectChInfo *spect_ch,
-	tSapSpectChInfo *spectch_start,
-	tSapSpectChInfo *spectch_end)
+					tSapSpectChInfo *spectch_start,
+					tSapSpectChInfo *spectch_end,
+					struct mac_context *mac)
 {
 	if (!spect_ch) {
 		sap_err("spect_ch is NULL");
 		return;
 	}
 
-	switch (wlan_freq_to_chan(spect_ch->chan_freq)) {
+	switch (wlan_reg_freq_to_chan(mac->pdev, spect_ch->chan_freq)) {
 	case CHANNEL_1:
 		sap_update_rssi_bsscount(spect_ch, 1, true,
 			spectch_start, spectch_end);
@@ -1323,7 +1324,7 @@ static void sap_compute_spect_weight(tSapChSelSpectInfo *pSpectInfoParams,
 
 			if (WLAN_REG_IS_24GHZ_CH_FREQ(chan_freq))
 				sap_interference_rssi_count(pSpectCh,
-					spectch_start, spectch_end);
+					spectch_start, spectch_end, mac);
 			else
 				sap_interference_rssi_count_5G(
 				    pSpectCh, ch_width, secondaryChannelOffset,
@@ -1900,7 +1901,8 @@ static void sap_sort_chl_weight_ht40_24_g(struct mac_context *mac_ctx,
 	 */
 	for (i = 0; i < ARRAY_SIZE(acs_ht40_channels24_g); i++) {
 		for (j = 0; j < pSpectInfoParams->numSpectChans; j++) {
-			channel = wlan_freq_to_chan(pSpectInfo[j].chan_freq);
+			channel = wlan_reg_freq_to_chan(mac_ctx->pdev,
+							pSpectInfo[j].chan_freq);
 			if (channel == acs_ht40_channels24_g[i].chStartNum)
 				break;
 		}

+ 5 - 3
core/sap/src/sap_fsm.c

@@ -281,9 +281,11 @@ static uint8_t sap_random_channel_sel(struct sap_context *sap_ctx)
 static bool
 sap_is_channel_bonding_etsi_weather_channel(struct sap_context *sap_ctx)
 {
-	if (IS_CH_BONDING_WITH_WEATHER_CH(wlan_freq_to_chan(
-					  sap_ctx->chan_freq)) &&
-	    (sap_ctx->ch_params.ch_width != CH_WIDTH_20MHZ))
+	struct wlan_objmgr_pdev *pdev = wlan_vdev_get_pdev(sap_ctx->vdev);
+
+	if (IS_CH_BONDING_WITH_WEATHER_CH(wlan_reg_freq_to_chan(pdev,
+								sap_ctx->chan_freq)) &&
+	    sap_ctx->ch_params.ch_width != CH_WIDTH_20MHZ)
 		return true;
 
 	return false;

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

@@ -971,8 +971,12 @@ static void wma_update_phymode_on_roam(tp_wma_handle wma, uint8_t *bssid,
 	struct wlan_channel *bss_chan;
 	struct vdev_mlme_obj *vdev_mlme;
 	uint8_t channel;
+	struct wlan_objmgr_pdev *pdev = NULL;
 
-	channel = wlan_freq_to_chan(iface->ch_freq);
+	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(iface->vdev);
+	pdev = wlan_vdev_get_pdev(vdev_mlme->vdev);
+
+	channel = wlan_reg_freq_to_chan(pdev, iface->ch_freq);
 	if (chan)
 		bss_phymode =
 			wma_fw_to_host_phymode(WMI_GET_CHANNEL_MODE(chan));
@@ -980,7 +984,6 @@ static void wma_update_phymode_on_roam(tp_wma_handle wma, uint8_t *bssid,
 		wma_get_phy_mode_cb(iface->ch_freq,
 				    iface->chan_width, &bss_phymode);
 
-	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(iface->vdev);
 	/* Update vdev mlme channel info after roaming */
 	des_chan = wlan_vdev_mlme_get_des_chan(iface->vdev);
 	bss_chan = wlan_vdev_mlme_get_bss_chan(iface->vdev);

+ 9 - 4
os_if/p2p/src/wlan_cfg80211_p2p.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -342,6 +342,7 @@ int wlan_cfg80211_roc(struct wlan_objmgr_vdev *vdev,
 	uint8_t vdev_id;
 	bool ok;
 	int ret;
+	struct wlan_objmgr_pdev *pdev = NULL;
 
 	if (!vdev) {
 		osif_err("invalid vdev object");
@@ -355,12 +356,14 @@ int wlan_cfg80211_roc(struct wlan_objmgr_vdev *vdev,
 
 	psoc = wlan_vdev_get_psoc(vdev);
 	vdev_id = wlan_vdev_get_id(vdev);
+	pdev = wlan_vdev_get_pdev(vdev);
+
 	if (!psoc) {
 		osif_err("psoc handle is NULL");
 		return -EINVAL;
 	}
 
-	roc_req.chan = (uint32_t)wlan_freq_to_chan(chan->center_freq);
+	roc_req.chan = (uint32_t)wlan_reg_freq_to_chan(pdev, chan->center_freq);
 	roc_req.duration = duration;
 	roc_req.vdev_id = (uint32_t)vdev_id;
 
@@ -410,14 +413,16 @@ int wlan_cfg80211_mgmt_tx(struct wlan_objmgr_vdev *vdev,
 	struct wlan_objmgr_psoc *psoc;
 	uint8_t vdev_id;
 	uint32_t channel = 0;
-
+	struct wlan_objmgr_pdev *pdev = NULL;
 	if (!vdev) {
 		osif_err("invalid vdev object");
 		return -EINVAL;
 	}
 
+	pdev = wlan_vdev_get_pdev(vdev);
 	if (chan)
-		channel = (uint32_t)wlan_freq_to_chan(chan->center_freq);
+		channel = (uint32_t)wlan_reg_freq_to_chan(pdev,
+							  chan->center_freq);
 	else
 		osif_debug("NULL chan, set channel to 0");