mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 07:37:31 -04:00
qcacld-3.0: Retain channel info from hostapd
Currently the driver modifies the channel list which came from hostapd in trim channel list API in case of concurrency present. This would in turn prevent SAP to change channel to a safe channel whenever a LTE-COEX event comes as the acs channel list would contain only one channel that would be the SAP channel itself. Fix is to retain the info of channels which came from the hostapd, and use this info to restart he SAP. Change-Id: I9d43930d78f1eaedb01139a9ddc319b610d21862 CRs-Fixed: 2501400
This commit is contained in:
parent
dae6817208
commit
7ca94aead5
5 changed files with 40 additions and 15 deletions
|
|
@ -2751,15 +2751,21 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
|
|||
tb[QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST]);
|
||||
if (sap_config->acs_cfg.ch_list_count) {
|
||||
sap_config->acs_cfg.ch_list = qdf_mem_malloc(
|
||||
sizeof(uint8_t) *
|
||||
sap_config->acs_cfg.ch_list_count);
|
||||
if (!sap_config->acs_cfg.ch_list) {
|
||||
sap_config->acs_cfg.master_ch_list = qdf_mem_malloc(
|
||||
sap_config->acs_cfg.ch_list_count);
|
||||
if (!sap_config->acs_cfg.ch_list ||
|
||||
!sap_config->acs_cfg.master_ch_list) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
qdf_mem_copy(sap_config->acs_cfg.ch_list, tmp,
|
||||
sap_config->acs_cfg.ch_list_count);
|
||||
sap_config->acs_cfg.ch_list_count);
|
||||
qdf_mem_copy(sap_config->acs_cfg.master_ch_list, tmp,
|
||||
sap_config->acs_cfg.ch_list_count);
|
||||
sap_config->acs_cfg.master_ch_list_count =
|
||||
sap_config->acs_cfg.ch_list_count;
|
||||
}
|
||||
} else if (tb[QCA_WLAN_VENDOR_ATTR_ACS_FREQ_LIST]) {
|
||||
uint32_t *freq =
|
||||
|
|
@ -2770,7 +2776,10 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
|
|||
if (sap_config->acs_cfg.ch_list_count) {
|
||||
sap_config->acs_cfg.ch_list = qdf_mem_malloc(
|
||||
sap_config->acs_cfg.ch_list_count);
|
||||
if (!sap_config->acs_cfg.ch_list) {
|
||||
sap_config->acs_cfg.master_ch_list = qdf_mem_malloc(
|
||||
sap_config->acs_cfg.ch_list_count);
|
||||
if (!sap_config->acs_cfg.ch_list ||
|
||||
!sap_config->acs_cfg.master_ch_list) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -2779,6 +2788,11 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
|
|||
for (i = 0; i < sap_config->acs_cfg.ch_list_count; i++)
|
||||
sap_config->acs_cfg.ch_list[i] =
|
||||
ieee80211_frequency_to_channel(freq[i]);
|
||||
qdf_mem_copy(sap_config->acs_cfg.master_ch_list,
|
||||
sap_config->acs_cfg.ch_list,
|
||||
sap_config->acs_cfg.ch_list_count);
|
||||
sap_config->acs_cfg.master_ch_list_count =
|
||||
sap_config->acs_cfg.ch_list_count;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3024,7 +3038,13 @@ void wlan_hdd_undo_acs(struct hdd_adapter *adapter)
|
|||
qdf_mem_free(sap_cfg->acs_cfg.ch_list);
|
||||
sap_cfg->acs_cfg.ch_list = NULL;
|
||||
}
|
||||
if (sap_cfg->acs_cfg.master_ch_list) {
|
||||
hdd_debug("Clearing master ACS cfg channel list");
|
||||
qdf_mem_free(sap_cfg->acs_cfg.master_ch_list);
|
||||
sap_cfg->acs_cfg.master_ch_list = NULL;
|
||||
}
|
||||
sap_cfg->acs_cfg.ch_list_count = 0;
|
||||
sap_cfg->acs_cfg.master_ch_list_count = 0;
|
||||
sap_cfg->acs_cfg.acs_mode = false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -430,6 +430,8 @@ struct sap_acs_cfg {
|
|||
uint8_t end_ch;
|
||||
uint8_t *ch_list;
|
||||
uint8_t ch_list_count;
|
||||
uint8_t *master_ch_list;
|
||||
uint8_t master_ch_list_count;
|
||||
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
|
||||
uint8_t skip_scan_status;
|
||||
uint8_t skip_scan_range1_stch;
|
||||
|
|
|
|||
|
|
@ -503,13 +503,14 @@ uint8_t sap_channel_in_acs_channel_list(uint8_t channel_num,
|
|||
{
|
||||
uint8_t i = 0;
|
||||
|
||||
if ((!sap_ctx->acs_cfg->ch_list) ||
|
||||
if ((!sap_ctx->acs_cfg->master_ch_list) ||
|
||||
(!spect_info_params))
|
||||
return channel_num;
|
||||
|
||||
if (channel_num > 0 && channel_num <= 252) {
|
||||
for (i = 0; i < sap_ctx->acs_cfg->ch_list_count; i++) {
|
||||
if ((sap_ctx->acs_cfg->ch_list[i]) == channel_num)
|
||||
for (i = 0; i < sap_ctx->acs_cfg->master_ch_list_count; i++) {
|
||||
if ((sap_ctx->acs_cfg->master_ch_list[i]) ==
|
||||
channel_num)
|
||||
return channel_num;
|
||||
}
|
||||
return SAP_CHANNEL_NOT_SELECTED;
|
||||
|
|
|
|||
|
|
@ -222,8 +222,9 @@ static uint8_t sap_random_channel_sel(struct sap_context *sap_ctx)
|
|||
ch_params->ch_width = ch_wd;
|
||||
if (sap_ctx->acs_cfg) {
|
||||
acs_info.acs_mode = sap_ctx->acs_cfg->acs_mode;
|
||||
acs_info.channel_list = sap_ctx->acs_cfg->ch_list;
|
||||
acs_info.num_of_channel = sap_ctx->acs_cfg->ch_list_count;
|
||||
acs_info.channel_list = sap_ctx->acs_cfg->master_ch_list;
|
||||
acs_info.num_of_channel =
|
||||
sap_ctx->acs_cfg->master_ch_list_count;
|
||||
} else {
|
||||
acs_info.acs_mode = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2806,9 +2806,8 @@ QDF_STATUS wlansap_update_owe_info(struct sap_context *sap_ctx,
|
|||
return status;
|
||||
}
|
||||
|
||||
static bool wlansap_is_channel_present_in_acs_list(uint8_t ch,
|
||||
uint8_t *ch_list,
|
||||
uint8_t ch_count)
|
||||
static bool wlansap_is_channel_present_in_acs_list(uint8_t ch, uint8_t *ch_list,
|
||||
uint8_t ch_count)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
|
|
@ -2833,15 +2832,17 @@ QDF_STATUS wlansap_filter_ch_based_acs(struct sap_context *sap_ctx,
|
|||
size_t ch_index;
|
||||
size_t target_ch_cnt = 0;
|
||||
|
||||
if (!sap_ctx || !ch_list || !ch_cnt || !sap_ctx->acs_cfg->ch_list) {
|
||||
if (!sap_ctx || !ch_list || !ch_cnt ||
|
||||
!sap_ctx->acs_cfg->master_ch_list ||
|
||||
!sap_ctx->acs_cfg->master_ch_list_count) {
|
||||
sap_err("NULL parameters");
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
|
||||
for (ch_index = 0; ch_index < *ch_cnt; ch_index++) {
|
||||
if (wlansap_is_channel_present_in_acs_list(ch_list[ch_index],
|
||||
sap_ctx->acs_cfg->ch_list,
|
||||
sap_ctx->acs_cfg->ch_list_count))
|
||||
sap_ctx->acs_cfg->master_ch_list,
|
||||
sap_ctx->acs_cfg->master_ch_list_count))
|
||||
ch_list[target_ch_cnt++] = ch_list[ch_index];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue