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

qcacmn: Update proper center freq in mlo link info

FW sends "Center Frequency Index" as new center frequency.
via mlo sta standby csa event WMI_CSA_HANDLING_EVENTID.

Currently host uses value of Center Frequency Index (CFI)
directly to update center frequency for all links to
"mlo_link_info" structure. Due to this host maintains a
wrong value of center frequency throughout of connection
which leads to failure in calculation of bonded channel
in case of 6 GHz and 320 MHz connection.

Fix is to update center frequency in "mlo_link_info"
structure for all require link(s) as per CFI coming via
mlo sta standby csa event.

Change-Id: Iea04fb9b1c1c9b0dbd0be3647173708c47ea74be
CRs-Fixed: 3702255
Abhinav Kumar 1 éve
szülő
commit
3e44744502

+ 4 - 2
umac/mlo_mgr/inc/wlan_mlo_mgr_link_switch.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. 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 above
@@ -273,12 +273,14 @@ mlo_mgr_get_ap_link_by_link_id(struct wlan_mlo_dev_context *mlo_dev_ctx,
 
 /**
  * mlo_mgr_update_csa_link_info - update mlo sta csa params
+ * @pdev: pdev object manager
  * @mlo_dev_ctx: mlo dev ctx
  * @csa_param: csa parameters to be updated
  * @link_id: link id
  * Return : true if csa parameters are updated
  */
-bool mlo_mgr_update_csa_link_info(struct wlan_mlo_dev_context *mlo_dev_ctx,
+bool mlo_mgr_update_csa_link_info(struct wlan_objmgr_pdev *pdev,
+				  struct wlan_mlo_dev_context *mlo_dev_ctx,
 				  struct csa_offload_params *csa_param,
 				  uint8_t link_id);
 

+ 28 - 12
umac/mlo_mgr/src/wlan_mlo_mgr_link_switch.c

@@ -280,12 +280,14 @@ struct mlo_link_info
 	return NULL;
 }
 
-bool mlo_mgr_update_csa_link_info(struct wlan_mlo_dev_context *mlo_dev_ctx,
+bool mlo_mgr_update_csa_link_info(struct wlan_objmgr_pdev *pdev,
+				  struct wlan_mlo_dev_context *mlo_dev_ctx,
 				  struct csa_offload_params *csa_param,
 				  uint8_t link_id)
 {
 	struct mlo_link_info *link_info;
 	uint16_t bw_val;
+	uint32_t ch_cfreq1, ch_cfreq2;
 
 	if (!mlo_dev_ctx) {
 		mlo_err("invalid mlo dev ctx");
@@ -300,17 +302,31 @@ bool mlo_mgr_update_csa_link_info(struct wlan_mlo_dev_context *mlo_dev_ctx,
 		goto done;
 	}
 
-	link_info->link_chan_info->ch_freq =
-				csa_param->csa_chan_freq;
-	link_info->link_chan_info->ch_cfreq1 =
-				csa_param->new_ch_freq_seg1;
-	link_info->link_chan_info->ch_cfreq2 =
-				csa_param->new_ch_freq_seg2;
-
-	link_info->link_chan_info->ch_phymode =
-			wlan_eht_chan_phy_mode(
-				csa_param->csa_chan_freq,
-				bw_val, csa_param->new_ch_width);
+	link_info->link_chan_info->ch_freq = csa_param->csa_chan_freq;
+
+	if (wlan_reg_is_6ghz_chan_freq(csa_param->csa_chan_freq)) {
+		ch_cfreq1 = wlan_reg_compute_6g_center_freq_from_cfi(
+					csa_param->new_ch_freq_seg1);
+		ch_cfreq2 = wlan_reg_compute_6g_center_freq_from_cfi(
+					csa_param->new_ch_freq_seg2);
+	} else {
+		ch_cfreq1 = wlan_reg_legacy_chan_to_freq(pdev,
+					csa_param->new_ch_freq_seg1);
+		ch_cfreq2 = wlan_reg_legacy_chan_to_freq(pdev,
+					csa_param->new_ch_freq_seg2);
+	}
+
+	link_info->link_chan_info->ch_cfreq1 = ch_cfreq1;
+	link_info->link_chan_info->ch_cfreq2 = ch_cfreq2;
+
+	link_info->link_chan_info->ch_phymode = wlan_eht_chan_phy_mode(
+					csa_param->csa_chan_freq,
+					bw_val, csa_param->new_ch_width);
+
+	mlo_debug("CSA: freq: %d, cfreq1: %d, cfreq2: %d, bw: %d, phymode:%d",
+		  link_info->link_chan_info->ch_freq, ch_cfreq1, ch_cfreq2,
+		  bw_val, link_info->link_chan_info->ch_phymode);
+
 	return true;
 done:
 	return false;

+ 8 - 1
umac/mlo_mgr/src/wlan_mlo_mgr_sta.c

@@ -2005,12 +2005,19 @@ QDF_STATUS mlo_sta_handle_csa_standby_link(
 	struct mlo_link_info *link_info;
 	struct mlo_link_bss_params params = {0};
 	struct wlan_objmgr_psoc *psoc;
+	struct wlan_objmgr_pdev *pdev;
 
 	if (!mlo_dev_ctx) {
 		mlo_err("invalid mlo_dev_ctx");
 		return QDF_STATUS_E_NULL_VALUE;
 	}
 
+	pdev = wlan_vdev_get_pdev(vdev);
+	if (!pdev) {
+		mlo_err("null pdev");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
 	psoc = wlan_vdev_get_psoc(vdev);
 	if (!psoc) {
 		mlo_err("null psoc");
@@ -2031,7 +2038,7 @@ QDF_STATUS mlo_sta_handle_csa_standby_link(
 		return QDF_STATUS_E_NULL_VALUE;
 	}
 
-	mlo_mgr_update_csa_link_info(mlo_dev_ctx, csa_param, link_id);
+	mlo_mgr_update_csa_link_info(pdev, mlo_dev_ctx, csa_param, link_id);
 
 	params.link_id = link_info->link_id;
 	params.chan = qdf_mem_malloc(sizeof(struct wlan_channel));