[PATCH 2/7] Automatic Scanning support added

Bondar, Alexander alexander.bondar at intel.com
Mon Apr 23 08:20:32 EDT 2012


	Hi Tomasz,

> diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index
> 1c3b9eb..584f74e 100644
> --- a/wpa_supplicant/events.c
> +++ b/wpa_supplicant/events.c
> @@ -41,6 +41,7 @@
>  #include "gas_query.h"
>  #include "p2p_supplicant.h"
>  #include "bgscan.h"
> +#include "autoscan.h"
>  #include "ap.h"
>  #include "bss.h"
>  #include "scan.h"
> @@ -1086,6 +1087,11 @@ static int
> _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
>  		return 0;
>  	}
> 
> +	if (autoscan_notify_scan(wpa_s, scan_res)) {
> +		wpa_scan_results_free(scan_res);
> +		return 0;
> +	}
> +
>  	if (wpa_s->disconnected) {
>  		wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
>  		wpa_scan_results_free(scan_res);



Regarding this snippet, I'd suggest to do it slightly different - trigger scan only if candidate not found:

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 8fdc544..ca5f415 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1135,9 +1135,10 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
                                return 0;
                        }
 #endif /* CONFIG_P2P */
-                       if (wpa_supplicant_req_sched_scan(wpa_s))
-                               wpa_supplicant_req_new_scan(wpa_s, timeout_sec,
-                                                           timeout_usec);
+                        if (autoscan_notify_scan(wpa_s, scan_res)) {
+                               wpa_scan_results_free(scan_res);
+                               return 0;
+                        }
                }
        }
        return 0;

> diff --git a/wpa_supplicant/wpa_supplicant_i.h
> b/wpa_supplicant/wpa_supplicant_i.h
> index 9698c68..cb84bb6 100644
> --- a/wpa_supplicant/wpa_supplicant_i.h
> +++ b/wpa_supplicant/wpa_supplicant_i.h
> @@ -484,6 +484,10 @@ struct wpa_supplicant {
>  	const struct bgscan_ops *bgscan;
>  	void *bgscan_priv;
> 
> +	const struct autoscan_ops *autoscan;
> +	struct wpa_driver_scan_params *autoscan_params;
> +	void *autoscan_priv;
> +
>  	struct wpa_ssid *connect_without_scan;
> 
>  	int after_wps;

Regarding the autoscan_params, I have implemented additional method to let other modules to request scan 
specifying scan parameters (see attached).

Best.
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
An embedded message was scrubbed...
From: "Bondar, Alexander" <alexander.bondar at intel.com>
Subject: [RFC] scan: Intoduce new scan API method -
 wpa_supplicant_req_scan_spec()
Date: Mon, 23 Apr 2012 08:49:07 +0000
Size: 10091
Url: http://lists.shmoo.com/pipermail/hostap/attachments/20120423/5fba960f/attachment-0001.eml 


More information about the HostAP mailing list