WPS: Set currently used RF band in RF Bands attribute

According to WSC specification (Ver 2.0.2, section 8.3), RF Bands
attribute should be set to the specific RF band used for the current
message. Add an option to set wanted band in wps_build_rf_bands() and
add a callback to get the current band from wpa_supplicant and hostapd.

Signed-hostap: David Spinadel <david.spinadel@intel.com>
This commit is contained in:
David Spinadel 2013-08-25 10:55:53 +03:00 committed by Jouni Malinen
parent bf83eab553
commit 239abaf2ab
8 changed files with 43 additions and 9 deletions

View file

@ -856,6 +856,17 @@ static void wpa_supplicant_wps_event(void *ctx, enum wps_event event,
}
static int wpa_supplicant_wps_rf_band(void *ctx)
{
struct wpa_supplicant *wpa_s = ctx;
if (!wpa_s->current_ssid || !wpa_s->assoc_freq)
return 0;
return (wpa_s->assoc_freq > 2484) ? WPS_RF_50GHZ : WPS_RF_24GHZ;
}
enum wps_request_type wpas_wps_get_req_type(struct wpa_ssid *ssid)
{
if (eap_is_wps_pbc_enrollee(&ssid->eap) ||
@ -1327,6 +1338,7 @@ int wpas_wps_init(struct wpa_supplicant *wpa_s)
wps->cred_cb = wpa_supplicant_wps_cred;
wps->event_cb = wpa_supplicant_wps_event;
wps->rf_band_cb = wpa_supplicant_wps_rf_band;
wps->cb_ctx = wpa_s;
wps->dev.device_name = wpa_s->conf->device_name;