Jelajahi Sumber

qcacld-3.0: Save initial connection ch width in mlme

To process get_cu_for_each_subbw request from upper layer,
host needs to trigger scan for initial connection ch width
on every get_cu request.

Change-Id: I2bbf20c9207f46983b14dcd95bf81f32cfd7c060
CRs-Fixed: 3466958
abhinav kumar 2 tahun lalu
induk
melakukan
38a0fbbf01

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

@@ -386,6 +386,7 @@ struct ft_context {
  * @ese_tspec_info: ese tspec info
  * @ext_cap_ie: Ext CAP IE
  * @assoc_btm_cap: BSS transition management cap used in (re)assoc req
+ * @ch_width_orig: channel width at the time of initial connection
  */
 struct mlme_connect_info {
 	uint8_t timing_meas_cap;
@@ -411,6 +412,7 @@ struct mlme_connect_info {
 #endif
 	uint8_t ext_cap_ie[DOT11F_IE_EXTCAP_MAX_LEN + 2];
 	bool assoc_btm_cap;
+	enum phy_ch_width ch_width_orig;
 };
 
 /** struct wait_for_key_timer - wait for key timer object

+ 2 - 0
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_fw_sync.c

@@ -1014,6 +1014,8 @@ cm_fw_roam_sync_propagation(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 	cm_connect_info(vdev, true, &connect_rsp->bssid, &connect_rsp->ssid,
 			connect_rsp->freq);
 
+	cm_update_associated_ch_width(vdev, true);
+
 	status = cm_sm_deliver_event_sync(cm_ctx, WLAN_CM_SM_EV_ROAM_DONE,
 					  sizeof(*roam_synch_data),
 					  roam_synch_data);

+ 1 - 0
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_connect.c

@@ -1647,6 +1647,7 @@ cm_connect_complete_ind(struct wlan_objmgr_vdev *vdev,
 					     vdev);
 		wlan_p2p_status_connect(vdev);
 		cm_update_tid_mapping(vdev);
+		cm_update_associated_ch_width(vdev, true);
 	}
 
 	mlo_roam_connect_complete(vdev);

+ 1 - 0
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_disconnect.c

@@ -249,6 +249,7 @@ cm_disconnect_complete_ind(struct wlan_objmgr_vdev *vdev,
 	wlan_tdls_notify_sta_disconnect(vdev_id, false, false, vdev);
 	policy_mgr_decr_session_set_pcl(psoc, op_mode, vdev_id);
 	wlan_clear_mlo_sta_link_removed_flag(vdev);
+	cm_update_associated_ch_width(vdev, false);
 
 	return QDF_STATUS_SUCCESS;
 }

+ 12 - 0
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_api.h

@@ -150,6 +150,18 @@ wlan_cm_enable_roaming_on_connected_sta(struct wlan_objmgr_pdev *pdev,
 }
 #endif
 
+/**
+ * cm_update_associated_ch_width() - to save channel width in mlme priv obj at
+ * the time of initial connection
+ * @vdev: Pointer to vdev
+ * @is_update: to distinguish whether update is during connection or
+ * disconnection
+ *
+ * Return: none
+ */
+void cm_update_associated_ch_width(struct wlan_objmgr_vdev *vdev,
+				   bool is_update);
+
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 #define wlan_is_roam_offload_enabled(lfr) \
 	(lfr.lfr3_roaming_offload)

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

@@ -128,6 +128,31 @@ wlan_roam_update_cfg(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 
 #endif
 
+void cm_update_associated_ch_width(struct wlan_objmgr_vdev *vdev,
+				   bool is_update)
+{
+	struct mlme_legacy_priv *mlme_priv;
+	struct wlan_channel *des_chan;
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv)
+		return;
+
+	if (!is_update) {
+		mlme_priv->connect_info.ch_width_orig = CH_WIDTH_INVALID;
+		goto print;
+	}
+
+	des_chan = wlan_vdev_mlme_get_des_chan(vdev);
+	if (!des_chan)
+		return;
+	mlme_priv->connect_info.ch_width_orig = des_chan->ch_width;
+
+print:
+	mlme_debug("update associated ch width :%d, is_update:%d",
+		   mlme_priv->connect_info.ch_width_orig, is_update);
+}
+
 char *cm_roam_get_requestor_string(enum wlan_cm_rso_control_requestor requestor)
 {
 	switch (requestor) {