Переглянути джерело

qcacld-3.0: Fetch bcn/prb rsp received freq based on source addr

Firmware sends beacon/probe rsp received to host as part of roam
sync(frame) indication. Frame received frequency is same as
re-association frequency in case of non-ML or single link ML
roaming.
But the ML probe response might come from non-assoc link in case
of multi link roaming. Probe response received frequency and
reassociation frequency are different in such cases. Some
IEs(e.g. HT_INFO) expect frame received frequency to match with
the frequency mentioned in the IE.
So, fetch the probe response received frequency from source
address of the frame and the ml_info of roam sync indication.

Change-Id: Ife96aa46de10d4cd6882e6d04479dfdd481582d4
CRs-Fixed: 3412842
Srinivas Dasari 2 роки тому
батько
коміт
8f1170af29

+ 12 - 0
components/mlme/dispatcher/inc/wlan_mlme_api.h

@@ -4245,4 +4245,16 @@ wlan_mlme_stats_get_periodic_display_time(struct wlan_objmgr_psoc *psoc,
  */
 bool
 wlan_mlme_is_bcn_prot_disabled_for_sap(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * wlan_mlme_get_src_addr_from_frame() - Get source address of the frame
+ * @frame: frame ptr
+ *
+ * Extract source mac address of the frame
+ *
+ * Return: Ptr for extracted src mac address
+ *
+ */
+uint8_t *
+wlan_mlme_get_src_addr_from_frame(struct element_info *frame);
 #endif /* _WLAN_MLME_API_H_ */

+ 12 - 0
components/mlme/dispatcher/src/wlan_mlme_api.c

@@ -6735,3 +6735,15 @@ wlan_mlme_is_bcn_prot_disabled_for_sap(struct wlan_objmgr_psoc *psoc)
 
 	return mlme_obj->cfg.sap_cfg.disable_bcn_prot;
 }
+
+uint8_t *wlan_mlme_get_src_addr_from_frame(struct element_info *frame)
+{
+	struct wlan_frame_hdr *hdr;
+
+	if (!frame || !frame->len || frame->len < WLAN_MAC_HDR_LEN_3A)
+		return NULL;
+
+	hdr = (struct wlan_frame_hdr *)frame->ptr;
+
+	return hdr->i_addr2;
+}

+ 21 - 8
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_fw_sync.c

@@ -860,37 +860,50 @@ cm_update_scan_db_on_roam_success(struct wlan_objmgr_vdev *vdev,
 				  wlan_cm_id cm_id)
 {
 	struct cnx_mgr *cm_ctx;
-	qdf_freq_t link_freq;
+	qdf_freq_t frame_freq;
 	struct wlan_connect_rsp_ies *ies = &resp->connect_ies;
 
 	cm_ctx = cm_get_cm_ctx(vdev);
 	if (!cm_ctx)
 		return;
 
-	link_freq = mlo_roam_get_chan_freq(wlan_vdev_get_id(vdev),
-					   roam_synch_ind);
 	if (roam_synch_ind->auth_status == ROAM_AUTH_STATUS_CONNECTED) {
-		if (ies->link_bcn_probe_rsp.len)
+		if (ies->link_bcn_probe_rsp.len) {
+			frame_freq = mlo_roam_get_link_freq_from_mac_addr(
+					roam_synch_ind,
+					wlan_mlme_get_src_addr_from_frame(
+					&ies->link_bcn_probe_rsp));
 			cm_inform_bcn_probe(cm_ctx,
 					    ies->link_bcn_probe_rsp.ptr,
 					    ies->link_bcn_probe_rsp.len,
-					    link_freq,
+					    frame_freq,
 					    roam_synch_ind->rssi,
 					    cm_id);
+		}
+
+		frame_freq = mlo_roam_get_link_freq_from_mac_addr(
+					roam_synch_ind,
+					wlan_mlme_get_src_addr_from_frame(
+					&ies->bcn_probe_rsp));
 		cm_inform_bcn_probe(cm_ctx,
 				    ies->bcn_probe_rsp.ptr,
 				    ies->bcn_probe_rsp.len,
-				    resp->freq,
+				    frame_freq,
 				    roam_synch_ind->rssi,
 				    cm_id);
 	} else if (wlan_vdev_mlme_is_mlo_link_vdev(vdev)) {
-		if (ies->link_bcn_probe_rsp.len)
+		if (ies->link_bcn_probe_rsp.len) {
+			frame_freq = mlo_roam_get_link_freq_from_mac_addr(
+					roam_synch_ind,
+					wlan_mlme_get_src_addr_from_frame(
+					&ies->link_bcn_probe_rsp));
 			cm_inform_bcn_probe(cm_ctx,
 					    ies->link_bcn_probe_rsp.ptr,
 					    ies->link_bcn_probe_rsp.len,
-					    link_freq,
+					    frame_freq,
 					    roam_synch_ind->rssi,
 					    cm_id);
+		}
 	} else {
 		cm_inform_bcn_probe(cm_ctx,
 				    ies->bcn_probe_rsp.ptr,

+ 6 - 0
components/umac/mlme/mlo_mgr/inc/wlan_mlo_mgr_roam.h

@@ -517,5 +517,11 @@ mlo_get_link_mac_addr_from_reassoc_rsp(struct wlan_objmgr_vdev *vdev,
 	return QDF_STATUS_E_NOSUPPORT;
 }
 
+static inline uint32_t
+mlo_roam_get_link_freq_from_mac_addr(struct roam_offload_synch_ind *sync_ind,
+				     uint8_t *link_mac_addr)
+{
+	return 0;
+}
 #endif /* WLAN_FEATURE_11BE_MLO */
 #endif

+ 2 - 1
core/mac/src/pe/lim/lim_api.c

@@ -4270,7 +4270,8 @@ lim_gen_link_probe_rsp_roam(struct mac_context *mac_ctx,
 			pe_debug("MLO: link probe rsp size:%u orig probe rsp :%u",
 				 link_probe_rsp.len, frame_len);
 
-			src_addr = lim_get_src_addr_from_frame(&link_probe_rsp);
+			src_addr = wlan_mlme_get_src_addr_from_frame(
+							&link_probe_rsp);
 			if (!src_addr) {
 				pe_err("MLO: Failed to fetch src address");
 				status = QDF_STATUS_E_FAILURE;

+ 0 - 12
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -4725,15 +4725,3 @@ void lim_extract_ies_from_deauth_disassoc(struct pe_session *session,
 
 	mlme_set_peer_disconnect_ies(session->vdev, &ie);
 }
-
-uint8_t *lim_get_src_addr_from_frame(struct element_info *frame)
-{
-	struct wlan_frame_hdr *hdr;
-
-	if (!frame || !frame->len || frame->len < WLAN_MAC_HDR_LEN_3A)
-		return NULL;
-
-	hdr = (struct wlan_frame_hdr *)frame->ptr;
-
-	return hdr->i_addr2;
-}

+ 1 - 13
core/mac/src/pe/lim/lim_assoc_utils.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 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
@@ -422,16 +422,4 @@ void lim_free_assoc_req_frm_buf(tpSirAssocReq assoc_req);
 bool lim_alloc_assoc_req_frm_buf(tpSirAssocReq assoc_req,
 				 qdf_nbuf_t buf, uint32_t mac_header_len,
 				 uint32_t frame_len);
-
-/**
- * lim_get_src_addr_from_frame() - Get source address of the frame
- * @frame: frame ptr
- *
- * Extract source mac address of the frame
- *
- * Return: Ptr for extracted src mac address
- *
- */
-uint8_t *
-lim_get_src_addr_from_frame(struct element_info *frame);
 #endif /* __LIM_ASSOC_UTILS_H */