Merge branch 'moonshot' of ssh://moonshot.suchdamage.org:822/srv/git/libeap into...
[libeap.git] / wpa_supplicant / events.c
index b0e1d3b..76ee93b 100644 (file)
@@ -463,6 +463,11 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
                }
 
 #ifdef CONFIG_WPS
+               if ((ssid->key_mgmt & WPA_KEY_MGMT_WPS) && e && e->count > 0) {
+                       wpa_printf(MSG_DEBUG, "   skip - blacklisted (WPS)");
+                       continue;
+               }
+
                if (wpa && ssid->ssid_len == 0 &&
                    wpas_wps_ssid_wildcard_ok(wpa_s, ssid, bss))
                        check_ssid = 0;
@@ -627,7 +632,10 @@ void wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
                if (wpas_p2p_notif_pbc_overlap(wpa_s) == 1)
                        return;
 #endif /* CONFIG_P2P */
+
+#ifdef CONFIG_WPS
                wpas_wps_cancel(wpa_s);
+#endif /* CONFIG_WPS */
                return;
        }
 
@@ -1795,14 +1803,25 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
        case EVENT_SIGNAL_CHANGE:
                bgscan_notify_signal_change(
                        wpa_s, data->signal_change.above_threshold,
-                       data->signal_change.current_signal);
+                       data->signal_change.current_signal,
+                       data->signal_change.current_noise,
+                       data->signal_change.current_txrate);
                break;
        case EVENT_INTERFACE_ENABLED:
                wpa_printf(MSG_DEBUG, "Interface was enabled");
                if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) {
-                       wpa_supplicant_set_state(wpa_s,
-                                                WPA_DISCONNECTED);
+#ifdef CONFIG_AP
+                       if (!wpa_s->ap_iface) {
+                               wpa_supplicant_set_state(wpa_s,
+                                                        WPA_DISCONNECTED);
+                               wpa_supplicant_req_scan(wpa_s, 0, 0);
+                       } else
+                               wpa_supplicant_set_state(wpa_s,
+                                                        WPA_COMPLETED);
+#else /* CONFIG_AP */
+                       wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
                        wpa_supplicant_req_scan(wpa_s, 0, 0);
+#endif /* CONFIG_AP */
                }
                break;
        case EVENT_INTERFACE_DISABLED:
@@ -1810,6 +1829,11 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                wpa_supplicant_mark_disassoc(wpa_s);
                wpa_supplicant_set_state(wpa_s, WPA_INTERFACE_DISABLED);
                break;
+       case EVENT_CHANNEL_LIST_CHANGED:
+#ifdef CONFIG_P2P
+               wpas_p2p_update_channel_list(wpa_s);
+#endif /* CONFIG_P2P */
+               break;
        default:
                wpa_printf(MSG_INFO, "Unknown event %d", event);
                break;