From b3921db426eaba1468973cd8b5a1d8dd093151b3 Mon Sep 17 00:00:00 2001 From: Harshitha Prem <quic_hprem@quicinc.com> Date: Wed, 22 Feb 2023 09:29:01 +0530 Subject: [PATCH] nl80211: Add frequency info in start AP command 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 58978f7f2..4db29f1d5 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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;