diff --git a/fw/wlan_defs.h b/fw/wlan_defs.h index d81973f8a2c1..d2a55653dd1e 100644 --- a/fw/wlan_defs.h +++ b/fw/wlan_defs.h @@ -44,8 +44,49 @@ #define MAX_SPATIAL_STREAM 3 #endif -#ifndef CONFIG_160MHZ_SUPPORT -#define CONFIG_160MHZ_SUPPORT 0 /* default: 160 MHz channels not supported */ +/* + * NOTE: The CONFIG_160MHZ_SUPPORT is not used consistently - some code + * uses "#ifdef CONFIG_160MHZ_SUPPORT" while other code uses + * "#if CONFIG_160MHZ_SUPPORT". + * This use is being standardized in the recent versions of code to use + * #ifdef, but is being left as is in the legacy code branches. + * To minimize impact to legacy code branches, this file internally + * converts CONFIG_160MHZ_SUPPORT=0 to having CONFIG_160MHZ_SUPPORT + * undefined. + * For builds that explicitly set CONFIG_160MHZ_SUPPORT=0, the bottom of + * this file restores CONFIG_160MHZ_SUPPORT from being undefined to being 0. + */ +// OLD: +//#ifndef CONFIG_160MHZ_SUPPORT +//#define CONFIG_160MHZ_SUPPORT 0 /* default: 160 MHz channels not supported */ +//#endif +// NEW: +#ifdef CONFIG_160MHZ_SUPPORT + /* CONFIG_160MHZ_SUPPORT is explicitly enabled or explicitly disabled */ + #if !CONFIG_160MHZ_SUPPORT + /* CONFIG_160MHZ_SUPPORT is explicitly disabled */ + /* Change from CONFIG_160MHZ_SUPPORT=0 to CONFIG_160MHZ_SUPPORT= */ + #undef CONFIG_160MHZ_SUPPORT + /* + * Set a flag to indicate this CONFIG_160MHZ_SUPPORT = 0 --> undef + * change has been done, so we can undo the change at the bottom + * of the file. + */ + #define CONFIG_160MHZ_SUPPORT_UNDEF_WAR + #endif +#else + /* + * For backwards compatibility, if CONFIG_160MHZ_SUPPORT is not defined, + * default it to 0, if this is either a host build or a Rome target build. + * This maintains the prior behavior for the host and Rome target builds. + */ + #if defined(AR6320) || !defined(ATH_TARGET) + /* + * Set a flag to indicate that at the end of the file, + * CONFIG_160MHZ_SUPPORT should be set to 0. + */ + #define CONFIG_160MHZ_SUPPORT_UNDEF_WAR + #endif #endif #ifndef SUPPORT_11AX @@ -89,7 +130,7 @@ typedef enum { MODE_11AC_VHT20_2G = 11, MODE_11AC_VHT40_2G = 12, MODE_11AC_VHT80_2G = 13, -#if CONFIG_160MHZ_SUPPORT +#ifdef CONFIG_160MHZ_SUPPORT MODE_11AC_VHT80_80 = 14, MODE_11AC_VHT160 = 15, #endif @@ -129,7 +170,7 @@ typedef enum { #endif } WLAN_PHY_MODE; -#if CONFIG_160MHZ_SUPPORT == 0 +#ifndef CONFIG_160MHZ_SUPPORT A_COMPILE_TIME_ASSERT( mode_unknown_value_consistency_Check, MODE_UNKNOWN == MODE_UNKNOWN_NO_160MHZ_SUPPORT); @@ -153,7 +194,7 @@ typedef enum { WLAN_11AG_CAPABILITY = 3, } WLAN_CAPABILITY; -#if CONFIG_160MHZ_SUPPORT +#ifdef CONFIG_160MHZ_SUPPORT #define IS_MODE_VHT(mode) (((mode) == MODE_11AC_VHT20) || \ ((mode) == MODE_11AC_VHT40) || \ ((mode) == MODE_11AC_VHT80) || \ @@ -450,7 +491,7 @@ typedef struct { * for all targets, but until this is complete, the WHAL_RC_INIT_RC_MASKS def * will be maintained here in its old location. */ -#if CONFIG_160MHZ_SUPPORT == 0 +#ifndef CONFIG_160MHZ_SUPPORT #define WHAL_RC_INIT_RC_MASKS(_rm) do { \ _rm[WHAL_RC_MASK_IDX_NON_HT] = A_RATEMASK_OFDM_CCK; \ _rm[WHAL_RC_MASK_IDX_HT_20] = A_RATEMASK_HT_20; \ @@ -930,4 +971,13 @@ typedef enum { WLAN_DBG_DATA_STALL_RECOVERY_CONNECT_SSR, } wlan_dbg_data_stall_recovery_type_e; +/* + * NOTE: If necessary, restore the explicit disabling of CONFIG_160MHZ_SUPPORT + * See the corresponding comment + pre-processor block at the top of the file. + */ +#ifdef CONFIG_160MHZ_SUPPORT_UNDEF_WAR + #define CONFIG_160MHZ_SUPPORT 0 + #undef CONFIG_160MHZ_SUPPORT_UNDEF_WAR +#endif + #endif /* __WLANDEFS_H__ */