diff options
author | Eyal Shapira <eyal@wizery.com> | 2012-01-24 18:24:14 +0200 |
---|---|---|
committer | Arik Nemtsov <arik@wizery.com> | 2012-08-02 13:01:43 +0300 |
commit | 590300aec44dec0c6b5261954c859135517abaf6 (patch) | |
tree | 38363def6f7e68af82a35921d6ddcb3f5b26caf1 /src | |
parent | 1a56e98a2797556b32626118944ae1a4524c4214 (diff) | |
download | external_wpa_supplicant_8_ti-590300aec44dec0c6b5261954c859135517abaf6.zip external_wpa_supplicant_8_ti-590300aec44dec0c6b5261954c859135517abaf6.tar.gz external_wpa_supplicant_8_ti-590300aec44dec0c6b5261954c859135517abaf6.tar.bz2 |
nl80211: Handle ROAMING_SUPPORT event
Some drivers may notify us that roaming support changed.
This is passed on to wpa_s in order to take that into
account regarding bgscan and roaming.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/driver.h | 16 | ||||
-rw-r--r-- | src/drivers/driver_nl80211.c | 22 |
2 files changed, 38 insertions, 0 deletions
diff --git a/src/drivers/driver.h b/src/drivers/driver.h index a5c5f92..096891a 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -2864,6 +2864,22 @@ enum wpa_event_type { EVENT_SIGNAL_CHANGE, /** + * EVENT_ROAMING_ENABLED - Notify that the driver can do roaming again + * + * This event is used to indicate that the driver can do roaming + * and bgscan after it was previosly disabled + */ + EVENT_ROAMING_ENABLED, + + /** + * EVENT_ROAMING_DISABLED - Notify that the driver can't do roaming + * + * This event is used to indicate that the driver can't do roaming + * and bgscan and roaming attempts should be disabled + */ + EVENT_ROAMING_DISABLED, + + /** * EVENT_INTERFACE_ENABLED - Notify that interface was enabled * * This event is used to indicate that the interface was enabled after diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 2192a6e..9990944 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -1917,6 +1917,25 @@ static void nl80211_cqm_event(struct wpa_driver_nl80211_data *drv, } +static void nl80211_roaming_support_event(struct wpa_driver_nl80211_data *drv, + struct nlattr *tb[]) +{ + int enabled; + enum wpa_event_type event; + + enabled = (tb[NL80211_ATTR_ROAMING_DISABLED] == NULL); + + if (enabled) + event = EVENT_ROAMING_ENABLED; + else + event = EVENT_ROAMING_DISABLED; + + wpa_printf(MSG_DEBUG, "nl80211: roaming %s", + enabled ? "enabled" : "disabled"); + + wpa_supplicant_event(drv->ctx, event, NULL); +} + static void nl80211_new_station_event(struct wpa_driver_nl80211_data *drv, struct nlattr **tb) { @@ -2174,6 +2193,9 @@ static void do_process_drv_event(struct wpa_driver_nl80211_data *drv, case NL80211_CMD_NOTIFY_CQM: nl80211_cqm_event(drv, tb); break; + case NL80211_CMD_ROAMING_SUPPORT: + nl80211_roaming_support_event(drv, tb); + break; case NL80211_CMD_REG_CHANGE: wpa_printf(MSG_DEBUG, "nl80211: Regulatory domain change"); wpa_supplicant_event(drv->ctx, EVENT_CHANNEL_LIST_CHANGED, |