device: Add function for requesting a hidden scan
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 2 Dec 2011 14:18:32 +0000 (16:18 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 12 Dec 2011 09:44:40 +0000 (10:44 +0100)
Add function for requesting a hidden (WLAN) network scan. Call
the hidden scan function is implemented by the device in question.

src/connman.h
src/device.c

index e46fbe2..0d8ef1e 100644 (file)
@@ -344,6 +344,9 @@ void __connman_device_list(DBusMessageIter *iter, void *user_data);
 enum connman_service_type __connman_device_get_service_type(struct connman_device *device);
 struct connman_device *__connman_device_find_device(enum connman_service_type type);
 int __connman_device_request_scan(enum connman_service_type type);
+int __connman_device_request_hidden_scan(struct connman_device *device,
+                               const char *ssid, unsigned int ssid_len,
+                               const char *identity, const char *passphrase);
 
 connman_bool_t __connman_device_isfiltered(const char *devname);
 
index 29da1a1..6a34d40 100644 (file)
@@ -1185,6 +1185,23 @@ int __connman_device_request_scan(enum connman_service_type type)
        return 0;
 }
 
+int __connman_device_request_hidden_scan(struct connman_device *device,
+                               const char *ssid, unsigned int ssid_len,
+                               const char *identity, const char *passphrase)
+{
+       DBG("device %p", device);
+
+       if (device == NULL || device->driver == NULL ||
+                       device->driver->scan_hidden == NULL)
+               return -EINVAL;
+
+       if (device->scanning == TRUE)
+               return -EALREADY;
+
+       return device->driver->scan_hidden(device, ssid, ssid_len,
+                                       identity, passphrase);
+}
+
 connman_bool_t __connman_device_isfiltered(const char *devname)
 {
        char **pattern;