All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ap: remove rates requirement for fmac cards
@ 2021-04-12 18:22 James Prestwood
  2021-04-12 19:17 ` Denis Kenzior
  0 siblings, 1 reply; 3+ messages in thread
From: James Prestwood @ 2021-04-12 18:22 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 2399 bytes --]

It was seen that some full mac cards/drivers do not include any
rate information with the NEW_STATION event. This was causing
the NEW_STATION event to be ignored, preventing AP mode from
working on these cards.

Since the full mac path does not even require sta->rates the
parsing can be removed completely.
---
 src/ap.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/ap.c b/src/ap.c
index 86451d42..46821c04 100644
--- a/src/ap.c
+++ b/src/ap.c
@@ -281,7 +281,9 @@ static void ap_sta_free(void *data)
 	struct sta_state *sta = data;
 	struct ap_state *ap = sta->ap;
 
-	l_uintset_free(sta->rates);
+	if (sta->rates)
+		l_uintset_free(sta->rates);
+
 	l_free(sta->assoc_ies);
 
 	if (sta->assoc_resp_cmd_id)
@@ -2329,7 +2331,9 @@ static bool ap_parse_new_station_ies(const void *data, uint16_t len,
 	}
 
 	*rsn_out = rsn;
-	*rates_out = rates;
+
+	if (rates_out)
+		*rates_out = rates;
 
 	return true;
 
@@ -2352,7 +2356,6 @@ static void ap_handle_new_station(struct ap_state *ap, struct l_genl_msg *msg)
 	const void *data;
 	uint8_t mac[6];
 	uint8_t *assoc_rsne = NULL;
-	struct l_uintset *rates = NULL;
 
 	if (!l_genl_attr_init(&attr, msg))
 		return;
@@ -2360,11 +2363,11 @@ static void ap_handle_new_station(struct ap_state *ap, struct l_genl_msg *msg)
 	while (l_genl_attr_next(&attr, &type, &len, &data)) {
 		switch (type) {
 		case NL80211_ATTR_IE:
-			if (assoc_rsne || rates)
+			if (assoc_rsne)
 				goto cleanup;
 
 			if (!ap_parse_new_station_ies(data, len, &assoc_rsne,
-							&rates))
+							NULL))
 				return;
 			break;
 		case NL80211_ATTR_MAC:
@@ -2376,7 +2379,7 @@ static void ap_handle_new_station(struct ap_state *ap, struct l_genl_msg *msg)
 		}
 	}
 
-	if (!assoc_rsne || !rates)
+	if (!assoc_rsne)
 		goto cleanup;
 
 	/*
@@ -2391,7 +2394,6 @@ static void ap_handle_new_station(struct ap_state *ap, struct l_genl_msg *msg)
 	memcpy(sta->addr, mac, 6);
 	sta->ap = ap;
 	sta->assoc_rsne = assoc_rsne;
-	sta->rates = rates;
 	sta->aid = ++ap->last_aid;
 
 	sta->associated = true;
@@ -2415,7 +2417,6 @@ static void ap_handle_new_station(struct ap_state *ap, struct l_genl_msg *msg)
 
 cleanup:
 	l_free(assoc_rsne);
-	l_uintset_free(rates);
 }
 
 static void ap_handle_del_station(struct ap_state *ap, struct l_genl_msg *msg)
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ap: remove rates requirement for fmac cards
  2021-04-12 18:22 [PATCH] ap: remove rates requirement for fmac cards James Prestwood
@ 2021-04-12 19:17 ` Denis Kenzior
  2021-04-12 21:32   ` salahaldeen.altous
  0 siblings, 1 reply; 3+ messages in thread
From: Denis Kenzior @ 2021-04-12 19:17 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 588 bytes --]

Hi James,

On 4/12/21 1:22 PM, James Prestwood wrote:
> It was seen that some full mac cards/drivers do not include any
> rate information with the NEW_STATION event. This was causing
> the NEW_STATION event to be ignored, preventing AP mode from
> working on these cards.
> 
> Since the full mac path does not even require sta->rates the
> parsing can be removed completely.
> ---
>   src/ap.c | 17 +++++++++--------
>   1 file changed, 9 insertions(+), 8 deletions(-)
> 

Applied, thanks.

Salahaldeen, can you check whether this fixes your issue?

Regards,
-Denis

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ap: remove rates requirement for fmac cards
  2021-04-12 19:17 ` Denis Kenzior
@ 2021-04-12 21:32   ` salahaldeen.altous
  0 siblings, 0 replies; 3+ messages in thread
From: salahaldeen.altous @ 2021-04-12 21:32 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 183 bytes --]

Hi Denis,
Hi James, 

I have applied this patch now and the ap is working fine with qualcomm qca9377.
Now both station and ap mode are working.

Thanks.

Regards,
Salahaldeen

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-12 21:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12 18:22 [PATCH] ap: remove rates requirement for fmac cards James Prestwood
2021-04-12 19:17 ` Denis Kenzior
2021-04-12 21:32   ` salahaldeen.altous

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.