]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Add frequency info in start AP command
authorHarshitha Prem <quic_hprem@quicinc.com>
Wed, 22 Feb 2023 03:59:01 +0000 (09:29 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 22 Feb 2023 11:10:49 +0000 (13:10 +0200)
When ACS is configured in multiple BSS case, sometimes a virtual AP
interface does not come up as the channel context information between
different BSSs of the same band does not match.

Same behavior is observed in case of multiple band/hardware under a
single wiphy, when we bring up multiple virtual interface in various
bands simultaneously and the kernel maps a random channel as it has more
than one channel context, e.g., say a 2.4 GHz channel to a 5 GHz virtual
AP interface when the start AP command is sent. This is because the
frequency information is not present in the command.

Add the frequency information into the start AP netlink command so that
the kernel maps the appropriate channel context by parsing it instead of
using a previous set channel information.

Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
src/drivers/driver_nl80211.c

index 58978f7f2c754e537b65fd50a7f5a852cc71448b..4db29f1d52df1c8d9c24bbf1b5023a70de3bd064 100644 (file)
@@ -173,6 +173,8 @@ static int nl80211_send_frame_cmd(struct i802_bss *bss,
                                  const u16 *csa_offs, size_t csa_offs_len);
 static int wpa_driver_nl80211_probe_req_report(struct i802_bss *bss,
                                               int report);
+static int nl80211_put_freq_params(struct nl_msg *msg,
+                                  const struct hostapd_freq_params *freq);
 
 #define IFIDX_ANY -1
 
@@ -4948,6 +4950,9 @@ static int wpa_driver_nl80211_set_ap(void *priv,
                nla_nest_end(msg, spr);
        }
 
+       if (params->freq && nl80211_put_freq_params(msg, params->freq) < 0)
+               goto fail;
+
        if (params->freq && params->freq->he_enabled) {
                struct nlattr *bss_color;