Forráskód Böngészése

qcacld-3.0: GET_CU_SUB_CBW20 report 320 MHz use invalid center freq2

When connected 320 MHz AP, use SET_MAX_BANDWIDTH set to 160 MHz,
then GET_CU_SUB_CBW20, driver should report all 320 MHz channel
CU info, so we need record center freq2 for 320 MHz at the time
of initial connection.

Change-Id: I8b8ed049926caa31bfac3c702434b68e5f5a26ae
CRs-Fixed: 3629227
Chunquan Luo 1 éve
szülő
commit
683966fb7d

+ 2 - 0
components/mlme/core/inc/wlan_mlme_main.h

@@ -400,10 +400,12 @@ struct ft_context {
  * struct assoc_channel_info - store channel info at the time of association
  * @assoc_ch_width: channel width at the time of initial connection
  * @sec_2g_freq: secondary 2 GHz freq
+ * @cen320_freq: 320 MHz center freq
  */
 struct assoc_channel_info {
 	enum phy_ch_width assoc_ch_width;
 	qdf_freq_t sec_2g_freq;
+	qdf_freq_t cen320_freq;
 };
 
 /**

+ 7 - 1
components/mlme/core/src/wlan_mlme_main.c

@@ -401,9 +401,14 @@ mlme_update_freq_in_scan_start_req(struct wlan_objmgr_vdev *vdev,
 	enum scan_phy_mode phymode = SCAN_PHY_MODE_UNKNOWN;
 	uint8_t vdev_id;
 	struct wlan_channel *des_chan;
+	struct mlme_legacy_priv *mlme_priv;
 
 	vdev_id = vdev->vdev_objmgr.vdev_id;
 
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv)
+		return QDF_STATUS_E_FAILURE;
+
 	if (scan_freq != INVALID_CHANNEL) {
 		op_freq = scan_freq;
 	} else {
@@ -414,7 +419,7 @@ mlme_update_freq_in_scan_start_req(struct wlan_objmgr_vdev *vdev,
 		}
 		op_freq = des_chan->ch_freq;
 		/* Set center_freq1 to center frequency of complete 320MHz */
-		cen320_freq = des_chan->ch_cfreq2;
+		cen320_freq = mlme_priv->connect_info.assoc_chan_info.cen320_freq;
 	}
 
 	mlme_debug("vdev %d :op_freq:%d, cen320_freq:%d, scan_ch_width: %d",
@@ -827,6 +832,7 @@ QDF_STATUS mlme_init_connect_chan_info_config(struct vdev_mlme_obj *vdev_mlme)
 	mlme_priv->connect_info.assoc_chan_info.assoc_ch_width =
 							CH_WIDTH_INVALID;
 	mlme_priv->connect_info.assoc_chan_info.sec_2g_freq = 0;
+	mlme_priv->connect_info.assoc_chan_info.cen320_freq = 0;
 
 	return QDF_STATUS_SUCCESS;
 }

+ 21 - 0
components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_api.c

@@ -139,8 +139,16 @@ cm_update_associated_ch_info(struct wlan_objmgr_vdev *vdev, bool is_update)
 	struct mlme_legacy_priv *mlme_priv;
 	struct wlan_channel *des_chan;
 	struct assoc_channel_info *assoc_chan_info;
+	struct wlan_objmgr_pdev *pdev;
 	enum phy_ch_width ch_width;
 	QDF_STATUS status;
+	uint8_t band_mask;
+
+	pdev = wlan_vdev_get_pdev(vdev);
+	if (!pdev) {
+		mlme_err("invalid pdev");
+		return;
+	}
 
 	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
 	if (!mlme_priv)
@@ -177,6 +185,19 @@ cm_update_associated_ch_info(struct wlan_objmgr_vdev *vdev, bool is_update)
 		if (des_chan->ch_cfreq1 == des_chan->ch_freq - BW_10_MHZ)
 			assoc_chan_info->sec_2g_freq =
 					des_chan->ch_freq - BW_20_MHZ;
+	} else if (des_chan->ch_width == CH_WIDTH_320MHZ) {
+		if (WLAN_REG_IS_6GHZ_CHAN_FREQ(des_chan->ch_freq))
+			band_mask = BIT(REG_BAND_6G);
+		else
+			band_mask = BIT(REG_BAND_5G);
+		assoc_chan_info->cen320_freq =
+			wlan_reg_chan_band_to_freq(pdev,
+						   des_chan->ch_freq_seg2,
+						   band_mask);
+
+		mlme_debug("ch_freq_seg2: %d, cen320_freq: %d",
+			   des_chan->ch_freq_seg2,
+			   assoc_chan_info->cen320_freq);
 	}
 
 	mlme_debug("ch width :%d, ch_freq:%d, ch_cfreq1:%d, sec_2g_freq:%d",