Allow multi scan type for fast connect.
---
 include/device.h |    9 ++++++++-
 plugins/iwmx.c   |    3 ++-
 plugins/wifi.c   |    5 +++--
 src/device.c     |    6 +++---
 4 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/include/device.h b/include/device.h
index a82d08d..1b54288 100644
--- a/include/device.h
+++ b/include/device.h
@@ -47,6 +47,12 @@ enum connman_device_type {
        CONNMAN_DEVICE_TYPE_VENDOR    = 10000,
 };
 
+enum connman_device_scan_type {
+       CONNMAN_DEVICE_SCAN_TYPE_NORMAL = 0,
+       CONNMAN_DEVICE_SCAN_TYPE_FAST   = 1,
+       CONNMAN_DEVICE_SCAN_TYPE_HIDDEN = 2,
+};
+
 #define CONNMAN_DEVICE_PRIORITY_LOW      -100
 #define CONNMAN_DEVICE_PRIORITY_DEFAULT     0
 #define CONNMAN_DEVICE_PRIORITY_HIGH      100
@@ -107,7 +113,8 @@ struct connman_device_driver {
        void (*remove) (struct connman_device *device);
        int (*enable) (struct connman_device *device);
        int (*disable) (struct connman_device *device);
-       int (*scan) (struct connman_device *device);
+       int (*scan) (struct connman_device *device,
+                       enum connman_device_scan_type type);
 };
 
 int connman_device_driver_register(struct connman_device_driver *driver);
diff --git a/plugins/iwmx.c b/plugins/iwmx.c
index e79c1af..eed3668 100644
--- a/plugins/iwmx.c
+++ b/plugins/iwmx.c
@@ -534,7 +534,8 @@ static void iwmx_cm_remove(struct connman_device *dev)
  * First we obtain the current list of networks and pass it to the
  * callback processor. Then we start an scan cycle.
  */
-static int iwmx_cm_scan(struct connman_device *dev)
+static int iwmx_cm_scan(struct connman_device *dev,
+                               enum connman_device_scan_type type)
 {
        struct wmxsdk *wmxsdk = connman_device_get_data(dev);
        return iwmx_sdk_scan(wmxsdk);
diff --git a/plugins/wifi.c b/plugins/wifi.c
index dfeaf38..e443f63 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -256,7 +256,8 @@ static void scan_callback(int result, GSupplicantInterface 
*interface,
                connman_device_set_scanning(device, FALSE);
 }
 
-static int wifi_scan(struct connman_device *device)
+static int wifi_scan(struct connman_device *device,
+                       enum connman_device_scan_type type)
 {
        struct wifi_data *wifi = connman_device_get_data(device);
        int ret;
@@ -527,7 +528,7 @@ static void interface_added(GSupplicantInterface *interface)
        if (wifi->tethering == TRUE)
                return;
 
-       wifi_scan(wifi->device);
+       wifi_scan(wifi->device, CONNMAN_DEVICE_SCAN_TYPE_FAST);
 }
 
 static connman_bool_t is_idle(struct wifi_data *wifi)
diff --git a/src/device.c b/src/device.c
index 067c794..6e9a6e7 100644
--- a/src/device.c
+++ b/src/device.c
@@ -79,7 +79,7 @@ static gboolean device_scan_trigger(gpointer user_data)
        }
 
        if (device->driver->scan)
-               device->driver->scan(device);
+               device->driver->scan(device, CONNMAN_DEVICE_SCAN_TYPE_NORMAL);
 
        return TRUE;
 }
@@ -694,7 +694,7 @@ int connman_device_set_powered(struct connman_device 
*device,
        reset_scan_trigger(device);
 
        if (device->driver && device->driver->scan)
-               device->driver->scan(device);
+               device->driver->scan(device, CONNMAN_DEVICE_SCAN_TYPE_FAST);
 
        return 0;
 }
@@ -736,7 +736,7 @@ int __connman_device_scan(struct connman_device *device)
 
        reset_scan_trigger(device);
 
-       return device->driver->scan(device);
+       return device->driver->scan(device, CONNMAN_DEVICE_SCAN_TYPE_NORMAL);
 }
 
 int __connman_device_enable_persistent(struct connman_device *device)
-- 
1.7.2.2

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to