aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2013-11-02 18:26:51 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2013-11-02 18:26:51 -0700
commit4dc94b992cf28c399e5e78c45eaa1cbfb7d43cfb (patch)
treeabc218f1a6c90730bd8a9aa5e1f5961b63180398
parentcd97389ead19517726667a4f650b701ea30f9cb7 (diff)
parent335ab63b68125a8db4192414d3670d4500e9ce8b (diff)
downloadandroid_external_wpa_supplicant_8-4dc94b992cf28c399e5e78c45eaa1cbfb7d43cfb.tar.gz
android_external_wpa_supplicant_8-4dc94b992cf28c399e5e78c45eaa1cbfb7d43cfb.tar.bz2
android_external_wpa_supplicant_8-4dc94b992cf28c399e5e78c45eaa1cbfb7d43cfb.zip
Merge "Update regulatory change to all virtual interface for the phy"
-rw-r--r--wpa_supplicant/events.c56
1 files changed, 46 insertions, 10 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index eb3db1b0..d0e3f4ab 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -2406,6 +2406,51 @@ static void wpa_supplicant_event_unprot_disassoc(struct wpa_supplicant *wpa_s,
#endif /* CONFIG_IEEE80211W */
}
+static void wpa_supplicant_update_channel_list(struct wpa_supplicant *wpa_s)
+{
+ const char *rn, *rn2;
+ struct wpa_supplicant *ifs;
+
+ if (wpa_s->drv_priv == NULL)
+ return; /* Ignore event during drv initialization */
+
+ free_hw_features(wpa_s);
+ wpa_s->hw.modes = wpa_drv_get_hw_feature_data(
+ wpa_s, &wpa_s->hw.num_modes, &wpa_s->hw.flags);
+
+#ifdef CONFIG_P2P
+ wpas_p2p_update_channel_list(wpa_s);
+#endif /* CONFIG_P2P */
+
+ /*
+ * Check other interfaces to see if they have the same radio-name. If
+ * so, they get updated with this same hw mode info.
+ */
+ if (!wpa_s->driver->get_radio_name)
+ return;
+
+ rn = wpa_s->driver->get_radio_name(wpa_s->drv_priv);
+ if (rn == NULL || rn[0] == '\0')
+ return;
+
+ wpa_dbg(wpa_s, MSG_DEBUG, "Checking for other virtual interfaces "
+ "sharing same radio (%s) in event_channel_list_change", rn);
+
+ for (ifs = wpa_s->global->ifaces; ifs; ifs = ifs->next) {
+ if (ifs == wpa_s || !ifs->driver->get_radio_name)
+ continue;
+
+ rn2 = ifs->driver->get_radio_name(ifs->drv_priv);
+ if (rn2 && os_strcmp(rn, rn2) == 0) {
+ wpa_printf(MSG_DEBUG, "%s: Updating hw mode",
+ ifs->ifname);
+ free_hw_features(ifs);
+ ifs->hw.modes = wpa_drv_get_hw_feature_data(
+ ifs, &ifs->hw.num_modes, &ifs->hw.flags);
+ }
+ }
+}
+
void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
union wpa_event_data *data)
@@ -2968,16 +3013,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
wpa_supplicant_set_state(wpa_s, WPA_INTERFACE_DISABLED);
break;
case EVENT_CHANNEL_LIST_CHANGED:
- if (wpa_s->drv_priv == NULL)
- break; /* Ignore event during drv initialization */
-
- free_hw_features(wpa_s);
- wpa_s->hw.modes = wpa_drv_get_hw_feature_data(
- wpa_s, &wpa_s->hw.num_modes, &wpa_s->hw.flags);
-
-#ifdef CONFIG_P2P
- wpas_p2p_update_channel_list(wpa_s);
-#endif /* CONFIG_P2P */
+ wpa_supplicant_update_channel_list(wpa_s);
break;
case EVENT_INTERFACE_UNAVAILABLE:
#ifdef CONFIG_P2P