Index: uspace/lib/libc/Makefile
===================================================================
--- uspace/lib/libc/Makefile	(revision 57937dd6bf7466b5c022cfaf61001daece9e0a5a)
+++ uspace/lib/libc/Makefile	(revision 5cd136abc29be1860cb1f40730725d7f1d76a017)
@@ -54,4 +54,5 @@
 	generic/devmap.c \
 	generic/devman.c \
+	generic/device/hw_res.c \
 	generic/event.c \
 	generic/errno.c \
Index: uspace/lib/libc/generic/device/hw_res.c
===================================================================
--- uspace/lib/libc/generic/device/hw_res.c	(revision 5cd136abc29be1860cb1f40730725d7f1d76a017)
+++ uspace/lib/libc/generic/device/hw_res.c	(revision 5cd136abc29be1860cb1f40730725d7f1d76a017)
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2010 Lenka Trochtova
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ 
+ /** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+ 
+#include <device/hw_res.h>
+#include <errno.h>
+#include <async.h>
+#include <malloc.h>
+ 
+
+bool get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources)
+{
+	bool ret = true;
+	ipcarg_t count = 0;
+	int rc = async_req_1_1(dev_phone, HW_RES_DEV_IFACE, GET_RESOURCE_LIST, &count);
+	hw_resources->count = count;
+	if (EOK != rc) {
+		return false;
+	}
+	
+	size_t size = count * sizeof(hw_resource_t);
+	hw_resources->resources = (hw_resource_t *)malloc(size);
+	if (NULL == hw_resources->resources) {
+		size = 0;
+		ret = false;
+	}
+	
+	rc = async_data_read_start(dev_phone, hw_resources->resources, size);
+	if (EOK != rc) {
+		free(hw_resources->resources);
+		hw_resources->resources = NULL;
+		ret = false;
+	}
+	 	 
+	return ret;	 
+}
+
+bool enable_interrupt(int dev_phone)
+{
+	int rc = async_req_1_0(dev_phone, HW_RES_DEV_IFACE, ENABLE_INTERRUPT);
+	return rc == EOK;
+}
+ 
+ 
+ 
+ /** @}
+ */
Index: uspace/lib/libc/generic/devman.c
===================================================================
--- uspace/lib/libc/generic/devman.c	(revision 57937dd6bf7466b5c022cfaf61001daece9e0a5a)
+++ uspace/lib/libc/generic/devman.c	(revision 5cd136abc29be1860cb1f40730725d7f1d76a017)
@@ -28,4 +28,10 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+ 
+ /** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
 
 #include <string.h>
@@ -193,2 +199,35 @@
 	}
 }
+
+int devman_device_connect(device_handle_t handle, unsigned int flags)
+{
+	int phone;
+	
+	if (flags & IPC_FLAG_BLOCKING) {
+		phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAN,
+		    DEVMAN_CONNECT_TO_DEVICE, handle);
+	} else {
+		phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAN,
+		    DEVMAN_CONNECT_TO_DEVICE, handle);
+	}
+	
+	return phone;
+}
+
+int devman_parent_device_connect(device_handle_t handle, unsigned int flags)
+{
+	int phone;
+	
+	if (flags & IPC_FLAG_BLOCKING) {
+		phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAN,
+		    DEVMAN_CONNECT_TO_PARENTS_DEVICE, handle);
+	} else {
+		phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAN,
+		    DEVMAN_CONNECT_TO_PARENTS_DEVICE, handle);
+	}
+	
+	return phone;
+}
+
+/** @}
+ */
Index: uspace/lib/libc/include/device/hw_res.h
===================================================================
--- uspace/lib/libc/include/device/hw_res.h	(revision 5cd136abc29be1860cb1f40730725d7f1d76a017)
+++ uspace/lib/libc/include/device/hw_res.h	(revision 5cd136abc29be1860cb1f40730725d7f1d76a017)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010 Lenka Trochtova
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ 
+ /** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+ 
+#ifndef LIBC_DEVICE_HW_RES_H_
+#define LIBC_DEVICE_HW_RES_H_
+
+#include <ipc/dev_iface.h>
+#include <bool.h>
+
+
+bool get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources);
+
+bool enable_interrupt(int dev_phone);
+
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/libc/include/devman.h
===================================================================
--- uspace/lib/libc/include/devman.h	(revision 57937dd6bf7466b5c022cfaf61001daece9e0a5a)
+++ uspace/lib/libc/include/devman.h	(revision 5cd136abc29be1860cb1f40730725d7f1d76a017)
@@ -48,4 +48,7 @@
 int devman_child_device_register(const char *, match_id_list_t *, device_handle_t, device_handle_t *);
 
+int devman_device_connect(device_handle_t handle, unsigned int flags);
+int devman_parent_device_connect(device_handle_t handle, unsigned int flags);
+
 
 #endif
Index: uspace/lib/libc/include/ipc/dev_iface.h
===================================================================
--- uspace/lib/libc/include/ipc/dev_iface.h	(revision 57937dd6bf7466b5c022cfaf61001daece9e0a5a)
+++ uspace/lib/libc/include/ipc/dev_iface.h	(revision 5cd136abc29be1860cb1f40730725d7f1d76a017)
@@ -77,8 +77,8 @@
 			int irq;			
 		} intr;		
-	};	
+	} res;	
 } hw_resource_t;
 
-typedef struct {
+typedef struct hw_resource_list {
 	size_t count;
 	hw_resource_t *resources;	
Index: uspace/lib/libc/include/ipc/devman.h
===================================================================
--- uspace/lib/libc/include/ipc/devman.h	(revision 57937dd6bf7466b5c022cfaf61001daece9e0a5a)
+++ uspace/lib/libc/include/ipc/devman.h	(revision 5cd136abc29be1860cb1f40730725d7f1d76a017)
@@ -116,5 +116,6 @@
 	DEVMAN_DRIVER = 1,
 	DEVMAN_CLIENT,
-	DEVMAN_CONNECT_TO_DEVICE
+	DEVMAN_CONNECT_TO_DEVICE,
+	DEVMAN_CONNECT_TO_PARENTS_DEVICE
 } devman_interface_t;
 
Index: uspace/lib/libdrv/generic/driver.c
===================================================================
--- uspace/lib/libdrv/generic/driver.c	(revision 57937dd6bf7466b5c022cfaf61001daece9e0a5a)
+++ uspace/lib/libdrv/generic/driver.c	(revision 5cd136abc29be1860cb1f40730725d7f1d76a017)
@@ -141,4 +141,7 @@
 		return;
 	}
+	
+	
+	// TODO - if the client is not a driver, check whether it is allowed to use the device
 
 	// TODO open the device (introduce some callbacks for opening and closing devices registered by the driver)
