Explorar o código

qcacmn: Reorder and optimize channel mode macros

Reorder channel mode macros to have macros in logical
order, and to optimize the channel modes to use
bit specific enums instead of single bit to reduce
the usage of number of bits. The changes are specific
to host

Example for Channel mode: IEEE80211_CHAN_HE20
Channel modes represents only the information regarding
to channel such as band, width, passive, DFS, blocked
40MHz_intolerant and so. It doesn't have information
regarding hwmode like 11ac,11ax.

CRs-Fixed: 2846331
Change-Id: I197de032a4d677a27b46028fa090a6eabe0c6086
Surya Prakash Raajen %!s(int64=4) %!d(string=hai) anos
pai
achega
21e219fe2f

+ 0 - 5
umac/dfs/core/src/dfs.h

@@ -296,11 +296,6 @@
  */
 #define CHANNEL_INTERFERENCE    0x01
 
-#define CHANNEL_2GHZ      0x00080 /* 2 GHz spectrum channel. */
-#define CHANNEL_OFDM      0x00040 /* OFDM channel */
-#define CHANNEL_TURBO     0x00010 /* Turbo Channel */
-#define CHANNEL_108G (CHANNEL_2GHZ|CHANNEL_OFDM|CHANNEL_TURBO)
-
 /* qdf_packed - denotes structure is packed. */
 #define qdf_packed __qdf_packed
 

+ 338 - 17
umac/dfs/core/src/dfs_channel.h

@@ -25,6 +25,309 @@
 #define _DFS_CHANNEL_H_
 
 /* Channel attributes */
+#ifdef WLAN_COMP_CHAN_MODE
+
+#define WLAN_CHAN_20MHZ            0x0000000000000100
+
+#define WLAN_CHAN_40PLUS           0x0000000000000200
+
+#define WLAN_CHAN_40MINUS          0x0000000000000300
+
+#define WLAN_CHAN_80MHZ            0x0000000000000400
+
+#define WLAN_CHAN_160MHZ           0x0000000000000500
+
+#define WLAN_CHAN_80_80MHZ         0x0000000000000600
+
+#define WLAN_CHAN_HTCAP            0x0000000000001000
+
+#define WLAN_CHAN_VHTCAP           0x0000000000002000
+
+#define WLAN_CHAN_HECAP            0x0000000000003000
+
+/* 2 GHz spectrum channel. */
+#define WLAN_CHAN_2GHZ             0x0000000000000010
+
+/* 5 GHz spectrum channel */
+#define WLAN_CHAN_5GHZ             0x0000000000000020
+
+/* 6 GHz spectrum channel */
+#define WLAN_CHAN_6GHZ             0x0000000000000030
+
+/* HT 20 channel */
+#define WLAN_CHAN_HT20             (WLAN_CHAN_HTCAP | WLAN_CHAN_20MHZ)
+
+/* HT 40 with extension channel above */
+#define WLAN_CHAN_HT40PLUS         (WLAN_CHAN_HTCAP | WLAN_CHAN_40PLUS)
+
+/* HT 40 with extension channel below */
+#define WLAN_CHAN_HT40MINUS        (WLAN_CHAN_HTCAP | WLAN_CHAN_40MINUS)
+
+/* VHT 20 channel */
+#define WLAN_CHAN_VHT20            (WLAN_CHAN_VHTCAP | WLAN_CHAN_20MHZ)
+
+/* VHT 40 with extension channel above */
+#define WLAN_CHAN_VHT40PLUS        (WLAN_CHAN_VHTCAP | WLAN_CHAN_40PLUS)
+
+/* VHT 40 with extension channel below */
+#define WLAN_CHAN_VHT40MINUS       (WLAN_CHAN_VHTCAP | WLAN_CHAN_40MINUS)
+
+/* VHT 80 channel */
+#define WLAN_CHAN_VHT80            (WLAN_CHAN_VHTCAP | WLAN_CHAN_80MHZ)
+
+/* VHT 160 channel */
+#define WLAN_CHAN_VHT160           (WLAN_CHAN_VHTCAP | WLAN_CHAN_160MHZ)
+
+/* VHT 80_80 channel */
+#define WLAN_CHAN_VHT80_80         (WLAN_CHAN_VHTCAP | WLAN_CHAN_80_80MHZ)
+
+/* HE 20 channel */
+#define WLAN_CHAN_HE20             (WLAN_CHAN_HECAP | WLAN_CHAN_20MHZ)
+
+/* HE 40 with extension channel above */
+#define WLAN_CHAN_HE40PLUS         (WLAN_CHAN_HECAP | WLAN_CHAN_40PLUS)
+
+/* HE 40 with extension channel below */
+#define WLAN_CHAN_HE40MINUS        (WLAN_CHAN_HECAP | WLAN_CHAN_40MINUS)
+
+/* HE 80 channel */
+#define WLAN_CHAN_HE80             (WLAN_CHAN_HECAP | WLAN_CHAN_80MHZ)
+
+/* HE 160 channel */
+#define WLAN_CHAN_HE160            (WLAN_CHAN_HECAP | WLAN_CHAN_160MHZ)
+
+/* HE 80_80 channel */
+#define WLAN_CHAN_HE80_80          (WLAN_CHAN_HECAP | WLAN_CHAN_80_80MHZ)
+
+/* OFDM channel */
+#define WLAN_CHAN_OFDM             0x0000000000400000
+
+/* Turbo Channel */
+#define WLAN_CHAN_TURBO            0x0000000020000000
+
+/* Radar found on channel */
+#define WLAN_CHAN_DFS_RADAR        0x0000000002000000
+
+#define WLAN_CHAN_BAND_MASK        0x00000000000000F0
+
+#define WLAN_CHAN_BW_MASK          0x000000000000FF00
+
+#define WLAN_IS_CHAN_2GHZ(_c)        WLAN_IS_FLAG_2GHZ((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_5GHZ(_c)        WLAN_IS_FLAG_5GHZ((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_6GHZ(_c)        WLAN_IS_FLAG_6GHZ((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_HT20(_c)        WLAN_IS_FLAG_HT20((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_HT40PLUS(_c)    WLAN_IS_FLAG_HT40PLUS((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_HT40MINUS(_c)   WLAN_IS_FLAG_HT40MINUS((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_HT40(_c)        WLAN_IS_FLAG_HT40((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_VHT20(_c)       WLAN_IS_FLAG_VHT20((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_VHT40PLUS(_c)   WLAN_IS_FLAG_VHT40PLUS((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_VHT40MINUS(_c)  WLAN_IS_FLAG_VHT40MINUS((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_VHT40(_c)       WLAN_IS_FLAG_VHT40((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_VHT80(_c)       WLAN_IS_FLAG_VHT80((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_VHT160(_c)      WLAN_IS_FLAG_VHT160((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_VHT80_80(_c)    WLAN_IS_FLAG_VHT80_80((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_VHT40(_c)       WLAN_IS_FLAG_VHT40((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_HE20(_c)        WLAN_IS_FLAG_HE20((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_HE40PLUS(_c)    WLAN_IS_FLAG_HE40PLUS((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_HE40MINUS(_c)   WLAN_IS_FLAG_HE40MINUS((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_HE40(_c)        WLAN_IS_FLAG_HE40((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_HE80(_c)        WLAN_IS_FLAG_HE80((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_HE160(_c)       WLAN_IS_FLAG_HE160((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_HE80_80(_c)     WLAN_IS_FLAG_HE80_80((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_OFDM(_c)        WLAN_IS_FLAG_OFDM((_c)->dfs_ch_flags)
+
+#define WLAN_IS_CHAN_TURBO(_c)       WLAN_IS_FLAG_TURBO((_c)->dfs_ch_flags)
+
+#define WLAN_IS_FLAG_2GHZ(_flag) \
+	(((_flag) & WLAN_CHAN_BAND_MASK) == WLAN_CHAN_2GHZ)
+
+#define WLAN_IS_FLAG_5GHZ(_flag) \
+	(((_flag) & WLAN_CHAN_BAND_MASK) == WLAN_CHAN_5GHZ)
+
+#define WLAN_IS_FLAG_6GHZ(_flag) \
+	(((_flag) & WLAN_CHAN_BAND_MASK) == WLAN_CHAN_6GHZ)
+
+#define WLAN_IS_FLAG_HT20(_flag) \
+	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HT20)
+
+#define WLAN_IS_FLAG_HT40PLUS(_flag) \
+	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HT40PLUS)
+
+#define WLAN_IS_FLAG_HT40MINUS(_flag) \
+	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HT40MINUS)
+
+#define WLAN_IS_FLAG_VHT20(_flag) \
+	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_VHT20)
+
+#define WLAN_IS_FLAG_VHT40PLUS(_flag) \
+	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_VHT40PLUS)
+
+#define WLAN_IS_FLAG_VHT40MINUS(_flag) \
+	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_VHT40MINUS)
+
+#define WLAN_IS_FLAG_VHT80(_flag) \
+	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_VHT80)
+
+#define WLAN_IS_FLAG_VHT160(_flag) \
+	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_VHT160)
+
+#define WLAN_IS_FLAG_VHT80_80(_flag) \
+	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_VHT80_80)
+
+#define WLAN_IS_FLAG_HE20(_flag) \
+	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HE20)
+
+#define WLAN_IS_FLAG_HE40PLUS(_flag) \
+	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HE40PLUS)
+
+#define WLAN_IS_FLAG_HE40MINUS(_flag) \
+	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HE40MINUS)
+
+#define WLAN_IS_FLAG_HE80(_flag) \
+	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HE80)
+
+#define WLAN_IS_FLAG_HE160(_flag) \
+	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HE160)
+
+#define WLAN_IS_FLAG_HE80_80(_flag) \
+	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HE80_80)
+
+#define WLAN_IS_FLAG_OFDM(_flag) \
+	((_flag) & WLAN_CHAN_OFDM)
+
+#define WLAN_IS_FLAG_TURBO(_flag) \
+	((_flag) & WLAN_CHAN_TURBO)
+
+#define WLAN_IS_CHAN_11N_HT40(_c) \
+	(WLAN_IS_CHAN_HT40PLUS(_c) || WLAN_IS_CHAN_HT40MINUS(_c))
+
+#define WLAN_IS_CHAN_11N_HT40PLUS(_c) WLAN_IS_CHAN_HT40PLUS(_c)
+
+#define WLAN_IS_CHAN_11N_HT40MINUS(_c) WLAN_IS_CHAN_HT40MINUS(_c)
+
+#define WLAN_IS_CHAN_A(_c) \
+	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_OFDM(_c))
+
+#define WLAN_IS_CHAN_11NA_HT20(_c) \
+	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HT20(_c))
+
+#define WLAN_IS_CHAN_11NA_HT40PLUS(_c) \
+	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HT40PLUS(_c))
+
+#define WLAN_IS_CHAN_11NA_HT40MINUS(_c) \
+	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HT40MINUS(_c))
+
+#define WLAN_IS_CHAN_11AC_VHT20(_c) \
+	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_VHT20(_c))
+
+#define WLAN_IS_CHAN_11AC_VHT40(_c) \
+	(WLAN_IS_CHAN_11AC_VHT40MINUS(_c) || WLAN_IS_CHAN_11AC_VHT40PLUS(_c))
+
+#define WLAN_IS_CHAN_11AC_VHT40PLUS(_c) \
+	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_VHT40PLUS(_c))
+
+#define WLAN_IS_CHAN_11AC_VHT40MINUS(_c) \
+	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_VHT40MINUS(_c))
+
+#define WLAN_IS_CHAN_11AC_VHT80(_c) \
+	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_VHT80(_c))
+
+#define WLAN_IS_CHAN_11AC_VHT160(_c) \
+	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_VHT160(_c))
+
+#define WLAN_IS_CHAN_11AC_VHT80_80(_c) \
+	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_VHT80_80(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE20_5G(_c) \
+	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HE20(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE40_5G(_c) \
+	(WLAN_IS_CHAN_11AXA_HE40MINUS_5G(_c) ||  \
+	 WLAN_IS_CHAN_11AXA_HE40PLUS_5G(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE40PLUS_5G(_c) \
+	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HE40PLUS(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE40MINUS_5G(_c) \
+	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HE40MINUS(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE80_5G(_c) \
+	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HE80(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE160_5G(_c) \
+	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HE160(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE80_80_5G(_c) \
+	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HE80_80(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE20_6G(_c) \
+	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_HE20(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE40_6G(_c) \
+	(WLAN_IS_CHAN_11AXA_HE40MINUS_6G(_c) || \
+	 WLAN_IS_CHAN_11AXA_HE40PLUS_6G(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE40PLUS_6G(_c) \
+	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_HE40PLUS(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE40MINUS_6G(_c) \
+	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_HE40MINUS(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE80_6G(_c) \
+	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_HE80(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE160_6G(_c) \
+	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_HE160(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE80_80_6G(_c) \
+	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_HE80_80(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE20(_c) \
+	(WLAN_IS_CHAN_11AXA_HE20_5G(_c) || WLAN_IS_CHAN_11AXA_HE20_6G(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE40PLUS(_c) \
+	(WLAN_IS_CHAN_11AXA_HE40PLUS_5G(_c) || \
+	 WLAN_IS_CHAN_11AXA_HE40PLUS_6G(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE40MINUS(_c) \
+	(WLAN_IS_CHAN_11AXA_HE40MINUS_5G(_c) || \
+	 WLAN_IS_CHAN_11AXA_HE40MINUS_6G(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE80(_c) \
+	(WLAN_IS_CHAN_11AXA_HE80_5G(_c) || WLAN_IS_CHAN_11AXA_HE80_6G(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE160(_c) \
+	(WLAN_IS_CHAN_11AXA_HE160_5G(_c) || WLAN_IS_CHAN_11AXA_HE160_6G(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE80_80(_c) \
+	(WLAN_IS_CHAN_11AXA_HE80_80_5G(_c) || WLAN_IS_CHAN_11AXA_HE80_80_6G(_c))
+
+#define WLAN_IS_CHAN_11AXA_HE80_80(_c) \
+	(WLAN_IS_CHAN_11AXA_HE80_80_5G(_c) || WLAN_IS_CHAN_11AXA_HE80_80_6G(_c))
+
+#else
 
 /* OFDM channel */
 #define WLAN_CHAN_OFDM             0x0000000000000040
@@ -86,23 +389,8 @@
 /* HE 80_80 channel */
 #define WLAN_CHAN_HE80_80          0x0000000800000000
 
-/* flagext */
-#define WLAN_CHAN_DFS_RADAR_FOUND    0x01
-
-/* DFS required on channel */
-#define WLAN_CHAN_DFS              0x0002
-
-/* DFS required on channel for 2nd band of 80+80*/
-#define WLAN_CHAN_DFS_CFREQ2       0x0004
-
-/* if channel has been checked for DFS */
-#define WLAN_CHAN_DFS_CLEAR        0x0008
-
-/* DFS radar history for slave device(STA mode) */
-#define WLAN_CHAN_HISTORY_RADAR    0x0100
-
-/* DFS CAC valid for  slave device(STA mode) */
-#define WLAN_CHAN_CAC_VALID        0x0200
+/* Turbo Channel */
+#define WLAN_CHAN_TURBO            0x0000000000000010
 
 #define WLAN_IS_CHAN_2GHZ(_c) \
 	(((_c)->dfs_ch_flags & WLAN_CHAN_2GHZ) != 0)
@@ -229,6 +517,9 @@
 #define WLAN_CHAN_11AXA_HE80_80_6G \
 	(WLAN_CHAN_6GHZ | WLAN_CHAN_HE80_80)
 
+#define WLAN_CHAN_108G \
+	(WLAN_CHAN_2GHZ | WLAN_CHAN_OFDM | WLAN_CHAN_TURBO)
+
 #define WLAN_IS_CHAN_11AXA_HE20(_c) \
 	((((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE20) == \
 	 WLAN_CHAN_11AXA_HE20) || \
@@ -265,6 +556,35 @@
 	 (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE80_80_6G) == \
 	  WLAN_CHAN_11AXA_HE80_80_6G))
 
+#define WLAN_IS_CHAN_TURBO(_c) \
+	(((_c)->dfs_ch_flags & WLAN_CHAN_TURBO) != 0)
+
+#endif /* WLAN_COMP_CHAN_MODE */
+
+#define WLAN_CHAN_108G \
+	(WLAN_CHAN_2GHZ | WLAN_CHAN_OFDM | WLAN_CHAN_TURBO)
+
+#define WLAN_IS_CHAN_108G(_c) \
+	(((_c)->dfs_ch_flags & WLAN_CHAN_108G) == WLAN_CHAN_108G)
+
+/* flagext */
+#define WLAN_CHAN_DFS_RADAR_FOUND    0x01
+
+/* DFS required on channel */
+#define WLAN_CHAN_DFS              0x0002
+
+/* DFS required on channel for 2nd band of 80+80*/
+#define WLAN_CHAN_DFS_CFREQ2       0x0004
+
+/* if channel has been checked for DFS */
+#define WLAN_CHAN_DFS_CLEAR        0x0008
+
+/* DFS radar history for slave device(STA mode) */
+#define WLAN_CHAN_HISTORY_RADAR    0x0100
+
+/* DFS CAC valid for  slave device(STA mode) */
+#define WLAN_CHAN_CAC_VALID        0x0200
+
 #define WLAN_IS_CHAN_DFS(_c) \
 	(((_c)->dfs_ch_flagext & \
 	(WLAN_CHAN_DFS | WLAN_CHAN_DFS_CLEAR)) == WLAN_CHAN_DFS)
@@ -293,6 +613,7 @@
 #define WLAN_IS_CHAN_HISTORY_RADAR(_dfs, _c)    \
 	(((_c)->dfs_ch_flagext & WLAN_CHAN_HISTORY_RADAR) == \
 	WLAN_CHAN_HISTORY_RADAR)
+
 #endif
 
 #define WLAN_CHAN_CLR_HISTORY_RADAR(_c)    \

+ 1 - 2
umac/dfs/core/src/filtering/dfs_fcc_bin5.c

@@ -52,9 +52,8 @@ int dfs_bin5_check_pulse(struct wlan_dfs *dfs, struct dfs_event *re,
 		return 0;
 	}
 
-#define CHANNEL_TURBO 0x00010
 	/* Adjust the filter threshold for rssi in non TURBO mode. */
-	if (!(dfs->dfs_curchan->dfs_ch_flags & CHANNEL_TURBO))
+	if (!WLAN_IS_CHAN_TURBO(dfs->dfs_curchan))
 		b5_rssithresh += br->br_pulse.b5_rssimargin;
 
 	/* Check if the pulse is within duration and rssi thresholds. */

+ 3 - 4
umac/dfs/core/src/filtering/dfs_phyerr_tlv.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012, 2016-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -481,11 +481,10 @@ static int dfs_tlv_calc_freq_info(struct wlan_dfs *dfs,
 
 		/* Calculate offset based on HT40U/HT40D and VHT40U/VHT40D. */
 		if (WLAN_IS_CHAN_11N_HT40PLUS(dfs->dfs_curchan) ||
-		    (dfs->dfs_curchan->dfs_ch_flags & WLAN_CHAN_VHT40PLUS))
+		    WLAN_IS_CHAN_VHT40PLUS(dfs->dfs_curchan))
 			chan_offset = chan_width;
 		else if (WLAN_IS_CHAN_11N_HT40MINUS(dfs->dfs_curchan) ||
-			 (dfs->dfs_curchan->dfs_ch_flags &
-			  WLAN_CHAN_VHT40MINUS))
+			  WLAN_IS_CHAN_VHT40MINUS(dfs->dfs_curchan))
 			chan_offset = -chan_width;
 		else
 			chan_offset = 0;

+ 1 - 1
umac/dfs/core/src/filtering/dfs_process_phyerr.c

@@ -727,7 +727,7 @@ void dfs_process_phyerr(struct wlan_dfs *dfs, void *buf, uint16_t datalen,
 	 * If the channel is a turbo G channel, then the event is for the
 	 * adaptive radio (AR) pattern matching rather than radar detection.
 	 */
-	if ((dfs->dfs_curchan->dfs_ch_flags & CHANNEL_108G) == CHANNEL_108G) {
+	if (WLAN_IS_CHAN_108G(dfs->dfs_curchan)) {
 		if (!(dfs->dfs_proc_phyerr & DFS_AR_EN)) {
 			dfs_debug(dfs, WLAN_DEBUG_DFS2,
 				"DFS_AR_EN not enabled");