Index: uspace/lib/drv/generic/remote_ieee80211.c
===================================================================
--- uspace/lib/drv/generic/remote_ieee80211.c	(revision 59fa7ab26f7b4336f753dcd52b89d6cac0dfca97)
+++ uspace/lib/drv/generic/remote_ieee80211.c	(revision 1dcc0b9aaf9f79f759ef62cc27bccd9e6b7c8d80)
@@ -47,5 +47,6 @@
 typedef enum {
 	IEEE80211_GET_SCAN_RESULTS,
-	IEEE80211_CONNECT
+	IEEE80211_CONNECT,
+	IEEE80211_DISCONNECT
 } ieee80211_funcs_t;
 
@@ -59,5 +60,5 @@
  */
 int ieee80211_get_scan_results(async_sess_t *dev_sess, 
-	ieee80211_scan_results_t *results)
+	ieee80211_scan_results_t *results, bool now)
 {
 	assert(results);
@@ -65,6 +66,6 @@
 	async_exch_t *exch = async_exchange_begin(dev_sess);
 	
-	aid_t aid = async_send_1(exch, DEV_IFACE_ID(IEEE80211_DEV_IFACE),
-	    IEEE80211_GET_SCAN_RESULTS, NULL);
+	aid_t aid = async_send_2(exch, DEV_IFACE_ID(IEEE80211_DEV_IFACE),
+	    IEEE80211_GET_SCAN_RESULTS, now, NULL);
 	int rc = async_data_read_start(exch, results, sizeof(ieee80211_scan_results_t));
 	async_exchange_end(exch);
@@ -73,8 +74,8 @@
 	async_wait_for(aid, &res);
 	
-	if (rc != EOK)
+	if(res != EOK)
+		return (int) res;
+	else
 		return rc;
-	
-	return (int) res;
 }
 
@@ -82,5 +83,5 @@
  *
  * @param[in] dev_sess Device session.
- * @param[in] ssid Network SSID.
+ * @param[in] ssid_start Network SSID prefix.
  * @param[in] password Network password (pass empty string if not needed).
  *
@@ -88,7 +89,7 @@
  * negative error code otherwise.
  */
-int ieee80211_connect(async_sess_t *dev_sess, char *ssid, char *password)
-{
-	assert(ssid);
+int ieee80211_connect(async_sess_t *dev_sess, char *ssid_start, char *password)
+{
+	assert(ssid_start);
 	
 	sysarg_t rc_orig;
@@ -99,5 +100,6 @@
 	    IEEE80211_CONNECT, NULL);
 	
-	sysarg_t rc = async_data_write_start(exch, ssid, str_size(ssid) + 1);
+	sysarg_t rc = async_data_write_start(exch, ssid_start, 
+		str_size(ssid_start) + 1);
 	if (rc != EOK) {
 		async_exchange_end(exch);
@@ -132,4 +134,21 @@
 }
 
+/** Disconnect device from network.
+ *
+ * @param[in] dev_sess Device session.
+ *
+ * @return EOK If the operation was successfully completed,
+ * negative error code otherwise.
+ */
+int ieee80211_disconnect(async_sess_t *dev_sess)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_1_0(exch, DEV_IFACE_ID(IEEE80211_DEV_IFACE),
+	    IEEE80211_DISCONNECT);
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
 static void remote_ieee80211_get_scan_results(ddf_fun_t *fun, void *iface,
     ipc_callid_t callid, ipc_call_t *call)
@@ -141,5 +160,7 @@
 	memset(&scan_results, 0, sizeof(ieee80211_scan_results_t));
 	
-	int rc = ieee80211_iface->get_scan_results(fun, &scan_results);
+	bool now = IPC_GET_ARG2(*call);
+	
+	int rc = ieee80211_iface->get_scan_results(fun, &scan_results, now);
 	if (rc == EOK) {
 		ipc_callid_t data_callid;
@@ -170,5 +191,5 @@
 	assert(ieee80211_iface->connect);
 	
-	char ssid[MAX_STRING_SIZE];
+	char ssid_start[MAX_STRING_SIZE];
 	char password[MAX_STRING_SIZE];
 	
@@ -187,5 +208,5 @@
 	}
 	
-	int rc = async_data_write_finalize(data_callid, ssid, len);
+	int rc = async_data_write_finalize(data_callid, ssid_start, len);
 	if (rc != EOK) {
 		async_answer_0(data_callid, EINVAL);
@@ -213,6 +234,15 @@
 	}
 	
-	rc = ieee80211_iface->connect(fun, ssid, password);
-	
+	rc = ieee80211_iface->connect(fun, ssid_start, password);
+	
+	async_answer_0(callid, rc);
+}
+
+static void remote_ieee80211_disconnect(ddf_fun_t *fun, void *iface,
+    ipc_callid_t callid, ipc_call_t *call)
+{
+	ieee80211_iface_t *ieee80211_iface = (ieee80211_iface_t *) iface;
+	assert(ieee80211_iface->disconnect);
+	int rc = ieee80211_iface->disconnect(fun);
 	async_answer_0(callid, rc);
 }
@@ -223,5 +253,6 @@
 static const remote_iface_func_ptr_t remote_ieee80211_iface_ops[] = {
 	[IEEE80211_GET_SCAN_RESULTS] = remote_ieee80211_get_scan_results,
-	[IEEE80211_CONNECT] = remote_ieee80211_connect
+	[IEEE80211_CONNECT] = remote_ieee80211_connect,
+	[IEEE80211_DISCONNECT] = remote_ieee80211_disconnect
 };
 
