qcacld-3.0: Refactor hdd_get_sap_adapter_of_dfs() iterator
Iterate through all the active links in the adapter to check for any SAP on DFS channel. Change-Id: I2d84edc2a8cb8d3c8410c9e7e4badfa0fb2215ea CRs-Fixed: 3522948
This commit is contained in:

committed by
Rahul Choudhary

parent
d83888b243
commit
8306982663
@@ -491,54 +491,60 @@ hdd_get_dot11mode_filter(struct hdd_context *hdd_ctx)
|
|||||||
*
|
*
|
||||||
* Return: pointer to adapter or null
|
* Return: pointer to adapter or null
|
||||||
*/
|
*/
|
||||||
static struct hdd_adapter
|
static struct hdd_adapter *
|
||||||
*hdd_get_sap_adapter_of_dfs(struct hdd_context *hdd_ctx)
|
hdd_get_sap_adapter_of_dfs(struct hdd_context *hdd_ctx)
|
||||||
{
|
{
|
||||||
struct hdd_adapter *adapter, *next_adapter = NULL;
|
struct hdd_adapter *adapter, *next_adapter = NULL;
|
||||||
wlan_net_dev_ref_dbgid dbgid = NET_DEV_HOLD_GET_ADAPTER;
|
wlan_net_dev_ref_dbgid dbgid = NET_DEV_HOLD_GET_ADAPTER;
|
||||||
struct wlan_channel *chan;
|
struct wlan_channel *chan;
|
||||||
struct ch_params ch_params = {0};
|
struct ch_params ch_params = {0};
|
||||||
|
struct wlan_hdd_link_info *link_info;
|
||||||
|
|
||||||
hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter,
|
hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter,
|
||||||
dbgid) {
|
dbgid) {
|
||||||
if (adapter->device_mode != QDF_SAP_MODE)
|
if (adapter->device_mode != QDF_SAP_MODE)
|
||||||
goto loop_next;
|
goto loop_next;
|
||||||
|
|
||||||
if (wlan_hdd_validate_vdev_id(adapter->deflink->vdev_id))
|
hdd_adapter_for_each_active_link_info(adapter, link_info) {
|
||||||
goto loop_next;
|
if (wlan_hdd_validate_vdev_id(link_info->vdev_id))
|
||||||
|
continue;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sap is not in started state and also not under doing CAC,
|
* sap is not in started state and also not under doing
|
||||||
* so it is fine to go ahead with sta.
|
* CAC, so it is fine to go ahead with sta.
|
||||||
*/
|
*/
|
||||||
if (!test_bit(SOFTAP_BSS_STARTED,
|
if (!test_bit(SOFTAP_BSS_STARTED,
|
||||||
&adapter->deflink->link_flags) &&
|
&link_info->link_flags) &&
|
||||||
hdd_ctx->dev_dfs_cac_status != DFS_CAC_IN_PROGRESS)
|
hdd_ctx->dev_dfs_cac_status != DFS_CAC_IN_PROGRESS)
|
||||||
goto loop_next;
|
continue;
|
||||||
|
|
||||||
chan = wlan_vdev_get_active_channel(adapter->deflink->vdev);
|
chan = wlan_vdev_get_active_channel(link_info->vdev);
|
||||||
if (!chan) {
|
if (!chan) {
|
||||||
hdd_debug("Can not get active channel");
|
hdd_debug("Can not get active channel");
|
||||||
goto loop_next;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wlan_reg_is_5ghz_ch_freq(chan->ch_freq))
|
if (!wlan_reg_is_5ghz_ch_freq(chan->ch_freq))
|
||||||
goto loop_next;
|
continue;
|
||||||
|
|
||||||
ch_params.ch_width = chan->ch_width;
|
ch_params.ch_width = chan->ch_width;
|
||||||
if (ch_params.ch_width == CH_WIDTH_160MHZ)
|
if (ch_params.ch_width == CH_WIDTH_160MHZ)
|
||||||
wlan_reg_set_create_punc_bitmap(&ch_params, true);
|
wlan_reg_set_create_punc_bitmap(&ch_params,
|
||||||
|
true);
|
||||||
|
|
||||||
if (wlan_reg_get_5g_bonded_channel_state_for_pwrmode(hdd_ctx->pdev,
|
if (wlan_reg_get_5g_bonded_channel_state_for_pwrmode(
|
||||||
chan->ch_freq,
|
hdd_ctx->pdev,
|
||||||
&ch_params,
|
chan->ch_freq,
|
||||||
REG_CURRENT_PWR_MODE) ==
|
&ch_params,
|
||||||
CHANNEL_STATE_DFS) {
|
REG_CURRENT_PWR_MODE) ==
|
||||||
hdd_adapter_dev_put_debug(adapter, dbgid);
|
CHANNEL_STATE_DFS) {
|
||||||
if (next_adapter)
|
hdd_adapter_dev_put_debug(adapter, dbgid);
|
||||||
hdd_adapter_dev_put_debug(next_adapter, dbgid);
|
if (next_adapter)
|
||||||
|
hdd_adapter_dev_put_debug(next_adapter,
|
||||||
|
dbgid);
|
||||||
|
|
||||||
return adapter;
|
return adapter;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
loop_next:
|
loop_next:
|
||||||
hdd_adapter_dev_put_debug(adapter, dbgid);
|
hdd_adapter_dev_put_debug(adapter, dbgid);
|
||||||
|
Reference in New Issue
Block a user