diff mbox series

[29/50] AP: Handle TX status for MLD AP

Message ID 20230215230904.933291-30-andrei.otcheretianski@intel.com
State Changes Requested
Headers show
Series Add basic MLO support for AP | expand

Commit Message

Andrei Otcheretianski Feb. 15, 2023, 11:08 p.m. UTC
From: Ilan Peer <ilan.peer@intel.com>

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 src/ap/drv_callbacks.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

Comments

Rameshkumar Sundaram (QUIC) Feb. 17, 2023, 11:15 a.m. UTC | #1
> -----Original Message-----
> From: Hostap <hostap-bounces@lists.infradead.org> On Behalf Of Andrei
> Otcheretianski
> Sent: Thursday, February 16, 2023 4:39 AM
> To: hostap@lists.infradead.org
> Cc: Ilan Peer <ilan.peer@intel.com>
> Subject: [PATCH 29/50] AP: Handle TX status for MLD AP
> 
> From: Ilan Peer <ilan.peer@intel.com>
> 
> Signed-off-by: Ilan Peer <ilan.peer@intel.com>
> ---
>  src/ap/drv_callbacks.c | 22 ++++++++++++++++++----
>  1 file changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index
> 5869d71f44..8dc4ad1ffb 100644
> --- a/src/ap/drv_callbacks.c
> +++ b/src/ap/drv_callbacks.c
> @@ -1534,12 +1534,26 @@ static void hostapd_mgmt_tx_cb(struct
> hostapd_data *hapd, const u8 *buf,
>  			       size_t len, u16 stype, int ok)  {
>  	struct ieee80211_hdr *hdr;
> -	struct hostapd_data *orig_hapd = hapd;
> +	struct hostapd_data *orig_hapd = hapd, *tmp_hapd;
> 
>  	hdr = (struct ieee80211_hdr *) buf;
> -	hapd = get_hapd_bssid(hapd->iface, get_hdr_bssid(hdr, len));
> -	if (!hapd)
> -		return;
> +	tmp_hapd = get_hapd_bssid(hapd->iface, get_hdr_bssid(hdr, len));
Given that we have a common i802_ bss for all link hapds, the incoming bss(hapd) here will always be the first link bss
If we have a 2.4G+5G mld, how will a 5G legacy(non-ml) stations tx_status will be routed to right link hapd (i.e., 5G)?
> +	if (tmp_hapd) {
Andrei Otcheretianski Feb. 22, 2023, 1:59 p.m. UTC | #2
> > hostapd_data *hapd, const u8 *buf,
> >  			       size_t len, u16 stype, int ok)  {
> >  	struct ieee80211_hdr *hdr;
> > -	struct hostapd_data *orig_hapd = hapd;
> > +	struct hostapd_data *orig_hapd = hapd, *tmp_hapd;
> >
> >  	hdr = (struct ieee80211_hdr *) buf;
> > -	hapd = get_hapd_bssid(hapd->iface, get_hdr_bssid(hdr, len));
> > -	if (!hapd)
> > -		return;
> > +	tmp_hapd = get_hapd_bssid(hapd->iface, get_hdr_bssid(hdr, len));

> Given that we have a common i802_ bss for all link hapds, the incoming
> bss(hapd) here will always be the first link bss If we have a 2.4G+5G mld, how
> will a 5G legacy(non-ml) stations tx_status will be routed to right link hapd
> (i.e., 5G)?

Right, it looks that this part wasn't handled properly. I will fix it by saving the cookie per link. This way link_id will be available in TX_STATUS events.

Andrei
> > +	if (tmp_hapd) {
diff mbox series

Patch

diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
index 5869d71f44..8dc4ad1ffb 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -1534,12 +1534,26 @@  static void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, const u8 *buf,
 			       size_t len, u16 stype, int ok)
 {
 	struct ieee80211_hdr *hdr;
-	struct hostapd_data *orig_hapd = hapd;
+	struct hostapd_data *orig_hapd = hapd, *tmp_hapd;
 
 	hdr = (struct ieee80211_hdr *) buf;
-	hapd = get_hapd_bssid(hapd->iface, get_hdr_bssid(hdr, len));
-	if (!hapd)
-		return;
+	tmp_hapd = get_hapd_bssid(hapd->iface, get_hdr_bssid(hdr, len));
+	if (tmp_hapd) {
+		hapd = tmp_hapd;
+	} else {
+		bool mld_ap_match = false;
+
+#ifdef CONFIG_IEEE80211BE
+		mld_ap_match = (hapd->conf->mld_ap &&
+				!os_memcmp(hapd->mld_addr,
+					   get_hdr_bssid(hdr, len),
+					   ETH_ALEN));
+#endif /* CONFIG_IEEE80211BE */
+
+		if (!mld_ap_match)
+			return;
+	}
+
 	if (hapd == HAPD_BROADCAST) {
 		if (stype != WLAN_FC_STYPE_ACTION || len <= 25 ||
 		    buf[24] != WLAN_ACTION_PUBLIC)