Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
qcacmn: Do not update the NOL state of the channels
Browse files Browse the repository at this point in the history
Currently driver sets the NOL state of the channels to false
on every regulatory updated, which indicates the channel is
not in NOL. Which may lead to some issues where the channel
is actually in NOL but host treats it as non-NOL channel.

Ideally NOL list should be maintained throughout the driver
lifetime and across the regulatory changes.

To address this issue add a logic to not update the NOL state
of the channels whenever the regulatory update is received.

Change-Id: I7487a24a349f5f6e06a058b4d07799c8e5ac2d40
CRs-Fixed: 2735137
  • Loading branch information
Ashish Kumar Dhanotiya authored and snandini committed Aug 8, 2020
1 parent 7ad7bf8 commit 20bccb7
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 2 deletions.
3 changes: 2 additions & 1 deletion umac/regulatory/core/src/reg_build_chan_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,8 @@ QDF_STATUS reg_process_master_chan_list(
REGULATORY_CHAN_DISABLED;
mas_chan_list[chan_enum].state =
CHANNEL_STATE_DISABLE;
mas_chan_list[chan_enum].nol_chan = false;
if (!soc_reg->retain_nol_across_regdmn_update)
mas_chan_list[chan_enum].nol_chan = false;
}

soc_reg->num_phy = regulat_info->num_phy;
Expand Down
1 change: 1 addition & 0 deletions umac/regulatory/core/src/reg_priv_objs.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification(
soc_reg_obj->restart_beaconing = CH_AVOID_RULE_RESTART;
soc_reg_obj->enable_srd_chan_in_master_mode = true;
soc_reg_obj->enable_11d_in_world_mode = false;
soc_reg_obj->retain_nol_across_regdmn_update = false;

for (i = 0; i < MAX_STA_VDEV_CNT; i++)
soc_reg_obj->vdev_ids_11d[i] = INVALID_VDEV_ID;
Expand Down
3 changes: 3 additions & 0 deletions umac/regulatory/core/src/reg_priv_objs.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ struct chan_change_cbk_entry {
* country update is pending for pdev (phy_id).
* @ignore_fw_reg_offload_ind: Ignore FW reg offload indication
* @six_ghz_supported: whether 6ghz is supported
* @retain_nol_across_regdmn_update: Retain the NOL list across the regdomain
* changes.
*/
struct wlan_regulatory_psoc_priv_obj {
struct mas_chan_params mas_chan_params[PSOC_MAX_PHY_REG_CAP];
Expand Down Expand Up @@ -140,6 +142,7 @@ struct wlan_regulatory_psoc_priv_obj {
bool enable_srd_chan_in_master_mode;
bool enable_11d_in_world_mode;
qdf_spinlock_t cbk_list_lock;
bool retain_nol_across_regdmn_update;
};

/**
Expand Down
39 changes: 38 additions & 1 deletion umac/regulatory/core/src/reg_services_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -3410,13 +3410,46 @@ bool reg_is_dfs_for_freq(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq)
return chan_flags & REGULATORY_CHAN_RADAR;
}

#ifdef CONFIG_REG_CLIENT
/**
* reg_get_psoc_mas_chan_list () - Get psoc master channel list
* @pdev: pointer to pdev object
* @psoc: pointer to psoc object
*
* Return: psoc master chanel list
*/
static struct regulatory_channel *reg_get_psoc_mas_chan_list(
struct wlan_objmgr_pdev *pdev,
struct wlan_objmgr_psoc *psoc)
{
struct wlan_regulatory_psoc_priv_obj *soc_reg;
uint8_t pdev_id;

soc_reg = reg_get_psoc_obj(psoc);
if (!soc_reg) {
reg_err("reg psoc private obj is NULL");
return NULL;
}
pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);

return soc_reg->mas_chan_params[pdev_id].mas_chan_list;
}
#else
static inline struct regulatory_channel *reg_get_psoc_mas_chan_list(
struct wlan_objmgr_pdev *pdev,
struct wlan_objmgr_psoc *psoc)
{
return NULL;
}
#endif

void reg_update_nol_ch_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t *chan_freq_list,
uint8_t num_chan,
bool nol_chan)
{
enum channel_enum chan_enum;
struct regulatory_channel *mas_chan_list;
struct regulatory_channel *mas_chan_list, *psoc_mas_chan_list;
struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
struct wlan_objmgr_psoc *psoc;
uint16_t i;
Expand All @@ -3434,6 +3467,8 @@ void reg_update_nol_ch_for_freq(struct wlan_objmgr_pdev *pdev,
return;
}

psoc_mas_chan_list = reg_get_psoc_mas_chan_list(pdev, psoc);

mas_chan_list = pdev_priv_obj->mas_chan_list;
for (i = 0; i < num_chan; i++) {
chan_enum = reg_get_chan_enum_for_freq(chan_freq_list[i]);
Expand All @@ -3443,6 +3478,8 @@ void reg_update_nol_ch_for_freq(struct wlan_objmgr_pdev *pdev,
continue;
}
mas_chan_list[chan_enum].nol_chan = nol_chan;
if (psoc_mas_chan_list)
psoc_mas_chan_list[chan_enum].nol_chan = nol_chan;
}

reg_compute_pdev_current_chan_list(pdev_priv_obj);
Expand Down
2 changes: 2 additions & 0 deletions umac/regulatory/core/src/reg_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,8 @@ QDF_STATUS reg_set_config_vars(struct wlan_objmgr_psoc *psoc,
config_vars.enable_srd_chan_in_master_mode;
psoc_priv_obj->enable_11d_in_world_mode =
config_vars.enable_11d_in_world_mode;
psoc_priv_obj->retain_nol_across_regdmn_update =
config_vars.retain_nol_across_regdmn_update;

status = wlan_objmgr_psoc_try_get_ref(psoc, WLAN_REGULATORY_SB_ID);
if (QDF_IS_STATUS_ERROR(status)) {
Expand Down
2 changes: 2 additions & 0 deletions umac/regulatory/dispatcher/inc/reg_services_public_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,7 @@ enum restart_beaconing_on_ch_avoid_rule {
* away from active LTE channels
* @enable_srd_chan_in_master_mode: SRD channel support in master mode
* @enable_11d_in_world_mode: enable 11d in world mode
* @retain_nol_across_regdmn_update: Retain the NOL list across the regdomain.
*/
struct reg_config_vars {
uint32_t enable_11d_support;
Expand All @@ -961,6 +962,7 @@ struct reg_config_vars {
enum restart_beaconing_on_ch_avoid_rule restart_beaconing;
bool enable_srd_chan_in_master_mode;
bool enable_11d_in_world_mode;
bool retain_nol_across_regdmn_update;
};

/**
Expand Down

0 comments on commit 20bccb7

Please sign in to comment.