From 86f1d1d9b34556d027f8f8c4ee41f4bc22efcc10 Mon Sep 17 00:00:00 2001 From: Ananya Barat Date: Mon, 3 Aug 2020 16:36:27 +0530 Subject: [PATCH] qcacmn: Allow all bands in DFS chanwidth check With the current implementation, the chanwidth of the Agile channel (for both PreCAC/RCAC) is the same as (or less than) as the chanwidth of DFS curchan. The width of the DFS curchan is determined in the function dfs_find_curchwidth_and_center_chan_for_freq which calls a macro WLAN_IS_CHAN_11AXA_HE80 for 80 MHz which checks if the channel is a 5G channel and 80 MHz. As a result, for wideband (i.e radio has both 5 and 6Ghz channels), if the curchan is a 6GHz channel this check fails which leads to invalid chanwidth and RCAC does not start. Fix this by checking the chanwidth of the DFS curchan for both 5GHz and 6GHz in case of 11AX. Change-Id: I9aef64cea1d442fc31b2314da08baba7769650f2 --- umac/dfs/core/src/dfs_channel.h | 57 ++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/umac/dfs/core/src/dfs_channel.h b/umac/dfs/core/src/dfs_channel.h index f6a1579e5b31..d2621d342073 100644 --- a/umac/dfs/core/src/dfs_channel.h +++ b/umac/dfs/core/src/dfs_channel.h @@ -35,6 +35,9 @@ /* 5 GHz spectrum channel */ #define WLAN_CHAN_5GHZ 0x0000000000000100 +/* 6 GHz spectrum channel */ +#define WLAN_CHAN_6GHZ 0x0000001000000000 + /* Radar found on channel */ #define WLAN_CHAN_DFS_RADAR 0x0000000000001000 @@ -193,44 +196,74 @@ #define WLAN_CHAN_11AXA_HE20 \ (WLAN_CHAN_5GHZ | WLAN_CHAN_HE20) +#define WLAN_CHAN_11AXA_HE20_6G \ + (WLAN_CHAN_6GHZ | WLAN_CHAN_HE20) + #define WLAN_CHAN_11AXA_HE40PLUS \ (WLAN_CHAN_5GHZ | WLAN_CHAN_HE40PLUS) +#define WLAN_CHAN_11AXA_HE40PLUS_6G \ + (WLAN_CHAN_6GHZ | WLAN_CHAN_HE40PLUS) + #define WLAN_CHAN_11AXA_HE40MINUS \ (WLAN_CHAN_5GHZ | WLAN_CHAN_HE40MINUS) +#define WLAN_CHAN_11AXA_HE40MINUS_6G \ + (WLAN_CHAN_6GHZ | WLAN_CHAN_HE40MINUS) + #define WLAN_CHAN_11AXA_HE80 \ (WLAN_CHAN_5GHZ | WLAN_CHAN_HE80) +#define WLAN_CHAN_11AXA_HE80_6G \ + (WLAN_CHAN_6GHZ | WLAN_CHAN_HE80) + #define WLAN_CHAN_11AXA_HE160 \ (WLAN_CHAN_5GHZ | WLAN_CHAN_HE160) +#define WLAN_CHAN_11AXA_HE160_6G \ + (WLAN_CHAN_6GHZ | WLAN_CHAN_HE160) + #define WLAN_CHAN_11AXA_HE80_80 \ (WLAN_CHAN_5GHZ | WLAN_CHAN_HE80_80) +#define WLAN_CHAN_11AXA_HE80_80_6G \ + (WLAN_CHAN_6GHZ | WLAN_CHAN_HE80_80) + #define WLAN_IS_CHAN_11AXA_HE20(_c) \ - (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE20) == \ - WLAN_CHAN_11AXA_HE20) + ((((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE20) == \ + WLAN_CHAN_11AXA_HE20) || \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE20_6G) == \ + WLAN_CHAN_11AXA_HE20_6G)) #define WLAN_IS_CHAN_11AXA_HE40PLUS(_c) \ - (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE40PLUS) == \ - WLAN_CHAN_11AXA_HE40PLUS) + ((((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE40PLUS) == \ + WLAN_CHAN_11AXA_HE40PLUS) || \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE40PLUS_6G) == \ + WLAN_CHAN_11AXA_HE40PLUS_6G)) #define WLAN_IS_CHAN_11AXA_HE40MINUS(_c) \ - (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE40MINUS) == \ - WLAN_CHAN_11AXA_HE40MINUS) + ((((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE40MINUS) == \ + WLAN_CHAN_11AXA_HE40MINUS) || \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE40MINUS_6G) == \ + WLAN_CHAN_11AXA_HE40MINUS_6G)) #define WLAN_IS_CHAN_11AXA_HE80(_c) \ - (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE80) == \ - WLAN_CHAN_11AXA_HE80) + ((((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE80) == \ + WLAN_CHAN_11AXA_HE80) || \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE80_6G) == \ + WLAN_CHAN_11AXA_HE80_6G)) #define WLAN_IS_CHAN_11AXA_HE160(_c) \ - (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE160) == \ - WLAN_CHAN_11AXA_HE160) + ((((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE160) == \ + WLAN_CHAN_11AXA_HE160) || \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE160_6G) == \ + WLAN_CHAN_11AXA_HE160_6G)) #define WLAN_IS_CHAN_11AXA_HE80_80(_c) \ - (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE80_80) == \ - WLAN_CHAN_11AXA_HE80_80) + ((((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE80_80) == \ + WLAN_CHAN_11AXA_HE80_80) || \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE80_80_6G) == \ + WLAN_CHAN_11AXA_HE80_80_6G)) #define WLAN_IS_CHAN_DFS(_c) \ (((_c)->dfs_ch_flagext & \