Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Jan 2025 23:42:39 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        Adrian Chadd <adrian@FreeBSD.org>
Cc:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org,  dev-commits-src-main@FreeBSD.org
Subject:   Re: git: 912a05670ed9 - main - net80211: add helper functions  for VHT transmit
Message-ID:  <4n262snp-q102-67q2-7q11-7qp1qp7rnn25@SerrOFQ.bet>
In-Reply-To: <202501090059.5090xBuW075394@gitrepo.freebsd.org>
References:  <202501090059.5090xBuW075394@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <adrian@FreeBSD.org>
> AuthorDate: 2024-12-16 02:29:33 +0000
> Commit:     Adrian Chadd <adrian@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4n262snp-q102-67q2-7q11-7qp1qp7rnn25>