diff mbox series

band: fix HT40+/- checks when creating chandef

Message ID 20230404155640.133794-1-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series band: fix HT40+/- checks when creating chandef | expand

Commit Message

James Prestwood April 4, 2023, 3:56 p.m. UTC
The HT40+/- flags were reversed when checking against the 802.11
behavior flags.

HT40+ means the secondary channel is above (+) the primary channel
therefore corresponds to the PRIMARY_CHANNEL_LOWER behavior. And
the opposite for HT40-.

Reported-By: Alagu Sankar <alagusankar@gmail.com>
---
 src/band.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Denis Kenzior April 9, 2023, 4:36 p.m. UTC | #1
Hi James,

On 4/4/23 10:56, James Prestwood wrote:
> The HT40+/- flags were reversed when checking against the 802.11
> behavior flags.
> 
> HT40+ means the secondary channel is above (+) the primary channel
> therefore corresponds to the PRIMARY_CHANNEL_LOWER behavior. And
> the opposite for HT40-.
> 
> Reported-By: Alagu Sankar <alagusankar@gmail.com>
> ---
>   src/band.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 

Applied, thanks.

Regards,
-Denis
diff mbox series

Patch

diff --git a/src/band.c b/src/band.c
index 27b4d174..486df6e1 100644
--- a/src/band.c
+++ b/src/band.c
@@ -1229,11 +1229,11 @@  int band_freq_to_ht_chandef(uint32_t freq, const struct band_freq_attrs *attr,
 			if (band == BAND_FREQ_6_GHZ)
 				break;
 
-			if (info->flags & PRIMARY_CHANNEL_UPPER &&
+			if (info->flags & PRIMARY_CHANNEL_LOWER &&
 						attr->no_ht40_plus)
 				continue;
 
-			if (info->flags & PRIMARY_CHANNEL_LOWER &&
+			if (info->flags & PRIMARY_CHANNEL_UPPER &&
 						attr->no_ht40_minus)
 				continue;