[PATCH v2] Add support for parsing MLO connection info from roam+auth event

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add support to parse MLO connection information from
QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_MLO_LINKS for
QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH event.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@xxxxxxxxxxx>
---
 src/drivers/driver_nl80211_event.c | 110 +++++++++++++++++++++++++++----------
 1 file changed, 82 insertions(+), 28 deletions(-)

diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
index 0de47ca..d714402 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -420,8 +420,79 @@ convert_connect_fail_reason_codes(enum qca_sta_connect_fail_reason_codes
 	}
 }
 
+
+static void
+nl80211_parse_qca_vendor_mlo_link_info(struct driver_sta_mlo_info *mlo,
+				       struct nlattr *mlo_links)
+{
+	struct nlattr *link;
+	int rem_links;
+
+	nla_for_each_nested(link, mlo_links, rem_links) {
+		struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_MLO_LINK_MAX + 1];
+		int link_id;
+
+		nla_parse(tb,QCA_WLAN_VENDOR_ATTR_MLO_LINK_MAX, nla_data(link),
+			  nla_len(link), NULL);
+
+		if (!tb[QCA_WLAN_VENDOR_ATTR_MLO_LINK_ID] ||
+		    !tb[QCA_WLAN_VENDOR_ATTR_MLO_LINK_MAC_ADDR] ||
+		    !tb[QCA_WLAN_VENDOR_ATTR_MLO_LINK_BSSID])
+			continue;
+
+		link_id = nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_MLO_LINK_ID]);
+		if (link_id >= MAX_NUM_MLD_LINKS)
+			continue;
+
+		mlo->valid_links |= BIT(link_id);
+		os_memcpy(mlo->links[link_id].addr,
+			  nla_data(tb[QCA_WLAN_VENDOR_ATTR_MLO_LINK_MAC_ADDR]),
+			  ETH_ALEN);
+		os_memcpy(mlo->links[link_id].bssid,
+			  nla_data(tb[QCA_WLAN_VENDOR_ATTR_MLO_LINK_BSSID]),
+			  ETH_ALEN);
+		wpa_printf(MSG_DEBUG, "nl80211: MLO link[%u] addr " MACSTR
+			   " bssid " MACSTR,
+			   link_id, MAC2STR(mlo->links[link_id].addr),
+			   MAC2STR(mlo->links[link_id].bssid));
+	}
+}
+
 #endif /* CONFIG_DRIVER_NL80211_QCA */
 
+static void nl80211_parse_mlo_link_info(struct driver_sta_mlo_info *mlo,
+					struct nlattr *mlo_links)
+{
+	struct nlattr *link;
+	int rem_links;
+
+	nla_for_each_nested(link, mlo_links, rem_links) {
+		struct nlattr *tb[NL80211_ATTR_MAX + 1];
+		int link_id;
+
+		nla_parse(tb, NL80211_ATTR_MAX, nla_data(link), nla_len(link),
+			  NULL);
+
+		if (!tb[NL80211_ATTR_MLO_LINK_ID] || !tb[NL80211_ATTR_MAC] ||
+		    !tb[NL80211_ATTR_BSSID])
+			continue;
+
+		link_id = nla_get_u8(tb[NL80211_ATTR_MLO_LINK_ID]);
+		if (link_id >= MAX_NUM_MLD_LINKS)
+			continue;
+
+		mlo->valid_links |= BIT(link_id);
+		os_memcpy(mlo->links[link_id].addr,
+			  nla_data(tb[NL80211_ATTR_MAC]), ETH_ALEN);
+		os_memcpy(mlo->links[link_id].bssid,
+			  nla_data(tb[NL80211_ATTR_BSSID]), ETH_ALEN);
+		wpa_printf(MSG_DEBUG, "nl80211: MLO link[%u] addr " MACSTR
+			   " bssid " MACSTR,
+			   link_id, MAC2STR(mlo->links[link_id].addr),
+			   MAC2STR(mlo->links[link_id].bssid));
+	}
+}
+
 
 static int nl80211_get_assoc_link_id(const u8 *data, u8 len)
 {
@@ -440,12 +511,11 @@ static int nl80211_get_assoc_link_id(const u8 *data, u8 len)
 
 
 static void nl80211_parse_mlo_info(struct wpa_driver_nl80211_data *drv,
+				   enum nl80211_commands cmd,
 				   struct nlattr *addr,
 				   struct nlattr *mlo_links,
 				   struct nlattr *resp_ie)
 {
-	struct nlattr *link;
-	int rem_links;
 	const u8 *ml_ie;
 	struct driver_sta_mlo_info *mlo = &drv->sta_mlo_info;
 
@@ -467,30 +537,14 @@ static void nl80211_parse_mlo_info(struct wpa_driver_nl80211_data *drv,
 	wpa_printf(MSG_DEBUG, "nl80211: AP MLD MAC Address " MACSTR,
 		   MAC2STR(mlo->ap_mld_addr));
 
-	nla_for_each_nested(link, mlo_links, rem_links) {
-		struct nlattr *tb[NL80211_ATTR_MAX + 1];
-		int link_id;
-
-		nla_parse(tb, NL80211_ATTR_MAX, nla_data(link), nla_len(link),
-			  NULL);
-
-		if (!tb[NL80211_ATTR_MLO_LINK_ID] || !tb[NL80211_ATTR_MAC] ||
-		    !tb[NL80211_ATTR_BSSID])
-			continue;
-
-		link_id = nla_get_u8(tb[NL80211_ATTR_MLO_LINK_ID]);
-		if (link_id >= MAX_NUM_MLD_LINKS)
-			continue;
-
-		mlo->valid_links |= BIT(link_id);
-		os_memcpy(mlo->links[link_id].addr,
-			  nla_data(tb[NL80211_ATTR_MAC]), ETH_ALEN);
-		os_memcpy(mlo->links[link_id].bssid,
-			  nla_data(tb[NL80211_ATTR_BSSID]), ETH_ALEN);
-		wpa_printf(MSG_DEBUG, "nl80211: MLO link[%u] addr " MACSTR
-			   " bssid " MACSTR,
-			   link_id, MAC2STR(mlo->links[link_id].addr),
-			   MAC2STR(mlo->links[link_id].bssid));
+	if (0) {
+#ifdef CONFIG_DRIVER_NL80211_QCA
+	} else if (cmd == NL80211_CMD_ROAM &&
+		   (drv->capa.flags & WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD)) {
+		nl80211_parse_qca_vendor_mlo_link_info(mlo, mlo_links);
+#endif /* CONFIG_DRIVER_NL80211_QCA */
+	} else {
+		nl80211_parse_mlo_link_info(mlo, mlo_links);
 	}
 
 	if (!(mlo->valid_links & BIT(drv->mlo_assoc_link_id))) {
@@ -613,7 +667,7 @@ static void mlme_event_connect(struct wpa_driver_nl80211_data *drv,
 
 	drv->associated = 1;
 	drv->sta_mlo_info.valid_links = 0;
-	nl80211_parse_mlo_info(drv, addr, mlo_links, resp_ie);
+	nl80211_parse_mlo_info(drv, cmd, addr, mlo_links, resp_ie);
 	if (!drv->sta_mlo_info.valid_links && addr) {
 		os_memcpy(drv->bssid, nla_data(addr), ETH_ALEN);
 		os_memcpy(drv->prev_bssid, drv->bssid, ETH_ALEN);
@@ -2241,7 +2295,7 @@ static void qca_nl80211_key_mgmt_auth(struct wpa_driver_nl80211_data *drv,
 			   tb[QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_FILS_ERP_NEXT_SEQ_NUM],
 			   tb[QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_PMK],
 			   tb[QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_PMKID],
-			   NULL);
+			   tb[QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_MLO_LINKS]);
 }
 
 
-- 
2.7.4


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux