On Thu, 9 Jan 2025, Adrian Chadd wrote:

The branch main has been updated by adrian:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=912a05670ed9545a1d1b010eedafb819e14eb1b8

commit 912a05670ed9545a1d1b010eedafb819e14eb1b8
Author:     Adrian Chadd <adr...@freebsd.org>
AuthorDate: 2024-12-16 02:29:33 +0000
Commit:     Adrian Chadd <adr...@freebsd.org>
CommitDate: 2025-01-09 00:51:51 +0000

   net80211: add helper functions for VHT transmit

   * Add static helper functions for VHT TX for 20MHz, 40MHz and 80MHz.
   * Add a public function to check if the given VHT width is available
     for transmit.

   Differential Revision:  https://reviews.freebsd.org/D48101
---
sys/net80211/ieee80211_vht.c | 137 +++++++++++++++++++++++++++++++++++++++++++
sys/net80211/ieee80211_vht.h |   4 ++
2 files changed, 141 insertions(+)

diff --git a/sys/net80211/ieee80211_vht.c b/sys/net80211/ieee80211_vht.c
index a05beb91216f..82879f90c67b 100644
--- a/sys/net80211/ieee80211_vht.c
+++ b/sys/net80211/ieee80211_vht.c
@@ -873,3 +873,140 @@ ieee80211_vht_get_vhtinfo_ie(struct ieee80211_node *ni,
+bool
+ieee80211_vht_check_tx_bw(const struct ieee80211_node *ni,
+    enum ieee80211_sta_rx_bw bw)
+{
+
+       switch (bw) {
+       case IEEE80211_STA_RX_BW_20:
+               return (ieee80211_vht_check_tx_vht(ni));
+       case IEEE80211_STA_RX_BW_40:
+               return (ieee80211_vht_check_tx_vht40(ni));
+       case IEEE80211_STA_RX_BW_80:
+               return (ieee80211_vht_check_tx_vht80(ni));
+       case IEEE80211_STA_RX_BW_160:
+               return (ieee80211_vht_check_tx_vht160(ni));
+       case IEEE80211_STA_RX_BW_320:
+               return (false);
+       default:
+               return (false);
+       }


You should be able to remove the default case and that'll mean we'll get
compiler errors if we add another BW fields in the future and don't
handle it ("check this place and implement it" warnings for free).

/bz

--
Bjoern A. Zeeb                                                     r15:7

Reply via email to