|
@@ -803,8 +803,8 @@ QDF_STATUS reg_read_default_country(struct wlan_objmgr_psoc *psoc,
|
|
|
}
|
|
|
|
|
|
qdf_mem_copy(country_code,
|
|
|
- psoc_reg->default_country,
|
|
|
- sizeof(psoc_reg->default_country));
|
|
|
+ psoc_reg->def_country,
|
|
|
+ REG_ALPHA2_LEN + 1);
|
|
|
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
@@ -830,9 +830,10 @@ QDF_STATUS reg_set_default_country(struct wlan_objmgr_psoc *psoc,
|
|
|
return QDF_STATUS_E_INVAL;
|
|
|
}
|
|
|
|
|
|
- reg_info("setting default_country:n%s", country);
|
|
|
- qdf_mem_copy(psoc_reg->default_country,
|
|
|
- country, sizeof(psoc_reg->default_country));
|
|
|
+ reg_info("setting default_country: %s", country);
|
|
|
+
|
|
|
+ qdf_mem_copy(psoc_reg->def_country,
|
|
|
+ country, REG_ALPHA2_LEN + 1);
|
|
|
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
@@ -853,13 +854,12 @@ QDF_STATUS reg_set_country(struct wlan_objmgr_pdev *pdev,
|
|
|
psoc = wlan_pdev_get_psoc(pdev);
|
|
|
|
|
|
psoc_reg = reg_get_psoc_obj(psoc);
|
|
|
-
|
|
|
if (!IS_VALID_PSOC_REG_OBJ(psoc_reg)) {
|
|
|
reg_err("psoc reg component is NULL");
|
|
|
return QDF_STATUS_E_INVAL;
|
|
|
}
|
|
|
|
|
|
- if (!qdf_mem_cmp(psoc_reg->current_country,
|
|
|
+ if (!qdf_mem_cmp(psoc_reg->cur_country,
|
|
|
country, REG_ALPHA2_LEN)) {
|
|
|
reg_err("country is not different");
|
|
|
return QDF_STATUS_E_INVAL;
|
|
@@ -895,10 +895,10 @@ QDF_STATUS reg_reset_country(struct wlan_objmgr_psoc *psoc)
|
|
|
return QDF_STATUS_E_INVAL;
|
|
|
}
|
|
|
|
|
|
- reg_info("re-setting current_country to default");
|
|
|
- qdf_mem_copy(psoc_reg->current_country,
|
|
|
- psoc_reg->default_country,
|
|
|
- sizeof(psoc_reg->current_country));
|
|
|
+ reg_info("re-setting user country to default");
|
|
|
+ qdf_mem_copy(psoc_reg->cur_country,
|
|
|
+ psoc_reg->def_country,
|
|
|
+ REG_ALPHA2_LEN + 1);
|
|
|
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
@@ -909,18 +909,18 @@ QDF_STATUS reg_reset_country(struct wlan_objmgr_psoc *psoc)
|
|
|
*
|
|
|
* Return: None
|
|
|
*/
|
|
|
-void reg_get_dfs_region(struct wlan_objmgr_psoc *psoc,
|
|
|
+void reg_get_dfs_region(struct wlan_objmgr_pdev *pdev,
|
|
|
enum dfs_reg *dfs_reg)
|
|
|
{
|
|
|
- struct wlan_regulatory_psoc_priv_obj *soc_reg;
|
|
|
+ struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
|
|
|
|
|
|
- soc_reg = reg_get_psoc_obj(psoc);
|
|
|
- if (!IS_VALID_PSOC_REG_OBJ(soc_reg)) {
|
|
|
- reg_err("psoc reg component is NULL");
|
|
|
+ pdev_priv_obj = reg_get_pdev_obj(pdev);
|
|
|
+ if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
|
|
|
+ reg_err("reg component pdev priv is NULL");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- *dfs_reg = soc_reg->dfs_region;
|
|
|
+ *dfs_reg = pdev_priv_obj->dfs_region;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -929,17 +929,18 @@ void reg_get_dfs_region(struct wlan_objmgr_psoc *psoc,
|
|
|
*
|
|
|
* Return: None
|
|
|
*/
|
|
|
-void reg_set_dfs_region(struct wlan_objmgr_psoc *psoc,
|
|
|
+void reg_set_dfs_region(struct wlan_objmgr_pdev *pdev,
|
|
|
enum dfs_reg dfs_reg)
|
|
|
{
|
|
|
- struct wlan_regulatory_psoc_priv_obj *soc_reg;
|
|
|
+ struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
|
|
|
|
|
|
- soc_reg = reg_get_psoc_obj(psoc);
|
|
|
- if (!IS_VALID_PSOC_REG_OBJ(soc_reg)) {
|
|
|
+ pdev_priv_obj = reg_get_pdev_obj(pdev);
|
|
|
+ if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
|
|
|
reg_err("psoc reg component is NULL");
|
|
|
return;
|
|
|
}
|
|
|
- soc_reg->dfs_region = dfs_reg;
|
|
|
+
|
|
|
+ pdev_priv_obj->dfs_region = dfs_reg;
|
|
|
}
|
|
|
|
|
|
QDF_STATUS reg_get_domain_from_country_code(v_REGDOMAIN_t *reg_domain_ptr,
|
|
@@ -1342,9 +1343,9 @@ static void modify_chan_list_for_indoor_channels(struct regulatory_channel
|
|
|
if (REGULATORY_CHAN_INDOOR_ONLY &
|
|
|
chan_list[chan_enum].chan_flags) {
|
|
|
chan_list[chan_enum].state =
|
|
|
- CHANNEL_STATE_PASSIVE;
|
|
|
+ CHANNEL_STATE_DISABLE;
|
|
|
chan_list[chan_enum].chan_flags |=
|
|
|
- REGULATORY_CHAN_NO_IR;
|
|
|
+ REGULATORY_CHAN_DISABLED;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1468,20 +1469,37 @@ modify_chan_list_for_freq_range(struct regulatory_channel *chan_list,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static void init_pdev_chan_list(struct wlan_regulatory_psoc_priv_obj
|
|
|
- *psoc_priv_obj,
|
|
|
- struct wlan_regulatory_pdev_priv_obj
|
|
|
- *pdev_priv_obj)
|
|
|
+static void init_pdev_mas_chan_list(struct wlan_regulatory_pdev_priv_obj
|
|
|
+ *pdev_priv_obj,
|
|
|
+ struct mas_chan_params
|
|
|
+ *mas_chan_params)
|
|
|
{
|
|
|
- qdf_mem_copy(pdev_priv_obj->cur_chan_list,
|
|
|
- psoc_priv_obj->mas_chan_list,
|
|
|
+ qdf_mem_copy(pdev_priv_obj->mas_chan_list,
|
|
|
+ mas_chan_params->mas_chan_list,
|
|
|
NUM_CHANNELS * sizeof(struct regulatory_channel));
|
|
|
+
|
|
|
+ pdev_priv_obj->dfs_region = mas_chan_params->dfs_region;
|
|
|
+
|
|
|
+ pdev_priv_obj->phybitmap = mas_chan_params->phybitmap;
|
|
|
+
|
|
|
+ pdev_priv_obj->reg_dmn_pair = mas_chan_params->reg_dmn_pair;
|
|
|
+ pdev_priv_obj->ctry_code = mas_chan_params->ctry_code;
|
|
|
+
|
|
|
+ qdf_mem_copy(pdev_priv_obj->default_country,
|
|
|
+ mas_chan_params->default_country, REG_ALPHA2_LEN + 1);
|
|
|
+
|
|
|
+ qdf_mem_copy(pdev_priv_obj->current_country,
|
|
|
+ mas_chan_params->current_country, REG_ALPHA2_LEN + 1);
|
|
|
}
|
|
|
|
|
|
|
|
|
static void compute_pdev_current_chan_list(struct wlan_regulatory_pdev_priv_obj
|
|
|
*pdev_priv_obj)
|
|
|
{
|
|
|
+ qdf_mem_copy(pdev_priv_obj->cur_chan_list,
|
|
|
+ pdev_priv_obj->mas_chan_list,
|
|
|
+ NUM_CHANNELS * sizeof(struct regulatory_channel));
|
|
|
+
|
|
|
modify_chan_list_for_freq_range(pdev_priv_obj->cur_chan_list,
|
|
|
pdev_priv_obj->range_2g_low,
|
|
|
pdev_priv_obj->range_2g_high,
|
|
@@ -1782,6 +1800,7 @@ static void reg_propagate_mas_chan_list_to_pdev(struct wlan_objmgr_psoc *psoc,
|
|
|
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
|
|
|
struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
|
|
|
enum direction *dir = arg;
|
|
|
+ uint32_t pdev_id;
|
|
|
struct wlan_lmac_if_reg_tx_ops *reg_tx_ops;
|
|
|
|
|
|
psoc_priv_obj = (struct wlan_regulatory_psoc_priv_obj *)
|
|
@@ -1800,8 +1819,9 @@ static void reg_propagate_mas_chan_list_to_pdev(struct wlan_objmgr_psoc *psoc,
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- init_pdev_chan_list(psoc_priv_obj,
|
|
|
- pdev_priv_obj);
|
|
|
+ pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);
|
|
|
+ init_pdev_mas_chan_list(pdev_priv_obj,
|
|
|
+ &psoc_priv_obj->mas_chan_params[pdev_id]);
|
|
|
|
|
|
compute_pdev_current_chan_list(pdev_priv_obj);
|
|
|
|
|
@@ -1855,18 +1875,13 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info
|
|
|
struct wlan_lmac_if_reg_tx_ops *tx_ops;
|
|
|
struct wlan_objmgr_psoc *psoc;
|
|
|
enum channel_enum chan_enum;
|
|
|
- QDF_STATUS status;
|
|
|
wlan_objmgr_ref_dbgid dbg_id;
|
|
|
enum direction dir;
|
|
|
+ uint8_t phy_id;
|
|
|
+ struct wlan_objmgr_pdev *pdev;
|
|
|
|
|
|
reg_debug("process reg master chan list");
|
|
|
|
|
|
- if (regulat_info->status_code == REG_CURRENT_ALPHA2_NOT_FOUND) {
|
|
|
- reg_err("current country not present in regdb");
|
|
|
- soc_reg->new_user_ctry_pending = false;
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
- }
|
|
|
-
|
|
|
psoc = regulat_info->psoc;
|
|
|
soc_reg = reg_get_psoc_obj(psoc);
|
|
|
|
|
@@ -1875,7 +1890,20 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
|
|
|
- mas_chan_list = soc_reg->mas_chan_list;
|
|
|
+ tx_ops = reg_get_psoc_tx_ops(psoc);
|
|
|
+ if (tx_ops->is_regdb_offloaded)
|
|
|
+ soc_reg->offload_enabled =
|
|
|
+ tx_ops->is_regdb_offloaded(psoc);
|
|
|
+ else
|
|
|
+ soc_reg->offload_enabled = false;
|
|
|
+ if (tx_ops->is_11d_offloaded)
|
|
|
+ soc_reg->is_11d_offloaded =
|
|
|
+ tx_ops->is_11d_offloaded(psoc);
|
|
|
+ else
|
|
|
+ soc_reg->is_11d_offloaded = false;
|
|
|
+
|
|
|
+ phy_id = regulat_info->phy_id;
|
|
|
+ mas_chan_list = soc_reg->mas_chan_params[phy_id].mas_chan_list;
|
|
|
|
|
|
for (chan_enum = 0; chan_enum < NUM_CHANNELS;
|
|
|
chan_enum++) {
|
|
@@ -1890,27 +1918,20 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info
|
|
|
mas_chan_list[chan_enum].nol_chan = false;
|
|
|
}
|
|
|
|
|
|
- tx_ops = reg_get_psoc_tx_ops(psoc);
|
|
|
- if (tx_ops->is_regdb_offloaded)
|
|
|
- soc_reg->offload_enabled =
|
|
|
- tx_ops->is_regdb_offloaded(psoc);
|
|
|
- else
|
|
|
- soc_reg->offload_enabled = false;
|
|
|
-
|
|
|
- if (tx_ops->is_11d_offloaded)
|
|
|
- soc_reg->is_11d_offloaded =
|
|
|
- tx_ops->is_11d_offloaded(psoc);
|
|
|
- else
|
|
|
- soc_reg->is_11d_offloaded = false;
|
|
|
-
|
|
|
- soc_reg->phybitmap = regulat_info->phybitmap;
|
|
|
- soc_reg->dfs_region = regulat_info->dfs_region;
|
|
|
soc_reg->num_phy = regulat_info->num_phy;
|
|
|
- soc_reg->ctry_code = regulat_info->ctry_code;
|
|
|
- soc_reg->reg_dmn_pair = regulat_info->reg_dmn_pair;
|
|
|
- qdf_mem_copy(soc_reg->default_country, regulat_info->alpha2,
|
|
|
+ soc_reg->mas_chan_params[phy_id].phybitmap =
|
|
|
+ regulat_info->phybitmap;
|
|
|
+ soc_reg->mas_chan_params[phy_id].dfs_region =
|
|
|
+ regulat_info->dfs_region;
|
|
|
+ soc_reg->mas_chan_params[phy_id].ctry_code =
|
|
|
+ regulat_info->ctry_code;
|
|
|
+ soc_reg->mas_chan_params[phy_id].reg_dmn_pair =
|
|
|
+ regulat_info->reg_dmn_pair;
|
|
|
+ qdf_mem_copy(soc_reg->mas_chan_params[phy_id].current_country,
|
|
|
+ regulat_info->alpha2,
|
|
|
REG_ALPHA2_LEN + 1);
|
|
|
- qdf_mem_copy(soc_reg->current_country, regulat_info->alpha2,
|
|
|
+ qdf_mem_copy(soc_reg->cur_country,
|
|
|
+ regulat_info->alpha2,
|
|
|
REG_ALPHA2_LEN + 1);
|
|
|
|
|
|
min_bw_2g = regulat_info->min_bw_2g;
|
|
@@ -1944,17 +1965,22 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info
|
|
|
|
|
|
soc_reg->cc_src = SOURCE_DRIVER;
|
|
|
if (soc_reg->new_user_ctry_pending == true) {
|
|
|
-
|
|
|
soc_reg->new_user_ctry_pending = false;
|
|
|
soc_reg->cc_src = SOURCE_USERSPACE;
|
|
|
soc_reg->user_ctry_set = true;
|
|
|
reg_debug("new country code is set");
|
|
|
reg_run_11d_state_machine(psoc);
|
|
|
} else if (soc_reg->new_11d_ctry_pending == true) {
|
|
|
-
|
|
|
soc_reg->new_11d_ctry_pending = false;
|
|
|
soc_reg->cc_src = SOURCE_11D;
|
|
|
soc_reg->user_ctry_set = false;
|
|
|
+ } else {
|
|
|
+ qdf_mem_copy(soc_reg->mas_chan_params[phy_id].default_country,
|
|
|
+ regulat_info->alpha2,
|
|
|
+ REG_ALPHA2_LEN + 1);
|
|
|
+ qdf_mem_copy(soc_reg->def_country,
|
|
|
+ regulat_info->alpha2,
|
|
|
+ REG_ALPHA2_LEN + 1);
|
|
|
}
|
|
|
|
|
|
if (soc_reg->offload_enabled) {
|
|
@@ -1965,17 +1991,13 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info
|
|
|
dir = SOUTHBOUND;
|
|
|
}
|
|
|
|
|
|
- status = wlan_objmgr_psoc_try_get_ref(psoc, dbg_id);
|
|
|
- if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
- reg_err("error taking psoc ref cnt");
|
|
|
- return status;
|
|
|
+ pdev = wlan_objmgr_get_pdev_by_id(psoc, phy_id, dbg_id);
|
|
|
+ if (pdev != NULL) {
|
|
|
+ reg_propagate_mas_chan_list_to_pdev(psoc, pdev, &dir);
|
|
|
+ wlan_objmgr_pdev_release_ref(pdev, dbg_id);
|
|
|
}
|
|
|
- status = wlan_objmgr_iterate_obj_list(psoc, WLAN_PDEV_OP,
|
|
|
- reg_propagate_mas_chan_list_to_pdev,
|
|
|
- &dir, 1, dbg_id);
|
|
|
- wlan_objmgr_psoc_release_ref(psoc, dbg_id);
|
|
|
|
|
|
- return status;
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1996,6 +2018,7 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification(
|
|
|
enum channel_enum chan_enum;
|
|
|
QDF_STATUS status;
|
|
|
uint8_t i;
|
|
|
+ uint8_t pdev_cnt;
|
|
|
|
|
|
soc_reg_obj = qdf_mem_malloc(sizeof(*soc_reg_obj));
|
|
|
if (NULL == soc_reg_obj) {
|
|
@@ -2006,7 +2029,6 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification(
|
|
|
soc_reg_obj->offload_enabled = false;
|
|
|
soc_reg_obj->psoc_ptr = psoc;
|
|
|
soc_reg_obj->dfs_enabled = true;
|
|
|
- soc_reg_obj->set_fcc_channel = false;
|
|
|
soc_reg_obj->band_capability = BAND_ALL;
|
|
|
soc_reg_obj->enable_11d_supp = false;
|
|
|
soc_reg_obj->indoor_chan_enabled = true;
|
|
@@ -2018,19 +2040,22 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification(
|
|
|
|
|
|
qdf_spinlock_create(&soc_reg_obj->cbk_list_lock);
|
|
|
|
|
|
- mas_chan_list = soc_reg_obj->mas_chan_list;
|
|
|
+ for (pdev_cnt = 0; pdev_cnt < PSOC_MAX_PHY_REG_CAP; pdev_cnt++) {
|
|
|
+ mas_chan_list =
|
|
|
+ soc_reg_obj->mas_chan_params[pdev_cnt].mas_chan_list;
|
|
|
|
|
|
- for (chan_enum = 0; chan_enum < NUM_CHANNELS;
|
|
|
- chan_enum++) {
|
|
|
- mas_chan_list[chan_enum].chan_num =
|
|
|
- channel_map[chan_enum].chan_num;
|
|
|
- mas_chan_list[chan_enum].center_freq =
|
|
|
- channel_map[chan_enum].center_freq;
|
|
|
- mas_chan_list[chan_enum].chan_flags |=
|
|
|
- REGULATORY_CHAN_DISABLED;
|
|
|
- mas_chan_list[chan_enum].state =
|
|
|
- CHANNEL_STATE_DISABLE;
|
|
|
- mas_chan_list[chan_enum].nol_chan = false;
|
|
|
+ for (chan_enum = 0; chan_enum < NUM_CHANNELS;
|
|
|
+ chan_enum++) {
|
|
|
+ mas_chan_list[chan_enum].chan_num =
|
|
|
+ channel_map[chan_enum].chan_num;
|
|
|
+ mas_chan_list[chan_enum].center_freq =
|
|
|
+ channel_map[chan_enum].center_freq;
|
|
|
+ mas_chan_list[chan_enum].chan_flags |=
|
|
|
+ REGULATORY_CHAN_DISABLED;
|
|
|
+ mas_chan_list[chan_enum].state =
|
|
|
+ CHANNEL_STATE_DISABLE;
|
|
|
+ mas_chan_list[chan_enum].nol_chan = false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
status = wlan_objmgr_psoc_component_obj_attach(psoc,
|
|
@@ -2118,9 +2143,6 @@ QDF_STATUS reg_set_band(struct wlan_objmgr_pdev *pdev,
|
|
|
reg_info("setting band_info: %d", band);
|
|
|
pdev_priv_obj->band_capability = band;
|
|
|
|
|
|
- init_pdev_chan_list(psoc_priv_obj,
|
|
|
- pdev_priv_obj);
|
|
|
-
|
|
|
compute_pdev_current_chan_list(pdev_priv_obj);
|
|
|
|
|
|
status = send_scheduler_msg_sb(psoc, pdev);
|
|
@@ -2162,9 +2184,6 @@ QDF_STATUS reg_set_fcc_constraint(struct wlan_objmgr_pdev *pdev,
|
|
|
return QDF_STATUS_E_INVAL;
|
|
|
}
|
|
|
|
|
|
- init_pdev_chan_list(psoc_priv_obj,
|
|
|
- pdev_priv_obj);
|
|
|
-
|
|
|
compute_pdev_current_chan_list(pdev_priv_obj);
|
|
|
|
|
|
status = send_scheduler_msg_sb(psoc, pdev);
|
|
@@ -2207,9 +2226,6 @@ QDF_STATUS reg_enable_dfs_channels(struct wlan_objmgr_pdev *pdev,
|
|
|
|
|
|
pdev_priv_obj->dfs_enabled = enable;
|
|
|
|
|
|
- init_pdev_chan_list(psoc_priv_obj,
|
|
|
- pdev_priv_obj);
|
|
|
-
|
|
|
compute_pdev_current_chan_list(pdev_priv_obj);
|
|
|
|
|
|
status = send_scheduler_msg_sb(psoc, pdev);
|
|
@@ -2261,7 +2277,7 @@ QDF_STATUS wlan_regulatory_pdev_obj_created_notification(
|
|
|
|
|
|
pdev_priv_obj->pdev_ptr = pdev;
|
|
|
pdev_priv_obj->dfs_enabled = psoc_priv_obj->dfs_enabled;
|
|
|
- pdev_priv_obj->set_fcc_channel = psoc_priv_obj->set_fcc_channel;
|
|
|
+ pdev_priv_obj->set_fcc_channel = false;
|
|
|
pdev_priv_obj->band_capability = psoc_priv_obj->band_capability;
|
|
|
pdev_priv_obj->indoor_chan_enabled =
|
|
|
psoc_priv_obj->indoor_chan_enabled;
|
|
@@ -2297,8 +2313,8 @@ QDF_STATUS wlan_regulatory_pdev_obj_created_notification(
|
|
|
pdev_priv_obj->range_5g_high = range_5g_high;
|
|
|
pdev_priv_obj->wireless_modes = reg_cap_ptr->wireless_modes;
|
|
|
|
|
|
- init_pdev_chan_list(psoc_priv_obj,
|
|
|
- pdev_priv_obj);
|
|
|
+ init_pdev_mas_chan_list(pdev_priv_obj,
|
|
|
+ &psoc_priv_obj->mas_chan_params[pdev_id]);
|
|
|
|
|
|
compute_pdev_current_chan_list(pdev_priv_obj);
|
|
|
|
|
@@ -2517,28 +2533,23 @@ void reg_update_nol_ch(struct wlan_objmgr_pdev *pdev,
|
|
|
{
|
|
|
enum channel_enum chan_enum;
|
|
|
struct regulatory_channel *mas_chan_list;
|
|
|
- struct wlan_objmgr_psoc *psoc;
|
|
|
- struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
|
|
|
+ struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
|
|
|
uint16_t i;
|
|
|
- enum direction dir;
|
|
|
- QDF_STATUS status;
|
|
|
|
|
|
if (!num_chan || !chan_list) {
|
|
|
reg_err("chan_list or num_ch is NULL");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- psoc = wlan_pdev_get_psoc(pdev);
|
|
|
-
|
|
|
- psoc_priv_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
|
|
- WLAN_UMAC_COMP_REGULATORY);
|
|
|
+ pdev_priv_obj = wlan_objmgr_pdev_get_comp_private_obj(pdev,
|
|
|
+ WLAN_UMAC_COMP_REGULATORY);
|
|
|
|
|
|
- if (NULL == psoc_priv_obj) {
|
|
|
+ if (NULL == pdev_priv_obj) {
|
|
|
reg_err("reg psoc private obj is NULL");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- mas_chan_list = psoc_priv_obj->mas_chan_list;
|
|
|
+ mas_chan_list = pdev_priv_obj->mas_chan_list;
|
|
|
for (i = 0; i < num_chan; i++) {
|
|
|
chan_enum = reg_get_chan_enum(chan_list[i]);
|
|
|
if (chan_enum == INVALID_CHANNEL) {
|
|
@@ -2549,17 +2560,7 @@ void reg_update_nol_ch(struct wlan_objmgr_pdev *pdev,
|
|
|
mas_chan_list[chan_enum].nol_chan = nol_chan;
|
|
|
}
|
|
|
|
|
|
- dir = SOUTHBOUND;
|
|
|
-
|
|
|
- status = wlan_objmgr_psoc_try_get_ref(psoc, WLAN_REGULATORY_SB_ID);
|
|
|
- if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
- reg_err("error taking psoc ref cnt");
|
|
|
- return;
|
|
|
- }
|
|
|
- status = wlan_objmgr_iterate_obj_list(psoc, WLAN_PDEV_OP,
|
|
|
- reg_propagate_mas_chan_list_to_pdev,
|
|
|
- &dir, 1, WLAN_REGULATORY_SB_ID);
|
|
|
- wlan_objmgr_psoc_release_ref(psoc, WLAN_REGULATORY_SB_ID);
|
|
|
+ compute_pdev_current_chan_list(pdev_priv_obj);
|
|
|
}
|
|
|
|
|
|
static void reg_change_pdev_for_config(struct wlan_objmgr_psoc *psoc,
|
|
@@ -2591,9 +2592,6 @@ static void reg_change_pdev_for_config(struct wlan_objmgr_psoc *psoc,
|
|
|
psoc_priv_obj->indoor_chan_enabled;
|
|
|
pdev_priv_obj->band_capability = psoc_priv_obj->band_capability;
|
|
|
|
|
|
- init_pdev_chan_list(psoc_priv_obj,
|
|
|
- pdev_priv_obj);
|
|
|
-
|
|
|
compute_pdev_current_chan_list(pdev_priv_obj);
|
|
|
|
|
|
send_scheduler_msg_sb(psoc, pdev);
|
|
@@ -2662,15 +2660,16 @@ bool reg_is_regdb_offloaded(struct wlan_objmgr_psoc *psoc)
|
|
|
}
|
|
|
|
|
|
void reg_program_mas_chan_list(struct wlan_objmgr_psoc *psoc,
|
|
|
- struct regulatory_channel *reg_channels,
|
|
|
- uint8_t *alpha2,
|
|
|
- enum dfs_reg dfs_region)
|
|
|
+ struct regulatory_channel *reg_channels,
|
|
|
+ uint8_t *alpha2,
|
|
|
+ enum dfs_reg dfs_region)
|
|
|
{
|
|
|
|
|
|
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
|
|
|
QDF_STATUS status;
|
|
|
uint32_t count;
|
|
|
enum direction dir;
|
|
|
+ uint32_t pdev_cnt;
|
|
|
|
|
|
psoc_priv_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
|
|
WLAN_UMAC_COMP_REGULATORY);
|
|
@@ -2680,10 +2679,10 @@ void reg_program_mas_chan_list(struct wlan_objmgr_psoc *psoc,
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- psoc_priv_obj->dfs_region = dfs_region;
|
|
|
- qdf_mem_copy(psoc_priv_obj->current_country, alpha2,
|
|
|
+ qdf_mem_copy(psoc_priv_obj->cur_country, alpha2,
|
|
|
REG_ALPHA2_LEN);
|
|
|
|
|
|
+
|
|
|
for (count = 0; count < NUM_CHANNELS; count++) {
|
|
|
reg_channels[count].chan_num =
|
|
|
channel_map[count].chan_num;
|
|
@@ -2692,12 +2691,17 @@ void reg_program_mas_chan_list(struct wlan_objmgr_psoc *psoc,
|
|
|
reg_channels[count].nol_chan = false;
|
|
|
}
|
|
|
|
|
|
- qdf_mem_copy(psoc_priv_obj->mas_chan_list,
|
|
|
- reg_channels,
|
|
|
- NUM_CHANNELS * sizeof(struct regulatory_channel));
|
|
|
+ for (pdev_cnt = 0; pdev_cnt < PSOC_MAX_PHY_REG_CAP; pdev_cnt++) {
|
|
|
+ qdf_mem_copy(psoc_priv_obj->mas_chan_params[pdev_cnt].
|
|
|
+ mas_chan_list,
|
|
|
+ reg_channels,
|
|
|
+ NUM_CHANNELS * sizeof(struct regulatory_channel));
|
|
|
|
|
|
- dir = SOUTHBOUND;
|
|
|
+ psoc_priv_obj->mas_chan_params[pdev_cnt].dfs_region =
|
|
|
+ dfs_region;
|
|
|
+ }
|
|
|
|
|
|
+ dir = SOUTHBOUND;
|
|
|
status = wlan_objmgr_psoc_try_get_ref(psoc, WLAN_REGULATORY_SB_ID);
|
|
|
if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
reg_err("error taking psoc ref cnt");
|
|
@@ -2772,41 +2776,38 @@ enum country_src reg_get_cc_and_src(struct wlan_objmgr_psoc *psoc,
|
|
|
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
|
|
|
|
|
|
psoc_priv_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
|
|
- WLAN_UMAC_COMP_REGULATORY);
|
|
|
+ WLAN_UMAC_COMP_REGULATORY);
|
|
|
|
|
|
if (NULL == psoc_priv_obj) {
|
|
|
reg_err("reg psoc private obj is NULL");
|
|
|
-
|
|
|
return SOURCE_UNKNOWN;
|
|
|
}
|
|
|
|
|
|
- qdf_mem_copy(alpha2, psoc_priv_obj->current_country,
|
|
|
+ qdf_mem_copy(alpha2, psoc_priv_obj->cur_country,
|
|
|
REG_ALPHA2_LEN + 1);
|
|
|
|
|
|
return psoc_priv_obj->cc_src;
|
|
|
}
|
|
|
|
|
|
-QDF_STATUS reg_program_default_cc(struct wlan_objmgr_psoc *psoc,
|
|
|
+QDF_STATUS reg_program_default_cc(struct wlan_objmgr_pdev *pdev,
|
|
|
uint16_t regdmn)
|
|
|
{
|
|
|
- struct wlan_regulatory_psoc_priv_obj *soc_reg;
|
|
|
+ struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
|
|
|
struct cur_regulatory_info *reg_info;
|
|
|
uint16_t cc = -1;
|
|
|
uint16_t country_index = -1, regdmn_pair = -1;
|
|
|
+ struct wlan_objmgr_psoc *psoc;
|
|
|
QDF_STATUS err;
|
|
|
|
|
|
- soc_reg = (struct wlan_regulatory_psoc_priv_obj *)
|
|
|
- wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
|
|
- WLAN_UMAC_COMP_REGULATORY);
|
|
|
+ pdev_priv_obj = (struct wlan_regulatory_pdev_priv_obj *)
|
|
|
+ wlan_objmgr_pdev_get_comp_private_obj(pdev,
|
|
|
+ WLAN_UMAC_COMP_REGULATORY);
|
|
|
|
|
|
- if (NULL == soc_reg) {
|
|
|
+ if (NULL == pdev_priv_obj) {
|
|
|
reg_err("reg soc is NULL");
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
|
|
|
- if (soc_reg->offload_enabled)
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
-
|
|
|
reg_info = (struct cur_regulatory_info *)qdf_mem_malloc
|
|
|
(sizeof(struct cur_regulatory_info));
|
|
|
if (reg_info == NULL) {
|
|
@@ -2814,7 +2815,14 @@ QDF_STATUS reg_program_default_cc(struct wlan_objmgr_psoc *psoc,
|
|
|
return QDF_STATUS_E_NOMEM;
|
|
|
}
|
|
|
|
|
|
+ psoc = wlan_pdev_get_psoc(pdev);
|
|
|
+ if (!psoc) {
|
|
|
+ reg_err("psoc is NULL");
|
|
|
+ return QDF_STATUS_E_INVAL;
|
|
|
+ }
|
|
|
+
|
|
|
reg_info->psoc = psoc;
|
|
|
+ reg_info->phy_id = wlan_objmgr_pdev_get_pdev_id(pdev);
|
|
|
|
|
|
if (regdmn == 0) {
|
|
|
reg_get_default_country(®dmn);
|
|
@@ -2837,7 +2845,7 @@ QDF_STATUS reg_program_default_cc(struct wlan_objmgr_psoc *psoc,
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
|
|
|
- soc_reg->ctry_code = cc;
|
|
|
+ pdev_priv_obj->ctry_code = cc;
|
|
|
|
|
|
} else {
|
|
|
reg_get_rdpair_from_regdmn_id(regdmn,
|
|
@@ -2852,7 +2860,7 @@ QDF_STATUS reg_program_default_cc(struct wlan_objmgr_psoc *psoc,
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
|
|
|
- soc_reg->reg_dmn_pair = regdmn;
|
|
|
+ pdev_priv_obj->reg_dmn_pair = regdmn;
|
|
|
}
|
|
|
|
|
|
reg_info->offload_enabled = false;
|
|
@@ -2865,20 +2873,21 @@ QDF_STATUS reg_program_default_cc(struct wlan_objmgr_psoc *psoc,
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-QDF_STATUS reg_program_chan_list(struct wlan_objmgr_psoc *psoc,
|
|
|
- struct cc_regdmn_s *rd)
|
|
|
+QDF_STATUS reg_program_chan_list(struct wlan_objmgr_pdev *pdev,
|
|
|
+ struct cc_regdmn_s *rd)
|
|
|
{
|
|
|
struct cur_regulatory_info *reg_info;
|
|
|
- struct wlan_regulatory_psoc_priv_obj *soc_reg;
|
|
|
+ struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
|
|
|
uint16_t country_index = -1, regdmn_pair = -1;
|
|
|
+ struct wlan_objmgr_psoc *psoc;
|
|
|
QDF_STATUS err;
|
|
|
|
|
|
- soc_reg = (struct wlan_regulatory_psoc_priv_obj *)
|
|
|
- wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
|
|
- WLAN_UMAC_COMP_REGULATORY);
|
|
|
+ pdev_priv_obj = (struct wlan_regulatory_pdev_priv_obj *)
|
|
|
+ wlan_objmgr_pdev_get_comp_private_obj(pdev,
|
|
|
+ WLAN_UMAC_COMP_REGULATORY);
|
|
|
|
|
|
- if (NULL == soc_reg) {
|
|
|
- reg_err("soc_reg is NULL");
|
|
|
+ if (NULL == pdev_priv_obj) {
|
|
|
+ reg_err(" pdev priv obj is NULL");
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
|
|
@@ -2889,7 +2898,14 @@ QDF_STATUS reg_program_chan_list(struct wlan_objmgr_psoc *psoc,
|
|
|
return QDF_STATUS_E_NOMEM;
|
|
|
}
|
|
|
|
|
|
+ psoc = wlan_pdev_get_psoc(pdev);
|
|
|
+ if (!psoc) {
|
|
|
+ reg_err("psoc is NULL");
|
|
|
+ return QDF_STATUS_E_INVAL;
|
|
|
+ }
|
|
|
+
|
|
|
reg_info->psoc = psoc;
|
|
|
+ reg_info->phy_id = wlan_objmgr_pdev_get_pdev_id(pdev);
|
|
|
|
|
|
if (rd->flags == CC_IS_SET) {
|
|
|
reg_get_rdpair_from_country_code(rd->cc.country_code,
|
|
@@ -2938,39 +2954,40 @@ bool reg_is_11d_scan_inprogress(struct wlan_objmgr_psoc *psoc)
|
|
|
return psoc_priv_obj->enable_11d_supp;
|
|
|
}
|
|
|
|
|
|
-QDF_STATUS reg_get_current_cc(struct wlan_objmgr_psoc *psoc,
|
|
|
- struct cc_regdmn_s *rd)
|
|
|
+QDF_STATUS reg_get_current_cc(struct wlan_objmgr_pdev *pdev,
|
|
|
+ struct cc_regdmn_s *rd)
|
|
|
{
|
|
|
- struct wlan_regulatory_psoc_priv_obj *soc_reg;
|
|
|
+ struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
|
|
|
|
|
|
- soc_reg = (struct wlan_regulatory_psoc_priv_obj *)
|
|
|
- wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
|
|
- WLAN_UMAC_COMP_REGULATORY);
|
|
|
+ pdev_priv_obj = (struct wlan_regulatory_pdev_priv_obj *)
|
|
|
+ wlan_objmgr_pdev_get_comp_private_obj(pdev,
|
|
|
+ WLAN_UMAC_COMP_REGULATORY);
|
|
|
|
|
|
- if (NULL == soc_reg) {
|
|
|
- reg_err("reg soc is NULL");
|
|
|
+ if (NULL == pdev_priv_obj) {
|
|
|
+ reg_err("reg pdev priv is NULL");
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
|
|
|
if (rd->flags == CC_IS_SET) {
|
|
|
- rd->cc.country_code = soc_reg->ctry_code;
|
|
|
+ rd->cc.country_code = pdev_priv_obj->ctry_code;
|
|
|
} else if (rd->flags == ALPHA_IS_SET) {
|
|
|
- qdf_mem_copy(rd->cc.alpha, soc_reg->current_country,
|
|
|
- sizeof(rd->cc.alpha));
|
|
|
+ qdf_mem_copy(rd->cc.alpha, pdev_priv_obj->current_country,
|
|
|
+ sizeof(rd->cc.alpha));
|
|
|
} else if (rd->flags == REGDMN_IS_SET) {
|
|
|
- rd->cc.regdmn_id = soc_reg->reg_dmn_pair;
|
|
|
+ rd->cc.regdmn_id = pdev_priv_obj->reg_dmn_pair;
|
|
|
}
|
|
|
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
|
QDF_STATUS reg_save_new_11d_country(struct wlan_objmgr_psoc *psoc,
|
|
|
- uint8_t *country)
|
|
|
+ uint8_t *country)
|
|
|
{
|
|
|
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
|
|
|
|
|
|
psoc_priv_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
|
|
- WLAN_UMAC_COMP_REGULATORY);
|
|
|
+ WLAN_UMAC_COMP_REGULATORY);
|
|
|
+
|
|
|
if (!psoc_priv_obj) {
|
|
|
reg_err("reg psoc private obj is NULL");
|
|
|
|