Эх сурвалжийг харах

qcacmn: Fix partner link id updation in ml_info of scan cache entry

Currently, partner info array in scan entry is contains self link
information in first index. to avoid confusion, update partner info
with only partner links information and store self link id in ml_info
of scan entry

Change-Id: I53992fee355613b8521409da412254c05fb63fbf
CRs-fixed: 2991229
Bapiraju Alla 4 жил өмнө
parent
commit
733e990dce

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

@@ -516,12 +516,14 @@ struct partner_link_info {
  * struct ml_info: Multi link formation of a 11be beacon
  * @mld_mac_addr: MLD mac address
  * @num_links: Number of links supported by ML AP
+ * @self_link_id: Link id of the scan entry
  * @link_info: Array containing partner links information
  * @ml_bss_score: Multi link BSS score
  */
 struct ml_info {
 	struct qdf_mac_addr mld_mac_addr;
 	uint8_t num_links;
+	uint8_t self_link_id;
 	struct partner_link_info link_info[MLD_MAX_LINKS - 1];
 	uint16_t ml_bss_score;
 };

+ 2 - 2
umac/scan/dispatcher/inc/wlan_scan_utils_api.h

@@ -771,8 +771,8 @@ util_scan_get_ml_partner_info(struct scan_cache_entry *scan_entry)
 	uint8_t i;
 
 	partner_info.num_partner_links =
-			qdf_min((uint8_t)WLAN_UMAC_MLO_MAX_VDEVS,
-				scan_entry->ml_info->num_links);
+			qdf_min((uint8_t)WLAN_UMAC_MLO_MAX_VDEVS - 1,
+				scan_entry->ml_info->num_links - 1);
 	/* TODO: Make sure that scan_entry->ml_info->link_info is a sorted
 	 * list */
 	for (i = 0; i < partner_info.num_partner_links; i++) {

+ 14 - 18
umac/scan/dispatcher/src/wlan_scan_utils_api.c

@@ -1763,8 +1763,8 @@ static void util_scan_set_security(struct scan_cache_entry *scan_params)
 #define ML_CONTROL_OFFSET 3
 #define ML_CMN_INFO_OFFSET ML_CONTROL_OFFSET + 2
 
-#define CMN_INFO_MLD_ADDR_PRESENT_BIT     BIT(0)
-#define CMN_INFO_LINK_ID_PRESENT_BIT      BIT(1)
+#define CMN_INFO_MLD_ADDR_PRESENT_BIT     BIT(4)
+#define CMN_INFO_LINK_ID_PRESENT_BIT      BIT(5)
 #define LINK_INFO_MAC_ADDR_PRESENT_BIT    BIT(5)
 
 static uint8_t util_get_link_info_offset(uint8_t *ml_ie)
@@ -1792,10 +1792,16 @@ static void util_get_partner_link_info(struct scan_cache_entry *scan_entry)
 	uint8_t offset = util_get_link_info_offset(ml_ie);
 	uint16_t sta_ctrl;
 
-	if (!offset) {
-		scm_err("Per STA profile is not present in the ML_IE ");
+	/* Update partner info  from RNR IE */
+	qdf_mem_copy(&scan_entry->ml_info->link_info[0].link_addr,
+		     &scan_entry->rnr.bss_info[0].bssid, 6);
+
+	scan_entry->ml_info->link_info[0].link_id =
+				scan_entry->rnr.bss_info[0].mld_info.link_id;
+
+	if (!offset)
 		return;
-	}
+
 	/* TODO: loop through all the STA info fields */
 
 	/* Sub element ID 0 represents Per-STA Profile */
@@ -1806,22 +1812,15 @@ static void util_get_partner_link_info(struct scan_cache_entry *scan_entry)
 		/* Skip STA control field */
 		offset += 2;
 
-		scan_entry->ml_info->link_info[1].link_id =
-						ml_ie[offset] & 0xF;
+		scan_entry->ml_info->link_info[0].link_id = sta_ctrl & 0xF;
 		if (sta_ctrl & LINK_INFO_MAC_ADDR_PRESENT_BIT) {
 			qdf_mem_copy(
-				&scan_entry->ml_info->link_info[1].link_addr,
+				&scan_entry->ml_info->link_info[0].link_addr,
 				ml_ie + offset, 6);
 			scm_debug("Found partner info in ML IE");
 			return;
 		}
 	}
-
-	qdf_mem_copy(&scan_entry->ml_info->link_info[1].link_addr,
-		     &scan_entry->rnr.bss_info[0].bssid, 6);
-
-	scan_entry->ml_info->link_info[1].link_id =
-				scan_entry->rnr.bss_info[0].mld_info.link_id;
 }
 
 static void util_scan_update_ml_info(struct scan_cache_entry *scan_entry)
@@ -1853,10 +1852,7 @@ static void util_scan_update_ml_info(struct scan_cache_entry *scan_entry)
 	 * in the partner info list
 	 */
 	if (multi_link_ctrl & CMN_INFO_LINK_ID_PRESENT_BIT)
-		scan_entry->ml_info->link_info[0].link_id = ml_ie[offset];
-
-	qdf_mem_copy(&scan_entry->ml_info->link_info[0].link_addr,
-		     &scan_entry->mac_addr, 6);
+		scan_entry->ml_info->self_link_id = ml_ie[offset] & 0x0F;
 
 	util_get_partner_link_info(scan_entry);
 }