瀏覽代碼

qcacld-3.0: Fix usage of wlan_reg_legacy_chan_to_freq

In wma_vdev_pre_start() freq is already available with des_chan->ch_freq
so no need to get the freq again from using wlan_reg_legacy_chan_to_freq.
In hdd_cfg80211_update_channel_info() use wlan_reg_chan_band_to_freq
to get the freq from channel.

Change-Id: I179907c9f5a80f355b44aa9c9509d8d12d8825f8
CRs-Fixed: 2696687
Utkarsh Bhatnagar 4 年之前
父節點
當前提交
09431aa329
共有 2 個文件被更改,包括 15 次插入10 次删除
  1. 14 7
      core/hdd/src/wlan_hdd_cfg80211.c
  2. 1 3
      core/wma/src/wma_dev_if.c

+ 14 - 7
core/hdd/src/wlan_hdd_cfg80211.c

@@ -2232,7 +2232,9 @@ hdd_cfg80211_update_channel_info(struct hdd_context *hdd_ctx,
 	struct nlattr *nla_attr, *channel;
 	struct hdd_channel_info *icv;
 	int i;
-	uint32_t freq_seg_0, freq_seg_1;
+	uint32_t freq_seg_0 = 0, freq_seg_1 = 0;
+	enum reg_wifi_band band;
+	uint8_t band_mask;
 
 	nla_attr = nla_nest_start(skb, idx);
 	if (!nla_attr)
@@ -2249,12 +2251,17 @@ hdd_cfg80211_update_channel_info(struct hdd_context *hdd_ctx,
 			goto fail;
 		}
 
-		freq_seg_0 = wlan_reg_legacy_chan_to_freq(
-						hdd_ctx->pdev,
-						icv->vht_center_freq_seg0);
-		freq_seg_1 = wlan_reg_legacy_chan_to_freq(
-						hdd_ctx->pdev,
-						icv->vht_center_freq_seg1);
+		band = wlan_reg_freq_to_band(icv->freq);
+		band_mask = 1 << band;
+
+		if (icv->vht_center_freq_seg0)
+			freq_seg_0 = wlan_reg_chan_band_to_freq(hdd_ctx->pdev,
+						    icv->vht_center_freq_seg0,
+						    band_mask);
+		if (icv->vht_center_freq_seg1)
+			freq_seg_1 = wlan_reg_chan_band_to_freq(hdd_ctx->pdev,
+						    icv->vht_center_freq_seg1,
+						    band_mask);
 
 		if (nla_put_u16(skb, CHAN_INFO_ATTR_FREQ,
 				icv->freq) ||

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

@@ -2779,9 +2779,7 @@ QDF_STATUS wma_vdev_pre_start(uint8_t vdev_id, bool restart)
 	 * enable the firmware flag here.
 	 */
 	if (QDF_GLOBAL_MONITOR_MODE != cds_get_conparam() &&
-	    utils_is_dfs_chan_for_freq(wma->pdev,
-				wlan_reg_legacy_chan_to_freq(wma->pdev,
-							des_chan->ch_ieee)))
+	    utils_is_dfs_chan_for_freq(wma->pdev, des_chan->ch_freq))
 		mlme_obj->mgmt.generic.disable_hw_ack = true;
 
 	if (mlme_obj->mgmt.rate_info.bcn_tx_rate) {