diff options
| author | Peng Xu <pxu@qca.qualcomm.com> | 2015-06-20 00:19:27 +0000 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-04-01 16:42:45 +0530 |
| commit | 2785a2f7d88ff1e3aecb8b0651811c1682523fbd (patch) | |
| tree | 98f91f3eda2981920d21bfbfc8a43e1d244c5312 /src/drivers | |
| parent | c810220c2a94a096c2cde603fb200de72c220df9 (diff) | |
| download | android_external_wpa_supplicant_8-2785a2f7d88ff1e3aecb8b0651811c1682523fbd.tar.gz android_external_wpa_supplicant_8-2785a2f7d88ff1e3aecb8b0651811c1682523fbd.tar.bz2 android_external_wpa_supplicant_8-2785a2f7d88ff1e3aecb8b0651811c1682523fbd.zip | |
Fix generating offloaded ACS channel list when hw_mode is set to any
When ACS is offloaded to device driver and the hw_mode parameter is set
to any, the current_mode structure is NULL which fails the ACS command.
Fix this by populating the ACS channel list with channels from all bands
when current_mode is NULL.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Git-commit: d0cdccd30785b2471c632c341caef68ab1bc62db
Git-repo : git://w1.fi/srv/git/hostap.git
Change-Id: Ia8a5ef25184788f836daec2e009eb5bc64108e5d
CRs-fixed: 842468
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/driver.h | 1 | ||||
| -rw-r--r-- | src/drivers/driver_nl80211.c | 23 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/drivers/driver.h b/src/drivers/driver.h index f9847839..b637570f 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1602,6 +1602,7 @@ struct drv_acs_params { /* ACS channel list info */ unsigned int ch_list_len; const u8 *ch_list; + const int *freq_list; }; diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 55028868..09c4054d 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -8424,6 +8424,26 @@ static int hw_mode_to_qca_acs(enum hostapd_hw_mode hw_mode) } +static int add_acs_freq_list(struct nl_msg *msg, const int *freq_list) +{ + int i, len, ret; + u32 *freqs; + + if (!freq_list) + return 0; + len = int_array_len(freq_list); + freqs = os_malloc(sizeof(u32) * len); + if (!freqs) + return -1; + for (i = 0; i < len; i++) + freqs[i] = freq_list[i]; + ret = nla_put(msg, QCA_WLAN_VENDOR_ATTR_ACS_FREQ_LIST, + sizeof(u32) * len, freqs); + os_free(freqs); + return ret; +} + + static int wpa_driver_do_acs(void *priv, struct drv_acs_params *params) { struct i802_bss *bss = priv; @@ -8453,7 +8473,8 @@ static int wpa_driver_do_acs(void *priv, struct drv_acs_params *params) params->ch_width) || (params->ch_list_len && nla_put(msg, QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST, params->ch_list_len, - params->ch_list))) { + params->ch_list)) || + add_acs_freq_list(msg, params->freq_list)) { nlmsg_free(msg); return -ENOBUFS; } |
