Index: uspace/lib/c/generic/loc.c
===================================================================
--- uspace/lib/c/generic/loc.c	(revision 0dd16778197e5f50b6e77a71d9b8aeb33b2ad863)
+++ uspace/lib/c/generic/loc.c	(revision 616f5dd374d278b942175913d4e7b7a01086e781)
@@ -107,9 +107,13 @@
 	if (!loc_callback_created) {
 		async_exch_t *exch =
-		    loc_exchange_begin_blocking(LOC_PORT_CONSUMER);
+		    loc_exchange_begin_blocking(INTERFACE_LOC_CONSUMER);
 		
 		ipc_call_t answer;
 		aid_t req = async_send_0(exch, LOC_CALLBACK_CREATE, &answer);
-		int rc = async_connect_to_me(exch, 0, 0, 0, loc_cb_conn, NULL);
+		
+		port_id_t port;
+		int rc = async_create_callback_port(exch, INTERFACE_LOC_CB, 0, 0,
+		    loc_cb_conn, NULL, &port);
+		
 		loc_exchange_end(exch);
 		
@@ -135,8 +139,8 @@
  *
  */
-async_exch_t *loc_exchange_begin_blocking(loc_interface_t iface)
+async_exch_t *loc_exchange_begin_blocking(iface_t iface)
 {
 	switch (iface) {
-	case LOC_PORT_SUPPLIER:
+	case INTERFACE_LOC_SUPPLIER:
 		fibril_mutex_lock(&loc_supp_block_mutex);
 		
@@ -147,6 +151,6 @@
 			if (loc_supp_block_sess == NULL)
 				loc_supp_block_sess =
-				    service_connect_blocking_iface(EXCHANGE_SERIALIZE,
-				    LOC_PORT_SUPPLIER, SERVICE_LOC, 0);
+				    service_connect_blocking(SERVICE_LOC,
+				    INTERFACE_LOC_SUPPLIER, 0);
 		}
 		
@@ -157,5 +161,5 @@
 		
 		return async_exchange_begin(loc_supp_block_sess);
-	case LOC_PORT_CONSUMER:
+	case INTERFACE_LOC_CONSUMER:
 		fibril_mutex_lock(&loc_cons_block_mutex);
 		
@@ -166,6 +170,6 @@
 			if (loc_cons_block_sess == NULL)
 				loc_cons_block_sess =
-				    service_connect_blocking_iface(EXCHANGE_SERIALIZE,
-				    LOC_PORT_CONSUMER, SERVICE_LOC, 0);
+				    service_connect_blocking(SERVICE_LOC,
+				    INTERFACE_LOC_CONSUMER, 0);
 		}
 		
@@ -188,14 +192,14 @@
  *
  */
-async_exch_t *loc_exchange_begin(loc_interface_t iface)
+async_exch_t *loc_exchange_begin(iface_t iface)
 {
 	switch (iface) {
-	case LOC_PORT_SUPPLIER:
+	case INTERFACE_LOC_SUPPLIER:
 		fibril_mutex_lock(&loc_supplier_mutex);
 		
 		if (loc_supplier_sess == NULL)
 			loc_supplier_sess =
-			    service_connect_iface(EXCHANGE_SERIALIZE, LOC_PORT_SUPPLIER,
-			    SERVICE_LOC, 0);
+			    service_connect(SERVICE_LOC,
+			    INTERFACE_LOC_SUPPLIER, 0);
 		
 		fibril_mutex_unlock(&loc_supplier_mutex);
@@ -205,11 +209,11 @@
 		
 		return async_exchange_begin(loc_supplier_sess);
-	case LOC_PORT_CONSUMER:
+	case INTERFACE_LOC_CONSUMER:
 		fibril_mutex_lock(&loc_consumer_mutex);
 		
 		if (loc_consumer_sess == NULL)
 			loc_consumer_sess =
-			    service_connect_iface(EXCHANGE_SERIALIZE, LOC_PORT_CONSUMER,
-			    SERVICE_LOC, 0);
+			    service_connect(SERVICE_LOC,
+			    INTERFACE_LOC_CONSUMER, 0);
 		
 		fibril_mutex_unlock(&loc_consumer_mutex);
@@ -237,5 +241,5 @@
 int loc_server_register(const char *name)
 {
-	async_exch_t *exch = loc_exchange_begin_blocking(LOC_PORT_SUPPLIER);
+	async_exch_t *exch = loc_exchange_begin_blocking(INTERFACE_LOC_SUPPLIER);
 	
 	ipc_call_t answer;
@@ -250,6 +254,6 @@
 	}
 	
-	exch = loc_exchange_begin(LOC_PORT_SUPPLIER);
-	async_connect_to_me(exch, 0, 0, 0, NULL, NULL);
+	exch = loc_exchange_begin(INTERFACE_LOC_SUPPLIER);
+	async_connect_to_me(exch, 0, 0, 0);
 	loc_exchange_end(exch);
 	
@@ -260,24 +264,14 @@
 /** Register new service.
  *
- * The @p interface is used when forwarding connection to the server.
- * If not 0, the first argument is the interface and the second argument
- * is the service ID.
- *
- * When the interface is zero (default), the first argument is directly
- * the handle (to ensure backward compatibility).
- *
- * @param      fqsn      Fully qualified service name
- * @param[out] sid       Service ID of new service
- * @param      interface Interface when forwarding
- *
- */
-int loc_service_register_with_iface(const char *fqsn,
-    service_id_t *sid, sysarg_t interface)
-{
-	async_exch_t *exch = loc_exchange_begin_blocking(LOC_PORT_SUPPLIER);
+ * @param      fqsn  Fully qualified service name
+ * @param[out] sid   Service ID of new service
+ *
+ */
+int loc_service_register(const char *fqsn, service_id_t *sid)
+{
+	async_exch_t *exch = loc_exchange_begin_blocking(INTERFACE_LOC_SUPPLIER);
 	
 	ipc_call_t answer;
-	aid_t req = async_send_2(exch, LOC_SERVICE_REGISTER, interface, 0,
-	    &answer);
+	aid_t req = async_send_0(exch, LOC_SERVICE_REGISTER, &answer);
 	sysarg_t retval = async_data_write_start(exch, fqsn, str_size(fqsn));
 	
@@ -304,15 +298,4 @@
 }
 
-/** Register new service.
- *
- * @param fqsn Fully qualified service name
- * @param sid  Output: ID of new service
- *
- */
-int loc_service_register(const char *fqdn, service_id_t *sid)
-{
-	return loc_service_register_with_iface(fqdn, sid, 0);
-}
-
 /** Unregister service.
  *
@@ -324,5 +307,5 @@
 	sysarg_t retval;
 	
-	exch = loc_exchange_begin_blocking(LOC_PORT_SUPPLIER);
+	exch = loc_exchange_begin_blocking(INTERFACE_LOC_SUPPLIER);
 	retval = async_req_1_0(exch, LOC_SERVICE_UNREGISTER, sid);
 	loc_exchange_end(exch);
@@ -337,7 +320,7 @@
 	
 	if (flags & IPC_FLAG_BLOCKING)
-		exch = loc_exchange_begin_blocking(LOC_PORT_CONSUMER);
+		exch = loc_exchange_begin_blocking(INTERFACE_LOC_CONSUMER);
 	else {
-		exch = loc_exchange_begin(LOC_PORT_CONSUMER);
+		exch = loc_exchange_begin(INTERFACE_LOC_CONSUMER);
 		if (exch == NULL)
 			return errno;
@@ -390,5 +373,5 @@
 	
 	*name = NULL;
-	exch = loc_exchange_begin_blocking(LOC_PORT_CONSUMER);
+	exch = loc_exchange_begin_blocking(INTERFACE_LOC_CONSUMER);
 	
 	ipc_call_t answer;
@@ -470,7 +453,7 @@
 	
 	if (flags & IPC_FLAG_BLOCKING)
-		exch = loc_exchange_begin_blocking(LOC_PORT_CONSUMER);
+		exch = loc_exchange_begin_blocking(INTERFACE_LOC_CONSUMER);
 	else {
-		exch = loc_exchange_begin(LOC_PORT_CONSUMER);
+		exch = loc_exchange_begin(INTERFACE_LOC_CONSUMER);
 		if (exch == NULL)
 			return errno;
@@ -519,7 +502,7 @@
 	
 	if (flags & IPC_FLAG_BLOCKING)
-		exch = loc_exchange_begin_blocking(LOC_PORT_CONSUMER);
+		exch = loc_exchange_begin_blocking(INTERFACE_LOC_CONSUMER);
 	else {
-		exch = loc_exchange_begin(LOC_PORT_CONSUMER);
+		exch = loc_exchange_begin(INTERFACE_LOC_CONSUMER);
 		if (exch == NULL)
 			return errno;
@@ -556,5 +539,5 @@
 loc_object_type_t loc_id_probe(service_id_t handle)
 {
-	async_exch_t *exch = loc_exchange_begin_blocking(LOC_PORT_CONSUMER);
+	async_exch_t *exch = loc_exchange_begin_blocking(INTERFACE_LOC_CONSUMER);
 	
 	sysarg_t type;
@@ -569,5 +552,5 @@
 }
 
-async_sess_t *loc_service_connect_iface(service_id_t handle, iface_t iface,
+async_sess_t *loc_service_connect(service_id_t handle, iface_t iface,
     unsigned int flags)
 {
@@ -575,29 +558,14 @@
 	
 	if (flags & IPC_FLAG_BLOCKING)
-		sess = service_connect_blocking_iface_extended(SERVICE_LOC, iface, handle);
+		sess = service_connect_blocking(SERVICE_LOC, iface, handle);
 	else
-		sess = service_connect_iface_extended(SERVICE_LOC, iface, handle);
+		sess = service_connect(SERVICE_LOC, iface, handle);
 	
 	return sess;
 }
 
-async_sess_t *loc_service_connect(exch_mgmt_t mgmt, service_id_t handle,
-    unsigned int flags)
-{
-	async_sess_t *sess;
-	
-	if (flags & IPC_FLAG_BLOCKING)
-		sess = service_connect_blocking_iface(mgmt, LOC_CONNECT_TO_SERVICE,
-		    SERVICE_LOC, handle);
-	else
-		sess = service_connect_iface(mgmt, LOC_CONNECT_TO_SERVICE,
-		    SERVICE_LOC, handle);
-	
-	return sess;
-}
-
 int loc_null_create(void)
 {
-	async_exch_t *exch = loc_exchange_begin_blocking(LOC_PORT_CONSUMER);
+	async_exch_t *exch = loc_exchange_begin_blocking(INTERFACE_LOC_CONSUMER);
 	
 	sysarg_t null_id;
@@ -614,5 +582,5 @@
 void loc_null_destroy(int null_id)
 {
-	async_exch_t *exch = loc_exchange_begin_blocking(LOC_PORT_CONSUMER);
+	async_exch_t *exch = loc_exchange_begin_blocking(INTERFACE_LOC_CONSUMER);
 	async_req_1_0(exch, LOC_NULL_DESTROY, (sysarg_t) null_id);
 	loc_exchange_end(exch);
@@ -640,5 +608,5 @@
 	sysarg_t retval;
 	
-	exch = loc_exchange_begin_blocking(LOC_PORT_SUPPLIER);
+	exch = loc_exchange_begin_blocking(INTERFACE_LOC_SUPPLIER);
 	retval = async_req_2_0(exch, LOC_SERVICE_ADD_TO_CAT, svc_id, cat_id);
 	loc_exchange_end(exch);
@@ -661,5 +629,5 @@
 size_t loc_count_namespaces(void)
 {
-	async_exch_t *exch = loc_exchange_begin_blocking(LOC_PORT_CONSUMER);
+	async_exch_t *exch = loc_exchange_begin_blocking(INTERFACE_LOC_CONSUMER);
 	size_t size = loc_count_namespaces_internal(exch);
 	loc_exchange_end(exch);
@@ -670,5 +638,5 @@
 size_t loc_count_services(service_id_t ns_handle)
 {
-	async_exch_t *exch = loc_exchange_begin_blocking(LOC_PORT_CONSUMER);
+	async_exch_t *exch = loc_exchange_begin_blocking(INTERFACE_LOC_CONSUMER);
 	size_t size = loc_count_services_internal(exch, ns_handle);
 	loc_exchange_end(exch);
@@ -681,5 +649,5 @@
 	/* Loop until read is succesful */
 	while (true) {
-		async_exch_t *exch = loc_exchange_begin_blocking(LOC_PORT_CONSUMER);
+		async_exch_t *exch = loc_exchange_begin_blocking(INTERFACE_LOC_CONSUMER);
 		size_t count = loc_count_namespaces_internal(exch);
 		loc_exchange_end(exch);
@@ -692,5 +660,5 @@
 			return 0;
 		
-		exch = loc_exchange_begin(LOC_PORT_CONSUMER);
+		exch = loc_exchange_begin(INTERFACE_LOC_CONSUMER);
 		
 		ipc_call_t answer;
@@ -730,5 +698,5 @@
 	/* Loop until read is succesful */
 	while (true) {
-		async_exch_t *exch = loc_exchange_begin_blocking(LOC_PORT_CONSUMER);
+		async_exch_t *exch = loc_exchange_begin_blocking(INTERFACE_LOC_CONSUMER);
 		size_t count = loc_count_services_internal(exch, ns_handle);
 		loc_exchange_end(exch);
@@ -741,5 +709,5 @@
 			return 0;
 		
-		exch = loc_exchange_begin(LOC_PORT_CONSUMER);
+		exch = loc_exchange_begin(INTERFACE_LOC_CONSUMER);
 		
 		ipc_call_t answer;
@@ -778,5 +746,5 @@
     sysarg_t *id_buf, size_t buf_size, size_t *act_size)
 {
-	async_exch_t *exch = loc_exchange_begin_blocking(LOC_PORT_CONSUMER);
+	async_exch_t *exch = loc_exchange_begin_blocking(INTERFACE_LOC_CONSUMER);
 
 	ipc_call_t answer;
