Index: uspace/lib/net/generic/generic.c
===================================================================
--- uspace/lib/net/generic/generic.c	(revision 79ae36ddc409577eb0da3750b3a7280e034566a2)
+++ uspace/lib/net/generic/generic.c	(revision ee2fa30aed4921e38c357a0420357b61329be533)
@@ -37,5 +37,4 @@
 #include <generic.h>
 #include <async.h>
-#include <async_obsolete.h>
 #include <ipc/services.h>
 #include <net/device.h>
@@ -45,18 +44,19 @@
 /** Notify the module about the device state change.
  *
- * @param[in] phone	The service module phone.
- * @param[in] message	The service specific message.
- * @param[in] device_id	The device identifier.
- * @param[in] state	The new device state.
- * @param[in] target	The target module service.
- * @return		EOK on success.
- *
- */
-int
-generic_device_state_msg_remote(int phone, int message, device_id_t device_id,
-    int state, services_t target)
-{
-	async_obsolete_msg_3(phone, (sysarg_t) message, (sysarg_t) device_id,
-	    (sysarg_t) state, target);
+ * @param[in] sess      Service module session.
+ * @param[in] message   Service specific message.
+ * @param[in] device_id Device identifier.
+ * @param[in] state     New device state.
+ * @param[in] target    Target module service.
+ *
+ * @return EOK on success.
+ *
+ */
+int generic_device_state_msg_remote(async_sess_t *sess, sysarg_t message,
+    device_id_t device_id, sysarg_t state, services_t target)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	async_msg_3(exch, message, (sysarg_t) device_id, state, target);
+	async_exchange_end(exch);
 	
 	return EOK;
@@ -65,54 +65,59 @@
 /** Notify a module about the device.
  *
- * @param[in] phone	The service module phone.
- * @param[in] message	The service specific message.
- * @param[in] device_id	The device identifier.
- * @param[in] arg2	The second argument of the message.
- * @param[in] service	The device module service.
- * @return		EOK on success.
- * @return		Other error codes as defined for the specific service
- *			 message.
- *
- */
-int
-generic_device_req_remote(int phone, int message, device_id_t device_id,
-    int arg2, services_t service)
-{
-	return (int) async_obsolete_req_3_0(phone, (sysarg_t) message,
-	    (sysarg_t) device_id, (sysarg_t) arg2, (sysarg_t) service);
+ * @param[in] sess      Service module session.
+ * @param[in] message   Service specific message.
+ * @param[in] device_id Device identifier.
+ * @param[in] arg2      Second argument of the message.
+ * @param[in] service   Device module service.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for the specific service
+ *         message.
+ *
+ */
+int generic_device_req_remote(async_sess_t *sess, sysarg_t message,
+    device_id_t device_id, sysarg_t arg2, services_t service)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	int rc = async_req_3_0(exch, message, (sysarg_t) device_id,
+	    arg2, (sysarg_t) service);
+	async_exchange_end(exch);
+	
+	return rc;
 }
 
 /** Returns the address.
  *
- * @param[in] phone	The service module phone.
- * @param[in] message	The service specific message.
- * @param[in] device_id	The device identifier.
- * @param[out] address	The desired address.
- * @param[out] data	The address data container.
- * @return		EOK on success.
- * @return		EBADMEM if the address parameter and/or the data
- *			parameter is NULL.
- * @return		Other error codes as defined for the specific service
- *			message.
- */
-int
-generic_get_addr_req(int phone, int message, device_id_t device_id,
-    measured_string_t **address, uint8_t **data)
-{
-	aid_t message_id;
+ * @param[in] sess      Service module session.
+ * @param[in] message   Service specific message.
+ * @param[in] device_id Device identifier.
+ * @param[out] address  Desired address.
+ * @param[out] data     Address data container.
+ *
+ * @return EOK on success.
+ * @return EBADMEM if the address parameter and/or the data
+ *         parameter is NULL.
+ * @return Other error codes as defined for the specific service
+ *         message.
+ *
+ */
+int generic_get_addr_req(async_sess_t *sess, sysarg_t message,
+    device_id_t device_id, measured_string_t **address, uint8_t **data)
+{
+	if ((!address) || (!data))
+		return EBADMEM;
+	
+	/* Request the address */
+	async_exch_t *exch = async_exchange_begin(sess);
+	aid_t message_id = async_send_1(exch, message, (sysarg_t) device_id,
+	    NULL);
+	int rc = measured_strings_return(exch, address, data, 1);
+	async_exchange_end(exch);
+	
 	sysarg_t result;
-	int string;
-
-	if (!address || !data)
-		return EBADMEM;
-
-	/* Request the address */
-	message_id = async_obsolete_send_1(phone, (sysarg_t) message,
-	    (sysarg_t) device_id, NULL);
-	string = measured_strings_return(phone, address, data, 1);
 	async_wait_for(message_id, &result);
-
+	
 	/* If not successful */
-	if ((string == EOK) && (result != EOK)) {
+	if ((rc == EOK) && (result != EOK)) {
 		/* Clear the data */
 		free(*address);
@@ -125,16 +130,17 @@
 /** Return the device packet dimension for sending.
  *
- * @param[in] phone	The service module phone.
- * @param[in] message	The service specific message.
- * @param[in] device_id	The device identifier.
- * @param[out] packet_dimension The packet dimension.
- * @return		EOK on success.
- * @return		EBADMEM if the packet_dimension parameter is NULL.
- * @return		Other error codes as defined for the specific service
- *			message.
- */
-int
-generic_packet_size_req_remote(int phone, int message, device_id_t device_id,
-    packet_dimension_t *packet_dimension)
+ * @param[in] sess              Service module session.
+ * @param[in] message           Service specific message.
+ * @param[in] device_id         Device identifier.
+ * @param[out] packet_dimension Packet dimension.
+ *
+ * @return EOK on success.
+ * @return EBADMEM if the packet_dimension parameter is NULL.
+ * @return Other error codes as defined for the specific service
+ *         message.
+ *
+ */
+int generic_packet_size_req_remote(async_sess_t *sess, sysarg_t message,
+    device_id_t device_id, packet_dimension_t *packet_dimension)
 {
 	if (!packet_dimension)
@@ -146,6 +152,8 @@
 	sysarg_t suffix;
 	
-	sysarg_t result = async_obsolete_req_1_4(phone, (sysarg_t) message,
-	    (sysarg_t) device_id, &addr_len, &prefix, &content, &suffix);
+	async_exch_t *exch = async_exchange_begin(sess);
+	sysarg_t result = async_req_1_4(exch, message, (sysarg_t) device_id,
+	    &addr_len, &prefix, &content, &suffix);
+	async_exchange_end(exch);
 	
 	packet_dimension->prefix = (size_t) prefix;
@@ -159,25 +167,31 @@
 /** Pass the packet queue to the module.
  *
- * @param[in] phone	The service module phone.
- * @param[in] message	The service specific message.
- * @param[in] device_id	The device identifier.
- * @param[in] packet_id	The received packet or the received packet queue
- *			identifier.
- * @param[in] target	The target module service.
- * @param[in] error	The error module service.
- * @return		EOK on success.
- */
-int
-generic_received_msg_remote(int phone, int message, device_id_t device_id,
-    packet_id_t packet_id, services_t target, services_t error)
-{
+ * @param[in] sess      Service module session.
+ * @param[in] message   Service specific message.
+ * @param[in] device_id Device identifier.
+ * @param[in] packet_id Received packet or the received packet queue
+ *                      identifier.
+ * @param[in] target    Target module service.
+ * @param[in] error     Error module service.
+ *
+ * @return EOK on success.
+ *
+ */
+int generic_received_msg_remote(async_sess_t *sess, sysarg_t message,
+    device_id_t device_id, packet_id_t packet_id, services_t target,
+    services_t error)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	
 	if (error) {
-		async_obsolete_msg_4(phone, (sysarg_t) message, (sysarg_t) device_id,
+		async_msg_4(exch, message, (sysarg_t) device_id,
 		    (sysarg_t) packet_id, (sysarg_t) target, (sysarg_t) error);
 	} else {
-		async_obsolete_msg_3(phone, (sysarg_t) message, (sysarg_t) device_id,
+		async_msg_3(exch, message, (sysarg_t) device_id,
 		    (sysarg_t) packet_id, (sysarg_t) target);
 	}
 	
+	async_exchange_end(exch);
+	
 	return EOK;
 }
@@ -185,25 +199,30 @@
 /** Send the packet queue.
  *
- * @param[in] phone	The service module phone.
- * @param[in] message	The service specific message.
- * @param[in] device_id	The device identifier.
- * @param[in] packet_id	The packet or the packet queue identifier.
- * @param[in] sender	The sending module service.
- * @param[in] error	The error module service.
- * @return		EOK on success.
- *
- */
-int
-generic_send_msg_remote(int phone, int message, device_id_t device_id,
-    packet_id_t packet_id, services_t sender, services_t error)
-{
+ * @param[in] sess      Service module session.
+ * @param[in] message   Service specific message.
+ * @param[in] device_id Device identifier.
+ * @param[in] packet_id Packet or the packet queue identifier.
+ * @param[in] sender    Sending module service.
+ * @param[in] error     Error module service.
+ *
+ * @return EOK on success.
+ *
+ */
+int generic_send_msg_remote(async_sess_t *sess, sysarg_t message,
+    device_id_t device_id, packet_id_t packet_id, services_t sender,
+    services_t error)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	
 	if (error) {
-		async_obsolete_msg_4(phone, (sysarg_t) message, (sysarg_t) device_id,
+		async_msg_4(exch, message, (sysarg_t) device_id,
 		    (sysarg_t) packet_id, (sysarg_t) sender, (sysarg_t) error);
 	} else {
-		async_obsolete_msg_3(phone, (sysarg_t) message, (sysarg_t) device_id,
+		async_msg_3(exch, message, (sysarg_t) device_id,
 		    (sysarg_t) packet_id, (sysarg_t) sender);
 	}
 	
+	async_exchange_end(exch);
+	
 	return EOK;
 }
@@ -213,48 +232,51 @@
  * Allocates and returns the needed memory block as the data parameter.
  *
- * @param[in] phone	The service module phone.
- * @param[in] message	The service specific message.
- * @param[in] device_id	The device identifier.
- * @param[in] service	The module service.
- * @param[in] configuration The key strings.
- * @param[in] count	The number of configuration keys.
- * @param[out] translation The translated values.
- * @param[out] data	The translation data container.
- * @return		EOK on success.
- * @return		EINVAL if the configuration parameter is NULL.
- * @return		EINVAL if the count parameter is zero.
- * @return		EBADMEM if the translation or the data parameters are
- *			NULL.
- * @return		Other error codes as defined for the specific service
- *			message.
- */
-int
-generic_translate_req(int phone, int message, device_id_t device_id,
-    services_t service, measured_string_t *configuration, size_t count,
+ * @param[in] sess          Service module session.
+ * @param[in] message       Service specific message.
+ * @param[in] device_id     Device identifier.
+ * @param[in] service       Module service.
+ * @param[in] configuration Key strings.
+ * @param[in] count         Number of configuration keys.
+ * @param[out] translation  Translated values.
+ * @param[out] data         Translation data container.
+ *
+ * @return EOK on success.
+ * @return EINVAL if the configuration parameter is NULL.
+ * @return EINVAL if the count parameter is zero.
+ * @return EBADMEM if the translation or the data parameters are
+ *         NULL.
+ * @return Other error codes as defined for the specific service
+ *         message.
+ *
+ */
+int generic_translate_req(async_sess_t *sess, sysarg_t message,
+    device_id_t device_id, services_t service,
+    measured_string_t *configuration, size_t count,
     measured_string_t **translation, uint8_t **data)
 {
-	aid_t message_id;
+	if ((!configuration) || (count == 0))
+		return EINVAL;
+	
+	if ((!translation) || (!data))
+		return EBADMEM;
+	
+	/* Request the translation */
+	async_exch_t *exch = async_exchange_begin(sess);
+	aid_t message_id = async_send_3(exch, message, (sysarg_t) device_id,
+	    (sysarg_t) count, (sysarg_t) service, NULL);
+	measured_strings_send(exch, configuration, count);
+	int rc = measured_strings_return(exch, translation, data, count);
+	async_exchange_end(exch);
+	
 	sysarg_t result;
-	int string;
-
-	if (!configuration || (count == 0))
-		return EINVAL;
-	if (!translation || !data)
-		return EBADMEM;
-
-	/* Request the translation */
-	message_id = async_obsolete_send_3(phone, (sysarg_t) message,
-	    (sysarg_t) device_id, (sysarg_t) count, (sysarg_t) service, NULL);
-	measured_strings_send(phone, configuration, count);
-	string = measured_strings_return(phone, translation, data, count);
 	async_wait_for(message_id, &result);
-
+	
 	/* If not successful */
-	if ((string == EOK) && (result != EOK)) {
+	if ((rc == EOK) && (result != EOK)) {
 		/* Clear the data */
 		free(*translation);
 		free(*data);
 	}
-
+	
 	return (int) result;
 }
