From 4942b19fff2fb0eeffdd7fc6d4d5486e9542c2ab Mon Sep 17 00:00:00 2001 From: Aloka Dixit Date: Mon, 13 Mar 2023 21:59:19 -0700 Subject: [PATCH] EHT: Send puncturing bitmap to the driver for AP bring up Send the user configured puncturing bitmap to the driver. Signed-off-by: Aloka Dixit Signed-off-by: Muna Sinada --- src/ap/beacon.c | 4 ++++ src/drivers/driver.h | 8 ++++++++ src/drivers/driver_nl80211.c | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index ec7ca7fc6..c25a5bbc3 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -2101,6 +2101,10 @@ static int __ieee802_11_set_beacon(struct hostapd_data *hapd) params.fd_frame_tmpl = hostapd_fils_discovery(hapd, ¶ms); #endif /* CONFIG_FILS */ +#ifdef CONFIG_IEEE80211BE + params.punct_bitmap = iconf->punct_bitmap; +#endif /* CONFIG_IEEE80211BE */ + if (cmode && hostapd_set_freq_params(&freq, iconf->hw_mode, iface->freq, iconf->channel, iconf->enable_edmg, diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 64b71a51c..a3ce31f60 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1713,6 +1713,14 @@ struct wpa_driver_ap_params { * ema - Enhanced MBSSID advertisements support. */ bool ema; + + /** + * punct_bitmap - Preamble puncturing bitmap + * Each bit corresponds to a 20 MHz subchannel, the lowest bit for the + * channel with the lowest frequency. A bit set to 1 indicates that the + * subchannel is punctured, otherwise active. + */ + u16 punct_bitmap; }; struct wpa_driver_mesh_bss_params { diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index db1d73f2f..edbecc7e8 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -5045,6 +5045,14 @@ static int wpa_driver_nl80211_set_ap(void *priv, goto fail; #endif /* CONFIG_FILS */ + if (params->punct_bitmap) { + wpa_printf(MSG_DEBUG, "nl80211: Puncturing bitmap=0x%04x", + params->punct_bitmap); + if (nla_put_u32(msg, NL80211_ATTR_PUNCT_BITMAP, + params->punct_bitmap)) + goto fail; + } + ret = send_and_recv_msgs_connect_handle(drv, msg, bss, 1); if (ret) { wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)",