nl80211: Select frame TX frequency according to the transmitting link

In MLO, multiple BSSs can transmit on different frequencies. Select
link frequencies according to the transmitter address.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
This commit is contained in:
Andrei Otcheretianski 2023-05-22 22:33:38 +03:00 committed by Jouni Malinen
parent 2b541601da
commit 7b45c2e6bc

View file

@ -4141,6 +4141,29 @@ static void nl80211_link_set_freq(struct i802_bss *bss, s8 link_id, int freq)
} }
static int nl80211_get_link_freq(struct i802_bss *bss, const u8 *addr,
bool bss_freq_debug)
{
size_t i;
for (i = 0; i < bss->n_links; i++) {
if (os_memcmp(bss->links[i].addr, addr, ETH_ALEN) == 0) {
wpa_printf(MSG_DEBUG,
"nl80211: Use link freq=%d for address "
MACSTR,
bss->links[i].freq, MAC2STR(addr));
return bss->links[i].freq;
}
}
if (bss_freq_debug)
wpa_printf(MSG_DEBUG, "nl80211: Use bss->freq=%d",
bss->flink->freq);
return bss->flink->freq;
}
static int wpa_driver_nl80211_send_mlme(struct i802_bss *bss, const u8 *data, static int wpa_driver_nl80211_send_mlme(struct i802_bss *bss, const u8 *data,
size_t data_len, int noack, size_t data_len, int noack,
unsigned int freq, int no_cck, unsigned int freq, int no_cck,
@ -4185,13 +4208,15 @@ static int wpa_driver_nl80211_send_mlme(struct i802_bss *bss, const u8 *data,
} }
if (drv->device_ap_sme && is_ap_interface(drv->nlmode)) { if (drv->device_ap_sme && is_ap_interface(drv->nlmode)) {
if (freq == 0) { unsigned int link_freq = nl80211_get_link_freq(bss, mgmt->sa,
wpa_printf(MSG_DEBUG, "nl80211: Use bss->freq=%d", !freq);
bss->flink->freq);
freq = bss->flink->freq; if (!freq)
} freq = link_freq;
if ((int) freq == bss->flink->freq)
if (freq == link_freq)
wait_time = 0; wait_time = 0;
goto send_frame_cmd; goto send_frame_cmd;
} }