diff --git a/umac/dfs/core/src/dfs.h b/umac/dfs/core/src/dfs.h index 8b64f2c32f5f..633567c21d98 100644 --- a/umac/dfs/core/src/dfs.h +++ b/umac/dfs/core/src/dfs.h @@ -557,7 +557,7 @@ struct dfs_filtertype { }; /** - * struct dfs_ieee80211_channel - Channel structure for dfs component. + * struct dfs_channel - Channel structure for dfs component. * @dfs_ch_freq: Frequency in Mhz. * @dfs_ch_flags: Channel flags. * @dfs_ch_flagext: Extended channel flags. @@ -566,7 +566,7 @@ struct dfs_filtertype { * @dfs_ch_vhtop_ch_freq_seg2: Channel Center frequency applicable for 80+80MHz * mode of operation. */ -struct dfs_ieee80211_channel { +struct dfs_channel { uint16_t dfs_ch_freq; uint64_t dfs_ch_flags; uint16_t dfs_ch_flagext; @@ -583,7 +583,7 @@ struct dfs_ieee80211_channel { * @rs_param: Phy param. */ struct dfs_state { - struct dfs_ieee80211_channel rs_chan; + struct dfs_channel rs_chan; uint8_t rs_chanindex; uint32_t rs_numradarevents; struct wlan_dfs_phyerr_param rs_param; @@ -773,7 +773,6 @@ struct dfs_event_log { * @dfs_extchan_radindex: Extension channel radar index. * @dfsdomain: cur. DFS domain. * @dfs_proc_phyerr: Flags for Phy Errs to process. - * @ic: pointer to ieee80211com structure. * @dfs_eventq: Q of free dfs event objects. * @dfs_eventqlock: Lock for free dfs event list. * @dfs_radarq: Q of radar events. @@ -861,7 +860,6 @@ struct wlan_dfs { int16_t dfs_extchan_radindex; uint32_t dfsdomain; uint32_t dfs_proc_phyerr; - struct ieee80211com *ic; STAILQ_HEAD(, dfs_event) dfs_eventq; spinlock_t dfs_eventqlock; @@ -941,7 +939,7 @@ struct wlan_dfs { TAILQ_HEAD(, dfs_precac_entry) dfs_precac_required_list; TAILQ_HEAD(, dfs_precac_entry) dfs_precac_done_list; TAILQ_HEAD(, dfs_precac_entry) dfs_precac_nol_list; - struct dfs_ieee80211_channel *dfs_curchan; + struct dfs_channel *dfs_curchan; struct wlan_objmgr_pdev *dfs_pdev_obj; bool dfs_is_offload_enabled; int dfs_use_nol; @@ -1149,7 +1147,7 @@ struct rx_search_fft_report { * was a radar. */ void dfs_process_radarevent(struct wlan_dfs *dfs, - struct dfs_ieee80211_channel *chan); + struct dfs_channel *chan); /** * dfs_nol_addchan() - Add channel to NOL. @@ -1449,7 +1447,7 @@ int dfs_get_filter_threshold(struct wlan_dfs *dfs, * @chan: Current channel structure. */ void dfs_process_ar_event(struct wlan_dfs *dfs, - struct dfs_ieee80211_channel *chan); + struct dfs_channel *chan); /** * dfs_reset_ar() - resets the ar state. @@ -1667,7 +1665,7 @@ int dfs_override_cac_timeout(struct wlan_dfs *dfs, int cac_timeout); /** - * dfs_clear_nolhistory() - unmarks IEEE80211_CHAN_CLR_HISTORY_RADAR flag for + * dfs_clear_nolhistory() - unmarks WLAN_CHAN_CLR_HISTORY_RADAR flag for * all the channels in dfs_ch_channels. * @dfs: Pointer to wlan_dfs structure. */ @@ -1796,7 +1794,7 @@ void dfs_stacac_stop(struct wlan_dfs *dfs); * @chan: Pointer to dfs channel structure. */ void dfs_find_precac_secondary_vht80_chan(struct wlan_dfs *dfs, - struct dfs_ieee80211_channel *chan); + struct dfs_channel *chan); /** * dfs_phyerr_param_copy() - Function to copy src buf to dest buf. @@ -2037,5 +2035,5 @@ void dfs_send_csa_to_current_chan(struct wlan_dfs *dfs); * return 1. */ int dfs_radarevent_basic_sanity(struct wlan_dfs *dfs, - struct dfs_ieee80211_channel *chan); + struct dfs_channel *chan); #endif /* _DFS_H_ */ diff --git a/umac/dfs/core/src/dfs_channel.h b/umac/dfs/core/src/dfs_channel.h index a377073d4b25..8a44a6204de3 100644 --- a/umac/dfs/core/src/dfs_channel.h +++ b/umac/dfs/core/src/dfs_channel.h @@ -21,656 +21,273 @@ * DOC: This file has channel related information. */ -#ifndef _NET80211__IEEE80211_H_ -#define _NET80211__IEEE80211_H_ - -/** - * enum ieee80211_phymode - Phymodes. - * @IEEE80211_MODE_AUTO: autoselect. - * @IEEE80211_MODE_11A: 5GHz, OFDM - * @IEEE80211_MODE_11B: 2GHz, CCK - * @IEEE80211_MODE_11G: 2GHz, OFDM - * @IEEE80211_MODE_FH: 2GHz, GFSK - * @IEEE80211_MODE_TURBO_A: 5GHz, OFDM, 2x clock dynamic turbo - * @IEEE80211_MODE_TURBO_G: 2GHz, OFDM, 2x clock dynamic turbo - * @IEEE80211_MODE_11NA_HT20: 5Ghz, HT20 - * @IEEE80211_MODE_11NG_HT20: 2Ghz, HT20 - * @IEEE80211_MODE_11NA_HT40PLUS: 5Ghz, HT40 (ext ch +1) - * @IEEE80211_MODE_11NA_HT40MINUS: 5Ghz, HT40 (ext ch -1) - * @IEEE80211_MODE_11NG_HT40PLUS: 2Ghz, HT40 (ext ch +1) - * @IEEE80211_MODE_11NG_HT40MINUS: 2Ghz, HT40 (ext ch -1) - * @IEEE80211_MODE_11NG_HT40: 2Ghz, Auto HT40. - * @IEEE80211_MODE_11NA_HT40: 5Ghz, Auto HT40 - * @IEEE80211_MODE_11AC_VHT20: 5Ghz, VHT20 - * @IEEE80211_MODE_11AC_VHT40PLUS: 5Ghz, VHT40 (Ext ch +1) - * @IEEE80211_MODE_11AC_VHT40MINUS: 5Ghz VHT40 (Ext ch -1) - * @IEEE80211_MODE_11AC_VHT40: 5Ghz, VHT40 - * @IEEE80211_MODE_11AC_VHT80: 5Ghz, VHT80 - * @IEEE80211_MODE_11AC_VHT160: 5Ghz, VHT160 - * @IEEE80211_MODE_11AC_VHT80_80: 5Ghz, VHT80_80 - */ -enum ieee80211_phymode { - IEEE80211_MODE_AUTO = 0, - IEEE80211_MODE_11A = 1, - IEEE80211_MODE_11B = 2, - IEEE80211_MODE_11G = 3, - IEEE80211_MODE_FH = 4, - IEEE80211_MODE_TURBO_A = 5, - IEEE80211_MODE_TURBO_G = 6, - IEEE80211_MODE_11NA_HT20 = 7, - IEEE80211_MODE_11NG_HT20 = 8, - IEEE80211_MODE_11NA_HT40PLUS = 9, - IEEE80211_MODE_11NA_HT40MINUS = 10, - IEEE80211_MODE_11NG_HT40PLUS = 11, - IEEE80211_MODE_11NG_HT40MINUS = 12, - IEEE80211_MODE_11NG_HT40 = 13, - IEEE80211_MODE_11NA_HT40 = 14, - IEEE80211_MODE_11AC_VHT20 = 15, - IEEE80211_MODE_11AC_VHT40PLUS = 16, - IEEE80211_MODE_11AC_VHT40MINUS = 17, - IEEE80211_MODE_11AC_VHT40 = 18, - IEEE80211_MODE_11AC_VHT80 = 19, - IEEE80211_MODE_11AC_VHT160 = 20, - IEEE80211_MODE_11AC_VHT80_80 = 21, -}; -#define IEEE80211_MODE_MAX (IEEE80211_MODE_11AC_VHT80_80 + 1) - -/** - * enum dfs_ieee80211_opmode - Device opmode. - * @IEEE80211_M_STA: Infrastructure station - * @IEEE80211_M_IBSS: IBSS (adhoc) station - * @IEEE80211_M_HOSTAP: Software Access Point - * - * opmode value should be same as mlme ieee80211_opmode enum. - */ -enum dfs_ieee80211_opmode { - IEEE80211_M_STA = 1, - IEEE80211_M_IBSS = 0, - IEEE80211_M_HOSTAP = 6, -}; +#ifndef _DFS_CHANNEL_H_ +#define _DFS_CHANNEL_H_ /* Channel attributes */ -/* Turbo channel */ -#define IEEE80211_CHAN_TURBO 0x00000010 - -/* CCK channel */ -#define IEEE80211_CHAN_CCK 0x00000020 /* OFDM channel */ -#define IEEE80211_CHAN_OFDM 0x00000040 +#define WLAN_CHAN_OFDM 0x0000000000000040 /* 2 GHz spectrum channel. */ -#define IEEE80211_CHAN_2GHZ 0x00000080 +#define WLAN_CHAN_2GHZ 0x0000000000000080 /* 5 GHz spectrum channel */ -#define IEEE80211_CHAN_5GHZ 0x00000100 - -/* Only passive scan allowed */ -#define IEEE80211_CHAN_PASSIVE 0x00000200 - -/* Dynamic CCK-OFDM channel */ -#define IEEE80211_CHAN_DYN 0x00000400 - -/* GFSK channel (FHSS PHY) */ -#define IEEE80211_CHAN_GFSK 0x00000800 +#define WLAN_CHAN_5GHZ 0x0000000000000100 /* Radar found on channel */ -#define IEEE80211_CHAN_DFS_RADAR 0x00001000 - -/* 11a static turbo channel only */ -#define IEEE80211_CHAN_STURBO 0x00002000 - -/* Half rate channel */ -#define IEEE80211_CHAN_HALF 0x00004000 - -/* Quarter rate channel */ -#define IEEE80211_CHAN_QUARTER 0x00008000 +#define WLAN_CHAN_DFS_RADAR 0x0000000000001000 /* HT 20 channel */ -#define IEEE80211_CHAN_HT20 0x00010000 +#define WLAN_CHAN_HT20 0x0000000000010000 /* HT 40 with extension channel above */ -#define IEEE80211_CHAN_HT40PLUS 0x00020000 +#define WLAN_CHAN_HT40PLUS 0x0000000000020000 /* HT 40 with extension channel below */ -#define IEEE80211_CHAN_HT40MINUS 0x00040000 - -/* HT 40 Intolerant */ -#define IEEE80211_CHAN_HT40INTOL 0x00080000 +#define WLAN_CHAN_HT40MINUS 0x0000000000040000 /* VHT 20 channel */ -#define IEEE80211_CHAN_VHT20 0x00100000 +#define WLAN_CHAN_VHT20 0x0000000000100000 /* VHT 40 with extension channel above */ -#define IEEE80211_CHAN_VHT40PLUS 0x00200000 +#define WLAN_CHAN_VHT40PLUS 0x0000000000200000 /* VHT 40 with extension channel below */ -#define IEEE80211_CHAN_VHT40MINUS 0x00400000 +#define WLAN_CHAN_VHT40MINUS 0x0000000000400000 /* VHT 80 channel */ -#define IEEE80211_CHAN_VHT80 0x00800000 - -/* HT 40 Intolerant mark bit for ACS use */ -#define IEEE80211_CHAN_HT40INTOLMARK 0x01000000 - -/* channel temporarily blocked due to noise */ -#define IEEE80211_CHAN_BLOCKED 0x02000000 +#define WLAN_CHAN_VHT80 0x0000000000800000 /* VHT 160 channel */ -#define IEEE80211_CHAN_VHT160 0x04000000 +#define WLAN_CHAN_VHT160 0x0000000004000000 /* VHT 80_80 channel */ -#define IEEE80211_CHAN_VHT80_80 0x08000000 +#define WLAN_CHAN_VHT80_80 0x0000000008000000 /* HE 20 channel */ -#define IEEE80211_CHAN_HE20 0x0000000010000000 +#define WLAN_CHAN_HE20 0x0000000010000000 /* HE 40 with extension channel above */ -#define IEEE80211_CHAN_HE40PLUS 0x0000000020000000 +#define WLAN_CHAN_HE40PLUS 0x0000000020000000 /* HE 40 with extension channel below */ -#define IEEE80211_CHAN_HE40MINUS 0x0000000040000000 - -/* HE 40 Intolerant */ -#define IEEE80211_CHAN_HE40INTOL 0x0000000080000000 - -/* HE 40 Intolerant mark bit for ACS use */ -#define IEEE80211_CHAN_HE40INTOLMARK 0x0000000100000000 +#define WLAN_CHAN_HE40MINUS 0x0000000040000000 /* HE 80 channel */ -#define IEEE80211_CHAN_HE80 0x0000000200000000 +#define WLAN_CHAN_HE80 0x0000000200000000 /* HE 160 channel */ -#define IEEE80211_CHAN_HE160 0x0000000400000000 +#define WLAN_CHAN_HE160 0x0000000400000000 /* HE 80_80 channel */ -#define IEEE80211_CHAN_HE80_80 0x0000000800000000 +#define WLAN_CHAN_HE80_80 0x0000000800000000 /* flagext */ -#define IEEE80211_CHAN_DFS_RADAR_FOUND 0x01 +#define WLAN_CHAN_DFS_RADAR_FOUND 0x01 /* DFS required on channel */ -#define IEEE80211_CHAN_DFS 0x0002 +#define WLAN_CHAN_DFS 0x0002 /* DFS required on channel for 2nd band of 80+80*/ -#define IEEE80211_CHAN_DFS_CFREQ2 0x0004 +#define WLAN_CHAN_DFS_CFREQ2 0x0004 /* if channel has been checked for DFS */ -#define IEEE80211_CHAN_DFS_CLEAR 0x0008 - -/* excluded in 11D */ -#define IEEE80211_CHAN_11D_EXCLUDED 0x0010 - -/* Channel Switch Announcement received on this channel */ -#define IEEE80211_CHAN_CSA_RECEIVED 0x0020 - -/* ad-hoc is not allowed */ -#define IEEE80211_CHAN_DISALLOW_ADHOC 0x0040 - -/* Station only channel */ -#define IEEE80211_CHAN_DISALLOW_HOSTAP 0x0080 +#define WLAN_CHAN_DFS_CLEAR 0x0008 /* DFS radar history for slave device(STA mode) */ -#define IEEE80211_CHAN_HISTORY_RADAR 0x0100 +#define WLAN_CHAN_HISTORY_RADAR 0x0100 /* DFS CAC valid for slave device(STA mode) */ -#define IEEE80211_CHAN_CAC_VALID 0x0200 +#define WLAN_CHAN_CAC_VALID 0x0200 -/* CONF: block the use of DFS channels */ -#define IEEE80211_FEXT_BLKDFSCHAN 0x00000200 +#define WLAN_IS_CHAN_2GHZ(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_2GHZ) != 0) -/* Useful combinations of channel characteristics. */ -#define IEEE80211_CHAN_FHSS \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_GFSK) +#define WLAN_IS_CHAN_5GHZ(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_5GHZ) != 0) -#define IEEE80211_CHAN_A \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM) +#define WLAN_IS_CHAN_11N_HT40(_c) \ + (((_c)->dfs_ch_flags & (WLAN_CHAN_HT40PLUS | \ + WLAN_CHAN_HT40MINUS)) != 0) -#define IEEE80211_CHAN_B \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK) +#define WLAN_IS_CHAN_11N_HT40PLUS(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_HT40PLUS) != 0) -#define IEEE80211_CHAN_PUREG \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM) +#define WLAN_IS_CHAN_11N_HT40MINUS(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_HT40MINUS) != 0) -#define IEEE80211_CHAN_G \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN) +#define WLAN_CHAN_A \ + (WLAN_CHAN_5GHZ | WLAN_CHAN_OFDM) -#define IEEE80211_CHAN_108A \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO) +#define WLAN_IS_CHAN_A(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_A) == WLAN_CHAN_A) -#define IEEE80211_CHAN_108G \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO) +#define WLAN_CHAN_11NA_HT20 \ + (WLAN_CHAN_5GHZ | WLAN_CHAN_HT20) -#define IEEE80211_CHAN_ST \ - (IEEE80211_CHAN_108A | IEEE80211_CHAN_STURBO) +#define WLAN_CHAN_11NA_HT40PLUS \ + (WLAN_CHAN_5GHZ | WLAN_CHAN_HT40PLUS) -#define IEEE80211_CHAN_11NG_HT20 \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_HT20) +#define WLAN_CHAN_11NA_HT40MINUS \ + (WLAN_CHAN_5GHZ | WLAN_CHAN_HT40MINUS) -#define IEEE80211_CHAN_11NA_HT20 \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_HT20) +#define WLAN_IS_CHAN_11NA_HT20(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11NA_HT20) == \ + WLAN_CHAN_11NA_HT20) -#define IEEE80211_CHAN_11NG_HT40PLUS \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_HT40PLUS) +#define WLAN_IS_CHAN_11NA_HT40PLUS(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11NA_HT40PLUS) == \ + WLAN_CHAN_11NA_HT40PLUS) -#define IEEE80211_CHAN_11NG_HT40MINUS \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_HT40MINUS) +#define WLAN_IS_CHAN_11NA_HT40MINUS(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11NA_HT40MINUS) == \ + WLAN_CHAN_11NA_HT40MINUS) -#define IEEE80211_CHAN_11NA_HT40PLUS \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_HT40PLUS) +#define WLAN_CHAN_11AC_VHT20 \ + (WLAN_CHAN_5GHZ | WLAN_CHAN_VHT20) -#define IEEE80211_CHAN_11NA_HT40MINUS \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_HT40MINUS) +#define WLAN_CHAN_11AC_VHT40PLUS \ + (WLAN_CHAN_5GHZ | WLAN_CHAN_VHT40PLUS) -#define IEEE80211_CHAN_11AXG_HE20 \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_HE20) +#define WLAN_CHAN_11AC_VHT40MINUS \ + (WLAN_CHAN_5GHZ | WLAN_CHAN_VHT40MINUS) -#define IEEE80211_CHAN_11AXA_HE20 \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_HE20) +#define WLAN_CHAN_11AC_VHT80 \ + (WLAN_CHAN_5GHZ | WLAN_CHAN_VHT80) -#define IEEE80211_CHAN_11AXG_HE40PLUS \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_HE40PLUS) +#define WLAN_CHAN_11AC_VHT160 \ + (WLAN_CHAN_5GHZ | WLAN_CHAN_VHT160) -#define IEEE80211_CHAN_11AXG_HE40MINUS \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_HE40MINUS) +#define WLAN_CHAN_11AC_VHT80_80 \ + (WLAN_CHAN_5GHZ | WLAN_CHAN_VHT80_80) -#define IEEE80211_CHAN_11AXG_HE40 \ - (IEEE80211_CHAN_11AXG_HE40PLUS | IEEE80211_CHAN_11AXG_HE40MINUS) +#define WLAN_IS_CHAN_11AC_VHT20(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AC_VHT20) == \ + WLAN_CHAN_11AC_VHT20) -#define IEEE80211_CHAN_11AXA_HE40PLUS \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_HE40PLUS) +#define WLAN_IS_CHAN_11AC_VHT40(_c) \ + (((_c)->dfs_ch_flags & (WLAN_CHAN_VHT40PLUS | \ + WLAN_CHAN_VHT40MINUS)) != 0) -#define IEEE80211_CHAN_11AXA_HE40MINUS \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_HE40MINUS) +#define WLAN_IS_CHAN_11AC_VHT40PLUS(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AC_VHT40PLUS) == \ + WLAN_CHAN_11AC_VHT40PLUS) -#define IEEE80211_CHAN_11AXA_HE40 \ - (IEEE80211_CHAN_11AXA_HE40PLUS | IEEE80211_CHAN_11AXA_HE40MINUS) +#define WLAN_IS_CHAN_11AC_VHT40MINUS(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AC_VHT40MINUS) == \ + WLAN_CHAN_11AC_VHT40MINUS) -#define IEEE80211_CHAN_11AX_HE40 \ - (IEEE80211_CHAN_HE40PLUS | IEEE80211_CHAN_HE40MINUS) +#define WLAN_IS_CHAN_11AC_VHT80(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AC_VHT80) == \ + WLAN_CHAN_11AC_VHT80) -#define IEEE80211_CHAN_11AXA_HE80 \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_HE80) +#define WLAN_IS_CHAN_11AC_VHT160(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AC_VHT160) == \ + WLAN_CHAN_11AC_VHT160) -#define IEEE80211_CHAN_11AXA_HE160 \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_HE160) +#define WLAN_IS_CHAN_11AC_VHT80_80(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AC_VHT80_80) == \ + WLAN_CHAN_11AC_VHT80_80) -#define IEEE80211_CHAN_11AXA_HE80_80 \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_HE80_80) +#define WLAN_CHAN_11AXA_HE20 \ + (WLAN_CHAN_5GHZ | WLAN_CHAN_HE20) -#define IEEE80211_CHAN_ALL \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ | \ - IEEE80211_CHAN_GFSK | IEEE80211_CHAN_CCK | \ - IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN | \ - IEEE80211_CHAN_HT20 | IEEE80211_CHAN_HT40PLUS | \ - IEEE80211_CHAN_HT40MINUS | IEEE80211_CHAN_VHT20 | \ - IEEE80211_CHAN_VHT40PLUS | IEEE80211_CHAN_VHT40MINUS | \ - IEEE80211_CHAN_VHT80 | IEEE80211_CHAN_VHT160 | \ - IEEE80211_CHAN_VHT80_80 | IEEE80211_CHAN_HALF | \ - IEEE80211_CHAN_QUARTER | IEEE80211_CHAN_HE20 | \ - IEEE80211_CHAN_HE40PLUS | IEEE80211_CHAN_HE40MINUS | \ - IEEE80211_CHAN_HE80 | IEEE80211_CHAN_HE160 | \ - IEEE80211_CHAN_HE80_80) +#define WLAN_CHAN_11AXA_HE40PLUS \ + (WLAN_CHAN_5GHZ | WLAN_CHAN_HE40PLUS) -#define IEEE80211_CHAN_ALLTURBO \ - (IEEE80211_CHAN_ALL | IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO) +#define WLAN_CHAN_11AXA_HE40MINUS \ + (WLAN_CHAN_5GHZ | WLAN_CHAN_HE40MINUS) -#define IEEE80211_IS_CHAN_FHSS(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS) +#define WLAN_CHAN_11AXA_HE80 \ + (WLAN_CHAN_5GHZ | WLAN_CHAN_HE80) -#define IEEE80211_IS_CHAN_A(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A) +#define WLAN_CHAN_11AXA_HE160 \ + (WLAN_CHAN_5GHZ | WLAN_CHAN_HE160) -#define IEEE80211_IS_CHAN_B(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B) +#define WLAN_CHAN_11AXA_HE80_80 \ + (WLAN_CHAN_5GHZ | WLAN_CHAN_HE80_80) -#define IEEE80211_IS_CHAN_PUREG(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG) +#define WLAN_IS_CHAN_11AXA_HE20(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE20) == \ + WLAN_CHAN_11AXA_HE20) -#define IEEE80211_IS_CHAN_G(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G) +#define WLAN_IS_CHAN_11AXA_HE40PLUS(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE40PLUS) == \ + WLAN_CHAN_11AXA_HE40PLUS) -#define IEEE80211_IS_CHAN_ANYG(_c) \ - (IEEE80211_IS_CHAN_PUREG(_c) || IEEE80211_IS_CHAN_G(_c)) +#define WLAN_IS_CHAN_11AXA_HE40MINUS(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE40MINUS) == \ + WLAN_CHAN_11AXA_HE40MINUS) -#define IEEE80211_IS_CHAN_ST(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_ST) == IEEE80211_CHAN_ST) +#define WLAN_IS_CHAN_11AXA_HE80(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE80) == \ + WLAN_CHAN_11AXA_HE80) -#define IEEE80211_IS_CHAN_108A(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_108A) == IEEE80211_CHAN_108A) +#define WLAN_IS_CHAN_11AXA_HE160(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE160) == \ + WLAN_CHAN_11AXA_HE160) -#define IEEE80211_IS_CHAN_108G(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_108G) == IEEE80211_CHAN_108G) +#define WLAN_IS_CHAN_11AXA_HE80_80(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE80_80) == \ + WLAN_CHAN_11AXA_HE80_80) -#define IEEE80211_IS_CHAN_2GHZ(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_2GHZ) != 0) - -#define IEEE80211_IS_CHAN_5GHZ(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_5GHZ) != 0) - -#define IEEE80211_IS_CHAN_OFDM(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_OFDM) != 0) - -#define IEEE80211_IS_CHAN_CCK(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_CCK) != 0) - -#define IEEE80211_IS_CHAN_GFSK(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_GFSK) != 0) - -#define IEEE80211_IS_CHAN_TURBO(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_TURBO) != 0) - -#define IEEE80211_IS_CHAN_WEATHER_RADAR(_c) \ - ((((_c)->dfs_ch_freq >= 5600) && ((_c)->dfs_ch_freq <= 5650)) || \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_HT40PLUS) && \ - (5580 == (_c)->dfs_ch_freq))) - -#define IEEE80211_IS_CHAN_STURBO(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_STURBO) != 0) - -#define IEEE80211_IS_CHAN_DTURBO(_c) \ - (((_c)->dfs_ch_flags & \ - (IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO)) == IEEE80211_CHAN_TURBO) - -#define IEEE80211_IS_CHAN_HALF(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_HALF) != 0) - -#define IEEE80211_IS_CHAN_QUARTER(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_QUARTER) != 0) - -#define IEEE80211_IS_CHAN_PASSIVE(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_PASSIVE) != 0) - -#define IEEE80211_IS_PRIMARY_OR_SECONDARY_CHAN_DFS(_c) \ - (IEEE80211_IS_CHAN_DFS(_c) || \ - ((IEEE80211_IS_CHAN_11AC_VHT160(_c) || \ - IEEE80211_IS_CHAN_11AC_VHT80_80(_c) || \ - IEEE80211_IS_CHAN_11AXA_HE160(_c) || \ - IEEE80211_IS_CHAN_11AXA_HE80_80(_c)) \ - && IEEE80211_IS_CHAN_DFS_CFREQ2(_c))) - -#define IEEE80211_IS_CHAN_DFS(_c) \ +#define WLAN_IS_CHAN_DFS(_c) \ (((_c)->dfs_ch_flagext & \ - (IEEE80211_CHAN_DFS|IEEE80211_CHAN_DFS_CLEAR)) == IEEE80211_CHAN_DFS) + (WLAN_CHAN_DFS | WLAN_CHAN_DFS_CLEAR)) == WLAN_CHAN_DFS) -#define IEEE80211_IS_CHAN_DFS_CFREQ2(_c) \ +#define WLAN_IS_CHAN_DFS_CFREQ2(_c) \ (((_c)->dfs_ch_flagext & \ - (IEEE80211_CHAN_DFS_CFREQ2|IEEE80211_CHAN_DFS_CLEAR)) == \ - IEEE80211_CHAN_DFS_CFREQ2) - -#define IEEE80211_IS_CHAN_DFSFLAG(_c) \ - (((_c)->dfs_ch_flagext & IEEE80211_CHAN_DFS) == IEEE80211_CHAN_DFS) - -#define IEEE80211_IS_CHAN_DFSFLAG_CFREQ2(_c) \ - (((_c)->dfs_ch_flagext & IEEE80211_CHAN_DFS_CFREQ2) == \ - IEEE80211_CHAN_DFS_CFREQ2) - -#define IEEE80211_IS_CHAN_DISALLOW_ADHOC(_c) \ - (((_c)->dfs_ch_flagext & IEEE80211_CHAN_DISALLOW_ADHOC) != 0) - -#define IEEE80211_IS_CHAN_11D_EXCLUDED(_c) \ - (((_c)->dfs_ch_flagext & IEEE80211_CHAN_11D_EXCLUDED) != 0) - -#define IEEE80211_IS_CHAN_CSA(_c) \ - (((_c)->dfs_ch_flagext & IEEE80211_CHAN_CSA_RECEIVED) != 0) - -#define IEEE80211_IS_CHAN_ODD(_c) \ - (((_c)->dfs_ch_freq == 5170) || ((_c)->dfs_ch_freq == 5190) || \ - ((_c)->dfs_ch_freq == 5210) || ((_c)->dfs_ch_freq == 5230)) - -#define IEEE80211_IS_CHAN_DISALLOW_HOSTAP(_c) \ - (((_c)->dfs_ch_flagext & IEEE80211_CHAN_DISALLOW_HOSTAP) != 0) - -#define IEEE80211_IS_CHAN_11NG_HT20(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11NG_HT20) == \ - IEEE80211_CHAN_11NG_HT20) - -#define IEEE80211_IS_CHAN_11NA_HT20(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11NA_HT20) == \ - IEEE80211_CHAN_11NA_HT20) - -#define IEEE80211_IS_CHAN_11NG_HT40PLUS(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11NG_HT40PLUS) == \ - IEEE80211_CHAN_11NG_HT40PLUS) - -#define IEEE80211_IS_CHAN_11NG_HT40MINUS(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11NG_HT40MINUS) == \ - IEEE80211_CHAN_11NG_HT40MINUS) - -#define IEEE80211_IS_CHAN_11NA_HT40PLUS(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11NA_HT40PLUS) == \ - IEEE80211_CHAN_11NA_HT40PLUS) - -#define IEEE80211_IS_CHAN_11NA_HT40MINUS(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11NA_HT40MINUS) == \ - IEEE80211_CHAN_11NA_HT40MINUS) - -#define IEEE80211_IS_CHAN_11N(_c) \ - (((_c)->dfs_ch_flags & (IEEE80211_CHAN_HT20 | \ - IEEE80211_CHAN_HT40PLUS | \ - IEEE80211_CHAN_HT40MINUS)) != 0) - -#define IEEE80211_IS_CHAN_11N_HT20(_c) \ - (((_c)->dfs_ch_flags & (IEEE80211_CHAN_HT20)) != 0) - -#define IEEE80211_IS_CHAN_11N_HT40(_c) \ - (((_c)->dfs_ch_flags & (IEEE80211_CHAN_HT40PLUS | \ - IEEE80211_CHAN_HT40MINUS)) != 0) - -#define IEEE80211_IS_CHAN_11NG(_c) \ - (IEEE80211_IS_CHAN_2GHZ((_c)) && IEEE80211_IS_CHAN_11N((_c))) - -#define IEEE80211_IS_CHAN_11NA(_c) \ - (IEEE80211_IS_CHAN_5GHZ((_c)) && IEEE80211_IS_CHAN_11N((_c))) - -#define IEEE80211_IS_CHAN_11N_HT40PLUS(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_HT40PLUS) != 0) - -#define IEEE80211_IS_CHAN_11N_HT40MINUS(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_HT40MINUS) != 0) - -#define IEEE80211_IS_CHAN_HT20_CAPABLE(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_HT20) == IEEE80211_CHAN_HT20) - -#define IEEE80211_IS_CHAN_HT40PLUS_CAPABLE(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_HT40PLUS) == \ - IEEE80211_CHAN_HT40PLUS) - -#define IEEE80211_IS_CHAN_HT40MINUS_CAPABLE(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_HT40MINUS) == \ - IEEE80211_CHAN_HT40MINUS) - -#define IEEE80211_IS_CHAN_HT40_CAPABLE(_c) \ - (IEEE80211_IS_CHAN_HT40PLUS_CAPABLE(_c) || \ - IEEE80211_IS_CHAN_HT40MINUS_CAPABLE(_c)) - -#define IEEE80211_IS_CHAN_HT_CAPABLE(_c) \ - (IEEE80211_IS_CHAN_HT20_CAPABLE(_c) || \ - IEEE80211_IS_CHAN_HT40_CAPABLE(_c)) - -#define IEEE80211_IS_CHAN_11N_CTL_CAPABLE(_c) \ - IEEE80211_IS_CHAN_HT20_CAPABLE(_c) - -#define IEEE80211_IS_CHAN_11N_CTL_U_CAPABLE(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_HT40PLUS) == \ - IEEE80211_CHAN_HT40PLUS) - -#define IEEE80211_IS_CHAN_11N_CTL_L_CAPABLE(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_HT40MINUS) == \ - IEEE80211_CHAN_HT40MINUS) - -#define IEEE80211_IS_CHAN_11N_CTL_40_CAPABLE(_c) \ - (IEEE80211_IS_CHAN_11N_CTL_U_CAPABLE((_c)) || \ - IEEE80211_IS_CHAN_11N_CTL_L_CAPABLE((_c))) - -#define IEEE80211_IS_CHAN_VHT(_c) \ - (((_c)->dfs_ch_flags & (IEEE80211_CHAN_VHT20 | \ - IEEE80211_CHAN_VHT40PLUS | \ - IEEE80211_CHAN_VHT40MINUS | \ - IEEE80211_CHAN_VHT80 | \ - IEEE80211_CHAN_VHT160 | \ - IEEE80211_CHAN_VHT80_80)) != 0) - -#define IEEE80211_IS_CHAN_11AC(_c) \ - (IEEE80211_IS_CHAN_5GHZ((_c)) && IEEE80211_IS_CHAN_VHT((_c))) - -#define IEEE80211_CHAN_11AC_VHT20 \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_VHT20) - -#define IEEE80211_CHAN_11AC_VHT40 \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_VHT40PLUS | \ - IEEE80211_CHAN_VHT40MINUS) - -#define IEEE80211_CHAN_11AC_VHT40PLUS \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_VHT40PLUS) - -#define IEEE80211_CHAN_11AC_VHT40MINUS \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_VHT40MINUS) - -#define IEEE80211_CHAN_11AC_VHT80 \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_VHT80) - -#define IEEE80211_CHAN_11AC_VHT160 \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_VHT160) - -#define IEEE80211_CHAN_11AC_VHT80_80 \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_VHT80_80) - -#define IEEE80211_IS_CHAN_11AC_VHT20(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11AC_VHT20) == \ - IEEE80211_CHAN_11AC_VHT20) - -#define IEEE80211_IS_CHAN_11AC_VHT40(_c) \ - (((_c)->dfs_ch_flags & (IEEE80211_CHAN_VHT40PLUS | \ - IEEE80211_CHAN_VHT40MINUS)) != 0) - -#define IEEE80211_IS_CHAN_11AC_VHT40PLUS(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11AC_VHT40PLUS) == \ - IEEE80211_CHAN_11AC_VHT40PLUS) - -#define IEEE80211_IS_CHAN_11AC_VHT40MINUS(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11AC_VHT40MINUS) == \ - IEEE80211_CHAN_11AC_VHT40MINUS) - -#define IEEE80211_IS_CHAN_11AC_VHT80(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11AC_VHT80) == \ - IEEE80211_CHAN_11AC_VHT80) - -#define IEEE80211_IS_CHAN_11AC_VHT160(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11AC_VHT160) == \ - IEEE80211_CHAN_11AC_VHT160) - -#define IEEE80211_IS_CHAN_11AC_VHT80_80(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11AC_VHT80_80) == \ - IEEE80211_CHAN_11AC_VHT80_80) - -#define IEEE80211_CH_HOPPING_SET_CHAN_BLOCKED(_c) \ - ((_c)->dfs_ch_flags |= IEEE80211_CHAN_BLOCKED) - -#define IEEE80211_CH_HOPPING_IS_CHAN_BLOCKED(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_BLOCKED) == \ - IEEE80211_CHAN_BLOCKED) - -#define IEEE80211_CH_HOPPING_CLEAR_CHAN_BLOCKED(_c) \ - ((_c)->dfs_ch_flags &= ~IEEE80211_CHAN_BLOCKED) - -#define IEEE80211_IS_CHAN_RADAR(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_DFS_RADAR) == \ - IEEE80211_CHAN_DFS_RADAR) - -#define IEEE80211_CHAN_SET_RADAR(_c) \ - ((_c)->dfs_ch_flags |= IEEE80211_CHAN_DFS_RADAR) - -#define IEEE80211_CHAN_CLR_RADAR(_c) \ - ((_c)->dfs_ch_flags &= ~IEEE80211_CHAN_DFS_RADAR) - -#define IEEE80211_CHAN_SET_DISALLOW_ADHOC(_c) \ - ((_c)->dfs_ch_flagext |= IEEE80211_CHAN_DISALLOW_ADHOC) - -#define IEEE80211_CHAN_SET_DISALLOW_HOSTAP(_c) \ - ((_c)->dfs_ch_flagext |= IEEE80211_CHAN_DISALLOW_HOSTAP) - -#define IEEE80211_CHAN_SET_DFS(_c) \ - ((_c)->dfs_ch_flagext |= IEEE80211_CHAN_DFS) - -#define IEEE80211_CHAN_SET_DFS_CLEAR(_c) \ - ((_c)->dfs_ch_flagext |= IEEE80211_CHAN_DFS_CLEAR) - -#define IEEE80211_CHAN_EXCLUDE_11D(_c) \ - ((_c)->dfs_ch_flagext |= IEEE80211_CHAN_11D_EXCLUDED) - -#define IEEE80211_IS_CHAN_HISTORY_RADAR(_c) \ - (((_c)->dfs_ch_flagext & IEEE80211_CHAN_HISTORY_RADAR) == \ - IEEE80211_CHAN_HISTORY_RADAR) - -#define IEEE80211_CHAN_SET_HISTORY_RADAR(_c) \ - ((_c)->dfs_ch_flagext |= IEEE80211_CHAN_HISTORY_RADAR) - -#define IEEE80211_CHAN_CLR_HISTORY_RADAR(_c) \ - ((_c)->dfs_ch_flagext &= ~IEEE80211_CHAN_HISTORY_RADAR) - -#define IEEE80211_IS_CHAN_CAC_VALID(_c) \ - (((_c)->dfs_ch_flagext & IEEE80211_CHAN_CAC_VALID) == \ - IEEE80211_CHAN_CAC_VALID) - -#define IEEE80211_CHAN_SET_CAC_VALID(_c) \ - ((_c)->dfs_ch_flagext |= IEEE80211_CHAN_CAC_VALID) - -#define IEEE80211_CHAN_CLR_CAC_VALID(_c) \ - ((_c)->dfs_ch_flagext &= ~IEEE80211_CHAN_CAC_VALID) - -#define IEEE80211_CHAN_ANY (-1) /* token for ``any channel'' */ - -#define IEEE80211_CHAN_ANYC \ - ((struct dfs_ieee80211_channel *) IEEE80211_CHAN_ANY) - -#define IEEE80211_IS_CHAN_11AXA_HE20(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11AXA_HE20) == \ - IEEE80211_CHAN_11AXA_HE20) - -#define IEEE80211_IS_CHAN_11AXA_HE40PLUS(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11AXA_HE40PLUS) == \ - IEEE80211_CHAN_11AXA_HE40PLUS) - -#define IEEE80211_IS_CHAN_11AXA_HE40MINUS(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11AXA_HE40MINUS) == \ - IEEE80211_CHAN_11AXA_HE40MINUS) - -#define IEEE80211_IS_CHAN_11AXA_HE80(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11AXA_HE80) == \ - IEEE80211_CHAN_11AXA_HE80) - -#define IEEE80211_IS_CHAN_11AXA_HE160(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11AXA_HE160) == \ - IEEE80211_CHAN_11AXA_HE160) - -#define IEEE80211_IS_CHAN_11AXA_HE80_80(_c) \ - (((_c)->dfs_ch_flags & IEEE80211_CHAN_11AXA_HE80_80) == \ - IEEE80211_CHAN_11AXA_HE80_80) - -#define IEEE80211_IS_CHAN_MODE_20(_c) \ - (IEEE80211_IS_CHAN_11NA_HT20(_c) || \ - IEEE80211_IS_CHAN_11AC_VHT20(_c) || \ - IEEE80211_IS_CHAN_11AXA_HE20(_c)) - -#define IEEE80211_IS_CHAN_MODE_40(_c) \ - (IEEE80211_IS_CHAN_11AC_VHT40PLUS(_c) || \ - IEEE80211_IS_CHAN_11AC_VHT40MINUS(_c) || \ - IEEE80211_IS_CHAN_11NA_HT40PLUS(_c) || \ - IEEE80211_IS_CHAN_11NA_HT40MINUS(_c) || \ - IEEE80211_IS_CHAN_11AXA_HE40PLUS(_c) || \ - IEEE80211_IS_CHAN_11AXA_HE40MINUS(_c)) - -#define IEEE80211_IS_CHAN_MODE_80(_c) \ - (IEEE80211_IS_CHAN_11AC_VHT80(_c) || \ - IEEE80211_IS_CHAN_11AXA_HE80(_c)) - -#define IEEE80211_IS_CHAN_MODE_160(_c) \ - (IEEE80211_IS_CHAN_11AC_VHT160(_c) || \ - IEEE80211_IS_CHAN_11AXA_HE160(_c)) - -#define IEEE80211_IS_CHAN_MODE_80_80(_c) \ - (IEEE80211_IS_CHAN_11AC_VHT80_80(_c) || \ - IEEE80211_IS_CHAN_11AXA_HE80_80(_c)) - -#endif /* _NET80211__IEEE80211_H_ */ + (WLAN_CHAN_DFS_CFREQ2|WLAN_CHAN_DFS_CLEAR)) == \ + WLAN_CHAN_DFS_CFREQ2) + +#define WLAN_IS_PRIMARY_OR_SECONDARY_CHAN_DFS(_c) \ + (WLAN_IS_CHAN_DFS(_c) || \ + ((WLAN_IS_CHAN_11AC_VHT160(_c) || \ + WLAN_IS_CHAN_11AC_VHT80_80(_c) || \ + WLAN_IS_CHAN_11AXA_HE160(_c) || \ + WLAN_IS_CHAN_11AXA_HE80_80(_c)) \ + && WLAN_IS_CHAN_DFS_CFREQ2(_c))) + +#define WLAN_IS_CHAN_RADAR(_c) \ + (((_c)->dfs_ch_flags & WLAN_CHAN_DFS_RADAR) == \ + WLAN_CHAN_DFS_RADAR) + +#define WLAN_IS_CHAN_HISTORY_RADAR(_c) \ + (((_c)->dfs_ch_flagext & WLAN_CHAN_HISTORY_RADAR) == \ + WLAN_CHAN_HISTORY_RADAR) + +#define WLAN_CHAN_CLR_HISTORY_RADAR(_c) \ + ((_c)->dfs_ch_flagext &= ~WLAN_CHAN_HISTORY_RADAR) + +#define WLAN_CHAN_ANY (-1) /* token for ``any channel'' */ + +#define WLAN_CHAN_ANYC \ + ((struct dfs_channel *) WLAN_CHAN_ANY) + +#define WLAN_IS_CHAN_MODE_20(_c) \ + (WLAN_IS_CHAN_11NA_HT20(_c) || \ + WLAN_IS_CHAN_11AC_VHT20(_c) || \ + WLAN_IS_CHAN_11AXA_HE20(_c)) + +#define WLAN_IS_CHAN_MODE_40(_c) \ + (WLAN_IS_CHAN_11AC_VHT40PLUS(_c) || \ + WLAN_IS_CHAN_11AC_VHT40MINUS(_c) || \ + WLAN_IS_CHAN_11NA_HT40PLUS(_c) || \ + WLAN_IS_CHAN_11NA_HT40MINUS(_c) || \ + WLAN_IS_CHAN_11AXA_HE40PLUS(_c) || \ + WLAN_IS_CHAN_11AXA_HE40MINUS(_c)) + +#define WLAN_IS_CHAN_MODE_80(_c) \ + (WLAN_IS_CHAN_11AC_VHT80(_c) || \ + WLAN_IS_CHAN_11AXA_HE80(_c)) + +#define WLAN_IS_CHAN_MODE_160(_c) \ + (WLAN_IS_CHAN_11AC_VHT160(_c) || \ + WLAN_IS_CHAN_11AXA_HE160(_c)) + +#define WLAN_IS_CHAN_MODE_80_80(_c) \ + (WLAN_IS_CHAN_11AC_VHT80_80(_c) || \ + WLAN_IS_CHAN_11AXA_HE80_80(_c)) + +#endif /* _DFS_CHANNEL_H_ */ diff --git a/umac/dfs/core/src/dfs_internal.h b/umac/dfs/core/src/dfs_internal.h index 863402db1d30..07ff4b1670e4 100644 --- a/umac/dfs/core/src/dfs_internal.h +++ b/umac/dfs/core/src/dfs_internal.h @@ -49,12 +49,14 @@ enum DFS_DOMAIN { }; /* CAPABILITY: the device support STA DFS */ -#define IEEE80211_CEXT_STADFS 0x00000040 +#define WLAN_CEXT_STADFS 0x00000040 /** - * dfs_ieee80211_chan2freq() - Convert channel to frequency value. - * @chan: Pointer to dfs_ieee80211_channel structure. + * dfs_chan2freq() - Convert channel to frequency value. + * @chan: Pointer to dfs_channel structure. + * + * Return: Channel frequency. */ -u_int dfs_ieee80211_chan2freq(struct dfs_ieee80211_channel *chan); +uint16_t dfs_chan2freq(struct dfs_channel *chan); #endif /* _DFS_INTERNAL_H_ */ diff --git a/umac/dfs/core/src/dfs_random_chan_sel.h b/umac/dfs/core/src/dfs_random_chan_sel.h index ea8b23f381be..61337b797ac0 100644 --- a/umac/dfs/core/src/dfs_random_chan_sel.h +++ b/umac/dfs/core/src/dfs_random_chan_sel.h @@ -159,10 +159,10 @@ struct chan_bonding_bitmap { * Return: channel number, else zero. */ uint8_t dfs_prepare_random_channel(struct wlan_dfs *dfs, - struct dfs_ieee80211_channel *ch_list, + struct dfs_channel *ch_list, uint32_t ch_count, uint32_t flags, uint8_t *ch_wd, - struct dfs_ieee80211_channel *cur_chan, + struct dfs_channel *cur_chan, uint8_t dfs_region, struct dfs_acs_info *acs_info); diff --git a/umac/dfs/core/src/filtering/dfs_ar.c b/umac/dfs/core/src/filtering/dfs_ar.c index fe4a40414c26..fb6c136af2a9 100644 --- a/umac/dfs/core/src/filtering/dfs_ar.c +++ b/umac/dfs/core/src/filtering/dfs_ar.c @@ -44,7 +44,7 @@ } while (0) void dfs_process_ar_event(struct wlan_dfs *dfs, - struct dfs_ieee80211_channel *chan) + struct dfs_channel *chan) { struct dfs_ar_state *ar; struct dfs_event *re = NULL; diff --git a/umac/dfs/core/src/filtering/dfs_fcc_bin5.c b/umac/dfs/core/src/filtering/dfs_fcc_bin5.c index 230527ae8642..347799cefc51 100644 --- a/umac/dfs/core/src/filtering/dfs_fcc_bin5.c +++ b/umac/dfs/core/src/filtering/dfs_fcc_bin5.c @@ -541,7 +541,7 @@ static int dfs_check_chirping_merlin(struct wlan_dfs *dfs, int same_sign; int temp; - if (IEEE80211_IS_CHAN_11N_HT40(dfs->dfs_curchan)) { + if (WLAN_IS_CHAN_11N_HT40(dfs->dfs_curchan)) { num_fft_bytes = NUM_FFT_BYTES_HT40; num_bin_bytes = NUM_BIN_BYTES_HT40; num_subchan_bins = NUM_SUBCHAN_BINS_HT40; @@ -553,7 +553,7 @@ static int dfs_check_chirping_merlin(struct wlan_dfs *dfs, upper_mag_byte = UPPER_MAG_BYTE_HT40; /* If we are in HT40MINUS then swap primary and extension. */ - if (IEEE80211_IS_CHAN_11N_HT40MINUS(dfs->dfs_curchan)) { + if (WLAN_IS_CHAN_11N_HT40MINUS(dfs->dfs_curchan)) { temp = is_ctl; is_ctl = is_ext; is_ext = temp; @@ -600,7 +600,7 @@ static int dfs_check_chirping_merlin(struct wlan_dfs *dfs, max_index_upper[i] = (ptr[fft_start + upper_index_byte] >> 2) + num_subchan_bins; - if (!IEEE80211_IS_CHAN_11N_HT40(dfs->dfs_curchan)) { + if (!WLAN_IS_CHAN_11N_HT40(dfs->dfs_curchan)) { /* For HT20 mode indices are 6 bit signed number. */ max_index_lower[i] ^= 0x20; max_index_upper[i] = 0; diff --git a/umac/dfs/core/src/filtering/dfs_misc.c b/umac/dfs/core/src/filtering/dfs_misc.c index 6ae7984a9cd5..64602df3ad81 100644 --- a/umac/dfs/core/src/filtering/dfs_misc.c +++ b/umac/dfs/core/src/filtering/dfs_misc.c @@ -107,7 +107,7 @@ int dfs_get_pri_margin(struct wlan_dfs *dfs, else pri_margin = DFS_DEFAULT_PRI_MARGIN; - if (IEEE80211_IS_CHAN_11N_HT40(dfs->dfs_curchan)) { + if (WLAN_IS_CHAN_11N_HT40(dfs->dfs_curchan)) { ext_chan_busy = lmac_get_ext_busy(dfs->dfs_pdev_obj); if (ext_chan_busy >= 0) { dfs->dfs_rinfo.ext_chan_busy_ts = @@ -133,7 +133,7 @@ int dfs_get_filter_threshold(struct wlan_dfs *dfs, thresh = rf->rf_threshold; - if (IEEE80211_IS_CHAN_11N_HT40(dfs->dfs_curchan)) { + if (WLAN_IS_CHAN_11N_HT40(dfs->dfs_curchan)) { ext_chan_busy = lmac_get_ext_busy(dfs->dfs_pdev_obj); if (ext_chan_busy >= 0) { dfs->dfs_rinfo.ext_chan_busy_ts = diff --git a/umac/dfs/core/src/filtering/dfs_phyerr_tlv.c b/umac/dfs/core/src/filtering/dfs_phyerr_tlv.c index 4e317710c079..9855e3e142d9 100644 --- a/umac/dfs/core/src/filtering/dfs_phyerr_tlv.c +++ b/umac/dfs/core/src/filtering/dfs_phyerr_tlv.c @@ -437,7 +437,7 @@ static int dfs_tlv_calc_freq_info(struct wlan_dfs *dfs, * For now, the only 11ac channel with freq1/freq2 setup is * VHT80. Should have a flag macro to check this! */ - } else if (IEEE80211_IS_CHAN_11AC_VHT80(dfs->dfs_curchan)) { + } else if (WLAN_IS_CHAN_11AC_VHT80(dfs->dfs_curchan)) { /* * 11AC, so cfreq1/cfreq2 are setup. * If it's 80+80 this won't work - need to use seg @@ -455,16 +455,16 @@ static int dfs_tlv_calc_freq_info(struct wlan_dfs *dfs, chan_width = 20; /* Grab default channel centre. */ - chan_centre = dfs_ieee80211_chan2freq(dfs->dfs_curchan); + chan_centre = dfs_chan2freq(dfs->dfs_curchan); /* Calculate offset based on HT40U/HT40D and VHT40U/VHT40D. */ - if (IEEE80211_IS_CHAN_11N_HT40PLUS(dfs->dfs_curchan) || + if (WLAN_IS_CHAN_11N_HT40PLUS(dfs->dfs_curchan) || dfs->dfs_curchan->dfs_ch_flags & - IEEE80211_CHAN_VHT40PLUS) + WLAN_CHAN_VHT40PLUS) chan_offset = chan_width; - else if (IEEE80211_IS_CHAN_11N_HT40MINUS(dfs->dfs_curchan) || + else if (WLAN_IS_CHAN_11N_HT40MINUS(dfs->dfs_curchan) || dfs->dfs_curchan->dfs_ch_flags & - IEEE80211_CHAN_VHT40MINUS) + WLAN_CHAN_VHT40MINUS) chan_offset = -chan_width; else chan_offset = 0; diff --git a/umac/dfs/core/src/filtering/dfs_process_phyerr.c b/umac/dfs/core/src/filtering/dfs_process_phyerr.c index 2efccffa9544..1724d923eedf 100644 --- a/umac/dfs/core/src/filtering/dfs_process_phyerr.c +++ b/umac/dfs/core/src/filtering/dfs_process_phyerr.c @@ -81,9 +81,9 @@ static inline uint16_t dfs_get_event_freqcentre(struct wlan_dfs *dfs, */ chan_width = dfs_get_event_freqwidth(dfs); - if (IEEE80211_IS_CHAN_11N_HT40PLUS(dfs->dfs_curchan)) + if (WLAN_IS_CHAN_11N_HT40PLUS(dfs->dfs_curchan)) chan_offset = chan_width; - else if (IEEE80211_IS_CHAN_11N_HT40MINUS(dfs->dfs_curchan)) + else if (WLAN_IS_CHAN_11N_HT40MINUS(dfs->dfs_curchan)) chan_offset = -chan_width; else chan_offset = 0; @@ -94,7 +94,7 @@ static inline uint16_t dfs_get_event_freqcentre(struct wlan_dfs *dfs, */ if (is_dc) { /* XXX TODO: Should DC events be considered 40MHz wide here? */ - return dfs_ieee80211_chan2freq( + return dfs_chan2freq( dfs->dfs_curchan) + (chan_offset / 2); } @@ -103,12 +103,12 @@ static inline uint16_t dfs_get_event_freqcentre(struct wlan_dfs *dfs, * The centre frequency for pri events is still dfs_ch_freq. */ if (is_pri) - return dfs_ieee80211_chan2freq(dfs->dfs_curchan); + return dfs_chan2freq(dfs->dfs_curchan); if (is_ext) - return dfs_ieee80211_chan2freq(dfs->dfs_curchan) + chan_width; + return dfs_chan2freq(dfs->dfs_curchan) + chan_width; - return dfs_ieee80211_chan2freq(dfs->dfs_curchan); + return dfs_chan2freq(dfs->dfs_curchan); } int dfs_process_phyerr_owl(struct wlan_dfs *dfs, @@ -571,7 +571,7 @@ void dfs_process_phyerr(struct wlan_dfs *dfs, void *buf, uint16_t datalen, if (dfs->dfs_debug_mask & WLAN_DEBUG_DFS_PHYERR_PKT) dfs_dump_phyerr_contents(buf, datalen); - if (IEEE80211_IS_CHAN_RADAR(dfs->dfs_curchan)) { + if (WLAN_IS_CHAN_RADAR(dfs->dfs_curchan)) { dfs_debug(dfs, WLAN_DEBUG_DFS1, "Radar already found in the channel, do not queue radar data"); return; @@ -761,10 +761,10 @@ void dfs_process_phyerr(struct wlan_dfs *dfs, void *buf, uint16_t datalen, STAILQ_INSERT_TAIL(&(dfs->dfs_arq), event, re_list); WLAN_ARQ_UNLOCK(dfs); } else { - if ((IEEE80211_IS_CHAN_DFS(dfs->dfs_curchan) || - ((IEEE80211_IS_CHAN_11AC_VHT160(dfs->dfs_curchan) || - IEEE80211_IS_CHAN_11AC_VHT80_80(dfs->dfs_curchan)) && - IEEE80211_IS_CHAN_DFS_CFREQ2(dfs->dfs_curchan))) || + if ((WLAN_IS_CHAN_DFS(dfs->dfs_curchan) || + ((WLAN_IS_CHAN_11AC_VHT160(dfs->dfs_curchan) || + WLAN_IS_CHAN_11AC_VHT80_80(dfs->dfs_curchan)) && + WLAN_IS_CHAN_DFS_CFREQ2(dfs->dfs_curchan))) || (dfs_is_precac_timer_running(dfs))) { int retval = 0; diff --git a/umac/dfs/core/src/filtering/dfs_process_radarevent.c b/umac/dfs/core/src/filtering/dfs_process_radarevent.c index 713cedf32f21..643f39412e82 100644 --- a/umac/dfs/core/src/filtering/dfs_process_radarevent.c +++ b/umac/dfs/core/src/filtering/dfs_process_radarevent.c @@ -449,10 +449,10 @@ void __dfs_process_radarevent(struct wlan_dfs *dfs, static inline void dfs_radarfound_reset_vars( struct wlan_dfs *dfs, struct dfs_state *rs, - struct dfs_ieee80211_channel *chan, + struct dfs_channel *chan, uint8_t seg_id) { - struct dfs_ieee80211_channel *thischan; + struct dfs_channel *thischan; /* * TODO: Instead of discarding the radar, create a workqueue @@ -499,11 +499,11 @@ static inline void dfs_radarfound_reset_vars( } int dfs_radarevent_basic_sanity(struct wlan_dfs *dfs, - struct dfs_ieee80211_channel *chan) + struct dfs_channel *chan) { if (!(dfs->dfs_second_segment_bangradar || dfs_is_precac_timer_running(dfs))) - if (!(IEEE80211_IS_PRIMARY_OR_SECONDARY_CHAN_DFS(chan))) { + if (!(WLAN_IS_PRIMARY_OR_SECONDARY_CHAN_DFS(chan))) { dfs_debug(dfs, WLAN_DEBUG_DFS2, "radar event on non-DFS chan"); if (!(dfs->dfs_is_offload_enabled)) { @@ -526,7 +526,7 @@ int dfs_radarevent_basic_sanity(struct wlan_dfs *dfs, */ static inline int dfs_handle_bangradar( struct wlan_dfs *dfs, - struct dfs_ieee80211_channel *chan, + struct dfs_channel *chan, struct dfs_state **rs, uint8_t *seg_id, int *retval) @@ -546,8 +546,8 @@ static inline int dfs_handle_bangradar( if (dfs->dfs_second_segment_bangradar) { if (dfs_is_precac_timer_running(dfs) || - IEEE80211_IS_CHAN_11AC_VHT160(chan) || - IEEE80211_IS_CHAN_11AC_VHT80_80(chan)) { + WLAN_IS_CHAN_11AC_VHT160(chan) || + WLAN_IS_CHAN_11AC_VHT80_80(chan)) { dfs->is_radar_found_on_secondary_seg = 1; *rs = &dfs->dfs_radar[dfs->dfs_curchan_radindex]; dfs_debug(dfs, WLAN_DEBUG_DFS, @@ -604,7 +604,7 @@ static inline void dfs_process_w53_pulses( */ static inline int dfs_handle_missing_pulses( struct wlan_dfs *dfs, - struct dfs_ieee80211_channel *chan) + struct dfs_channel *chan) { if ((dfs->dfsdomain == DFS_MKK4_DOMAIN) && (dfs->dfs_caps.wlan_chip_is_bb_tlv) && @@ -1136,7 +1136,7 @@ static inline void dfs_conditional_clear_delaylines( */ static inline int dfs_process_each_radarevent( struct wlan_dfs *dfs, - struct dfs_ieee80211_channel *chan, + struct dfs_channel *chan, struct dfs_state **rs, uint8_t *seg_id, int *retval, @@ -1216,7 +1216,7 @@ static inline void dfs_false_radarfound_reset_vars( void dfs_process_radarevent( struct wlan_dfs *dfs, - struct dfs_ieee80211_channel *chan) + struct dfs_channel *chan) { struct dfs_state *rs = NULL; uint8_t seg_id = 0; diff --git a/umac/dfs/core/src/misc/dfs.c b/umac/dfs/core/src/misc/dfs.c index 5fbac30ebaa1..c59fd5248cce 100644 --- a/umac/dfs/core/src/misc/dfs.c +++ b/umac/dfs/core/src/misc/dfs.c @@ -141,8 +141,8 @@ int dfs_create_object(struct wlan_dfs **dfs) qdf_mem_zero(*dfs, sizeof(**dfs)); - (*dfs)->dfs_curchan = (struct dfs_ieee80211_channel *)qdf_mem_malloc( - sizeof(struct dfs_ieee80211_channel)); + (*dfs)->dfs_curchan = (struct dfs_channel *)qdf_mem_malloc( + sizeof(struct dfs_channel)); if (!((*dfs)->dfs_curchan)) { dfs_alert(*dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs_curchan allocation failed"); @@ -462,7 +462,7 @@ struct dfs_state *dfs_getchanstate(struct wlan_dfs *dfs, uint8_t *index, int ext_chan_flag) { struct dfs_state *rs = NULL; - struct dfs_ieee80211_channel *cmp_ch, cmp_ch1; + struct dfs_channel *cmp_ch, cmp_ch1; int i; QDF_STATUS err; @@ -532,7 +532,7 @@ void dfs_radar_enable(struct wlan_dfs *dfs, int no_cac, uint32_t opmode) { int is_ext_ch; int is_fastclk = 0; - struct dfs_ieee80211_channel *ext_ch, extchan; + struct dfs_channel *ext_ch, extchan; QDF_STATUS err = QDF_STATUS_E_FAILURE; if (!dfs) { @@ -540,7 +540,7 @@ void dfs_radar_enable(struct wlan_dfs *dfs, int no_cac, uint32_t opmode) return; } - is_ext_ch = IEEE80211_IS_CHAN_11N_HT40(dfs->dfs_curchan); + is_ext_ch = WLAN_IS_CHAN_11N_HT40(dfs->dfs_curchan); lmac_dfs_disable(dfs->dfs_pdev_obj, no_cac); /* @@ -548,10 +548,10 @@ void dfs_radar_enable(struct wlan_dfs *dfs, int no_cac, uint32_t opmode) * enable radar detection. In HT80_80, we can have * primary non-DFS 80MHz with extension 80MHz DFS. */ - if ((IEEE80211_IS_CHAN_DFS(dfs->dfs_curchan) || - ((IEEE80211_IS_CHAN_11AC_VHT160(dfs->dfs_curchan) || - IEEE80211_IS_CHAN_11AC_VHT80_80(dfs->dfs_curchan)) && - IEEE80211_IS_CHAN_DFS_CFREQ2(dfs->dfs_curchan))) || + if ((WLAN_IS_CHAN_DFS(dfs->dfs_curchan) || + ((WLAN_IS_CHAN_11AC_VHT160(dfs->dfs_curchan) || + WLAN_IS_CHAN_11AC_VHT80_80(dfs->dfs_curchan)) && + WLAN_IS_CHAN_DFS_CFREQ2(dfs->dfs_curchan))) || (dfs_is_precac_timer_running(dfs))) { struct dfs_state *rs_pri = NULL, *rs_ext = NULL; uint8_t index_pri, index_ext; @@ -1059,13 +1059,13 @@ void dfs_set_current_channel(struct wlan_dfs *dfs, dfs->dfs_curchan->dfs_ch_vhtop_ch_freq_seg2 = dfs_ch_vhtop_ch_freq_seg2; } -u_int dfs_ieee80211_chan2freq(struct dfs_ieee80211_channel *chan) +uint16_t dfs_chan2freq(struct dfs_channel *chan) { if (!chan) return 0; - return chan == IEEE80211_CHAN_ANYC ? - IEEE80211_CHAN_ANY : chan->dfs_ch_freq; + return chan == WLAN_CHAN_ANYC ? + WLAN_CHAN_ANY : chan->dfs_ch_freq; } void dfs_update_cur_chan_flags(struct wlan_dfs *dfs, diff --git a/umac/dfs/core/src/misc/dfs_cac.c b/umac/dfs/core/src/misc/dfs_cac.c index 4593ded4a01f..fb3a4140696c 100644 --- a/umac/dfs/core/src/misc/dfs_cac.c +++ b/umac/dfs/core/src/misc/dfs_cac.c @@ -120,7 +120,7 @@ static os_timer_func(dfs_cac_timeout) * When radar is detected during a CAC we are woken up prematurely to * switch to a new channel. Check the channel to decide how to act. */ - if (IEEE80211_IS_CHAN_RADAR(dfs->dfs_curchan)) { + if (WLAN_IS_CHAN_RADAR(dfs->dfs_curchan)) { dfs_mlme_mark_dfs(dfs->dfs_pdev_obj, dfs->dfs_curchan->dfs_ch_ieee, dfs->dfs_curchan->dfs_ch_freq, diff --git a/umac/dfs/core/src/misc/dfs_nol.c b/umac/dfs/core/src/misc/dfs_nol.c index 7908d912fae9..83db6aeee0c3 100644 --- a/umac/dfs/core/src/misc/dfs_nol.c +++ b/umac/dfs/core/src/misc/dfs_nol.c @@ -38,11 +38,11 @@ /** * dfs_nol_timeout() - NOL timeout function. * - * Clears the IEEE80211_CHAN_DFS_RADAR_FOUND flag for the NOL timeout channel. + * Clears the WLAN_CHAN_DFS_RADAR_FOUND flag for the NOL timeout channel. */ static os_timer_func(dfs_nol_timeout) { - struct dfs_ieee80211_channel *c = NULL, lc; + struct dfs_channel *c = NULL, lc; unsigned long oldest, now; struct wlan_dfs *dfs = NULL; int i; @@ -63,14 +63,14 @@ static os_timer_func(dfs_nol_timeout) &(c->dfs_ch_vhtop_ch_freq_seg1), &(c->dfs_ch_vhtop_ch_freq_seg2), i); - if (IEEE80211_IS_CHAN_RADAR(c)) { + if (WLAN_IS_CHAN_RADAR(c)) { if (qdf_system_time_after_eq(now, dfs->dfs_nol_event[i] + dfs_get_nol_timeout(dfs))) { c->dfs_ch_flagext &= - ~IEEE80211_CHAN_DFS_RADAR_FOUND; + ~WLAN_CHAN_DFS_RADAR_FOUND; if (c->dfs_ch_flags & - IEEE80211_CHAN_DFS_RADAR) { + WLAN_CHAN_DFS_RADAR) { /* * NB: do this here so we get only one * msg instead of one for every channel @@ -227,7 +227,7 @@ void dfs_print_nol(struct wlan_dfs *dfs) void dfs_print_nolhistory(struct wlan_dfs *dfs) { - struct dfs_ieee80211_channel *c, lc; + struct dfs_channel *c, lc; int i, j = 0; int nchans = 0; @@ -248,7 +248,7 @@ void dfs_print_nolhistory(struct wlan_dfs *dfs) &(c->dfs_ch_vhtop_ch_freq_seg1), &(c->dfs_ch_vhtop_ch_freq_seg2), i); - if (IEEE80211_IS_CHAN_HISTORY_RADAR(c)) { + if (WLAN_IS_CHAN_HISTORY_RADAR(c)) { dfs_info(NULL, WLAN_DEBUG_DFS_ALWAYS, "nolhistory:%d channel=%d MHz Flags=%llx", j, c->dfs_ch_freq, c->dfs_ch_flags); @@ -287,7 +287,7 @@ void dfs_set_nol(struct wlan_dfs *dfs, { #define TIME_IN_MS 1000 uint32_t nol_time_left_ms; - struct dfs_ieee80211_channel chan; + struct dfs_channel chan; int i; if (!dfs) { @@ -506,7 +506,7 @@ void dfs_getnol(struct wlan_dfs *dfs, void *dfs_nolinfo) void dfs_clear_nolhistory(struct wlan_dfs *dfs) { /* We should have a dfs_clear_nolhistory API from Regdomain. */ - struct dfs_ieee80211_channel *c, lc; + struct dfs_channel *c, lc; int i; int nchans = 0; @@ -521,6 +521,6 @@ void dfs_clear_nolhistory(struct wlan_dfs *dfs) &(c->dfs_ch_vhtop_ch_freq_seg1), &(c->dfs_ch_vhtop_ch_freq_seg2), i); - IEEE80211_CHAN_CLR_HISTORY_RADAR(c); + WLAN_CHAN_CLR_HISTORY_RADAR(c); } } diff --git a/umac/dfs/core/src/misc/dfs_process_radar_found_ind.c b/umac/dfs/core/src/misc/dfs_process_radar_found_ind.c index 731a76bc6cff..bd839b479311 100644 --- a/umac/dfs/core/src/misc/dfs_process_radar_found_ind.c +++ b/umac/dfs/core/src/misc/dfs_process_radar_found_ind.c @@ -160,6 +160,7 @@ static QDF_STATUS dfs_radar_add_to_nol(struct wlan_dfs *dfs, nollist, num_ch, DFS_NOL_SET); dfs_nol_update(dfs); utils_dfs_save_nol(dfs->dfs_pdev_obj); + return QDF_STATUS_SUCCESS; } @@ -276,7 +277,7 @@ static void dfs_find_radar_affected_subchans( int i; uint32_t freq_center, flag; int32_t sidx; - struct dfs_ieee80211_channel *curchan = dfs->dfs_curchan; + struct dfs_channel *curchan = dfs->dfs_curchan; qdf_mem_set(freq_offset, sizeof(*freq_offset), 0); flag = curchan->dfs_ch_flags; @@ -296,7 +297,7 @@ static void dfs_find_radar_affected_subchans( } else { freq_center = utils_dfs_chan_to_freq( curchan->dfs_ch_vhtop_ch_freq_seg2); - if (flag & IEEE80211_CHAN_VHT160) + if (flag & WLAN_CHAN_VHT160) freq_center += DFS_160MHZ_SECOND_SEG_OFFSET; } } @@ -307,23 +308,23 @@ static void dfs_find_radar_affected_subchans( radar_found->freq_offset, radar_found->is_chirp, flag, freq_center); - if ((IEEE80211_IS_CHAN_A(curchan)) || - IEEE80211_IS_CHAN_MODE_20(curchan)) { + if ((WLAN_IS_CHAN_A(curchan)) || + WLAN_IS_CHAN_MODE_20(curchan)) { if (radar_found->is_chirp || (sidx && !(abs(sidx) % DFS_BOUNDRY_SIDX))) { freq_offset->offset[LEFT_CH] -= DFS_CHIRP_OFFSET; freq_offset->offset[RIGHT_CH] += DFS_CHIRP_OFFSET; } dfs_radar_chan_for_20(freq_offset, freq_center); - } else if (IEEE80211_IS_CHAN_MODE_40(curchan)) { + } else if (WLAN_IS_CHAN_MODE_40(curchan)) { if (radar_found->is_chirp || !(abs(sidx) % DFS_BOUNDRY_SIDX)) { freq_offset->offset[LEFT_CH] -= DFS_CHIRP_OFFSET; freq_offset->offset[RIGHT_CH] += DFS_CHIRP_OFFSET; } dfs_radar_chan_for_40(freq_offset, freq_center); - } else if (IEEE80211_IS_CHAN_MODE_80(curchan) || - IEEE80211_IS_CHAN_MODE_160(curchan) || - IEEE80211_IS_CHAN_MODE_80_80(curchan)) { + } else if (WLAN_IS_CHAN_MODE_80(curchan) || + WLAN_IS_CHAN_MODE_160(curchan) || + WLAN_IS_CHAN_MODE_80_80(curchan)) { if (radar_found->is_chirp || !(abs(sidx) % DFS_BOUNDRY_SIDX)) { freq_offset->offset[LEFT_CH] -= DFS_CHIRP_OFFSET; freq_offset->offset[RIGHT_CH] += DFS_CHIRP_OFFSET; @@ -421,7 +422,7 @@ QDF_STATUS dfs_process_radar_ind(struct wlan_dfs *dfs, * related radar flags and begins the channel change * machinery. * XXX TODO: the umac NOL code isn't used, but - * IEEE80211_CHAN_DFS_RADAR still gets set. Since the umac + * WLAN_CHAN_DFS_RADAR still gets set. Since the umac * NOL code isn't used, that flag is never cleared. This * needs to be fixed. See EV 105776. */ diff --git a/umac/dfs/core/src/misc/dfs_random_chan_sel.c b/umac/dfs/core/src/misc/dfs_random_chan_sel.c index 5f77564885ab..85610d22d3e5 100644 --- a/umac/dfs/core/src/misc/dfs_random_chan_sel.c +++ b/umac/dfs/core/src/misc/dfs_random_chan_sel.c @@ -180,6 +180,7 @@ static uint8_t dfs_get_rand_from_lst( dfs_info(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN, "random channel %d", ch_lst[i]); + return ch_lst[i]; } @@ -376,10 +377,10 @@ static uint8_t dfs_find_ch_with_fallback( * Return: channel number */ static void dfs_remove_cur_ch_from_list( - struct dfs_ieee80211_channel *ch_list, + struct dfs_channel *ch_list, uint32_t *ch_cnt, uint8_t *ch_wd, - struct dfs_ieee80211_channel *cur_chan) + struct dfs_channel *cur_chan) { /* TODO */ return; @@ -435,12 +436,12 @@ static void dfs_apply_rules(struct wlan_dfs *dfs, uint32_t flags, uint8_t *random_chan_list, uint32_t *random_chan_cnt, - struct dfs_ieee80211_channel *ch_list, + struct dfs_channel *ch_list, uint32_t ch_cnt, uint8_t dfs_region, struct dfs_acs_info *acs_info) { - struct dfs_ieee80211_channel *chan; + struct dfs_channel *chan; uint16_t flag_no_weather = 0; uint16_t flag_no_lower_5g = 0; uint16_t flag_no_upper_5g = 0; @@ -538,7 +539,7 @@ static void dfs_apply_rules(struct wlan_dfs *dfs, } if (flag_no_dfs_chan && - (chan->dfs_ch_flagext & IEEE80211_CHAN_DFS)) { + (chan->dfs_ch_flagext & WLAN_CHAN_DFS)) { dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN, "skip dfs channel=%d", chan->dfs_ch_ieee); @@ -558,11 +559,11 @@ static void dfs_apply_rules(struct wlan_dfs *dfs, } uint8_t dfs_prepare_random_channel(struct wlan_dfs *dfs, - struct dfs_ieee80211_channel *ch_list, + struct dfs_channel *ch_list, uint32_t ch_cnt, uint32_t flags, uint8_t *ch_wd, - struct dfs_ieee80211_channel *cur_chan, + struct dfs_channel *cur_chan, uint8_t dfs_region, struct dfs_acs_info *acs_info) { diff --git a/umac/dfs/core/src/misc/dfs_zero_cac.c b/umac/dfs/core/src/misc/dfs_zero_cac.c index 95996c07799e..0505633d646f 100644 --- a/umac/dfs/core/src/misc/dfs_zero_cac.c +++ b/umac/dfs/core/src/misc/dfs_zero_cac.c @@ -185,7 +185,7 @@ bool dfs_is_ht80_80_chan_in_precac_done_list(struct wlan_dfs *dfs) if (!TAILQ_EMPTY(&dfs->dfs_precac_done_list)) { bool primary_found = 0; /* Check if primary is DFS then search */ - if (IEEE80211_IS_CHAN_DFS(dfs->dfs_curchan)) { + if (WLAN_IS_CHAN_DFS(dfs->dfs_curchan)) { TAILQ_FOREACH(precac_entry, &dfs->dfs_precac_done_list, pe_list) { @@ -200,7 +200,7 @@ bool dfs_is_ht80_80_chan_in_precac_done_list(struct wlan_dfs *dfs) } /* Check if secondary DFS then search */ - if (IEEE80211_IS_CHAN_DFS_CFREQ2(dfs->dfs_curchan) && + if (WLAN_IS_CHAN_DFS_CFREQ2(dfs->dfs_curchan) && primary_found) { TAILQ_FOREACH(precac_entry, &dfs->dfs_precac_done_list, @@ -232,12 +232,12 @@ bool dfs_is_precac_done(struct wlan_dfs *dfs) { bool ret_val = 0; - if (IEEE80211_IS_CHAN_11AC_VHT20(dfs->dfs_curchan) || - IEEE80211_IS_CHAN_11AC_VHT40(dfs->dfs_curchan) || - IEEE80211_IS_CHAN_11AC_VHT80(dfs->dfs_curchan)) { + if (WLAN_IS_CHAN_11AC_VHT20(dfs->dfs_curchan) || + WLAN_IS_CHAN_11AC_VHT40(dfs->dfs_curchan) || + WLAN_IS_CHAN_11AC_VHT80(dfs->dfs_curchan)) { ret_val = dfs_is_ht20_40_80_chan_in_precac_done_list(dfs); - } else if (IEEE80211_IS_CHAN_11AC_VHT80_80(dfs->dfs_curchan) || - IEEE80211_IS_CHAN_11AC_VHT160(dfs->dfs_curchan)) { + } else if (WLAN_IS_CHAN_11AC_VHT80_80(dfs->dfs_curchan) || + WLAN_IS_CHAN_11AC_VHT160(dfs->dfs_curchan)) { ret_val = dfs_is_ht80_80_chan_in_precac_done_list(dfs); } @@ -366,7 +366,7 @@ bool dfs_is_precac_timer_running(struct wlan_dfs *dfs) #define VHT80_IEEE_FREQ_OFFSET 6 void dfs_find_precac_secondary_vht80_chan(struct wlan_dfs *dfs, - struct dfs_ieee80211_channel *chan) + struct dfs_channel *chan) { uint8_t first_primary_dfs_ch_ieee; @@ -375,7 +375,7 @@ void dfs_find_precac_secondary_vht80_chan(struct wlan_dfs *dfs, dfs_mlme_find_dot11_channel(dfs->dfs_pdev_obj, first_primary_dfs_ch_ieee, 0, - IEEE80211_MODE_11AC_VHT80, + WLAN_PHYMODE_11AC_VHT80, &(chan->dfs_ch_freq), &(chan->dfs_ch_flags), &(chan->dfs_ch_flagext), @@ -504,7 +504,7 @@ void dfs_init_precac_list(struct wlan_dfs *dfs) PRECAC_LIST_LOCK(dfs); /* Fill the precac-required-list with unique elements */ for (i = 0; i < nchans; i++) { - struct dfs_ieee80211_channel *ichan = NULL, lc; + struct dfs_channel *ichan = NULL, lc; ichan = &lc; dfs_mlme_get_dfs_ch_channels(dfs->dfs_pdev_obj, @@ -516,8 +516,8 @@ void dfs_init_precac_list(struct wlan_dfs *dfs) &(ichan->dfs_ch_vhtop_ch_freq_seg2), i); - if (IEEE80211_IS_CHAN_11AC_VHT80(ichan) && - IEEE80211_IS_CHAN_DFS(ichan)) { + if (WLAN_IS_CHAN_11AC_VHT80(ichan) && + WLAN_IS_CHAN_DFS(ichan)) { found = 0; TAILQ_FOREACH(tmp_precac_entry, &dfs->dfs_precac_required_list, @@ -648,7 +648,7 @@ void dfs_cancel_precac_timer(struct wlan_dfs *dfs) void dfs_start_precac_timer(struct wlan_dfs *dfs, uint8_t precac_chan) { - struct dfs_ieee80211_channel *ichan, lc; + struct dfs_channel *ichan, lc; uint8_t first_primary_dfs_ch_ieee; int primary_cac_timeout; int secondary_cac_timeout; @@ -671,7 +671,7 @@ void dfs_start_precac_timer(struct wlan_dfs *dfs, uint8_t precac_chan) ichan = &lc; dfs_mlme_find_dot11_channel(dfs->dfs_pdev_obj, first_primary_dfs_ch_ieee, 0, - IEEE80211_MODE_11AC_VHT80, + WLAN_PHYMODE_11AC_VHT80, &(ichan->dfs_ch_freq), &(ichan->dfs_ch_flags), &(ichan->dfs_ch_flagext), @@ -785,7 +785,7 @@ void dfs_find_vht80_chan_for_precac(struct wlan_dfs *dfs, tx_ops = &(psoc->soc_cb.tx_ops.target_tx_ops); target_type = lmac_get_target_type(dfs->dfs_pdev_obj); - if (chan_mode == IEEE80211_MODE_11AC_VHT80) { + if (chan_mode == WLAN_PHYMODE_11AC_VHT80) { /* * If * 1) The chip is CASCADE @@ -844,26 +844,26 @@ void dfs_find_vht80_chan_for_precac(struct wlan_dfs *dfs, ieee_160_cfreq = (ieee_freq + ch_freq_seg1)/2; - chan_mode = IEEE80211_MODE_11AC_VHT160; + chan_mode = WLAN_PHYMODE_11AC_VHT160; *cfreq1 = dfs_mlme_ieee2mhz( dfs->dfs_pdev_obj, ch_freq_seg1, - IEEE80211_CHAN_5GHZ); + WLAN_CHAN_5GHZ); *cfreq2 = dfs_mlme_ieee2mhz( dfs->dfs_pdev_obj, ieee_160_cfreq, - IEEE80211_CHAN_5GHZ); + WLAN_CHAN_5GHZ); } else { /* * Override the HW channel mode to * VHT80_80. */ chan_mode = - IEEE80211_MODE_11AC_VHT80_80; + WLAN_PHYMODE_11AC_VHT80_80; *cfreq2 = dfs_mlme_ieee2mhz( dfs->dfs_pdev_obj, ieee_freq, - IEEE80211_CHAN_5GHZ); + WLAN_CHAN_5GHZ); } *phy_mode = lmac_get_phymode_info( dfs->dfs_pdev_obj, chan_mode); diff --git a/umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h b/umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h index ad64aa70c95e..e7a08133eacc 100644 --- a/umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h +++ b/umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h @@ -69,7 +69,7 @@ extern struct dfs_to_mlme global_dfs_to_mlme; /** * tgt_dfs_set_current_channel() - Fill dfs channel structure from - * dfs_ieee80211_channel structure. + * dfs_channel structure. * @pdev: Pointer to DFS pdev object. * @dfs_ch_freq: Frequency in Mhz. * @dfs_ch_flags: Channel flags. diff --git a/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c b/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c index 281247766fb4..65d3d6d3dabe 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c @@ -412,7 +412,7 @@ static void utils_dfs_get_max_sup_width(struct wlan_objmgr_pdev *pdev, */ #ifndef QCA_DFS_USE_POLICY_MANAGER static void utils_dfs_get_chan_list(struct wlan_objmgr_pdev *pdev, - struct dfs_ieee80211_channel *chan_list, uint32_t *num_chan) + struct dfs_channel *chan_list, uint32_t *num_chan) { int i = 0, j = 0; enum channel_state state; @@ -447,7 +447,7 @@ static void utils_dfs_get_chan_list(struct wlan_objmgr_pdev *pdev, chan_list[j].dfs_ch_freq = cur_chan_list[i].center_freq; if (state == CHANNEL_STATE_DFS) chan_list[j].dfs_ch_flagext = - IEEE80211_CHAN_DFS; + WLAN_CHAN_DFS; j++; } } @@ -470,9 +470,9 @@ static void utils_dfs_get_chan_list(struct wlan_objmgr_pdev *pdev, * channel. */ static void utils_dfs_get_channel_list(struct wlan_objmgr_pdev *pdev, - struct dfs_ieee80211_channel *chan_list, uint32_t *num_chan) + struct dfs_channel *chan_list, uint32_t *num_chan) { - struct dfs_ieee80211_channel *tmp_chan_list = NULL; + struct dfs_channel *tmp_chan_list = NULL; struct wlan_dfs *dfs; bool is_curchan_5g; bool is_curchan_24g; @@ -533,7 +533,7 @@ static void utils_dfs_get_channel_list(struct wlan_objmgr_pdev *pdev, #else static void utils_dfs_get_chan_list(struct wlan_objmgr_pdev *pdev, - struct dfs_ieee80211_channel *chan_list, uint32_t *num_chan) + struct dfs_channel *chan_list, uint32_t *num_chan) { uint8_t pcl_ch[NUM_CHANNELS]; uint8_t weight_list[NUM_CHANNELS]; @@ -586,7 +586,7 @@ static void utils_dfs_get_chan_list(struct wlan_objmgr_pdev *pdev, * @num_chan: number of channels. */ static void utils_dfs_get_channel_list(struct wlan_objmgr_pdev *pdev, - struct dfs_ieee80211_channel *chan_list, uint32_t *num_chan) + struct dfs_channel *chan_list, uint32_t *num_chan) { utils_dfs_get_chan_list(pdev, chan_list, num_chan); } @@ -604,8 +604,8 @@ QDF_STATUS utils_dfs_get_random_channel( uint32_t num_chan = NUM_CHANNELS; struct wlan_dfs *dfs = NULL; struct wlan_objmgr_psoc *psoc; - struct dfs_ieee80211_channel *chan_list = NULL; - struct dfs_ieee80211_channel cur_chan; + struct dfs_channel *chan_list = NULL; + struct dfs_channel cur_chan; QDF_STATUS status = QDF_STATUS_E_FAILURE; *target_chan = 0;