Index: uspace/lib/libc/include/device/hw_res.h
===================================================================
--- uspace/lib/libc/include/device/hw_res.h	(revision 3a5909fe4bb88de08b53e63b8b853f35876cd30c)
+++ uspace/lib/libc/include/device/hw_res.h	(revision c1a8ae52fba8b8b7f0dfe4c310347c3d44299e2b)
@@ -39,4 +39,38 @@
 #include <bool.h>
 
+/** HW resource (e.g. interrupt, memory register, i/o register etc.). */
+typedef struct hw_resource {
+	hw_res_type_t type;
+	union {
+		struct {
+			uint64_t address;
+			endianness_t endianness;			
+			size_t size;			
+		} mem_range;
+		struct {
+			uint64_t address;
+			endianness_t endianness;			
+			size_t size;			
+		} io_range;
+		struct {
+			int irq;			
+		} interrupt;		
+	} res;	
+} hw_resource_t;
+
+typedef struct hw_resource_list {
+	size_t count;
+	hw_resource_t *resources;	
+} hw_resource_list_t;
+
+static inline void clean_hw_resource_list(hw_resource_list_t *hw_res)
+{
+	if(NULL != hw_res->resources) {
+		free(hw_res->resources);
+		hw_res->resources = NULL;
+	}
+	hw_res->count = 0;	
+}
+
 
 bool get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources);
Index: uspace/lib/libc/include/ipc/dev_iface.h
===================================================================
--- uspace/lib/libc/include/ipc/dev_iface.h	(revision 3a5909fe4bb88de08b53e63b8b853f35876cd30c)
+++ uspace/lib/libc/include/ipc/dev_iface.h	(revision c1a8ae52fba8b8b7f0dfe4c310347c3d44299e2b)
@@ -35,17 +35,15 @@
 #include <libarch/types.h>
 
-#define DEV_IFACE_FIRST IPC_FIRST_USER_METHOD
-
 typedef enum {	
-	HW_RES_DEV_IFACE = DEV_IFACE_FIRST,	
+	HW_RES_DEV_IFACE = 0,	
 	// TODO add more interfaces
 	DEV_IFACE_MAX
-} dev_inferface_id_t;
+} dev_inferface_idx_t;
 
+#define DEV_IFACE_ID(idx) ((idx) + IPC_FIRST_USER_METHOD)
+#define DEV_IFACE_IDX(id) ((id) - IPC_FIRST_USER_METHOD)
 
-#define DEV_IFACE_COUNT (DEV_IFACE_MAX - DEV_IFACE_FIRST)
+#define DEV_IFACE_COUNT DEV_IFACE_MAX
 
-
-// data types related to some interface - TODO move this to separate header files
 
 
@@ -69,37 +67,3 @@
 } endianness_t;
 
-/** HW resource (e.g. interrupt, memory register, i/o register etc.). */
-typedef struct hw_resource {
-	hw_res_type_t type;
-	union {
-		struct {
-			uint64_t address;
-			endianness_t endianness;			
-			size_t size;			
-		} mem_range;
-		struct {
-			uint64_t address;
-			endianness_t endianness;			
-			size_t size;			
-		} io_range;
-		struct {
-			int irq;			
-		} interrupt;		
-	} res;	
-} hw_resource_t;
-
-typedef struct hw_resource_list {
-	size_t count;
-	hw_resource_t *resources;	
-} hw_resource_list_t;
-
-static inline void clean_hw_resource_list(hw_resource_list_t *hw_res)
-{
-	if(NULL != hw_res->resources) {
-		free(hw_res->resources);
-		hw_res->resources = NULL;
-	}
-	hw_res->count = 0;	
-}
-
 #endif
