3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-26 10:39:23 +01:00

ap: remove rates requirement for fmac cards

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.
This commit is contained in:
James Prestwood 2021-04-12 11:22:45 -07:00 committed by Denis Kenzior
parent d04ab5ad96
commit b276e3f590

View File

@ -281,7 +281,9 @@ static void ap_sta_free(void *data)
struct sta_state *sta = data; struct sta_state *sta = data;
struct ap_state *ap = sta->ap; struct ap_state *ap = sta->ap;
l_uintset_free(sta->rates); if (sta->rates)
l_uintset_free(sta->rates);
l_free(sta->assoc_ies); l_free(sta->assoc_ies);
if (sta->assoc_resp_cmd_id) 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; *rsn_out = rsn;
*rates_out = rates;
if (rates_out)
*rates_out = rates;
return true; return true;
@ -2352,7 +2356,6 @@ static void ap_handle_new_station(struct ap_state *ap, struct l_genl_msg *msg)
const void *data; const void *data;
uint8_t mac[6]; uint8_t mac[6];
uint8_t *assoc_rsne = NULL; uint8_t *assoc_rsne = NULL;
struct l_uintset *rates = NULL;
if (!l_genl_attr_init(&attr, msg)) if (!l_genl_attr_init(&attr, msg))
return; 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)) { while (l_genl_attr_next(&attr, &type, &len, &data)) {
switch (type) { switch (type) {
case NL80211_ATTR_IE: case NL80211_ATTR_IE:
if (assoc_rsne || rates) if (assoc_rsne)
goto cleanup; goto cleanup;
if (!ap_parse_new_station_ies(data, len, &assoc_rsne, if (!ap_parse_new_station_ies(data, len, &assoc_rsne,
&rates)) NULL))
return; return;
break; break;
case NL80211_ATTR_MAC: 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; 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); memcpy(sta->addr, mac, 6);
sta->ap = ap; sta->ap = ap;
sta->assoc_rsne = assoc_rsne; sta->assoc_rsne = assoc_rsne;
sta->rates = rates;
sta->aid = ++ap->last_aid; sta->aid = ++ap->last_aid;
sta->associated = true; sta->associated = true;
@ -2415,7 +2417,6 @@ static void ap_handle_new_station(struct ap_state *ap, struct l_genl_msg *msg)
cleanup: cleanup:
l_free(assoc_rsne); l_free(assoc_rsne);
l_uintset_free(rates);
} }
static void ap_handle_del_station(struct ap_state *ap, struct l_genl_msg *msg) static void ap_handle_del_station(struct ap_state *ap, struct l_genl_msg *msg)