Selaa lähdekoodia

qcacmn: Get profile index and count for non-tx AP

In the scenario about MLO 5 GHz + 6 GHz and 6 GHz is non-tx AP in
MBSSID, if DUT tries to connect 5 GHz link as assoc link and uses
the scan entry generated from 5 GHz beacon. Then there is no info
about profile index and count in the scan entry and these info is
necessary for firmware when vdev up.

To resolve this issue, get the info from 6 GHz scan entry if it
exists.

CRs-Fixed: 3616899
Change-Id: Ic9bf9bc107c3486be1e87ea2c19c5d388ca41883
Paul Zhang 1 vuosi sitten
vanhempi
sitoutus
a64af3b447

+ 2 - 0
umac/mlme/include/wlan_vdev_mlme.h

@@ -593,6 +593,7 @@ struct vdev_mlme_beacon_info {
  * @vdev_bmap: vdev bitmap of VAPs in MBSS group
  * @is_cmn_param: flag to check mbss common param
  * @trans_bssid: bssid of transmitted AP (MBSS IE case)
+ * @non_trans_bssid: bssid of non transmitted AP (MBSS IE case)
  * @is_multi_mbssid: Flag to identify multi group mbssid support
  * @grp_id: Group id of current vdev
  */
@@ -604,6 +605,7 @@ struct vdev_mlme_mbss_11ax {
 	unsigned long vdev_bmap;
 	bool is_cmn_param;
 	uint8_t trans_bssid[QDF_MAC_ADDR_SIZE];
+	uint8_t non_trans_bssid[QDF_MAC_ADDR_SIZE];
 	bool is_multi_mbssid;
 	uint32_t grp_id;
 };

+ 7 - 0
umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c

@@ -42,6 +42,7 @@
 #include <wlan_mlo_mgr_ap.h>
 #endif
 #include <wlan_vdev_mgr_utils_api.h>
+#include <wlan_vdev_mgr_api.h>
 
 #ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT
 /**
@@ -696,11 +697,17 @@ static QDF_STATUS vdev_mgr_up_param_update(
 {
 	struct vdev_mlme_mbss_11ax *mbss;
 	struct wlan_objmgr_vdev *vdev;
+	uint8_t bssid[QDF_MAC_ADDR_SIZE];
 
 	vdev = mlme_obj->vdev;
 	param->vdev_id = wlan_vdev_get_id(vdev);
 	param->assoc_id = mlme_obj->proto.sta.assoc_id;
+
 	mbss = &mlme_obj->mgmt.mbss_11ax;
+	wlan_vdev_mgr_get_param_bssid(vdev, bssid);
+	if (qdf_mem_cmp(bssid, mbss->non_trans_bssid, QDF_MAC_ADDR_SIZE))
+		return QDF_STATUS_SUCCESS;
+
 	param->profile_idx = mbss->profile_idx;
 	param->profile_num = mbss->profile_num;
 	qdf_mem_copy(param->trans_bssid, mbss->trans_bssid, QDF_MAC_ADDR_SIZE);

+ 3 - 0
umac/scan/dispatcher/inc/wlan_scan_public_structs.h

@@ -368,6 +368,7 @@ struct security_info {
  * @profile_num: profile number
  * @profile_count: total profile count
  * @trans_bssid: TX BSSID address
+ * @non_trans_bssid: non TX BSSID address
  * @split_profile: Indicates if next MBSSID tag has the other part
  *                 of the non tx profile
  * @prof_residue: Set prof_residue to true, if the first non TX
@@ -384,6 +385,7 @@ struct scan_mbssid_info {
 	uint8_t profile_num;
 	uint8_t profile_count;
 	uint8_t trans_bssid[QDF_MAC_ADDR_SIZE];
+	uint8_t non_trans_bssid[QDF_MAC_ADDR_SIZE];
 	bool split_profile;
 	bool prof_residue;
 	bool split_prof_continue;
@@ -421,6 +423,7 @@ struct non_inheritance_ie {
 	bool non_inh_ie_found;
 };
 
+#define TBTT_BSS_PARAM_TRANS_BSSID_BIT 0x08
 /**
  * struct rnr_bss_info - Reduced Neighbor Report BSS information
  * @neighbor_ap_tbtt_offset: Neighbor AP TBTT offset

+ 43 - 9
umac/scan/dispatcher/src/wlan_scan_utils_api.c

@@ -2190,7 +2190,9 @@ static uint8_t util_get_link_info_offset(uint8_t *ml_ie, bool *is_ml_ie_valid)
 	return 0;
 }
 
-static void util_get_ml_bv_partner_link_info(struct scan_cache_entry *scan_entry)
+static void
+util_get_ml_bv_partner_link_info(struct wlan_objmgr_pdev *pdev,
+				 struct scan_cache_entry *scan_entry)
 {
 	uint8_t *ml_ie = scan_entry->ie_list.multi_link_bv;
 	uint8_t *end_ptr = NULL;
@@ -2205,6 +2207,10 @@ static void util_get_ml_bv_partner_link_info(struct scan_cache_entry *scan_entry
 	uint8_t rnr_idx = 0;
 	struct rnr_bss_info *rnr = NULL;
 	qdf_size_t ml_ie_len = ml_ie[TAG_LEN_POS] + sizeof(struct ie_header);
+	uint16_t freq;
+	struct scan_cache_entry *tmp_entry;
+	struct qdf_mac_addr bcast_addr = QDF_MAC_ADDR_BCAST_INIT;
+	struct scan_mbssid_info *mbssid;
 
 	/* Update partner info  from RNR IE */
 	while ((rnr_idx < MAX_RNR_BSS) && (rnr_idx < scan_entry->rnr.count)) {
@@ -2212,15 +2218,39 @@ static void util_get_ml_bv_partner_link_info(struct scan_cache_entry *scan_entry
 			break;
 		rnr = &scan_entry->rnr.bss_info[rnr_idx];
 		if (rnr->mld_info_valid && !rnr->mld_info.mld_id) {
+			mbssid = &scan_entry->mbssid_info;
+			freq =
+			     wlan_reg_chan_opclass_to_freq(rnr->channel_number,
+							   rnr->operating_class,
+							   true);
+
+			if ((!scan_entry->mbssid_info.profile_count) &&
+			    !(rnr->bss_params & TBTT_BSS_PARAM_TRANS_BSSID_BIT)) {
+				tmp_entry =
+				       scm_scan_get_scan_entry_by_mac_freq(pdev,
+							     &rnr->bssid, freq);
+				if (tmp_entry) {
+					qdf_mem_copy(mbssid,
+						     &tmp_entry->mbssid_info,
+						     sizeof(*mbssid));
+					util_scan_free_cache_entry(tmp_entry);
+				} else {
+					qdf_mem_copy(mbssid->non_trans_bssid,
+						     rnr->bssid.bytes,
+						     QDF_MAC_ADDR_SIZE);
+					qdf_mem_copy(mbssid->trans_bssid,
+						     bcast_addr.bytes,
+						     QDF_MAC_ADDR_SIZE);
+				}
+			}
+
 			link_info = &scan_entry->ml_info.link_info[link_idx];
 			qdf_mem_copy(&link_info->link_addr,
 				     &rnr->bssid, QDF_MAC_ADDR_SIZE);
 
 			link_info->link_id = rnr->mld_info.link_id;
-			link_info->freq =
-				wlan_reg_chan_opclass_to_freq(rnr->channel_number,
-							      rnr->operating_class,
-							      true);
+			link_info->freq = freq;
+
 			if (!link_info->freq)
 				scm_debug("freq 0 rnr channel %u op_class %u",
 					  rnr->channel_number,
@@ -2321,7 +2351,8 @@ static void util_get_ml_bv_partner_link_info(struct scan_cache_entry *scan_entry
 	}
 }
 
-static void util_scan_update_ml_info(struct scan_cache_entry *scan_entry)
+static void util_scan_update_ml_info(struct wlan_objmgr_pdev *pdev,
+				     struct scan_cache_entry *scan_entry)
 {
 	uint8_t *ml_ie = scan_entry->ie_list.multi_link_bv;
 	uint16_t multi_link_ctrl;
@@ -2372,10 +2403,11 @@ static void util_scan_update_ml_info(struct scan_cache_entry *scan_entry)
 			scan_entry->ml_info.self_link_id = ml_ie[offset] & 0x0F;
 	}
 
-	util_get_ml_bv_partner_link_info(scan_entry);
+	util_get_ml_bv_partner_link_info(pdev, scan_entry);
 }
 #else
-static void util_scan_update_ml_info(struct scan_cache_entry *scan_entry)
+static void util_scan_update_ml_info(struct wlan_objmgr_pdev *pdev,
+				     struct scan_cache_entry *scan_entry)
 {
 }
 #endif
@@ -2557,7 +2589,7 @@ util_scan_gen_scan_entry(struct wlan_objmgr_pdev *pdev,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	util_scan_update_ml_info(scan_entry);
+	util_scan_update_ml_info(pdev, scan_entry);
 
 	scan_node->entry = scan_entry;
 	qdf_list_insert_front(scan_list, &scan_node->node);
@@ -3210,6 +3242,8 @@ util_handle_nontx_prof(uint8_t *mbssid_elem, uint8_t *subelement,
 				   mbssid_elem[MBSSID_INDICATOR_POS],
 				   mbssid_index_ie[BSS_INDEX_POS],
 				   new_bssid);
+		qdf_mem_copy(mbssid_info->non_trans_bssid, new_bssid,
+			     QDF_MAC_ADDR_SIZE);
 	}
 	/* In single MBSS IE, there could be subelement holding
 	 * remaining vendor IEs of non tx profile from last MBSS IE

+ 2 - 2
wmi/src/wmi_unified_tlv.c

@@ -1871,10 +1871,10 @@ static QDF_STATUS send_vdev_up_cmd_tlv(wmi_unified_t wmi,
 
 	wmi_debug("VDEV_UP");
 	wmi_debug("vdev_id %d aid %d profile idx %d count %d bssid "
-		  QDF_MAC_ADDR_FMT,
+		  QDF_MAC_ADDR_FMT " trans bssid " QDF_MAC_ADDR_FMT,
 		  params->vdev_id, params->assoc_id,
 		  params->profile_idx, params->profile_num,
-		  QDF_MAC_ADDR_REF(bssid));
+		  QDF_MAC_ADDR_REF(bssid), QDF_MAC_ADDR_REF(params->trans_bssid));
 	buf = wmi_buf_alloc(wmi, len);
 	if (!buf)
 		return QDF_STATUS_E_NOMEM;