]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - wpa_supplicant/wpa_supplicant_i.h
tests: Verify behavior during externally triggered scan
[thirdparty/hostap.git] / wpa_supplicant / wpa_supplicant_i.h
index 68f508a983457517d18fac3c6d82532c9f742a51..1c10a036a97dd72cc0f053150f3c004a4156e30a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * wpa_supplicant - Internal definitions
- * Copyright (c) 2003-2012, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2003-2014, Jouni Malinen <j@w1.fi>
  *
  * This software may be distributed under the terms of the BSD license.
  * See README for more details.
@@ -257,7 +257,6 @@ struct wpa_global {
                WPA_CONC_PREF_STA,
                WPA_CONC_PREF_P2P
        } conc_pref;
-       unsigned int p2p_cb_on_scan_complete:1;
        unsigned int p2p_per_sta_psk:1;
 
 #ifdef CONFIG_WIFI_DISPLAY
@@ -281,8 +280,43 @@ struct wpa_radio {
        char name[16]; /* from driver_ops get_radio_name() or empty if not
                        * available */
        struct dl_list ifaces; /* struct wpa_supplicant::radio_list entries */
+       struct dl_list work; /* struct wpa_radio_work::list entries */
 };
 
+/**
+ * struct wpa_radio_work - Radio work item
+ */
+struct wpa_radio_work {
+       struct dl_list list;
+       unsigned int freq; /* known frequency (MHz) or 0 for multiple/unknown */
+       const char *type;
+       struct wpa_supplicant *wpa_s;
+       void (*cb)(struct wpa_radio_work *work, int deinit);
+       void *ctx;
+       unsigned int started:1;
+       struct os_reltime time;
+};
+
+int radio_add_work(struct wpa_supplicant *wpa_s, unsigned int freq,
+                  const char *type, int next,
+                  void (*cb)(struct wpa_radio_work *work, int deinit),
+                  void *ctx);
+void radio_work_done(struct wpa_radio_work *work);
+void radio_remove_unstarted_work(struct wpa_supplicant *wpa_s,
+                                const char *type);
+void radio_work_check_next(struct wpa_supplicant *wpa_s);
+
+struct wpa_connect_work {
+       unsigned int sme:1;
+       struct wpa_bss *bss;
+       struct wpa_ssid *ssid;
+};
+
+int wpas_valid_bss_ssid(struct wpa_supplicant *wpa_s, struct wpa_bss *test_bss,
+                       struct wpa_ssid *test_ssid);
+void wpas_connect_work_free(struct wpa_connect_work *cwork);
+void wpas_connect_work_done(struct wpa_supplicant *wpa_s);
+
 /**
  * offchannel_send_action_result - Result of offchannel send Action frame
  */
@@ -408,7 +442,6 @@ struct wpa_supplicant {
        struct wpa_bss **last_scan_res;
        unsigned int last_scan_res_used;
        unsigned int last_scan_res_size;
-       int last_scan_full;
        struct os_reltime last_scan;
 
        struct wpa_driver_ops *driver;
@@ -420,6 +453,7 @@ struct wpa_supplicant {
        struct ctrl_iface_priv *ctrl_iface;
 
        enum wpa_states wpa_state;
+       struct wpa_radio_work *scan_work;
        int scanning;
        int sched_scanning;
        int new_connection;
@@ -433,7 +467,8 @@ struct wpa_supplicant {
 
        unsigned char last_eapol_src[ETH_ALEN];
 
-       int keys_cleared;
+       unsigned int keys_cleared; /* bitfield of key indexes that the driver is
+                                   * known not to be configured with a key */
 
        struct wpa_blacklist *blacklist;
 
@@ -479,10 +514,18 @@ struct wpa_supplicant {
                 */
                MANUAL_SCAN_REQ
        } scan_req, last_scan_req;
-       struct os_reltime scan_trigger_time;
+       struct os_reltime scan_trigger_time, scan_start_time;
        int scan_runs; /* number of scan runs since WPS was started */
        int *next_scan_freqs;
        int *manual_scan_freqs;
+       unsigned int manual_scan_passive:1;
+       unsigned int manual_scan_use_id:1;
+       unsigned int manual_scan_only_new:1;
+       unsigned int own_scan_requested:1;
+       unsigned int own_scan_running:1;
+       unsigned int external_scan_running:1;
+       unsigned int clear_driver_scan_cache:1;
+       unsigned int manual_scan_id;
        int scan_interval; /* time in sec between scans to find suitable AP */
        int normal_scans; /* normal scans run before sched_scan */
        int scan_for_connection; /* whether the scan request was triggered for
@@ -648,7 +691,6 @@ struct wpa_supplicant {
         */
        char cross_connect_uplink[100];
 
-       unsigned int sta_scan_pending:1;
        unsigned int p2p_auto_join:1;
        unsigned int p2p_auto_pd:1;
        unsigned int p2p_persistent_group:1;
@@ -658,6 +700,7 @@ struct wpa_supplicant {
        unsigned int p2p_go_vht:1;
        unsigned int user_initiated_pd:1;
        unsigned int p2p_go_group_formation_completed:1;
+       unsigned int waiting_presence_resp;
        int p2p_first_connection_timeout;
        int p2p_persistent_go_freq;
        int p2p_persistent_id;
@@ -665,6 +708,9 @@ struct wpa_supplicant {
        int p2p_connect_freq;
        struct os_reltime p2p_auto_started;
        struct wpa_ssid *p2p_last_4way_hs_fail;
+       struct wpa_radio_work *p2p_scan_work;
+       struct wpa_radio_work *p2p_listen_work;
+       struct wpa_radio_work *p2p_send_action_work;
 #endif /* CONFIG_P2P */
 
        struct wpa_ssid *bgscan_ssid;
@@ -741,6 +787,7 @@ struct wpa_supplicant {
 #endif /* CONFIG_TESTING_GET_GTK */
 
        unsigned int num_multichan_concurrent;
+       struct wpa_radio_work *connect_work;
 };
 
 
@@ -822,7 +869,6 @@ int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
 void wpa_supplicant_terminate_proc(struct wpa_global *global);
 void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
                             const u8 *buf, size_t len);
-enum wpa_key_mgmt key_mgmt2driver(int key_mgmt);
 void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s);
 void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s);
 void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid);
@@ -836,7 +882,6 @@ int disallowed_ssid(struct wpa_supplicant *wpa_s, const u8 *ssid,
                    size_t ssid_len);
 void wpas_request_connection(struct wpa_supplicant *wpa_s);
 int wpas_build_ext_capab(struct wpa_supplicant *wpa_s, u8 *buf);
-int wpas_wpa_is_in_progress(struct wpa_supplicant *wpa_s, int include_current);
 
 /**
  * wpa_supplicant_ctrl_iface_ctrl_rsp_handle - Handle a control response