qcacld-3.0: Add ini support to disable regulatory channels

Currently regulatory channels are disabled for
QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY_EXT vendor command
event if ini coex_unsafe_chan_nb_user_prefer is not set and if
STA operates on disabled channels which results in crash for
STA interface in STA + SAP SCC case.

Hence coex_unsafe_chan_reg_disable ini is controlled based
on coex_unsafe_chan_nb_user_prefer.

Ini behavior summary:

|----------------|----------------------|-------------|--------------------------------|
|User prefer ini | Reg chan disable ini |   PLs       |  Expectation		       |
|	         |			| 	      |				       |
|----------------|----------------------|-------------|--------------------------------|
|   1	         |	  1	        |   LE        | accept freq ext command and    |
|                |                      |             |  disable the regulatory channel|
|----------------|----------------------|-------------|--------------------------------|
|   0            | 	  0	        | Non-Pixel SP| reject freq ext cmd driver and |
|                |                      |             | returns NOT SUPP               |
|----------------|----------------------|-------------|--------------------------------|
|   1		 |	  0             |  Pixel SP   |  accept freq ext command and   |
|                |                      |             |  Don't disable the reg channels|
|----------------|----------------------|-------------|--------------------------------|

Change-Id: Ia3acbc133cab4865d8ad69992e893be91439f856
CRs-Fixed: 3128908
This commit is contained in:
Balaji Pothunoori
2022-02-11 16:08:53 +05:30
committed by Madan Koyyalamudi
parent f8ac5388dc
commit 8fbe1e4593
6 changed files with 96 additions and 10 deletions

View File

@@ -2395,17 +2395,29 @@ static void mlme_init_acs_avoid_freq_list(struct wlan_objmgr_psoc *psoc,
#endif #endif
#ifdef FEATURE_WLAN_CH_AVOID_EXT #ifdef FEATURE_WLAN_CH_AVOID_EXT
static void mlme_init_unsafe_coex_cfg(struct wlan_objmgr_psoc *psoc, static void mlme_init_coex_unsafe_chan_cfg(struct wlan_objmgr_psoc *psoc,
struct wlan_mlme_reg *reg) struct wlan_mlme_reg *reg)
{ {
reg->coex_unsafe_chan_nb_user_prefer = reg->coex_unsafe_chan_nb_user_prefer =
cfg_get(psoc, CFG_COEX_UNSAFE_CHAN_NB_USER_PREFER); cfg_get(psoc, CFG_COEX_UNSAFE_CHAN_NB_USER_PREFER);
} }
static void mlme_init_coex_unsafe_chan_reg_disable_cfg(
struct wlan_objmgr_psoc *psoc, struct wlan_mlme_reg *reg)
{
reg->coex_unsafe_chan_reg_disable =
cfg_get(psoc, CFG_COEX_UNSAFE_CHAN_REG_DISABLE);
}
#else #else
static void mlme_init_unsafe_coex_cfg(struct wlan_objmgr_psoc *psoc, static void mlme_init_coex_unsafe_chan_cfg(struct wlan_objmgr_psoc *psoc,
struct wlan_mlme_reg *reg) struct wlan_mlme_reg *reg)
{ {
} }
static void mlme_init_coex_unsafe_chan_reg_disable_cfg(
struct wlan_objmgr_psoc *psoc, struct wlan_mlme_reg *reg)
{
}
#endif #endif
static void mlme_init_reg_cfg(struct wlan_objmgr_psoc *psoc, static void mlme_init_reg_cfg(struct wlan_objmgr_psoc *psoc,
@@ -2434,7 +2446,8 @@ static void mlme_init_reg_cfg(struct wlan_objmgr_psoc *psoc,
cfg_get(psoc, CFG_INDOOR_CHANNEL_SUPPORT_FOR_NAN); cfg_get(psoc, CFG_INDOOR_CHANNEL_SUPPORT_FOR_NAN);
mlme_init_acs_avoid_freq_list(psoc, reg); mlme_init_acs_avoid_freq_list(psoc, reg);
mlme_init_unsafe_coex_cfg(psoc, reg); mlme_init_coex_unsafe_chan_cfg(psoc, reg);
mlme_init_coex_unsafe_chan_reg_disable_cfg(psoc, reg);
} }
static void static void

View File

@@ -353,14 +353,35 @@
"coex_unsafe_chan_nb_user_prefer", \ "coex_unsafe_chan_nb_user_prefer", \
0, \ 0, \
"Honor coex unsafe freq event from firmware") "Honor coex unsafe freq event from firmware")
#define CFG_COEX_UNSAFE_CHAN_NB_USER_PREFER_ALL \ /*
CFG(CFG_COEX_UNSAFE_CHAN_NB_USER_PREFER) * <ini>
* coex_unsafe_chan_reg_disable - Used to disable reg channels
* for coex unsafe freq event
*
* @Min: 0 (Don't disable reg channels for coex unsafe chan event)
* @Max: 1 (Disable reg channels for coex unsafe chan event)
* Default: 0
*
* This ini is used to disable reg channels for coex unsafe chan
* event
* Usage: External
*
* </ini>
*/
#define CFG_COEX_UNSAFE_CHAN_REG_DISABLE CFG_INI_BOOL( \
"coex_unsafe_chan_reg_disable", \
0, \
"Disable reg channels for coex unsafe chan event")
#define CFG_COEX_UNSAFE_CHAN_ALL \
CFG(CFG_COEX_UNSAFE_CHAN_NB_USER_PREFER) \
CFG(CFG_COEX_UNSAFE_CHAN_REG_DISABLE)
#else #else
#define CFG_COEX_UNSAFE_CHAN_NB_USER_PREFER_ALL #define CFG_COEX_UNSAFE_CHAN_ALL
#endif #endif
#define CFG_REG_ALL \ #define CFG_REG_ALL \
CFG_COEX_UNSAFE_CHAN_NB_USER_PREFER_ALL \ CFG_COEX_UNSAFE_CHAN_ALL \
CFG(CFG_SELF_GEN_FRM_PWR) \ CFG(CFG_SELF_GEN_FRM_PWR) \
CFG(CFG_ENABLE_PENDING_CHAN_LIST_REQ) \ CFG(CFG_ENABLE_PENDING_CHAN_LIST_REQ) \
CFG(CFG_ENABLE_11D_IN_WORLD_MODE) \ CFG(CFG_ENABLE_11D_IN_WORLD_MODE) \

View File

@@ -2464,6 +2464,8 @@ enum mlme_reg_srd_master_modes {
* @enable_nan_on_indoor_channels: Enable nan on Indoor channels * @enable_nan_on_indoor_channels: Enable nan on Indoor channels
* @coex_unsafe_chan_nb_user_prefer: Honor coex unsafe freq event from firmware * @coex_unsafe_chan_nb_user_prefer: Honor coex unsafe freq event from firmware
* or not * or not
* @coex_unsafe_chan_reg_disable: To disable reg channels for received coex
* unsafe channels list
*/ */
struct wlan_mlme_reg { struct wlan_mlme_reg {
uint32_t self_gen_frm_pwr; uint32_t self_gen_frm_pwr;
@@ -2486,6 +2488,7 @@ struct wlan_mlme_reg {
bool enable_nan_on_indoor_channels; bool enable_nan_on_indoor_channels;
#ifdef FEATURE_WLAN_CH_AVOID_EXT #ifdef FEATURE_WLAN_CH_AVOID_EXT
bool coex_unsafe_chan_nb_user_prefer; bool coex_unsafe_chan_nb_user_prefer;
bool coex_unsafe_chan_reg_disable;
#endif #endif
}; };

View File

@@ -4391,6 +4391,17 @@ ucfg_mlme_cfg_get_ht_smps(struct wlan_objmgr_psoc *psoc,
*/ */
bool ucfg_mlme_get_coex_unsafe_chan_nb_user_prefer( bool ucfg_mlme_get_coex_unsafe_chan_nb_user_prefer(
struct wlan_objmgr_psoc *psoc); struct wlan_objmgr_psoc *psoc);
/**
* ucfg_mlme_get_coex_unsafe_chan_reg_disable() - get reg disable cap for
* coex unsafe channels support
* @psoc: pointer to psoc object
* @value: pointer to the value which will be filled for the caller
*
* Return: coex_unsafe_chan_reg_disable
*/
bool ucfg_mlme_get_coex_unsafe_chan_reg_disable(
struct wlan_objmgr_psoc *psoc);
#else #else
static inline static inline
bool ucfg_mlme_get_coex_unsafe_chan_nb_user_prefer( bool ucfg_mlme_get_coex_unsafe_chan_nb_user_prefer(
@@ -4398,5 +4409,12 @@ bool ucfg_mlme_get_coex_unsafe_chan_nb_user_prefer(
{ {
return false; return false;
} }
static inline
bool ucfg_mlme_get_coex_unsafe_chan_reg_disable(
struct wlan_objmgr_psoc *psoc)
{
return false;
}
#endif #endif
#endif /* _WLAN_MLME_UCFG_API_H_ */ #endif /* _WLAN_MLME_UCFG_API_H_ */

View File

@@ -1705,4 +1705,17 @@ bool ucfg_mlme_get_coex_unsafe_chan_nb_user_prefer(
} }
return mlme_obj->cfg.reg.coex_unsafe_chan_nb_user_prefer; return mlme_obj->cfg.reg.coex_unsafe_chan_nb_user_prefer;
} }
bool ucfg_mlme_get_coex_unsafe_chan_reg_disable(
struct wlan_objmgr_psoc *psoc)
{
struct wlan_mlme_psoc_ext_obj *mlme_obj;
mlme_obj = mlme_get_psoc_ext_obj(psoc);
if (!mlme_obj) {
mlme_legacy_err("Failed to get MLME Obj");
return cfg_default(CFG_COEX_UNSAFE_CHAN_REG_DISABLE);
}
return mlme_obj->cfg.reg.coex_unsafe_chan_reg_disable;
}
#endif #endif

View File

@@ -228,6 +228,16 @@ void hdd_update_coex_unsafe_chan_nb_user_prefer(
ucfg_mlme_get_coex_unsafe_chan_nb_user_prefer( ucfg_mlme_get_coex_unsafe_chan_nb_user_prefer(
hdd_ctx->psoc); hdd_ctx->psoc);
} }
static inline
void hdd_update_coex_unsafe_chan_reg_disable(
struct hdd_context *hdd_ctx,
struct reg_config_vars *config_vars)
{
config_vars->coex_unsafe_chan_reg_disable =
ucfg_mlme_get_coex_unsafe_chan_reg_disable(
hdd_ctx->psoc);
}
#else #else
static inline static inline
void hdd_update_coex_unsafe_chan_nb_user_prefer( void hdd_update_coex_unsafe_chan_nb_user_prefer(
@@ -235,6 +245,13 @@ void hdd_update_coex_unsafe_chan_nb_user_prefer(
struct reg_config_vars *config_vars) struct reg_config_vars *config_vars)
{ {
} }
static inline
void hdd_update_coex_unsafe_chan_reg_disable(
struct hdd_context *hdd_ctx,
struct reg_config_vars *config_vars)
{
}
#endif #endif
static void reg_program_config_vars(struct hdd_context *hdd_ctx, static void reg_program_config_vars(struct hdd_context *hdd_ctx,
@@ -303,6 +320,7 @@ static void reg_program_config_vars(struct hdd_context *hdd_ctx,
config_vars->enable_5dot9_ghz_chan_in_master_mode = config_vars->enable_5dot9_ghz_chan_in_master_mode =
enable_5dot9_ghz_chan; enable_5dot9_ghz_chan;
hdd_update_coex_unsafe_chan_nb_user_prefer(hdd_ctx, config_vars); hdd_update_coex_unsafe_chan_nb_user_prefer(hdd_ctx, config_vars);
hdd_update_coex_unsafe_chan_reg_disable(hdd_ctx, config_vars);
} }
/** /**