diff options
| author | Dmitry Shmidt <dimitrysh@google.com> | 2015-05-29 12:36:29 -0700 |
|---|---|---|
| committer | Dmitry Shmidt <dimitrysh@google.com> | 2015-05-29 12:40:15 -0700 |
| commit | b1e52102c211357f585e9ff6d54501e90254326e (patch) | |
| tree | 1e04b17ec4a5a2b3019a23229da603f58f4aec19 /src/ap | |
| parent | 8bd70b7d6ba220544ee2f0e201e5df23e277fa1d (diff) | |
| download | android_external_wpa_supplicant_8-b1e52102c211357f585e9ff6d54501e90254326e.tar.gz android_external_wpa_supplicant_8-b1e52102c211357f585e9ff6d54501e90254326e.tar.bz2 android_external_wpa_supplicant_8-b1e52102c211357f585e9ff6d54501e90254326e.zip | |
Cumulative patch from commit dc1a341dec54c28c3351ee7edab9ccaf7b68861f
dc1a341 P2P: Add manufacturer info into D-Bus peer interface
3330395 P2P: Add P2P Cancel method over D-Bus interface
87d3c62 WPS: Add WPS Cancel method over D-Bus interface
eda9d84 P2P: Fix a potential memory leak in a P2P+NFC corner case
701d972 Add libwpa_client build option to use a dynamic library
ccad05a P2P: Restart group formation timer upon receiving new Inv Req
4d3be9c Postpone updating of wpa_s->current_bss till association event
3784c05 Extend hw_mode to support any band for offloaded ACS case
1b748e6 HS 2.0: hs20-client: Fix hostname extraction from URL
dba68f2 HS 2.0: Fix hs20_spp_server compile error
e4a43a9 HS 2.0: spp-client: Warn user if xml file cannot be found
Change-Id: If4acdda6f6e6a07bf87216d34b2c89486a4a3078
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'src/ap')
| -rw-r--r-- | src/ap/drv_callbacks.c | 20 | ||||
| -rw-r--r-- | src/ap/hw_features.c | 20 |
2 files changed, 31 insertions, 9 deletions
diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index 80e4c2e7..6ecd094a 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -532,7 +532,7 @@ void hostapd_event_connect_failed_reason(struct hostapd_data *hapd, static void hostapd_acs_channel_selected(struct hostapd_data *hapd, struct acs_selected_channels *acs_res) { - int ret; + int ret, i; if (hapd->iconf->channel) { wpa_printf(MSG_INFO, "ACS: Channel was already set to %d", @@ -540,6 +540,24 @@ static void hostapd_acs_channel_selected(struct hostapd_data *hapd, return; } + if (!hapd->iface->current_mode) { + for (i = 0; i < hapd->iface->num_hw_features; i++) { + struct hostapd_hw_modes *mode = + &hapd->iface->hw_features[i]; + + if (mode->mode == acs_res->hw_mode) { + hapd->iface->current_mode = mode; + break; + } + } + if (!hapd->iface->current_mode) { + hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, + HOSTAPD_LEVEL_WARNING, + "driver selected to bad hw_mode"); + return; + } + } + hapd->iface->freq = hostapd_hw_get_freq(hapd, acs_res->pri_channel); if (!acs_res->pri_channel) { diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index 96744c4f..069d1ae5 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c @@ -895,14 +895,18 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface) } if (iface->current_mode == NULL) { - wpa_printf(MSG_ERROR, "Hardware does not support configured " - "mode"); - hostapd_logger(iface->bss[0], NULL, HOSTAPD_MODULE_IEEE80211, - HOSTAPD_LEVEL_WARNING, - "Hardware does not support configured mode " - "(%d) (hw_mode in hostapd.conf)", - (int) iface->conf->hw_mode); - return -2; + if (!(iface->drv_flags & WPA_DRIVER_FLAGS_ACS_OFFLOAD) || + !(iface->drv_flags & WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY)) + { + wpa_printf(MSG_ERROR, + "Hardware does not support configured mode"); + hostapd_logger(iface->bss[0], NULL, + HOSTAPD_MODULE_IEEE80211, + HOSTAPD_LEVEL_WARNING, + "Hardware does not support configured mode (%d) (hw_mode in hostapd.conf)", + (int) iface->conf->hw_mode); + return -2; + } } switch (hostapd_check_chans(iface)) { |
