wpa_s->ibss_rsn = NULL;
#endif /* CONFIG_IBSS_RSN */
+#ifdef CONFIG_AP
+ wpa_supplicant_ap_deinit(wpa_s);
+#endif /* CONFIG_AP */
+
if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED)
return;
wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
+ wpa_s->conf->ap_scan = DEFAULT_AP_SCAN;
bssid_changed = !is_zero_ether_addr(wpa_s->bssid);
os_memset(wpa_s->bssid, 0, ETH_ALEN);
os_memset(wpa_s->pending_bssid, 0, ETH_ALEN);
wpa_s->current_bss = NULL;
wpa_s->assoc_freq = 0;
+#ifdef CONFIG_IEEE80211R
+#ifdef CONFIG_SME
+ if (wpa_s->sme.ft_ies)
+ sme_update_ft_ies(wpa_s, NULL, NULL, 0);
+#endif /* CONFIG_SME */
+#endif /* CONFIG_IEEE80211R */
+
if (bssid_changed)
wpas_notify_bssid_changed(wpa_s);
privacy = 1;
#endif /* IEEE8021X_EAPOL */
+ if (wpa_key_mgmt_wpa(ssid->key_mgmt))
+ privacy = 1;
+
if (bss->caps & IEEE80211_CAP_PRIVACY)
return privacy;
return !privacy;
continue;
}
- if (!wpa && !wpa_supplicant_match_privacy(bss, ssid)) {
+ if (!wpa_supplicant_match_privacy(bss, ssid)) {
wpa_dbg(wpa_s, MSG_DEBUG, " skip - privacy "
"mismatch");
continue;
}
- if (!wpa && (bss->caps & IEEE80211_CAP_IBSS)) {
+ if (bss->caps & IEEE80211_CAP_IBSS) {
wpa_dbg(wpa_s, MSG_DEBUG, " skip - IBSS (adhoc) "
"network");
continue;
* reassociation is requested. If we are in process of associating with
* the selected BSSID, do not trigger new attempt.
*/
- if (wpa_s->reassociate ||
+ if ((wpa_s->reassociate
+#ifdef ANDROID_BRCM_P2P_PATCH
+ && (os_memcmp(selected->bssid, wpa_s->bssid, ETH_ALEN) != 0)
+ && (wpa_s->wpa_state != WPA_COMPLETED)
+#endif
+ )||
(os_memcmp(selected->bssid, wpa_s->bssid, ETH_ALEN) != 0 &&
((wpa_s->wpa_state != WPA_ASSOCIATING &&
wpa_s->wpa_state != WPA_AUTHENTICATING) ||
/* TODO: move the rsn_preauth_scan_result*() to be called from notify.c based
* on BSS added and BSS changed events */
static void wpa_supplicant_rsn_preauth_scan_results(
- struct wpa_supplicant *wpa_s, struct wpa_scan_results *scan_res)
+ struct wpa_supplicant *wpa_s)
{
- int i;
+ struct wpa_bss *bss;
if (rsn_preauth_scan_results(wpa_s->wpa) < 0)
return;
- for (i = scan_res->num - 1; i >= 0; i--) {
+ dl_list_for_each(bss, &wpa_s->bss, struct wpa_bss, list) {
const u8 *ssid, *rsn;
- struct wpa_scan_res *r;
-
- r = scan_res->res[i];
- ssid = wpa_scan_get_ie(r, WLAN_EID_SSID);
+ ssid = wpa_bss_get_ie(bss, WLAN_EID_SSID);
if (ssid == NULL)
continue;
- rsn = wpa_scan_get_ie(r, WLAN_EID_RSN);
+ rsn = wpa_bss_get_ie(bss, WLAN_EID_RSN);
if (rsn == NULL)
continue;
- rsn_preauth_scan_result(wpa_s->wpa, r->bssid, ssid, rsn);
+ rsn_preauth_scan_result(wpa_s->wpa, bss->bssid, ssid, rsn);
}
}
return 0;
}
- wpa_supplicant_rsn_preauth_scan_results(wpa_s, scan_res);
-
selected = wpa_supplicant_pick_network(wpa_s, scan_res, &ssid);
if (selected) {
if (skip)
return 0;
wpa_supplicant_connect(wpa_s, selected, ssid);
+ wpa_supplicant_rsn_preauth_scan_results(wpa_s);
} else {
wpa_scan_results_free(scan_res);
wpa_dbg(wpa_s, MSG_DEBUG, "No suitable network found");
if (ssid) {
wpa_dbg(wpa_s, MSG_DEBUG, "Setup a new network");
wpa_supplicant_associate(wpa_s, NULL, ssid);
+ wpa_supplicant_rsn_preauth_scan_results(wpa_s);
} else {
int timeout_sec = wpa_s->scan_interval;
int timeout_usec = 0;
if (wpa_found || rsn_found)
wpa_s->ap_ies_from_associnfo = 1;
+ if (wpa_s->assoc_freq && data->assoc_info.freq &&
+ wpa_s->assoc_freq != data->assoc_info.freq) {
+ wpa_printf(MSG_DEBUG, "Operating frequency changed from "
+ "%u to %u MHz",
+ wpa_s->assoc_freq, data->assoc_info.freq);
+ wpa_supplicant_update_scan_results(wpa_s);
+ }
+
wpa_s->assoc_freq = data->assoc_info.freq;
return 0;
"reconnect (wps=%d)",
wpa_s->key_mgmt == WPA_KEY_MGMT_WPS);
if (wpa_s->wpa_state >= WPA_ASSOCIATING)
- wpa_supplicant_req_scan(wpa_s, 0, 100000);
+ wpa_supplicant_req_scan(wpa_s, 0, 500000);
} else {
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: Auto connect disabled: do not "
"try to re-connect");
}
#endif /* CONFIG_AP */
wpa_supplicant_event_disassoc(wpa_s, reason_code);
+
+#if defined(ANDROID_BRCM_P2P_PATCH) && defined(CONFIG_P2P)
+ wpas_p2p_group_remove_notif(wpa_s, reason_code);
+#endif
+
break;
case EVENT_MICHAEL_MIC_FAILURE:
wpa_supplicant_event_michael_mic_failure(wpa_s, data);
size_t ie_len = data->rx_mgmt.frame_len -
(mgmt->u.probe_req.variable -
data->rx_mgmt.frame);
+ #ifdef ANDROID_BRCM_P2P_PATCH
+ wpa_printf(MSG_DEBUG, "Non-AP: Probe request frame ");
+ {
+ /* If we are Go or client, we need not reply the probe reqest on eth0 interface */
+ struct wpa_supplicant* ifs;
+ int ignore = 0;
+ for (ifs = wpa_s->global->ifaces; ifs; ifs = ifs->next) {
+ if ( (ifs->p2p_group_interface == P2P_GROUP_INTERFACE_GO ) ||(ifs->p2p_group_interface == P2P_GROUP_INTERFACE_CLIENT )) {
+ wpa_printf(MSG_DEBUG, "Non-AP: NEERAJKG Ignoring Probe request");
+ ignore = 1;
+ break;
+ }
+ }
+ if(ignore)
+ break;
+ else
+ wpa_printf(MSG_DEBUG, "Non-AP: Couln't Ignore Probe request %d", wpa_s->p2p_group_interface);
+ }
+ #endif
wpas_p2p_probe_req_rx(wpa_s, src, ie, ie_len);
break;
}