Index: uspace/lib/c/Makefile
===================================================================
--- uspace/lib/c/Makefile	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/c/Makefile	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -69,11 +69,5 @@
 	generic/device/hw_res_parsed.c \
 	generic/device/pio_window.c \
-	generic/device/char_dev.c \
 	generic/device/clock_dev.c \
-	generic/device/battery_dev.c \
-	generic/device/graph_dev.c \
-	generic/device/nic.c \
-	generic/device/pci.c \
-	generic/device/ahci.c \
 	generic/dhcp.c \
 	generic/dnsr.c \
Index: uspace/lib/c/generic/ddi.c
===================================================================
--- uspace/lib/c/generic/ddi.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/c/generic/ddi.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -280,5 +280,5 @@
  *
  */
-int irq_register(int inr, int devno, int method, irq_code_t *ucode)
+int irq_register(int inr, int devno, int method, const irq_code_t *ucode)
 {
 	return __SYSCALL4(SYS_IRQ_REGISTER, inr, devno, method,
Index: uspace/lib/c/generic/device/ahci.c
===================================================================
--- uspace/lib/c/generic/device/ahci.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,185 +1,0 @@
-/*
- * Copyright (c) 2012 Petr Jerman
- * 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 <ipc/dev_iface.h>
-#include <assert.h>
-#include <device/ahci.h>
-#include <errno.h>
-#include <async.h>
-#include <ipc/services.h>
-#include <stdio.h>
-#include <as.h>
-
-typedef enum {
-	IPC_M_AHCI_GET_SATA_DEVICE_NAME,
-	IPC_M_AHCI_GET_NUM_BLOCKS,
-	IPC_M_AHCI_GET_BLOCK_SIZE,
-	IPC_M_AHCI_READ_BLOCKS,
-	IPC_M_AHCI_WRITE_BLOCKS,
-} ahci_iface_funcs_t;
-
-#define MAX_NAME_LENGTH  1024
-
-#define LO(ptr) \
-	((uint32_t) (((uint64_t) ((uintptr_t) (ptr))) & 0xffffffff))
-
-#define HI(ptr) \
-	((uint32_t) (((uint64_t) ((uintptr_t) (ptr))) >> 32))
-
-async_sess_t* ahci_get_sess(devman_handle_t funh, char **name)
-{
-	// FIXME: Use a better way than substring match
-	
-	*name = NULL;
-	
-	char devn[MAX_NAME_LENGTH];
-	int rc = devman_fun_get_name(funh, devn, MAX_NAME_LENGTH);
-	if (rc != EOK)
-		return NULL;
-	
-	size_t devn_size = str_size(devn);
-	
-	if ((devn_size > 5) && (str_lcmp(devn, "ahci_", 5) == 0)) {
-		async_sess_t *sess = devman_device_connect(EXCHANGE_PARALLEL,
-		    funh, IPC_FLAG_BLOCKING);
-		
-		if (sess) {
-			*name = str_dup(devn);
-			return sess;
-		}
-	}
-	
-	return NULL;
-}
-
-int ahci_get_sata_device_name(async_sess_t *sess, size_t sata_dev_name_length,
-    char *sata_dev_name)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	if (!exch)
-		return EINVAL;
-	
-	aid_t req = async_send_2(exch, DEV_IFACE_ID(AHCI_DEV_IFACE),
-	    IPC_M_AHCI_GET_SATA_DEVICE_NAME, sata_dev_name_length, NULL);
-	
-	async_data_read_start(exch, sata_dev_name, sata_dev_name_length);
-	
-	sysarg_t rc;
-	async_wait_for(req, &rc);
-	
-	return rc;
-}
-
-int ahci_get_num_blocks(async_sess_t *sess, uint64_t *blocks)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	if (!exch)
-		return EINVAL;
-	
-	sysarg_t blocks_hi;
-	sysarg_t blocks_lo;
-	int rc = async_req_1_2(exch, DEV_IFACE_ID(AHCI_DEV_IFACE),
-	    IPC_M_AHCI_GET_NUM_BLOCKS, &blocks_hi, &blocks_lo);
-	
-	async_exchange_end(exch);
-	
-	if (rc == EOK) {
-		*blocks = (((uint64_t) blocks_hi) << 32)
-		    | (((uint64_t) blocks_lo) & 0xffffffff);
-	}
-	
-	return rc;
-}
-
-int ahci_get_block_size(async_sess_t *sess, size_t *blocks_size)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	if (!exch)
-		return EINVAL;
-	
-	sysarg_t bs;
-	int rc = async_req_1_1(exch, DEV_IFACE_ID(AHCI_DEV_IFACE),
-	    IPC_M_AHCI_GET_BLOCK_SIZE, &bs);
-	
-	async_exchange_end(exch);
-	
-	if (rc == EOK)
-		*blocks_size = (size_t) bs;
-	
-	return rc;
-}
-
-int ahci_read_blocks(async_sess_t *sess, uint64_t blocknum, size_t count,
-    void *buf)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	if (!exch)
-		return EINVAL;
-	
-	aid_t req;
-	req = async_send_4(exch, DEV_IFACE_ID(AHCI_DEV_IFACE),
-	    IPC_M_AHCI_READ_BLOCKS, HI(blocknum),  LO(blocknum), count, NULL);
-	
-	async_share_out_start(exch, buf, AS_AREA_READ | AS_AREA_WRITE);
-	
-	async_exchange_end(exch);
-	
-	sysarg_t rc;
-	async_wait_for(req, &rc);
-	
-	return rc;
-}
-
-int ahci_write_blocks(async_sess_t *sess, uint64_t blocknum, size_t count,
-    void* buf)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	if (!exch)
-		return EINVAL;
-	
-	aid_t req = async_send_4(exch, DEV_IFACE_ID(AHCI_DEV_IFACE),
-	    IPC_M_AHCI_WRITE_BLOCKS, HI(blocknum),  LO(blocknum), count, NULL);
-	
-	async_share_out_start(exch, buf, AS_AREA_READ | AS_AREA_WRITE);
-	
-	async_exchange_end(exch);
-	
-	sysarg_t rc;
-	async_wait_for(req, &rc);
-	
-	return rc;
-}
-
-/** @}
- */
Index: uspace/lib/c/generic/device/battery_dev.c
===================================================================
--- uspace/lib/c/generic/device/battery_dev.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,93 +1,0 @@
-/*
- * Copyright (c) 2012 Maurizio Lombardi
- * 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 <ipc/dev_iface.h>
-#include <device/battery_dev.h>
-#include <errno.h>
-#include <async.h>
-#include <time.h>
-
-/** Read the current battery status from the device
- *
- * @param sess     Session of the device
- * @param status   Current status of the battery
- *
- * @return         EOK on success or a negative error code
- */
-int
-battery_status_get(async_sess_t *sess, battery_status_t *batt_status)
-{
-	sysarg_t status;
-
-	async_exch_t *exch = async_exchange_begin(sess);
-
-	int const rc = async_req_1_1(exch, DEV_IFACE_ID(BATTERY_DEV_IFACE),
-	    BATTERY_STATUS_GET, &status);
-
-	async_exchange_end(exch);
-
-	if (rc == EOK)
-		*batt_status = (battery_status_t) status;
-
-	return rc;
-}
-
-/** Read the current battery charge level from the device
- *
- * @param sess     Session of the device
- * @param level    Battery charge level (0 - 100)
- *
- * @return         EOK on success or a negative error code
- */
-int
-battery_charge_level_get(async_sess_t *sess, int *level)
-{
-	sysarg_t charge_level;
-
-	async_exch_t *exch = async_exchange_begin(sess);
-
-	int const rc = async_req_1_1(exch, DEV_IFACE_ID(BATTERY_DEV_IFACE),
-	    BATTERY_CHARGE_LEVEL_GET, &charge_level);
-
-	async_exchange_end(exch);
-
-	if (rc == EOK)
-		*level = (int) charge_level;
-
-	return rc;
-}
-
-/** @}
- */
-
Index: uspace/lib/c/generic/device/char_dev.c
===================================================================
--- uspace/lib/c/generic/device/char_dev.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,127 +1,0 @@
-/*
- * 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 <ipc/dev_iface.h>
-#include <device/char_dev.h>
-#include <errno.h>
-#include <async.h>
-#include <malloc.h>
-#include <stdio.h>
-
-/** Read to or write from device.
- *
- * Helper function to read to or write from a device
- * using its character interface.
- *
- * @param sess Session to the device.
- * @param buf  Buffer for the data read from or written to the device.
- * @param size Maximum size of data (in bytes) to be read or written.
- * @param read Read from the device if true, write to it otherwise.
- *
- * @return Non-negative number of bytes actually read from or
- *         written to the device on success, negative error number
- *         otherwise.
- *
- */
-static ssize_t char_dev_rw(async_sess_t *sess, void *buf, size_t size, bool read)
-{
-	ipc_call_t answer;
-	aid_t req;
-	int ret;
-	
-	async_exch_t *exch = async_exchange_begin(sess);
-	
-	if (read) {
-		req = async_send_1(exch, DEV_IFACE_ID(CHAR_DEV_IFACE),
-		    CHAR_DEV_READ, &answer);
-		ret = async_data_read_start(exch, buf, size);
-	} else {
-		req = async_send_1(exch, DEV_IFACE_ID(CHAR_DEV_IFACE),
-		    CHAR_DEV_WRITE, &answer);
-		ret = async_data_write_start(exch, buf, size);
-	}
-	
-	async_exchange_end(exch);
-	
-	sysarg_t rc;
-	if (ret != EOK) {
-		async_wait_for(req, &rc);
-		if (rc == EOK)
-			return (ssize_t) ret;
-		
-		return (ssize_t) rc;
-	}
-	
-	async_wait_for(req, &rc);
-	
-	ret = (int) rc;
-	if (ret != EOK)
-		return (ssize_t) ret;
-	
-	return (ssize_t) IPC_GET_ARG1(answer);
-}
-
-/** Read from character device.
- *
- * @param sess Session to the device.
- * @param buf  Output buffer for the data read from the device.
- * @param size Maximum size (in bytes) of the data to be read.
- *
- * @return Non-negative number of bytes actually read from the
- *         device on success, negative error number otherwise.
- *
- */
-ssize_t char_dev_read(async_sess_t *sess, void *buf, size_t size)
-{
-	return char_dev_rw(sess, buf, size, true);
-}
-
-/** Write to character device.
- *
- * @param sess Session to the device.
- * @param buf  Input buffer containg the data to be written to the
- *             device.
- * @param size Maximum size (in bytes) of the data to be written.
- *
- * @return Non-negative number of bytes actually written to the
- *         device on success, negative error number otherwise.
- *
- */
-ssize_t char_dev_write(async_sess_t *sess, void *buf, size_t size)
-{
-	return char_dev_rw(sess, buf, size, false);
-}
-
-/** @}
- */
Index: uspace/lib/c/generic/device/graph_dev.c
===================================================================
--- uspace/lib/c/generic/device/graph_dev.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*
- * Copyright (c) 2011 Petr Koupy
- * 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 <errno.h>
-#include <ipc/dev_iface.h>
-#include <device/graph_dev.h>
-
-int graph_dev_connect(async_sess_t *sess)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	int ret = async_req_1_0(exch, DEV_IFACE_ID(GRAPH_DEV_IFACE), GRAPH_DEV_CONNECT);
-	async_exchange_end(exch);
-
-	return ret;
-}
-
-/** @}
- */
Index: uspace/lib/c/generic/device/nic.c
===================================================================
--- uspace/lib/c/generic/device/nic.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,1292 +1,0 @@
-/*
- * Copyright (c) 2011 Radim Vansa
- * 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
- * @brief Client-side RPC stubs for DDF NIC
- */
-
-#include <ipc/dev_iface.h>
-#include <assert.h>
-#include <device/nic.h>
-#include <errno.h>
-#include <async.h>
-#include <malloc.h>
-#include <stdio.h>
-#include <ipc/services.h>
-
-/** Send frame from NIC
- *
- * @param[in] dev_sess
- * @param[in] data     Frame data
- * @param[in] size     Frame size in bytes
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_send_frame(async_sess_t *dev_sess, void *data, size_t size)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	ipc_call_t answer;
-	aid_t req = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_SEND_MESSAGE, &answer);
-	sysarg_t retval = async_data_write_start(exch, data, size);
-	
-	async_exchange_end(exch);
-	
-	if (retval != EOK) {
-		async_forget(req);
-		return retval;
-	}
-
-	async_wait_for(req, &retval);
-	return retval;
-}
-
-/** Create callback connection from NIC service
- *
- * @param[in] dev_sess
- * @param[in] device_id
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_callback_create(async_sess_t *dev_sess, async_client_conn_t cfun,
-    void *carg)
-{
-	ipc_call_t answer;
-	int rc;
-	sysarg_t retval;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	aid_t req = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_CALLBACK_CREATE, &answer);
-	
-	rc = async_connect_to_me(exch, 0, 0, 0, cfun, carg);
-	if (rc != EOK) {
-		async_forget(req);
-		return rc;
-	}
-	async_exchange_end(exch);
-	
-	async_wait_for(req, &retval);
-	return (int) retval;
-}
-
-/** Get the current state of the device
- *
- * @param[in]  dev_sess
- * @param[out] state    Current state
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_get_state(async_sess_t *dev_sess, nic_device_state_t *state)
-{
-	assert(state);
-	
-	sysarg_t _state;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_GET_STATE, &_state);
-	async_exchange_end(exch);
-	
-	*state = (nic_device_state_t) _state;
-	
-	return rc;
-}
-
-/** Request the device to change its state
- *
- * @param[in] dev_sess
- * @param[in] state    New state
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_set_state(async_sess_t *dev_sess, nic_device_state_t state)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_SET_STATE, state);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Request the MAC address of the device
- *
- * @param[in]  dev_sess
- * @param[out] address  Structure with buffer for the address
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_get_address(async_sess_t *dev_sess, nic_address_t *address)
-{
-	assert(address);
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	aid_t aid = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_GET_ADDRESS, NULL);
-	int rc = async_data_read_start(exch, address, sizeof(nic_address_t));
-	async_exchange_end(exch);
-	
-	sysarg_t res;
-	async_wait_for(aid, &res);
-	
-	if (rc != EOK)
-		return rc;
-	
-	return (int) res;
-}
-
-/** Set the address of the device (e.g. MAC on Ethernet)
- *
- * @param[in] dev_sess
- * @param[in] address  Pointer to the address
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_set_address(async_sess_t *dev_sess, const nic_address_t *address)
-{
-	assert(address);
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	aid_t aid = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_SET_ADDRESS, NULL);
-	int rc = async_data_write_start(exch, address, sizeof(nic_address_t));
-	async_exchange_end(exch);
-	
-	sysarg_t res;
-	async_wait_for(aid, &res);
-	
-	if (rc != EOK)
-		return rc;
-	
-	return (int) res;
-}
-
-/** Request statistic data about NIC operation.
- *
- * @param[in]  dev_sess
- * @param[out] stats    Structure with the statistics
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_get_stats(async_sess_t *dev_sess, nic_device_stats_t *stats)
-{
-	assert(stats);
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_GET_STATS);
-	if (rc != EOK) {
-		async_exchange_end(exch);
-		return rc;
-	}
-	
-	rc = async_data_read_start(exch, stats, sizeof(nic_device_stats_t));
-	
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Request information about the device.
- *
- * @see nic_device_info_t
- *
- * @param[in]  dev_sess
- * @param[out] device_info Information about the device
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_get_device_info(async_sess_t *dev_sess, nic_device_info_t *device_info)
-{
-	assert(device_info);
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_GET_DEVICE_INFO);
-	if (rc != EOK) {
-		async_exchange_end(exch);
-		return rc;
-	}
-	
-	rc = async_data_read_start(exch, device_info, sizeof(nic_device_info_t));
-	
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Request status of the cable (plugged/unplugged)
- *
- * @param[in]  dev_sess
- * @param[out] cable_state Current cable state
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_get_cable_state(async_sess_t *dev_sess, nic_cable_state_t *cable_state)
-{
-	assert(cable_state);
-	
-	sysarg_t _cable_state;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_GET_CABLE_STATE, &_cable_state);
-	async_exchange_end(exch);
-	
-	*cable_state = (nic_cable_state_t) _cable_state;
-	
-	return rc;
-}
-
-/** Request current operation mode.
- *
- * @param[in]  dev_sess
- * @param[out] speed    Current operation speed in Mbps. Can be NULL.
- * @param[out] duplex   Full duplex/half duplex. Can be NULL.
- * @param[out] role     Master/slave/auto. Can be NULL.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_get_operation_mode(async_sess_t *dev_sess, int *speed,
-   nic_channel_mode_t *duplex, nic_role_t *role)
-{
-	sysarg_t _speed;
-	sysarg_t _duplex;
-	sysarg_t _role;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_GET_OPERATION_MODE, &_speed, &_duplex, &_role);
-	async_exchange_end(exch);
-	
-	if (speed)
-		*speed = (int) _speed;
-	
-	if (duplex)
-		*duplex = (nic_channel_mode_t) _duplex;
-	
-	if (role)
-		*role = (nic_role_t) _role;
-	
-	return rc;
-}
-
-/** Set current operation mode.
- *
- * If the NIC has auto-negotiation enabled, this command
- * disables auto-negotiation and sets the operation mode.
- *
- * @param[in] dev_sess
- * @param[in] speed    Operation speed in Mbps
- * @param[in] duplex   Full duplex/half duplex
- * @param[in] role     Master/slave/auto (e.g. in Gbit Ethernet]
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_set_operation_mode(async_sess_t *dev_sess, int speed,
-    nic_channel_mode_t duplex, nic_role_t role)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_SET_OPERATION_MODE, (sysarg_t) speed, (sysarg_t) duplex,
-	    (sysarg_t) role);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Enable auto-negotiation.
- *
- * The advertisement argument can only limit some modes,
- * it can never force the NIC to advertise unsupported modes.
- *
- * The allowed modes are defined in "nic/eth_phys.h" in the C library.
- *
- * @param[in] dev_sess
- * @param[in] advertisement Allowed advertised modes. Use 0 for all modes.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_autoneg_enable(async_sess_t *dev_sess, uint32_t advertisement)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_AUTONEG_ENABLE, (sysarg_t) advertisement);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Disable auto-negotiation.
- *
- * @param[in] dev_sess
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_autoneg_disable(async_sess_t *dev_sess)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_AUTONEG_DISABLE);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Probe current state of auto-negotiation.
- *
- * Modes are defined in the "nic/eth_phys.h" in the C library.
- *
- * @param[in]  dev_sess
- * @param[out] our_advertisement   Modes advertised by this NIC.
- *                                 Can be NULL.
- * @param[out] their_advertisement Modes advertised by the other side.
- *                                 Can be NULL.
- * @param[out] result              General state of auto-negotiation.
- *                                 Can be NULL.
- * @param[out]  their_result       State of other side auto-negotiation.
- *                                 Can be NULL.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_autoneg_probe(async_sess_t *dev_sess, uint32_t *our_advertisement,
-    uint32_t *their_advertisement, nic_result_t *result,
-    nic_result_t *their_result)
-{
-	sysarg_t _our_advertisement;
-	sysarg_t _their_advertisement;
-	sysarg_t _result;
-	sysarg_t _their_result;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_4(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_AUTONEG_PROBE, &_our_advertisement, &_their_advertisement,
-	    &_result, &_their_result);
-	async_exchange_end(exch);
-	
-	if (our_advertisement)
-		*our_advertisement = (uint32_t) _our_advertisement;
-	
-	if (*their_advertisement)
-		*their_advertisement = (uint32_t) _their_advertisement;
-	
-	if (result)
-		*result = (nic_result_t) _result;
-	
-	if (their_result)
-		*their_result = (nic_result_t) _their_result;
-	
-	return rc;
-}
-
-/** Restart the auto-negotiation process.
- *
- * @param[in] dev_sess
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_autoneg_restart(async_sess_t *dev_sess)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_AUTONEG_RESTART);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Query party's sending and reception of the PAUSE frame.
- *
- * @param[in]  dev_sess
- * @param[out] we_send    This NIC sends the PAUSE frame (true/false)
- * @param[out] we_receive This NIC receives the PAUSE frame (true/false)
- * @param[out] pause      The time set to transmitted PAUSE frames.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_get_pause(async_sess_t *dev_sess, nic_result_t *we_send,
-    nic_result_t *we_receive, uint16_t *pause)
-{
-	sysarg_t _we_send;
-	sysarg_t _we_receive;
-	sysarg_t _pause;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_GET_PAUSE, &_we_send, &_we_receive, &_pause);
-	async_exchange_end(exch);
-	
-	if (we_send)
-		*we_send = _we_send;
-	
-	if (we_receive)
-		*we_receive = _we_receive;
-	
-	if (pause)
-		*pause = _pause;
-	
-	return rc;
-}
-
-/** Control sending and reception of the PAUSE frame.
- *
- * @param[in] dev_sess
- * @param[in] allow_send    Allow sending the PAUSE frame (true/false)
- * @param[in] allow_receive Allow reception of the PAUSE frame (true/false)
- * @param[in] pause         Pause length in 512 bit units written
- *                          to transmitted frames. The value 0 means
- *                          auto value (the best). If the requested
- *                          time cannot be set the driver is allowed
- *                          to set the nearest supported value.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_set_pause(async_sess_t *dev_sess, int allow_send, int allow_receive,
-    uint16_t pause)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_SET_PAUSE, allow_send, allow_receive, pause);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Retrieve current settings of unicast frames reception.
- *
- * Note: In case of mode != NIC_UNICAST_LIST the contents of
- * address_list and address_count are undefined.
- *
- * @param[in]   dev_sess
- * @param[out]  mode          Current operation mode
- * @param[in]   max_count     Maximal number of addresses that could
- *                            be written into the list buffer.
- * @param[out]  address_list  Buffer for the list (array). Can be NULL.
- * @param[out]  address_count Number of addresses in the list before
- *                            possible truncation due to the max_count.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_unicast_get_mode(async_sess_t *dev_sess, nic_unicast_mode_t *mode,
-    size_t max_count, nic_address_t *address_list, size_t *address_count)
-{
-	assert(mode);
-	
-	sysarg_t _mode;
-	sysarg_t _address_count;
-	
-	if (!address_list)
-		max_count = 0;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	int rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_UNICAST_GET_MODE, max_count, &_mode, &_address_count);
-	if (rc != EOK) {
-		async_exchange_end(exch);
-		return rc;
-	}
-	
-	*mode = (nic_unicast_mode_t) _mode;
-	if (address_count)
-		*address_count = (size_t) _address_count;
-	
-	if ((max_count) && (_address_count))
-		rc = async_data_read_start(exch, address_list,
-		    max_count * sizeof(nic_address_t));
-	
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Set which unicast frames are received.
- *
- * @param[in] dev_sess
- * @param[in] mode          Current operation mode
- * @param[in] address_list  The list of addresses. Can be NULL.
- * @param[in] address_count Number of addresses in the list.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_unicast_set_mode(async_sess_t *dev_sess, nic_unicast_mode_t mode,
-    const nic_address_t *address_list, size_t address_count)
-{
-	if (address_list == NULL)
-		address_count = 0;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	aid_t message_id = async_send_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_UNICAST_SET_MODE, (sysarg_t) mode, address_count, NULL);
-	
-	int rc;
-	if (address_count)
-		rc = async_data_write_start(exch, address_list,
-		    address_count * sizeof(nic_address_t));
-	else
-		rc = EOK;
-	
-	async_exchange_end(exch);
-	
-	sysarg_t res;
-	async_wait_for(message_id, &res);
-	
-	if (rc != EOK)
-		return rc;
-	
-	return (int) res;
-}
-
-/** Retrieve current settings of multicast frames reception.
- *
- * Note: In case of mode != NIC_MULTICAST_LIST the contents of
- * address_list and address_count are undefined.
- *
- * @param[in]  dev_sess
- * @param[out] mode          Current operation mode
- * @param[in]  max_count     Maximal number of addresses that could
- *                           be written into the list buffer.
- * @param[out] address_list  Buffer for the list (array). Can be NULL.
- * @param[out] address_count Number of addresses in the list before
- *                           possible truncation due to the max_count.
- *                           Can be NULL.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_multicast_get_mode(async_sess_t *dev_sess, nic_multicast_mode_t *mode,
-    size_t max_count, nic_address_t *address_list, size_t *address_count)
-{
-	assert(mode);
-	
-	sysarg_t _mode;
-	
-	if (!address_list)
-		max_count = 0;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	sysarg_t ac;
-	int rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_MULTICAST_GET_MODE, max_count, &_mode, &ac);
-	if (rc != EOK) {
-		async_exchange_end(exch);
-		return rc;
-	}
-	
-	*mode = (nic_multicast_mode_t) _mode;
-	if (address_count)
-		*address_count = (size_t) ac;
-	
-	if ((max_count) && (ac))
-		rc = async_data_read_start(exch, address_list,
-		    max_count * sizeof(nic_address_t));
-	
-	async_exchange_end(exch);
-	return rc;
-}
-
-/** Set which multicast frames are received.
- *
- * @param[in] dev_sess
- * @param[in] mode          Current operation mode
- * @param[in] address_list  The list of addresses. Can be NULL.
- * @param[in] address_count Number of addresses in the list.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_multicast_set_mode(async_sess_t *dev_sess, nic_multicast_mode_t mode,
-    const nic_address_t *address_list, size_t address_count)
-{
-	if (address_list == NULL)
-		address_count = 0;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	aid_t message_id = async_send_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_MULTICAST_SET_MODE, (sysarg_t) mode, address_count, NULL);
-	
-	int rc;
-	if (address_count)
-		rc = async_data_write_start(exch, address_list,
-		    address_count * sizeof(nic_address_t));
-	else
-		rc = EOK;
-	
-	async_exchange_end(exch);
-	
-	sysarg_t res;
-	async_wait_for(message_id, &res);
-	
-	if (rc != EOK)
-		return rc;
-	
-	return (int) res;
-}
-
-/** Determine if broadcast packets are received.
- *
- * @param[in]  dev_sess
- * @param[out] mode     Current operation mode
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_broadcast_get_mode(async_sess_t *dev_sess, nic_broadcast_mode_t *mode)
-{
-	assert(mode);
-	
-	sysarg_t _mode;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_BROADCAST_GET_MODE, &_mode);
-	async_exchange_end(exch);
-	
-	*mode = (nic_broadcast_mode_t) _mode;
-	
-	return rc;
-}
-
-/** Set whether broadcast packets are received.
- *
- * @param[in] dev_sess
- * @param[in] mode     Current operation mode
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_broadcast_set_mode(async_sess_t *dev_sess, nic_broadcast_mode_t mode)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_BROADCAST_SET_MODE, mode);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Determine if defective (erroneous) packets are received.
- *
- * @param[in]  dev_sess
- * @param[out] mode     Bitmask specifying allowed errors
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_defective_get_mode(async_sess_t *dev_sess, uint32_t *mode)
-{
-	assert(mode);
-	
-	sysarg_t _mode;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_DEFECTIVE_GET_MODE, &_mode);
-	async_exchange_end(exch);
-	
-	*mode = (uint32_t) _mode;
-	
-	return rc;
-}
-
-/** Set whether defective (erroneous) packets are received.
- *
- * @param[in]  dev_sess
- * @param[out] mode     Bitmask specifying allowed errors
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_defective_set_mode(async_sess_t *dev_sess, uint32_t mode)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_DEFECTIVE_SET_MODE, mode);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Retrieve the currently blocked source MAC addresses.
- *
- * @param[in]  dev_sess
- * @param[in]  max_count     Maximal number of addresses that could
- *                           be written into the list buffer.
- * @param[out] address_list  Buffer for the list (array). Can be NULL.
- * @param[out] address_count Number of addresses in the list before
- *                           possible truncation due to the max_count.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_blocked_sources_get(async_sess_t *dev_sess, size_t max_count,
-    nic_address_t *address_list, size_t *address_count)
-{
-	if (!address_list)
-		max_count = 0;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	sysarg_t ac;
-	int rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_BLOCKED_SOURCES_GET, max_count, &ac);
-	if (rc != EOK) {
-		async_exchange_end(exch);
-		return rc;
-	}
-	
-	if (address_count)
-		*address_count = (size_t) ac;
-	
-	if ((max_count) && (ac))
-		rc = async_data_read_start(exch, address_list,
-		    max_count * sizeof(nic_address_t));
-	
-	async_exchange_end(exch);
-	return rc;
-}
-
-/** Set which source MACs are blocked
- *
- * @param[in] dev_sess
- * @param[in] address_list  The list of addresses. Can be NULL.
- * @param[in] address_count Number of addresses in the list.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_blocked_sources_set(async_sess_t *dev_sess,
-    const nic_address_t *address_list, size_t address_count)
-{
-	if (address_list == NULL)
-		address_count = 0;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	aid_t message_id = async_send_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_BLOCKED_SOURCES_SET, address_count, NULL);
-	
-	int rc;
-	if (address_count)
-		rc = async_data_write_start(exch, address_list,
-			address_count * sizeof(nic_address_t));
-	else
-		rc = EOK;
-	
-	async_exchange_end(exch);
-	
-	sysarg_t res;
-	async_wait_for(message_id, &res);
-	
-	if (rc != EOK)
-		return rc;
-	
-	return (int) res;
-}
-
-/** Request current VLAN filtering mask.
- *
- * @param[in]  dev_sess
- * @param[out] stats    Structure with the statistics
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_vlan_get_mask(async_sess_t *dev_sess, nic_vlan_mask_t *mask)
-{
-	assert(mask);
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_VLAN_GET_MASK);
-	if (rc != EOK) {
-		async_exchange_end(exch);
-		return rc;
-	}
-	
-	rc = async_data_read_start(exch, mask, sizeof(nic_vlan_mask_t));
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Set the mask used for VLAN filtering.
- *
- * If NULL, VLAN filtering is disabled.
- *
- * @param[in] dev_sess
- * @param[in] mask     Pointer to mask structure or NULL to disable.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_vlan_set_mask(async_sess_t *dev_sess, const nic_vlan_mask_t *mask)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	aid_t message_id = async_send_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_VLAN_SET_MASK, mask != NULL, NULL);
-	
-	int rc;
-	if (mask != NULL)
-		rc = async_data_write_start(exch, mask, sizeof(nic_vlan_mask_t));
-	else
-		rc = EOK;
-	
-	async_exchange_end(exch);
-	
-	sysarg_t res;
-	async_wait_for(message_id, &res);
-	
-	if (rc != EOK)
-		return rc;
-	
-	return (int) res;
-}
-
-/** Set VLAN (802.1q) tag.
- *
- * Set whether the tag is to be signaled in offload info and
- * if the tag should be stripped from received frames and added
- * to sent frames automatically. Not every combination of add
- * and strip must be supported.
- *
- * @param[in] dev_sess
- * @param[in] tag      VLAN priority (top 3 bits) and
- *                     the VLAN tag (bottom 12 bits)
- * @param[in] add      Add the VLAN tag automatically (boolean)
- * @param[in] strip    Strip the VLAN tag automatically (boolean)
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_vlan_set_tag(async_sess_t *dev_sess, uint16_t tag, bool add, bool strip)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_VLAN_SET_TAG, (sysarg_t) tag, (sysarg_t) add, (sysarg_t) strip);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Add new Wake-On-LAN virtue.
- *
- * @param[in]  dev_sess
- * @param[in]  type     Type of the virtue
- * @param[in]  data     Data required for this virtue
- *                      (depends on type)
- * @param[in]  length   Length of the data
- * @param[out] id       Identifier of the new virtue
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_wol_virtue_add(async_sess_t *dev_sess, nic_wv_type_t type,
-    const void *data, size_t length, nic_wv_id_t *id)
-{
-	assert(id);
-	
-	bool send_data = ((data != NULL) && (length != 0));
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	ipc_call_t result;
-	aid_t message_id = async_send_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_WOL_VIRTUE_ADD, (sysarg_t) type, send_data, &result);
-	
-	sysarg_t res;
-	if (send_data) {
-		int rc = async_data_write_start(exch, data, length);
-		if (rc != EOK) {
-			async_exchange_end(exch);
-			async_wait_for(message_id, &res);
-			return rc;
-		}
-	}
-	
-	async_exchange_end(exch);
-	async_wait_for(message_id, &res);
-	
-	*id = IPC_GET_ARG1(result);
-	return (int) res;
-}
-
-/** Remove Wake-On-LAN virtue.
- *
- * @param[in] dev_sess
- * @param[in] id       Virtue identifier
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_wol_virtue_remove(async_sess_t *dev_sess, nic_wv_id_t id)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_WOL_VIRTUE_REMOVE, (sysarg_t) id);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Get information about virtue.
- *
- * @param[in]  dev_sess
- * @param[in]  id         Virtue identifier
- * @param[out] type       Type of the filter. Can be NULL.
- * @param[out] max_length Size of the data buffer.
- * @param[out] data       Buffer for data used when the
- *                        virtue was created. Can be NULL.
- * @param[out] length     Length of the data. Can be NULL.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_wol_virtue_probe(async_sess_t *dev_sess, nic_wv_id_t id,
-    nic_wv_type_t *type, size_t max_length, void *data, size_t *length)
-{
-	sysarg_t _type;
-	sysarg_t _length;
-	
-	if (data == NULL)
-		max_length = 0;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	int rc = async_req_3_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_WOL_VIRTUE_PROBE, (sysarg_t) id, max_length,
-	    &_type, &_length);
-	if (rc != EOK) {
-		async_exchange_end(exch);
-		return rc;
-	}
-	
-	if (type)
-		*type = _type;
-	
-	if (length)
-		*length = _length;
-	
-	if ((max_length) && (_length != 0))
-		rc = async_data_read_start(exch, data, max_length);
-	
-	async_exchange_end(exch);
-	return rc;
-}
-
-/** Get a list of all virtues of the specified type.
- *
- * When NIC_WV_NONE is specified as the virtue type the function
- * lists virtues of all types.
- *
- * @param[in]  dev_sess
- * @param[in]  type      Type of the virtues
- * @param[in]  max_count Maximum number of ids that can be
- *                       written into the list buffer.
- * @param[out] id_list   Buffer for to the list of virtue ids.
- *                       Can be NULL.
- * @param[out] id_count  Number of virtue identifiers in the list
- *                       before possible truncation due to the
- *                       max_count. Can be NULL.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_wol_virtue_list(async_sess_t *dev_sess, nic_wv_type_t type,
-    size_t max_count, nic_wv_id_t *id_list, size_t *id_count)
-{
-	if (id_list == NULL)
-		max_count = 0;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	sysarg_t count;
-	int rc = async_req_3_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_WOL_VIRTUE_LIST, (sysarg_t) type, max_count, &count);
-	
-	if (id_count)
-		*id_count = (size_t) count;
-	
-	if ((rc != EOK) || (!max_count)) {
-		async_exchange_end(exch);
-		return rc;
-	}
-	
-	rc = async_data_read_start(exch, id_list,
-	    max_count * sizeof(nic_wv_id_t));
-	
-	async_exchange_end(exch);
-	return rc;
-}
-
-/** Get number of virtues that can be enabled yet.
- *
- * Count: < 0 => Virtue of this type can be never used
- *        = 0 => No more virtues can be enabled
- *        > 0 => #count virtues can be enabled yet
- *
- * @param[in]  dev_sess
- * @param[in]  type     Virtue type
- * @param[out] count    Number of virtues
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_wol_virtue_get_caps(async_sess_t *dev_sess, nic_wv_type_t type,
-    int *count)
-{
-	assert(count);
-	
-	sysarg_t _count;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_WOL_VIRTUE_GET_CAPS, (sysarg_t) type, &_count);
-	async_exchange_end(exch);
-	
-	*count = (int) _count;
-	return rc;
-}
-
-/** Load the frame that issued the wakeup.
- *
- * The NIC can support only matched_type,  only part of the frame
- * can be available or not at all. Sometimes even the type can be
- * uncertain -- in this case the matched_type contains NIC_WV_NONE.
- *
- * Frame_length can be greater than max_length, but at most max_length
- * bytes will be copied into the frame buffer.
- *
- * Note: Only the type of the filter can be detected, not the concrete
- * filter, because the driver is probably not running when the wakeup
- * is issued.
- *
- * @param[in]  dev_sess
- * @param[out] matched_type Type of the filter that issued wakeup.
- * @param[in]  max_length   Size of the buffer
- * @param[out] frame        Buffer for the frame. Can be NULL.
- * @param[out] frame_length Length of the stored frame. Can be NULL.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_wol_load_info(async_sess_t *dev_sess, nic_wv_type_t *matched_type,
-    size_t max_length, uint8_t *frame, size_t *frame_length)
-{
-	assert(matched_type);
-	
-	sysarg_t _matched_type;
-	sysarg_t _frame_length;
-	
-	if (frame == NULL)
-		max_length = 0;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	int rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_WOL_LOAD_INFO, max_length, &_matched_type, &_frame_length);
-	if (rc != EOK) {
-		async_exchange_end(exch);
-		return rc;
-	}
-	
-	*matched_type = (nic_wv_type_t) _matched_type;
-	if (frame_length)
-		*frame_length = (size_t) _frame_length;
-	
-	if ((max_length != 0) && (_frame_length != 0))
-		rc = async_data_read_start(exch, frame, max_length);
-	
-	async_exchange_end(exch);
-	return rc;
-}
-
-/** Probe supported options and current setting of offload computations
- *
- * @param[in]  dev_sess
- * @param[out] supported Supported offload options
- * @param[out] active    Currently active offload options
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_offload_probe(async_sess_t *dev_sess, uint32_t *supported,
-    uint32_t *active)
-{
-	assert(supported);
-	assert(active);
-	
-	sysarg_t _supported;
-	sysarg_t _active;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_OFFLOAD_PROBE, &_supported, &_active);
-	async_exchange_end(exch);
-	
-	*supported = (uint32_t) _supported;
-	*active = (uint32_t) _active;
-	return rc;
-}
-
-/** Set which offload computations can be performed on the NIC.
- *
- * @param[in] dev_sess
- * @param[in] mask     Mask for the options (only those set here will be set)
- * @param[in] active   Which options should be enabled and which disabled
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_offload_set(async_sess_t *dev_sess, uint32_t mask, uint32_t active)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_3_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_AUTONEG_RESTART, (sysarg_t) mask, (sysarg_t) active);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Query the current interrupt/poll mode of the NIC
- *
- * @param[in]  dev_sess
- * @param[out] mode     Current poll mode
- * @param[out] period   Period used in periodic polling.
- *                      Can be NULL.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_poll_get_mode(async_sess_t *dev_sess, nic_poll_mode_t *mode,
-    struct timeval *period)
-{
-	assert(mode);
-	
-	sysarg_t _mode;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	int rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_POLL_GET_MODE, period != NULL, &_mode);
-	if (rc != EOK) {
-		async_exchange_end(exch);
-		return rc;
-	}
-	
-	*mode = (nic_poll_mode_t) _mode;
-	
-	if (period != NULL)
-		rc = async_data_read_start(exch, period, sizeof(struct timeval));
-	
-	async_exchange_end(exch);
-	return rc;
-}
-
-/** Set the interrupt/poll mode of the NIC.
- *
- * @param[in] dev_sess
- * @param[in] mode     New poll mode
- * @param[in] period   Period used in periodic polling. Can be NULL.
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_poll_set_mode(async_sess_t *dev_sess, nic_poll_mode_t mode,
-    const struct timeval *period)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	aid_t message_id = async_send_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
-	    NIC_POLL_SET_MODE, (sysarg_t) mode, period != NULL, NULL);
-	
-	int rc;
-	if (period)
-		rc = async_data_write_start(exch, period, sizeof(struct timeval));
-	else
-		rc = EOK;
-	
-	async_exchange_end(exch);
-	
-	sysarg_t res;
-	async_wait_for(message_id, &res);
-	
-	if (rc != EOK)
-		return rc;
-	
-	return (int) res;
-}
-
-/** Request the driver to poll the NIC.
- *
- * @param[in] dev_sess
- *
- * @return EOK If the operation was successfully completed
- *
- */
-int nic_poll_now(async_sess_t *dev_sess)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), NIC_POLL_NOW);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** @}
- */
Index: uspace/lib/c/generic/device/pci.c
===================================================================
--- uspace/lib/c/generic/device/pci.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,116 +1,0 @@
-/*
- * Copyright (c) 2011 Jiri Michalec
- * 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 <ipc/dev_iface.h>
-#include <assert.h>
-#include <device/pci.h>
-#include <errno.h>
-#include <async.h>
-#include <ipc/services.h>
-
-int pci_config_space_read_8(async_sess_t *sess, uint32_t address, uint8_t *val)
-{
-	sysarg_t res = 0;
-	
-	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
-	    IPC_M_CONFIG_SPACE_READ_8, address, &res);
-	async_exchange_end(exch);
-	
-	*val = (uint8_t) res;
-	return rc;
-}
-
-int pci_config_space_read_16(async_sess_t *sess, uint32_t address,
-    uint16_t *val)
-{
-	sysarg_t res = 0;
-	
-	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
-	    IPC_M_CONFIG_SPACE_READ_16, address, &res);
-	async_exchange_end(exch);
-	
-	*val = (uint16_t) res;
-	return rc;
-}
-
-int pci_config_space_read_32(async_sess_t *sess, uint32_t address,
-    uint32_t *val)
-{
-	sysarg_t res = 0;
-	
-	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
-	    IPC_M_CONFIG_SPACE_READ_32, address, &res);
-	async_exchange_end(exch);
-	
-	*val = (uint32_t) res;
-	return rc;
-}
-
-int pci_config_space_write_8(async_sess_t *sess, uint32_t address, uint8_t val)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
-	    IPC_M_CONFIG_SPACE_WRITE_8, address, val);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-int pci_config_space_write_16(async_sess_t *sess, uint32_t address,
-    uint16_t val)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
-	    IPC_M_CONFIG_SPACE_WRITE_16, address, val);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-int pci_config_space_write_32(async_sess_t *sess, uint32_t address,
-    uint32_t val)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
-	    IPC_M_CONFIG_SPACE_WRITE_32, address, val);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** @}
- */
Index: uspace/lib/c/include/ddi.h
===================================================================
--- uspace/lib/c/include/ddi.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/c/include/ddi.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -130,5 +130,5 @@
 }
 
-extern int irq_register(int, int, int, irq_code_t *);
+extern int irq_register(int, int, int, const irq_code_t *);
 extern int irq_unregister(int, int);
 
Index: uspace/lib/c/include/device/ahci.h
===================================================================
--- uspace/lib/c/include/device/ahci.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/*
- * Copyright (c) 2012 Petr Jerman
- * 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
- * @brief AHCI interface definition.
- */
-
-#ifndef LIBC_DEVICE_AHCI_H_
-#define LIBC_DEVICE_AHCI_H_
-
-#include <async.h>
-#include <devman.h>
-
-extern async_sess_t* ahci_get_sess(devman_handle_t, char **);
-
-extern int ahci_get_sata_device_name(async_sess_t *, size_t, char *);
-extern int ahci_get_num_blocks(async_sess_t *, uint64_t *);
-extern int ahci_get_block_size(async_sess_t *, size_t *);
-extern int ahci_read_blocks(async_sess_t *, uint64_t, size_t, void *);
-extern int ahci_write_blocks(async_sess_t *, uint64_t, size_t, void *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/device/battery_dev.h
===================================================================
--- uspace/lib/c/include/device/battery_dev.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,55 +1,0 @@
-/*
- * Copyright (c) 2012 Maurizio Lombardi
- * 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_BATTERY_DEV_H_
-#define LIBC_DEVICE_BATTERY_DEV_H_
-
-#include <async.h>
-
-typedef enum {
-	BATTERY_OK,
-	BATTERY_LOW,
-	BATTERY_NOT_PRESENT,
-} battery_status_t;
-
-typedef enum {
-	BATTERY_STATUS_GET = 0,
-	BATTERY_CHARGE_LEVEL_GET,
-} battery_dev_method_t;
-
-extern int battery_status_get(async_sess_t *, battery_status_t *);
-extern int battery_charge_level_get(async_sess_t *, int *);
-
-#endif
-
Index: uspace/lib/c/include/device/char_dev.h
===================================================================
--- uspace/lib/c/include/device/char_dev.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
- * 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_CHAR_DEV_H_
-#define LIBC_DEVICE_CHAR_DEV_H_
-
-#include <async.h>
-
-typedef enum {
-	CHAR_DEV_READ = 0,
-	CHAR_DEV_WRITE
-} char_dev_method_t;
-
-extern ssize_t char_dev_read(async_sess_t *, void *, size_t);
-extern ssize_t char_dev_write(async_sess_t *, void *, size_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/device/graph_dev.h
===================================================================
--- uspace/lib/c/include/device/graph_dev.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*
- * Copyright (c) 2011 Petr Koupy
- * 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_GRAPH_DEV_H_
-#define LIBC_DEVICE_GRAPH_DEV_H_
-
-#include <async.h>
-
-typedef enum {
-	GRAPH_DEV_CONNECT = 0
-} graph_dev_method_t;
-
-extern int graph_dev_connect(async_sess_t *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/device/nic.h
===================================================================
--- uspace/lib/c/include/device/nic.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,159 +1,0 @@
-/*
- * Copyright (c) 2010 Radim Vansa
- * 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_NIC_H_
-#define LIBC_DEVICE_NIC_H_
-
-#include <async.h>
-#include <nic/nic.h>
-#include <ipc/common.h>
-
-typedef enum {
-	NIC_SEND_MESSAGE = 0,
-	NIC_CALLBACK_CREATE,
-	NIC_GET_STATE,
-	NIC_SET_STATE,
-	NIC_GET_ADDRESS,
-	NIC_SET_ADDRESS,
-	NIC_GET_STATS,
-	NIC_GET_DEVICE_INFO,
-	NIC_GET_CABLE_STATE,
-	NIC_GET_OPERATION_MODE,
-	NIC_SET_OPERATION_MODE,
-	NIC_AUTONEG_ENABLE,
-	NIC_AUTONEG_DISABLE,
-	NIC_AUTONEG_PROBE,
-	NIC_AUTONEG_RESTART,
-	NIC_GET_PAUSE,
-	NIC_SET_PAUSE,
-	NIC_UNICAST_GET_MODE,
-	NIC_UNICAST_SET_MODE,
-	NIC_MULTICAST_GET_MODE,
-	NIC_MULTICAST_SET_MODE,
-	NIC_BROADCAST_GET_MODE,
-	NIC_BROADCAST_SET_MODE,
-	NIC_DEFECTIVE_GET_MODE,
-	NIC_DEFECTIVE_SET_MODE,
-	NIC_BLOCKED_SOURCES_GET,
-	NIC_BLOCKED_SOURCES_SET,
-	NIC_VLAN_GET_MASK,
-	NIC_VLAN_SET_MASK,
-	NIC_VLAN_SET_TAG,
-	NIC_WOL_VIRTUE_ADD,
-	NIC_WOL_VIRTUE_REMOVE,
-	NIC_WOL_VIRTUE_PROBE,
-	NIC_WOL_VIRTUE_LIST,
-	NIC_WOL_VIRTUE_GET_CAPS,
-	NIC_WOL_LOAD_INFO,
-	NIC_OFFLOAD_PROBE,
-	NIC_OFFLOAD_SET,
-	NIC_POLL_GET_MODE,
-	NIC_POLL_SET_MODE,
-	NIC_POLL_NOW
-} nic_funcs_t;
-
-typedef enum {
-	NIC_EV_ADDR_CHANGED = IPC_FIRST_USER_METHOD,
-	NIC_EV_RECEIVED,
-	NIC_EV_DEVICE_STATE
-} nic_event_t;
-
-extern int nic_send_frame(async_sess_t *, void *, size_t);
-extern int nic_callback_create(async_sess_t *, async_client_conn_t, void *);
-extern int nic_get_state(async_sess_t *, nic_device_state_t *);
-extern int nic_set_state(async_sess_t *, nic_device_state_t);
-extern int nic_get_address(async_sess_t *, nic_address_t *);
-extern int nic_set_address(async_sess_t *, const nic_address_t *);
-extern int nic_get_stats(async_sess_t *, nic_device_stats_t *);
-extern int nic_get_device_info(async_sess_t *, nic_device_info_t *);
-extern int nic_get_cable_state(async_sess_t *, nic_cable_state_t *);
-
-extern int nic_get_operation_mode(async_sess_t *, int *, nic_channel_mode_t *,
-    nic_role_t *);
-extern int nic_set_operation_mode(async_sess_t *, int, nic_channel_mode_t,
-    nic_role_t);
-extern int nic_autoneg_enable(async_sess_t *, uint32_t);
-extern int nic_autoneg_disable(async_sess_t *);
-extern int nic_autoneg_probe(async_sess_t *, uint32_t *, uint32_t *,
-    nic_result_t *, nic_result_t *);
-extern int nic_autoneg_restart(async_sess_t *);
-extern int nic_get_pause(async_sess_t *, nic_result_t *, nic_result_t *,
-    uint16_t *);
-extern int nic_set_pause(async_sess_t *, int, int, uint16_t);
-
-extern int nic_unicast_get_mode(async_sess_t *, nic_unicast_mode_t *, size_t,
-    nic_address_t *, size_t *);
-extern int nic_unicast_set_mode(async_sess_t *, nic_unicast_mode_t,
-    const nic_address_t *, size_t);
-extern int nic_multicast_get_mode(async_sess_t *, nic_multicast_mode_t *,
-    size_t, nic_address_t *, size_t *);
-extern int nic_multicast_set_mode(async_sess_t *, nic_multicast_mode_t,
-    const nic_address_t *, size_t);
-extern int nic_broadcast_get_mode(async_sess_t *, nic_broadcast_mode_t *);
-extern int nic_broadcast_set_mode(async_sess_t *, nic_broadcast_mode_t);
-extern int nic_defective_get_mode(async_sess_t *, uint32_t *);
-extern int nic_defective_set_mode(async_sess_t *, uint32_t);
-extern int nic_blocked_sources_get(async_sess_t *, size_t, nic_address_t *,
-    size_t *);
-extern int nic_blocked_sources_set(async_sess_t *, const nic_address_t *,
-    size_t);
-
-extern int nic_vlan_get_mask(async_sess_t *, nic_vlan_mask_t *);
-extern int nic_vlan_set_mask(async_sess_t *, const nic_vlan_mask_t *);
-extern int nic_vlan_set_tag(async_sess_t *, uint16_t, bool, bool);
-
-extern int nic_wol_virtue_add(async_sess_t *, nic_wv_type_t, const void *,
-    size_t, nic_wv_id_t *);
-extern int nic_wol_virtue_remove(async_sess_t *, nic_wv_id_t);
-extern int nic_wol_virtue_probe(async_sess_t *, nic_wv_id_t, nic_wv_type_t *,
-    size_t, void *, size_t *);
-extern int nic_wol_virtue_list(async_sess_t *, nic_wv_type_t, size_t,
-    nic_wv_id_t *, size_t *);
-extern int nic_wol_virtue_get_caps(async_sess_t *, nic_wv_type_t, int *);
-extern int nic_wol_load_info(async_sess_t *, nic_wv_type_t *, size_t, uint8_t *,
-    size_t *);
-
-extern int nic_offload_probe(async_sess_t *, uint32_t *, uint32_t *);
-extern int nic_offload_set(async_sess_t *, uint32_t, uint32_t);
-
-extern int nic_poll_get_mode(async_sess_t *, nic_poll_mode_t *,
-    struct timeval *);
-extern int nic_poll_set_mode(async_sess_t *, nic_poll_mode_t,
-    const struct timeval *);
-extern int nic_poll_now(async_sess_t *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/device/pci.h
===================================================================
--- uspace/lib/c/include/device/pci.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,63 +1,0 @@
-/*
- * Copyright (c) 2011 Jiri Michalec
- * 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_PCI_H_
-#define LIBC_DEVICE_PCI_H_
-
-#include <async.h>
-
-#define PCI_DEVICE_ID  0x02
-
-typedef enum {
-	IPC_M_CONFIG_SPACE_READ_8,
-	IPC_M_CONFIG_SPACE_READ_16,
-	IPC_M_CONFIG_SPACE_READ_32,
-	
-	IPC_M_CONFIG_SPACE_WRITE_8,
-	IPC_M_CONFIG_SPACE_WRITE_16,
-	IPC_M_CONFIG_SPACE_WRITE_32
-} pci_dev_iface_funcs_t;
-
-extern int pci_config_space_read_8(async_sess_t *, uint32_t, uint8_t *);
-extern int pci_config_space_read_16(async_sess_t *, uint32_t, uint16_t *);
-extern int pci_config_space_read_32(async_sess_t *, uint32_t, uint32_t *);
-
-extern int pci_config_space_write_8(async_sess_t *, uint32_t, uint8_t);
-extern int pci_config_space_write_16(async_sess_t *, uint32_t, uint16_t);
-extern int pci_config_space_write_32(async_sess_t *, uint32_t, uint32_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/drv/Makefile
===================================================================
--- uspace/lib/drv/Makefile	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/Makefile	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -29,5 +29,9 @@
 
 USPACE_PREFIX = ../..
-EXTRA_CFLAGS = -Iinclude -I$(LIBUSB_PREFIX)/include -I$(LIBPCM_PREFIX)/include
+EXTRA_CFLAGS = \
+	-Iinclude \
+	-Igeneric/private \
+	-I$(LIBUSB_PREFIX)/include \
+	-I$(LIBPCM_PREFIX)/include
 LIBRARY = libdrv
 
Index: uspace/lib/drv/generic/dev_iface.c
===================================================================
--- uspace/lib/drv/generic/dev_iface.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/dev_iface.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -69,9 +69,9 @@
 		[CLOCK_DEV_IFACE] = &remote_clock_dev_iface,
 		[BATTERY_DEV_IFACE] = &remote_battery_dev_iface,
-		[AHCI_DEV_IFACE] = &remote_ahci_iface
+		[AHCI_DEV_IFACE] = &remote_ahci_iface,
 	}
 };
 
-remote_iface_t *get_remote_iface(int idx)
+const remote_iface_t *get_remote_iface(int idx)
 {
 	assert(is_valid_iface_idx(idx));
@@ -80,5 +80,5 @@
 
 remote_iface_func_ptr_t
-get_remote_method(remote_iface_t *rem_iface, sysarg_t iface_method_idx)
+get_remote_method(const remote_iface_t *rem_iface, sysarg_t iface_method_idx)
 {
 	if (iface_method_idx >= rem_iface->method_count)
Index: uspace/lib/drv/generic/driver.c
===================================================================
--- uspace/lib/drv/generic/driver.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/driver.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -63,5 +63,5 @@
 
 /** Driver structure */
-static driver_t *driver;
+static const driver_t *driver;
 
 /** Devices */
@@ -413,5 +413,5 @@
 		 * handling ("remote interface").
 		 */
-		remote_iface_t *rem_iface = get_remote_iface(iface_idx);
+		const remote_iface_t *rem_iface = get_remote_iface(iface_idx);
 		assert(rem_iface != NULL);
 		
@@ -956,5 +956,5 @@
 }
 
-int ddf_driver_main(driver_t *drv)
+int ddf_driver_main(const driver_t *drv)
 {
 	/*
Index: uspace/lib/drv/generic/interrupt.c
===================================================================
--- uspace/lib/drv/generic/interrupt.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/interrupt.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -39,4 +39,5 @@
 #include <errno.h>
 #include <sys/types.h>
+#include <macros.h>
 
 #include "ddf/interrupt.h"
@@ -55,7 +56,4 @@
 static interrupt_context_t *find_interrupt_context(
     interrupt_context_list_t *list, ddf_dev_t *dev, int irq);
-int register_interrupt_handler(ddf_dev_t *dev, int irq,
-    interrupt_handler_t *handler, irq_code_t *pseudocode);
-int unregister_interrupt_handler(ddf_dev_t *dev, int irq);
 
 /** Interrupts */
@@ -68,8 +66,8 @@
 };
 
-static irq_code_t default_pseudocode = {
+static const irq_code_t default_pseudocode = {
 	0,
 	NULL,
-	sizeof(default_cmds) / sizeof(irq_cmd_t),
+	ARRAY_SIZE(default_cmds),
 	default_cmds
 };
@@ -169,5 +167,5 @@
 
 int register_interrupt_handler(ddf_dev_t *dev, int irq,
-    interrupt_handler_t *handler, irq_code_t *pseudocode)
+    interrupt_handler_t *handler, const irq_code_t *pseudocode)
 {
 	interrupt_context_t *ctx = create_interrupt_context();
Index: uspace/lib/drv/generic/private/remote_ahci.h
===================================================================
--- uspace/lib/drv/generic/private/remote_ahci.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/generic/private/remote_ahci.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2012 Petr Jerman
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBDRV_REMOTE_AHCI_H_
+#define LIBDRV_REMOTE_AHCI_H_
+
+extern remote_iface_t remote_ahci_iface;
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/lib/drv/generic/private/remote_audio_mixer.h
===================================================================
--- uspace/lib/drv/generic/private/remote_audio_mixer.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/generic/private/remote_audio_mixer.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2011 Jan Vesely
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBDRV_REMOTE_AUDIO_MIXER_H_
+#define LIBDRV_REMOTE_AUDIO_MIXER_H_
+
+extern remote_iface_t remote_audio_mixer_iface;
+
+#endif
+
+/**
+ * @}
+ */
+
Index: uspace/lib/drv/generic/private/remote_audio_pcm.h
===================================================================
--- uspace/lib/drv/generic/private/remote_audio_pcm.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/generic/private/remote_audio_pcm.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2011 Jan Vesely
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBDRV_REMOTE_AUDIO_PCM_H_
+#define LIBDRV_REMOTE_AUDIO_PCM_H_
+
+extern remote_iface_t remote_audio_pcm_iface;
+
+#endif
+
+/**
+ * @}
+ */
+
Index: uspace/lib/drv/generic/private/remote_battery_dev.h
===================================================================
--- uspace/lib/drv/generic/private/remote_battery_dev.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/generic/private/remote_battery_dev.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2012 Maurizio Lombardi
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBDRV_REMOTE_BATTERY_DEV_H_
+#define LIBDRV_REMOTE_BATTERY_DEV_H_
+
+extern remote_iface_t remote_battery_dev_iface;
+
+#endif
+
+/**
+ * @}
+ */
+
Index: uspace/lib/drv/generic/private/remote_char_dev.h
===================================================================
--- uspace/lib/drv/generic/private/remote_char_dev.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/generic/private/remote_char_dev.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,44 @@
+/*
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBDRV_REMOTE_CHAR_DEV_H_
+#define LIBDRV_REMOTE_CHAR_DEV_H_
+
+extern remote_iface_t remote_char_dev_iface;
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/lib/drv/generic/private/remote_clock_dev.h
===================================================================
--- uspace/lib/drv/generic/private/remote_clock_dev.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/generic/private/remote_clock_dev.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2012 Maurizio Lombardi
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBDRV_REMOTE_CLOCK_DEV_H_
+#define LIBDRV_REMOTE_CLOCK_DEV_H_
+
+extern remote_iface_t remote_clock_dev_iface;
+
+#endif
+
+/**
+ * @}
+ */
+
Index: uspace/lib/drv/generic/private/remote_graph_dev.h
===================================================================
--- uspace/lib/drv/generic/private/remote_graph_dev.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/generic/private/remote_graph_dev.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2011 Petr Koupy
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBDRV_REMOTE_GRAPH_DEV_H_
+#define LIBDRV_REMOTE_GRAPH_DEV_H_
+
+extern remote_iface_t remote_graph_dev_iface;
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/lib/drv/generic/private/remote_hw_res.h
===================================================================
--- uspace/lib/drv/generic/private/remote_hw_res.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/generic/private/remote_hw_res.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,44 @@
+/*
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBDRV_REMOTE_HW_RES_H_
+#define LIBDRV_REMOTE_HW_RES_H_
+
+extern remote_iface_t remote_hw_res_iface;
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/lib/drv/generic/private/remote_nic.h
===================================================================
--- uspace/lib/drv/generic/private/remote_nic.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/generic/private/remote_nic.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2011 Radim Vansa
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBDRV_REMOTE_NIC_H_
+#define LIBDRV_REMOTE_NIC_H_
+
+extern remote_iface_t remote_nic_iface;
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/lib/drv/generic/private/remote_pci.h
===================================================================
--- uspace/lib/drv/generic/private/remote_pci.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/generic/private/remote_pci.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2011 Jan Vesely
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBDRV_REMOTE_PCI_H_
+#define LIBDRV_REMOTE_PCI_H_
+
+extern remote_iface_t remote_pci_iface;
+
+#endif
+
+/**
+ * @}
+ */
+
Index: uspace/lib/drv/generic/private/remote_pio_window.h
===================================================================
--- uspace/lib/drv/generic/private/remote_pio_window.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/generic/private/remote_pio_window.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2013 Jakub Jermar 
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBDRV_REMOTE_PIO_WINDOW_H_
+#define LIBDRV_REMOTE_PIO_WINDOW_H_
+
+extern remote_iface_t remote_pio_window_iface;
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/lib/drv/generic/private/remote_usb.h
===================================================================
--- uspace/lib/drv/generic/private/remote_usb.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/generic/private/remote_usb.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2010 Vojtech Horky
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBDRV_REMOTE_USB_H_
+#define LIBDRV_REMOTE_USB_H_
+
+extern remote_iface_t remote_usb_iface;
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/lib/drv/generic/private/remote_usbhc.h
===================================================================
--- uspace/lib/drv/generic/private/remote_usbhc.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/generic/private/remote_usbhc.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2010 Vojtech Horky
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBDRV_REMOTE_USBHC_H_
+#define LIBDRV_REMOTE_USBHC_H_
+
+extern remote_iface_t remote_usbhc_iface;
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/lib/drv/generic/private/remote_usbhid.h
===================================================================
--- uspace/lib/drv/generic/private/remote_usbhid.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/generic/private/remote_usbhid.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2011 Vojtech Horky
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBDRV_REMOTE_USBHID_H_
+#define LIBDRV_REMOTE_USBHID_H_
+
+extern remote_iface_t remote_usbhid_iface;
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/lib/drv/generic/remote_ahci.c
===================================================================
--- uspace/lib/drv/generic/remote_ahci.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/remote_ahci.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -33,7 +33,10 @@
  */
 
+#include <as.h>
 #include <async.h>
+#include <devman.h>
 #include <errno.h>
 #include <stdio.h>
+#include <macros.h>
 #include "ahci_iface.h"
 #include "ddf/driver.h"
@@ -47,4 +50,6 @@
 } ahci_iface_funcs_t;
 
+#define MAX_NAME_LENGTH  1024
+
 #define LO(ptr) \
 	((uint32_t) (((uint64_t) ((uintptr_t) (ptr))) & 0xffffffff))
@@ -53,4 +58,128 @@
 	((uint32_t) (((uint64_t) ((uintptr_t) (ptr))) >> 32))
 
+async_sess_t* ahci_get_sess(devman_handle_t funh, char **name)
+{
+	// FIXME: Use a better way than substring match
+	
+	*name = NULL;
+	
+	char devn[MAX_NAME_LENGTH];
+	int rc = devman_fun_get_name(funh, devn, MAX_NAME_LENGTH);
+	if (rc != EOK)
+		return NULL;
+	
+	size_t devn_size = str_size(devn);
+	
+	if ((devn_size > 5) && (str_lcmp(devn, "ahci_", 5) == 0)) {
+		async_sess_t *sess = devman_device_connect(EXCHANGE_PARALLEL,
+		    funh, IPC_FLAG_BLOCKING);
+		
+		if (sess) {
+			*name = str_dup(devn);
+			return sess;
+		}
+	}
+	
+	return NULL;
+}
+
+int ahci_get_sata_device_name(async_sess_t *sess, size_t sata_dev_name_length,
+    char *sata_dev_name)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	if (!exch)
+		return EINVAL;
+	
+	aid_t req = async_send_2(exch, DEV_IFACE_ID(AHCI_DEV_IFACE),
+	    IPC_M_AHCI_GET_SATA_DEVICE_NAME, sata_dev_name_length, NULL);
+	
+	async_data_read_start(exch, sata_dev_name, sata_dev_name_length);
+	
+	sysarg_t rc;
+	async_wait_for(req, &rc);
+	
+	return rc;
+}
+
+int ahci_get_num_blocks(async_sess_t *sess, uint64_t *blocks)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	if (!exch)
+		return EINVAL;
+	
+	sysarg_t blocks_hi;
+	sysarg_t blocks_lo;
+	int rc = async_req_1_2(exch, DEV_IFACE_ID(AHCI_DEV_IFACE),
+	    IPC_M_AHCI_GET_NUM_BLOCKS, &blocks_hi, &blocks_lo);
+	
+	async_exchange_end(exch);
+	
+	if (rc == EOK) {
+		*blocks = (((uint64_t) blocks_hi) << 32)
+		    | (((uint64_t) blocks_lo) & 0xffffffff);
+	}
+	
+	return rc;
+}
+
+int ahci_get_block_size(async_sess_t *sess, size_t *blocks_size)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	if (!exch)
+		return EINVAL;
+	
+	sysarg_t bs;
+	int rc = async_req_1_1(exch, DEV_IFACE_ID(AHCI_DEV_IFACE),
+	    IPC_M_AHCI_GET_BLOCK_SIZE, &bs);
+	
+	async_exchange_end(exch);
+	
+	if (rc == EOK)
+		*blocks_size = (size_t) bs;
+	
+	return rc;
+}
+
+int ahci_read_blocks(async_sess_t *sess, uint64_t blocknum, size_t count,
+    void *buf)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	if (!exch)
+		return EINVAL;
+	
+	aid_t req;
+	req = async_send_4(exch, DEV_IFACE_ID(AHCI_DEV_IFACE),
+	    IPC_M_AHCI_READ_BLOCKS, HI(blocknum),  LO(blocknum), count, NULL);
+	
+	async_share_out_start(exch, buf, AS_AREA_READ | AS_AREA_WRITE);
+	
+	async_exchange_end(exch);
+	
+	sysarg_t rc;
+	async_wait_for(req, &rc);
+	
+	return rc;
+}
+
+int ahci_write_blocks(async_sess_t *sess, uint64_t blocknum, size_t count,
+    void* buf)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	if (!exch)
+		return EINVAL;
+	
+	aid_t req = async_send_4(exch, DEV_IFACE_ID(AHCI_DEV_IFACE),
+	    IPC_M_AHCI_WRITE_BLOCKS, HI(blocknum),  LO(blocknum), count, NULL);
+	
+	async_share_out_start(exch, buf, AS_AREA_READ | AS_AREA_WRITE);
+	
+	async_exchange_end(exch);
+	
+	sysarg_t rc;
+	async_wait_for(req, &rc);
+	
+	return rc;
+}
+
 static void remote_ahci_get_sata_device_name(ddf_fun_t *, void *, ipc_callid_t,
     ipc_call_t *);
@@ -65,5 +194,5 @@
 
 /** Remote AHCI interface operations. */
-static remote_iface_func_ptr_t remote_ahci_iface_ops [] = {
+static const remote_iface_func_ptr_t remote_ahci_iface_ops [] = {
 	[IPC_M_AHCI_GET_SATA_DEVICE_NAME] = remote_ahci_get_sata_device_name,
 	[IPC_M_AHCI_GET_NUM_BLOCKS] = remote_ahci_get_num_blocks,
@@ -75,7 +204,6 @@
 /** Remote AHCI interface structure.
  */
-remote_iface_t remote_ahci_iface = {
-	.method_count = sizeof(remote_ahci_iface_ops) /
-	    sizeof(remote_ahci_iface_ops[0]),
+const remote_iface_t remote_ahci_iface = {
+	.method_count = ARRAY_SIZE(remote_ahci_iface_ops),
 	.methods = remote_ahci_iface_ops
 };
Index: uspace/lib/drv/generic/remote_audio_mixer.c
===================================================================
--- uspace/lib/drv/generic/remote_audio_mixer.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/remote_audio_mixer.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -37,4 +37,5 @@
 #include <assert.h>
 #include <str.h>
+#include <macros.h>
 
 #include "audio_mixer_iface.h"
@@ -204,5 +205,5 @@
 
 /** Remote audio mixer interface operations. */
-static remote_iface_func_ptr_t remote_audio_mixer_iface_ops[] = {
+static const remote_iface_func_ptr_t remote_audio_mixer_iface_ops[] = {
 	[IPC_M_AUDIO_MIXER_GET_INFO] = remote_audio_mixer_get_info,
 	[IPC_M_AUDIO_MIXER_GET_ITEM_INFO] = remote_audio_mixer_get_item_info,
@@ -212,7 +213,6 @@
 
 /** Remote audio mixer interface structure. */
-remote_iface_t remote_audio_mixer_iface = {
-	.method_count = sizeof(remote_audio_mixer_iface_ops) /
-	    sizeof(remote_audio_mixer_iface_ops[0]),
+const remote_iface_t remote_audio_mixer_iface = {
+	.method_count = ARRAY_SIZE(remote_audio_mixer_iface_ops),
 	.methods = remote_audio_mixer_iface_ops
 };
Index: uspace/lib/drv/generic/remote_audio_pcm.c
===================================================================
--- uspace/lib/drv/generic/remote_audio_pcm.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/remote_audio_pcm.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -38,5 +38,4 @@
 #include <macros.h>
 #include <str.h>
-#include <as.h>
 #include <sys/mman.h>
 
@@ -611,5 +610,5 @@
 
 /** Remote audio pcm buffer interface operations. */
-static remote_iface_func_ptr_t remote_audio_pcm_iface_ops[] = {
+static const remote_iface_func_ptr_t remote_audio_pcm_iface_ops[] = {
 	[IPC_M_AUDIO_PCM_GET_INFO_STR] = remote_audio_pcm_get_info_str,
 	[IPC_M_AUDIO_PCM_QUERY_CAPS] = remote_audio_pcm_query_caps,
@@ -627,7 +626,6 @@
 
 /** Remote audio mixer interface structure. */
-remote_iface_t remote_audio_pcm_iface = {
-	.method_count = sizeof(remote_audio_pcm_iface_ops) /
-	    sizeof(remote_audio_pcm_iface_ops[0]),
+const remote_iface_t remote_audio_pcm_iface = {
+	.method_count = ARRAY_SIZE(remote_audio_pcm_iface_ops),
 	.methods = remote_audio_pcm_iface_ops
 };
Index: uspace/lib/drv/generic/remote_battery_dev.c
===================================================================
--- uspace/lib/drv/generic/remote_battery_dev.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/remote_battery_dev.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -36,6 +36,57 @@
 #include <errno.h>
 #include <ops/battery_dev.h>
-#include <device/battery_dev.h>
+#include <battery_iface.h>
 #include <ddf/driver.h>
+#include <macros.h>
+
+/** Read the current battery status from the device
+ *
+ * @param sess     Session of the device
+ * @param status   Current status of the battery
+ *
+ * @return         EOK on success or a negative error code
+ */
+int
+battery_status_get(async_sess_t *sess, battery_status_t *batt_status)
+{
+	sysarg_t status;
+
+	async_exch_t *exch = async_exchange_begin(sess);
+
+	int const rc = async_req_1_1(exch, DEV_IFACE_ID(BATTERY_DEV_IFACE),
+	    BATTERY_STATUS_GET, &status);
+
+	async_exchange_end(exch);
+
+	if (rc == EOK)
+		*batt_status = (battery_status_t) status;
+
+	return rc;
+}
+
+/** Read the current battery charge level from the device
+ *
+ * @param sess     Session of the device
+ * @param level    Battery charge level (0 - 100)
+ *
+ * @return         EOK on success or a negative error code
+ */
+int
+battery_charge_level_get(async_sess_t *sess, int *level)
+{
+	sysarg_t charge_level;
+
+	async_exch_t *exch = async_exchange_begin(sess);
+
+	int const rc = async_req_1_1(exch, DEV_IFACE_ID(BATTERY_DEV_IFACE),
+	    BATTERY_CHARGE_LEVEL_GET, &charge_level);
+
+	async_exchange_end(exch);
+
+	if (rc == EOK)
+		*level = (int) charge_level;
+
+	return rc;
+}
 
 static void remote_battery_status_get(ddf_fun_t *, void *, ipc_callid_t,
@@ -45,7 +96,7 @@
 
 /** Remote battery interface operations */
-static remote_iface_func_ptr_t remote_battery_dev_iface_ops[] = {
-	&remote_battery_status_get,
-	&remote_battery_charge_level_get,
+static const remote_iface_func_ptr_t remote_battery_dev_iface_ops[] = {
+	[BATTERY_STATUS_GET] = remote_battery_status_get,
+	[BATTERY_CHARGE_LEVEL_GET] = remote_battery_charge_level_get,
 };
 
@@ -56,7 +107,6 @@
  *
  */
-remote_iface_t remote_battery_dev_iface = {
-	.method_count = sizeof(remote_battery_dev_iface_ops) /
-	    sizeof(remote_iface_func_ptr_t),
+const remote_iface_t remote_battery_dev_iface = {
+	.method_count = ARRAY_SIZE(remote_battery_dev_iface_ops),
 	.methods = remote_battery_dev_iface_ops,
 };
Index: uspace/lib/drv/generic/remote_char_dev.c
===================================================================
--- uspace/lib/drv/generic/remote_char_dev.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/remote_char_dev.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -35,9 +35,95 @@
 #include <async.h>
 #include <errno.h>
+#include <macros.h>
 
 #include "ops/char_dev.h"
+#include "char_dev_iface.h"
 #include "ddf/driver.h"
 
 #define MAX_CHAR_RW_COUNT 256
+
+/** Read to or write from device.
+ *
+ * Helper function to read to or write from a device
+ * using its character interface.
+ *
+ * @param sess Session to the device.
+ * @param buf  Buffer for the data read from or written to the device.
+ * @param size Maximum size of data (in bytes) to be read or written.
+ * @param read Read from the device if true, write to it otherwise.
+ *
+ * @return Non-negative number of bytes actually read from or
+ *         written to the device on success, negative error number
+ *         otherwise.
+ *
+ */
+static ssize_t char_dev_rw(async_sess_t *sess, void *buf, size_t size, bool read)
+{
+	ipc_call_t answer;
+	aid_t req;
+	int ret;
+	
+	async_exch_t *exch = async_exchange_begin(sess);
+	
+	if (read) {
+		req = async_send_1(exch, DEV_IFACE_ID(CHAR_DEV_IFACE),
+		    CHAR_DEV_READ, &answer);
+		ret = async_data_read_start(exch, buf, size);
+	} else {
+		req = async_send_1(exch, DEV_IFACE_ID(CHAR_DEV_IFACE),
+		    CHAR_DEV_WRITE, &answer);
+		ret = async_data_write_start(exch, buf, size);
+	}
+	
+	async_exchange_end(exch);
+	
+	sysarg_t rc;
+	if (ret != EOK) {
+		async_wait_for(req, &rc);
+		if (rc == EOK)
+			return (ssize_t) ret;
+		
+		return (ssize_t) rc;
+	}
+	
+	async_wait_for(req, &rc);
+	
+	ret = (int) rc;
+	if (ret != EOK)
+		return (ssize_t) ret;
+	
+	return (ssize_t) IPC_GET_ARG1(answer);
+}
+
+/** Read from character device.
+ *
+ * @param sess Session to the device.
+ * @param buf  Output buffer for the data read from the device.
+ * @param size Maximum size (in bytes) of the data to be read.
+ *
+ * @return Non-negative number of bytes actually read from the
+ *         device on success, negative error number otherwise.
+ *
+ */
+ssize_t char_dev_read(async_sess_t *sess, void *buf, size_t size)
+{
+	return char_dev_rw(sess, buf, size, true);
+}
+
+/** Write to character device.
+ *
+ * @param sess Session to the device.
+ * @param buf  Input buffer containg the data to be written to the
+ *             device.
+ * @param size Maximum size (in bytes) of the data to be written.
+ *
+ * @return Non-negative number of bytes actually written to the
+ *         device on success, negative error number otherwise.
+ *
+ */
+ssize_t char_dev_write(async_sess_t *sess, void *buf, size_t size)
+{
+	return char_dev_rw(sess, buf, size, false);
+}
 
 static void remote_char_read(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
@@ -45,7 +131,7 @@
 
 /** Remote character interface operations. */
-static remote_iface_func_ptr_t remote_char_dev_iface_ops[] = {
-	&remote_char_read,
-	&remote_char_write
+static const remote_iface_func_ptr_t remote_char_dev_iface_ops[] = {
+	[CHAR_DEV_READ] = remote_char_read,
+	[CHAR_DEV_WRITE] = remote_char_write
 };
 
@@ -55,7 +141,6 @@
  * character interface.
  */
-remote_iface_t remote_char_dev_iface = {
-	.method_count = sizeof(remote_char_dev_iface_ops) /
-	    sizeof(remote_iface_func_ptr_t),
+const remote_iface_t remote_char_dev_iface = {
+	.method_count = ARRAY_SIZE(remote_char_dev_iface_ops),
 	.methods = remote_char_dev_iface_ops
 };
Index: uspace/lib/drv/generic/remote_clock_dev.c
===================================================================
--- uspace/lib/drv/generic/remote_clock_dev.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/remote_clock_dev.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -36,4 +36,6 @@
 #include <errno.h>
 #include <time.h>
+#include <macros.h>
+#include <device/clock_dev.h>
 
 #include <ops/clock_dev.h>
@@ -46,7 +48,7 @@
 
 /** Remote clock interface operations */
-static remote_iface_func_ptr_t remote_clock_dev_iface_ops[] = {
-	&remote_clock_time_get,
-	&remote_clock_time_set,
+static const remote_iface_func_ptr_t remote_clock_dev_iface_ops[] = {
+	[CLOCK_DEV_TIME_GET] = remote_clock_time_get,
+	[CLOCK_DEV_TIME_SET] = remote_clock_time_set,
 };
 
@@ -56,7 +58,6 @@
  * addressed by the clock interface.
  */
-remote_iface_t remote_clock_dev_iface = {
-	.method_count = sizeof(remote_clock_dev_iface_ops) /
-	    sizeof(remote_iface_func_ptr_t),
+const remote_iface_t remote_clock_dev_iface = {
+	.method_count = ARRAY_SIZE(remote_clock_dev_iface_ops),
 	.methods = remote_clock_dev_iface_ops,
 };
Index: uspace/lib/drv/generic/remote_graph_dev.c
===================================================================
--- uspace/lib/drv/generic/remote_graph_dev.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/remote_graph_dev.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -35,17 +35,31 @@
 #include <errno.h>
 #include <async.h>
+#include <macros.h>
 
 #include "ops/graph_dev.h"
+#include "graph_iface.h"
 #include "ddf/driver.h"
+
+typedef enum {
+	GRAPH_DEV_CONNECT = 0
+} graph_dev_method_t;
+
+int graph_dev_connect(async_sess_t *sess)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	int ret = async_req_1_0(exch, DEV_IFACE_ID(GRAPH_DEV_IFACE), GRAPH_DEV_CONNECT);
+	async_exchange_end(exch);
+
+	return ret;
+}
 
 static void remote_graph_connect(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
 
-static remote_iface_func_ptr_t remote_graph_dev_iface_ops[] = {
-	&remote_graph_connect
+static const remote_iface_func_ptr_t remote_graph_dev_iface_ops[] = {
+	[GRAPH_DEV_CONNECT] = remote_graph_connect
 };
 
-remote_iface_t remote_graph_dev_iface = {
-	.method_count = sizeof(remote_graph_dev_iface_ops) /
-	    sizeof(remote_iface_func_ptr_t),
+const remote_iface_t remote_graph_dev_iface = {
+	.method_count = ARRAY_SIZE(remote_graph_dev_iface_ops),
 	.methods = remote_graph_dev_iface_ops
 };
Index: uspace/lib/drv/generic/remote_hw_res.c
===================================================================
--- uspace/lib/drv/generic/remote_hw_res.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/remote_hw_res.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -36,4 +36,5 @@
 #include <async.h>
 #include <errno.h>
+#include <macros.h>
 
 #include "ops/hw_res.h"
@@ -49,5 +50,5 @@
     ipc_call_t *);
 
-static remote_iface_func_ptr_t remote_hw_res_iface_ops [] = {
+static const remote_iface_func_ptr_t remote_hw_res_iface_ops [] = {
 	[HW_RES_GET_RESOURCE_LIST] = &remote_hw_res_get_resource_list,
 	[HW_RES_ENABLE_INTERRUPT] = &remote_hw_res_enable_interrupt,
@@ -56,7 +57,6 @@
 };
 
-remote_iface_t remote_hw_res_iface = {
-	.method_count = sizeof(remote_hw_res_iface_ops) /
-	    sizeof(remote_iface_func_ptr_t),
+const remote_iface_t remote_hw_res_iface = {
+	.method_count = ARRAY_SIZE(remote_hw_res_iface_ops),
 	.methods = remote_hw_res_iface_ops
 };
Index: uspace/lib/drv/generic/remote_nic.c
===================================================================
--- uspace/lib/drv/generic/remote_nic.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/remote_nic.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -40,5 +40,1297 @@
 #include <ipc/services.h>
 #include <sys/time.h>
+#include <macros.h>
+
 #include "ops/nic.h"
+#include "nic_iface.h"
+
+typedef enum {
+	NIC_SEND_MESSAGE = 0,
+	NIC_CALLBACK_CREATE,
+	NIC_GET_STATE,
+	NIC_SET_STATE,
+	NIC_GET_ADDRESS,
+	NIC_SET_ADDRESS,
+	NIC_GET_STATS,
+	NIC_GET_DEVICE_INFO,
+	NIC_GET_CABLE_STATE,
+	NIC_GET_OPERATION_MODE,
+	NIC_SET_OPERATION_MODE,
+	NIC_AUTONEG_ENABLE,
+	NIC_AUTONEG_DISABLE,
+	NIC_AUTONEG_PROBE,
+	NIC_AUTONEG_RESTART,
+	NIC_GET_PAUSE,
+	NIC_SET_PAUSE,
+	NIC_UNICAST_GET_MODE,
+	NIC_UNICAST_SET_MODE,
+	NIC_MULTICAST_GET_MODE,
+	NIC_MULTICAST_SET_MODE,
+	NIC_BROADCAST_GET_MODE,
+	NIC_BROADCAST_SET_MODE,
+	NIC_DEFECTIVE_GET_MODE,
+	NIC_DEFECTIVE_SET_MODE,
+	NIC_BLOCKED_SOURCES_GET,
+	NIC_BLOCKED_SOURCES_SET,
+	NIC_VLAN_GET_MASK,
+	NIC_VLAN_SET_MASK,
+	NIC_VLAN_SET_TAG,
+	NIC_WOL_VIRTUE_ADD,
+	NIC_WOL_VIRTUE_REMOVE,
+	NIC_WOL_VIRTUE_PROBE,
+	NIC_WOL_VIRTUE_LIST,
+	NIC_WOL_VIRTUE_GET_CAPS,
+	NIC_WOL_LOAD_INFO,
+	NIC_OFFLOAD_PROBE,
+	NIC_OFFLOAD_SET,
+	NIC_POLL_GET_MODE,
+	NIC_POLL_SET_MODE,
+	NIC_POLL_NOW
+} nic_funcs_t;
+
+/** Send frame from NIC
+ *
+ * @param[in] dev_sess
+ * @param[in] data     Frame data
+ * @param[in] size     Frame size in bytes
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_send_frame(async_sess_t *dev_sess, void *data, size_t size)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	ipc_call_t answer;
+	aid_t req = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_SEND_MESSAGE, &answer);
+	sysarg_t retval = async_data_write_start(exch, data, size);
+	
+	async_exchange_end(exch);
+	
+	if (retval != EOK) {
+		async_forget(req);
+		return retval;
+	}
+
+	async_wait_for(req, &retval);
+	return retval;
+}
+
+/** Create callback connection from NIC service
+ *
+ * @param[in] dev_sess
+ * @param[in] device_id
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_callback_create(async_sess_t *dev_sess, async_client_conn_t cfun,
+    void *carg)
+{
+	ipc_call_t answer;
+	int rc;
+	sysarg_t retval;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	aid_t req = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_CALLBACK_CREATE, &answer);
+	
+	rc = async_connect_to_me(exch, 0, 0, 0, cfun, carg);
+	if (rc != EOK) {
+		async_forget(req);
+		return rc;
+	}
+	async_exchange_end(exch);
+	
+	async_wait_for(req, &retval);
+	return (int) retval;
+}
+
+/** Get the current state of the device
+ *
+ * @param[in]  dev_sess
+ * @param[out] state    Current state
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_get_state(async_sess_t *dev_sess, nic_device_state_t *state)
+{
+	assert(state);
+	
+	sysarg_t _state;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_GET_STATE, &_state);
+	async_exchange_end(exch);
+	
+	*state = (nic_device_state_t) _state;
+	
+	return rc;
+}
+
+/** Request the device to change its state
+ *
+ * @param[in] dev_sess
+ * @param[in] state    New state
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_set_state(async_sess_t *dev_sess, nic_device_state_t state)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_SET_STATE, state);
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+/** Request the MAC address of the device
+ *
+ * @param[in]  dev_sess
+ * @param[out] address  Structure with buffer for the address
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_get_address(async_sess_t *dev_sess, nic_address_t *address)
+{
+	assert(address);
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	aid_t aid = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_GET_ADDRESS, NULL);
+	int rc = async_data_read_start(exch, address, sizeof(nic_address_t));
+	async_exchange_end(exch);
+	
+	sysarg_t res;
+	async_wait_for(aid, &res);
+	
+	if (rc != EOK)
+		return rc;
+	
+	return (int) res;
+}
+
+/** Set the address of the device (e.g. MAC on Ethernet)
+ *
+ * @param[in] dev_sess
+ * @param[in] address  Pointer to the address
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_set_address(async_sess_t *dev_sess, const nic_address_t *address)
+{
+	assert(address);
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	aid_t aid = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_SET_ADDRESS, NULL);
+	int rc = async_data_write_start(exch, address, sizeof(nic_address_t));
+	async_exchange_end(exch);
+	
+	sysarg_t res;
+	async_wait_for(aid, &res);
+	
+	if (rc != EOK)
+		return rc;
+	
+	return (int) res;
+}
+
+/** Request statistic data about NIC operation.
+ *
+ * @param[in]  dev_sess
+ * @param[out] stats    Structure with the statistics
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_get_stats(async_sess_t *dev_sess, nic_device_stats_t *stats)
+{
+	assert(stats);
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_GET_STATS);
+	if (rc != EOK) {
+		async_exchange_end(exch);
+		return rc;
+	}
+	
+	rc = async_data_read_start(exch, stats, sizeof(nic_device_stats_t));
+	
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+/** Request information about the device.
+ *
+ * @see nic_device_info_t
+ *
+ * @param[in]  dev_sess
+ * @param[out] device_info Information about the device
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_get_device_info(async_sess_t *dev_sess, nic_device_info_t *device_info)
+{
+	assert(device_info);
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_GET_DEVICE_INFO);
+	if (rc != EOK) {
+		async_exchange_end(exch);
+		return rc;
+	}
+	
+	rc = async_data_read_start(exch, device_info, sizeof(nic_device_info_t));
+	
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+/** Request status of the cable (plugged/unplugged)
+ *
+ * @param[in]  dev_sess
+ * @param[out] cable_state Current cable state
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_get_cable_state(async_sess_t *dev_sess, nic_cable_state_t *cable_state)
+{
+	assert(cable_state);
+	
+	sysarg_t _cable_state;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_GET_CABLE_STATE, &_cable_state);
+	async_exchange_end(exch);
+	
+	*cable_state = (nic_cable_state_t) _cable_state;
+	
+	return rc;
+}
+
+/** Request current operation mode.
+ *
+ * @param[in]  dev_sess
+ * @param[out] speed    Current operation speed in Mbps. Can be NULL.
+ * @param[out] duplex   Full duplex/half duplex. Can be NULL.
+ * @param[out] role     Master/slave/auto. Can be NULL.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_get_operation_mode(async_sess_t *dev_sess, int *speed,
+   nic_channel_mode_t *duplex, nic_role_t *role)
+{
+	sysarg_t _speed;
+	sysarg_t _duplex;
+	sysarg_t _role;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_1_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_GET_OPERATION_MODE, &_speed, &_duplex, &_role);
+	async_exchange_end(exch);
+	
+	if (speed)
+		*speed = (int) _speed;
+	
+	if (duplex)
+		*duplex = (nic_channel_mode_t) _duplex;
+	
+	if (role)
+		*role = (nic_role_t) _role;
+	
+	return rc;
+}
+
+/** Set current operation mode.
+ *
+ * If the NIC has auto-negotiation enabled, this command
+ * disables auto-negotiation and sets the operation mode.
+ *
+ * @param[in] dev_sess
+ * @param[in] speed    Operation speed in Mbps
+ * @param[in] duplex   Full duplex/half duplex
+ * @param[in] role     Master/slave/auto (e.g. in Gbit Ethernet]
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_set_operation_mode(async_sess_t *dev_sess, int speed,
+    nic_channel_mode_t duplex, nic_role_t role)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_SET_OPERATION_MODE, (sysarg_t) speed, (sysarg_t) duplex,
+	    (sysarg_t) role);
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+/** Enable auto-negotiation.
+ *
+ * The advertisement argument can only limit some modes,
+ * it can never force the NIC to advertise unsupported modes.
+ *
+ * The allowed modes are defined in "nic/eth_phys.h" in the C library.
+ *
+ * @param[in] dev_sess
+ * @param[in] advertisement Allowed advertised modes. Use 0 for all modes.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_autoneg_enable(async_sess_t *dev_sess, uint32_t advertisement)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_AUTONEG_ENABLE, (sysarg_t) advertisement);
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+/** Disable auto-negotiation.
+ *
+ * @param[in] dev_sess
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_autoneg_disable(async_sess_t *dev_sess)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_AUTONEG_DISABLE);
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+/** Probe current state of auto-negotiation.
+ *
+ * Modes are defined in the "nic/eth_phys.h" in the C library.
+ *
+ * @param[in]  dev_sess
+ * @param[out] our_advertisement   Modes advertised by this NIC.
+ *                                 Can be NULL.
+ * @param[out] their_advertisement Modes advertised by the other side.
+ *                                 Can be NULL.
+ * @param[out] result              General state of auto-negotiation.
+ *                                 Can be NULL.
+ * @param[out]  their_result       State of other side auto-negotiation.
+ *                                 Can be NULL.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_autoneg_probe(async_sess_t *dev_sess, uint32_t *our_advertisement,
+    uint32_t *their_advertisement, nic_result_t *result,
+    nic_result_t *their_result)
+{
+	sysarg_t _our_advertisement;
+	sysarg_t _their_advertisement;
+	sysarg_t _result;
+	sysarg_t _their_result;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_1_4(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_AUTONEG_PROBE, &_our_advertisement, &_their_advertisement,
+	    &_result, &_their_result);
+	async_exchange_end(exch);
+	
+	if (our_advertisement)
+		*our_advertisement = (uint32_t) _our_advertisement;
+	
+	if (*their_advertisement)
+		*their_advertisement = (uint32_t) _their_advertisement;
+	
+	if (result)
+		*result = (nic_result_t) _result;
+	
+	if (their_result)
+		*their_result = (nic_result_t) _their_result;
+	
+	return rc;
+}
+
+/** Restart the auto-negotiation process.
+ *
+ * @param[in] dev_sess
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_autoneg_restart(async_sess_t *dev_sess)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_AUTONEG_RESTART);
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+/** Query party's sending and reception of the PAUSE frame.
+ *
+ * @param[in]  dev_sess
+ * @param[out] we_send    This NIC sends the PAUSE frame (true/false)
+ * @param[out] we_receive This NIC receives the PAUSE frame (true/false)
+ * @param[out] pause      The time set to transmitted PAUSE frames.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_get_pause(async_sess_t *dev_sess, nic_result_t *we_send,
+    nic_result_t *we_receive, uint16_t *pause)
+{
+	sysarg_t _we_send;
+	sysarg_t _we_receive;
+	sysarg_t _pause;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_1_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_GET_PAUSE, &_we_send, &_we_receive, &_pause);
+	async_exchange_end(exch);
+	
+	if (we_send)
+		*we_send = _we_send;
+	
+	if (we_receive)
+		*we_receive = _we_receive;
+	
+	if (pause)
+		*pause = _pause;
+	
+	return rc;
+}
+
+/** Control sending and reception of the PAUSE frame.
+ *
+ * @param[in] dev_sess
+ * @param[in] allow_send    Allow sending the PAUSE frame (true/false)
+ * @param[in] allow_receive Allow reception of the PAUSE frame (true/false)
+ * @param[in] pause         Pause length in 512 bit units written
+ *                          to transmitted frames. The value 0 means
+ *                          auto value (the best). If the requested
+ *                          time cannot be set the driver is allowed
+ *                          to set the nearest supported value.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_set_pause(async_sess_t *dev_sess, int allow_send, int allow_receive,
+    uint16_t pause)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_SET_PAUSE, allow_send, allow_receive, pause);
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+/** Retrieve current settings of unicast frames reception.
+ *
+ * Note: In case of mode != NIC_UNICAST_LIST the contents of
+ * address_list and address_count are undefined.
+ *
+ * @param[in]   dev_sess
+ * @param[out]  mode          Current operation mode
+ * @param[in]   max_count     Maximal number of addresses that could
+ *                            be written into the list buffer.
+ * @param[out]  address_list  Buffer for the list (array). Can be NULL.
+ * @param[out]  address_count Number of addresses in the list before
+ *                            possible truncation due to the max_count.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_unicast_get_mode(async_sess_t *dev_sess, nic_unicast_mode_t *mode,
+    size_t max_count, nic_address_t *address_list, size_t *address_count)
+{
+	assert(mode);
+	
+	sysarg_t _mode;
+	sysarg_t _address_count;
+	
+	if (!address_list)
+		max_count = 0;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	int rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_UNICAST_GET_MODE, max_count, &_mode, &_address_count);
+	if (rc != EOK) {
+		async_exchange_end(exch);
+		return rc;
+	}
+	
+	*mode = (nic_unicast_mode_t) _mode;
+	if (address_count)
+		*address_count = (size_t) _address_count;
+	
+	if ((max_count) && (_address_count))
+		rc = async_data_read_start(exch, address_list,
+		    max_count * sizeof(nic_address_t));
+	
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+/** Set which unicast frames are received.
+ *
+ * @param[in] dev_sess
+ * @param[in] mode          Current operation mode
+ * @param[in] address_list  The list of addresses. Can be NULL.
+ * @param[in] address_count Number of addresses in the list.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_unicast_set_mode(async_sess_t *dev_sess, nic_unicast_mode_t mode,
+    const nic_address_t *address_list, size_t address_count)
+{
+	if (address_list == NULL)
+		address_count = 0;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	aid_t message_id = async_send_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_UNICAST_SET_MODE, (sysarg_t) mode, address_count, NULL);
+	
+	int rc;
+	if (address_count)
+		rc = async_data_write_start(exch, address_list,
+		    address_count * sizeof(nic_address_t));
+	else
+		rc = EOK;
+	
+	async_exchange_end(exch);
+	
+	sysarg_t res;
+	async_wait_for(message_id, &res);
+	
+	if (rc != EOK)
+		return rc;
+	
+	return (int) res;
+}
+
+/** Retrieve current settings of multicast frames reception.
+ *
+ * Note: In case of mode != NIC_MULTICAST_LIST the contents of
+ * address_list and address_count are undefined.
+ *
+ * @param[in]  dev_sess
+ * @param[out] mode          Current operation mode
+ * @param[in]  max_count     Maximal number of addresses that could
+ *                           be written into the list buffer.
+ * @param[out] address_list  Buffer for the list (array). Can be NULL.
+ * @param[out] address_count Number of addresses in the list before
+ *                           possible truncation due to the max_count.
+ *                           Can be NULL.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_multicast_get_mode(async_sess_t *dev_sess, nic_multicast_mode_t *mode,
+    size_t max_count, nic_address_t *address_list, size_t *address_count)
+{
+	assert(mode);
+	
+	sysarg_t _mode;
+	
+	if (!address_list)
+		max_count = 0;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	sysarg_t ac;
+	int rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_MULTICAST_GET_MODE, max_count, &_mode, &ac);
+	if (rc != EOK) {
+		async_exchange_end(exch);
+		return rc;
+	}
+	
+	*mode = (nic_multicast_mode_t) _mode;
+	if (address_count)
+		*address_count = (size_t) ac;
+	
+	if ((max_count) && (ac))
+		rc = async_data_read_start(exch, address_list,
+		    max_count * sizeof(nic_address_t));
+	
+	async_exchange_end(exch);
+	return rc;
+}
+
+/** Set which multicast frames are received.
+ *
+ * @param[in] dev_sess
+ * @param[in] mode          Current operation mode
+ * @param[in] address_list  The list of addresses. Can be NULL.
+ * @param[in] address_count Number of addresses in the list.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_multicast_set_mode(async_sess_t *dev_sess, nic_multicast_mode_t mode,
+    const nic_address_t *address_list, size_t address_count)
+{
+	if (address_list == NULL)
+		address_count = 0;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	aid_t message_id = async_send_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_MULTICAST_SET_MODE, (sysarg_t) mode, address_count, NULL);
+	
+	int rc;
+	if (address_count)
+		rc = async_data_write_start(exch, address_list,
+		    address_count * sizeof(nic_address_t));
+	else
+		rc = EOK;
+	
+	async_exchange_end(exch);
+	
+	sysarg_t res;
+	async_wait_for(message_id, &res);
+	
+	if (rc != EOK)
+		return rc;
+	
+	return (int) res;
+}
+
+/** Determine if broadcast packets are received.
+ *
+ * @param[in]  dev_sess
+ * @param[out] mode     Current operation mode
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_broadcast_get_mode(async_sess_t *dev_sess, nic_broadcast_mode_t *mode)
+{
+	assert(mode);
+	
+	sysarg_t _mode;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_BROADCAST_GET_MODE, &_mode);
+	async_exchange_end(exch);
+	
+	*mode = (nic_broadcast_mode_t) _mode;
+	
+	return rc;
+}
+
+/** Set whether broadcast packets are received.
+ *
+ * @param[in] dev_sess
+ * @param[in] mode     Current operation mode
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_broadcast_set_mode(async_sess_t *dev_sess, nic_broadcast_mode_t mode)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_BROADCAST_SET_MODE, mode);
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+/** Determine if defective (erroneous) packets are received.
+ *
+ * @param[in]  dev_sess
+ * @param[out] mode     Bitmask specifying allowed errors
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_defective_get_mode(async_sess_t *dev_sess, uint32_t *mode)
+{
+	assert(mode);
+	
+	sysarg_t _mode;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_DEFECTIVE_GET_MODE, &_mode);
+	async_exchange_end(exch);
+	
+	*mode = (uint32_t) _mode;
+	
+	return rc;
+}
+
+/** Set whether defective (erroneous) packets are received.
+ *
+ * @param[in]  dev_sess
+ * @param[out] mode     Bitmask specifying allowed errors
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_defective_set_mode(async_sess_t *dev_sess, uint32_t mode)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_DEFECTIVE_SET_MODE, mode);
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+/** Retrieve the currently blocked source MAC addresses.
+ *
+ * @param[in]  dev_sess
+ * @param[in]  max_count     Maximal number of addresses that could
+ *                           be written into the list buffer.
+ * @param[out] address_list  Buffer for the list (array). Can be NULL.
+ * @param[out] address_count Number of addresses in the list before
+ *                           possible truncation due to the max_count.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_blocked_sources_get(async_sess_t *dev_sess, size_t max_count,
+    nic_address_t *address_list, size_t *address_count)
+{
+	if (!address_list)
+		max_count = 0;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	sysarg_t ac;
+	int rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_BLOCKED_SOURCES_GET, max_count, &ac);
+	if (rc != EOK) {
+		async_exchange_end(exch);
+		return rc;
+	}
+	
+	if (address_count)
+		*address_count = (size_t) ac;
+	
+	if ((max_count) && (ac))
+		rc = async_data_read_start(exch, address_list,
+		    max_count * sizeof(nic_address_t));
+	
+	async_exchange_end(exch);
+	return rc;
+}
+
+/** Set which source MACs are blocked
+ *
+ * @param[in] dev_sess
+ * @param[in] address_list  The list of addresses. Can be NULL.
+ * @param[in] address_count Number of addresses in the list.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_blocked_sources_set(async_sess_t *dev_sess,
+    const nic_address_t *address_list, size_t address_count)
+{
+	if (address_list == NULL)
+		address_count = 0;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	aid_t message_id = async_send_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_BLOCKED_SOURCES_SET, address_count, NULL);
+	
+	int rc;
+	if (address_count)
+		rc = async_data_write_start(exch, address_list,
+			address_count * sizeof(nic_address_t));
+	else
+		rc = EOK;
+	
+	async_exchange_end(exch);
+	
+	sysarg_t res;
+	async_wait_for(message_id, &res);
+	
+	if (rc != EOK)
+		return rc;
+	
+	return (int) res;
+}
+
+/** Request current VLAN filtering mask.
+ *
+ * @param[in]  dev_sess
+ * @param[out] stats    Structure with the statistics
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_vlan_get_mask(async_sess_t *dev_sess, nic_vlan_mask_t *mask)
+{
+	assert(mask);
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_VLAN_GET_MASK);
+	if (rc != EOK) {
+		async_exchange_end(exch);
+		return rc;
+	}
+	
+	rc = async_data_read_start(exch, mask, sizeof(nic_vlan_mask_t));
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+/** Set the mask used for VLAN filtering.
+ *
+ * If NULL, VLAN filtering is disabled.
+ *
+ * @param[in] dev_sess
+ * @param[in] mask     Pointer to mask structure or NULL to disable.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_vlan_set_mask(async_sess_t *dev_sess, const nic_vlan_mask_t *mask)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	aid_t message_id = async_send_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_VLAN_SET_MASK, mask != NULL, NULL);
+	
+	int rc;
+	if (mask != NULL)
+		rc = async_data_write_start(exch, mask, sizeof(nic_vlan_mask_t));
+	else
+		rc = EOK;
+	
+	async_exchange_end(exch);
+	
+	sysarg_t res;
+	async_wait_for(message_id, &res);
+	
+	if (rc != EOK)
+		return rc;
+	
+	return (int) res;
+}
+
+/** Set VLAN (802.1q) tag.
+ *
+ * Set whether the tag is to be signaled in offload info and
+ * if the tag should be stripped from received frames and added
+ * to sent frames automatically. Not every combination of add
+ * and strip must be supported.
+ *
+ * @param[in] dev_sess
+ * @param[in] tag      VLAN priority (top 3 bits) and
+ *                     the VLAN tag (bottom 12 bits)
+ * @param[in] add      Add the VLAN tag automatically (boolean)
+ * @param[in] strip    Strip the VLAN tag automatically (boolean)
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_vlan_set_tag(async_sess_t *dev_sess, uint16_t tag, bool add, bool strip)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_VLAN_SET_TAG, (sysarg_t) tag, (sysarg_t) add, (sysarg_t) strip);
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+/** Add new Wake-On-LAN virtue.
+ *
+ * @param[in]  dev_sess
+ * @param[in]  type     Type of the virtue
+ * @param[in]  data     Data required for this virtue
+ *                      (depends on type)
+ * @param[in]  length   Length of the data
+ * @param[out] id       Identifier of the new virtue
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_wol_virtue_add(async_sess_t *dev_sess, nic_wv_type_t type,
+    const void *data, size_t length, nic_wv_id_t *id)
+{
+	assert(id);
+	
+	bool send_data = ((data != NULL) && (length != 0));
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	ipc_call_t result;
+	aid_t message_id = async_send_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_WOL_VIRTUE_ADD, (sysarg_t) type, send_data, &result);
+	
+	sysarg_t res;
+	if (send_data) {
+		int rc = async_data_write_start(exch, data, length);
+		if (rc != EOK) {
+			async_exchange_end(exch);
+			async_wait_for(message_id, &res);
+			return rc;
+		}
+	}
+	
+	async_exchange_end(exch);
+	async_wait_for(message_id, &res);
+	
+	*id = IPC_GET_ARG1(result);
+	return (int) res;
+}
+
+/** Remove Wake-On-LAN virtue.
+ *
+ * @param[in] dev_sess
+ * @param[in] id       Virtue identifier
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_wol_virtue_remove(async_sess_t *dev_sess, nic_wv_id_t id)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_WOL_VIRTUE_REMOVE, (sysarg_t) id);
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+/** Get information about virtue.
+ *
+ * @param[in]  dev_sess
+ * @param[in]  id         Virtue identifier
+ * @param[out] type       Type of the filter. Can be NULL.
+ * @param[out] max_length Size of the data buffer.
+ * @param[out] data       Buffer for data used when the
+ *                        virtue was created. Can be NULL.
+ * @param[out] length     Length of the data. Can be NULL.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_wol_virtue_probe(async_sess_t *dev_sess, nic_wv_id_t id,
+    nic_wv_type_t *type, size_t max_length, void *data, size_t *length)
+{
+	sysarg_t _type;
+	sysarg_t _length;
+	
+	if (data == NULL)
+		max_length = 0;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	int rc = async_req_3_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_WOL_VIRTUE_PROBE, (sysarg_t) id, max_length,
+	    &_type, &_length);
+	if (rc != EOK) {
+		async_exchange_end(exch);
+		return rc;
+	}
+	
+	if (type)
+		*type = _type;
+	
+	if (length)
+		*length = _length;
+	
+	if ((max_length) && (_length != 0))
+		rc = async_data_read_start(exch, data, max_length);
+	
+	async_exchange_end(exch);
+	return rc;
+}
+
+/** Get a list of all virtues of the specified type.
+ *
+ * When NIC_WV_NONE is specified as the virtue type the function
+ * lists virtues of all types.
+ *
+ * @param[in]  dev_sess
+ * @param[in]  type      Type of the virtues
+ * @param[in]  max_count Maximum number of ids that can be
+ *                       written into the list buffer.
+ * @param[out] id_list   Buffer for to the list of virtue ids.
+ *                       Can be NULL.
+ * @param[out] id_count  Number of virtue identifiers in the list
+ *                       before possible truncation due to the
+ *                       max_count. Can be NULL.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_wol_virtue_list(async_sess_t *dev_sess, nic_wv_type_t type,
+    size_t max_count, nic_wv_id_t *id_list, size_t *id_count)
+{
+	if (id_list == NULL)
+		max_count = 0;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	sysarg_t count;
+	int rc = async_req_3_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_WOL_VIRTUE_LIST, (sysarg_t) type, max_count, &count);
+	
+	if (id_count)
+		*id_count = (size_t) count;
+	
+	if ((rc != EOK) || (!max_count)) {
+		async_exchange_end(exch);
+		return rc;
+	}
+	
+	rc = async_data_read_start(exch, id_list,
+	    max_count * sizeof(nic_wv_id_t));
+	
+	async_exchange_end(exch);
+	return rc;
+}
+
+/** Get number of virtues that can be enabled yet.
+ *
+ * Count: < 0 => Virtue of this type can be never used
+ *        = 0 => No more virtues can be enabled
+ *        > 0 => #count virtues can be enabled yet
+ *
+ * @param[in]  dev_sess
+ * @param[in]  type     Virtue type
+ * @param[out] count    Number of virtues
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_wol_virtue_get_caps(async_sess_t *dev_sess, nic_wv_type_t type,
+    int *count)
+{
+	assert(count);
+	
+	sysarg_t _count;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_WOL_VIRTUE_GET_CAPS, (sysarg_t) type, &_count);
+	async_exchange_end(exch);
+	
+	*count = (int) _count;
+	return rc;
+}
+
+/** Load the frame that issued the wakeup.
+ *
+ * The NIC can support only matched_type,  only part of the frame
+ * can be available or not at all. Sometimes even the type can be
+ * uncertain -- in this case the matched_type contains NIC_WV_NONE.
+ *
+ * Frame_length can be greater than max_length, but at most max_length
+ * bytes will be copied into the frame buffer.
+ *
+ * Note: Only the type of the filter can be detected, not the concrete
+ * filter, because the driver is probably not running when the wakeup
+ * is issued.
+ *
+ * @param[in]  dev_sess
+ * @param[out] matched_type Type of the filter that issued wakeup.
+ * @param[in]  max_length   Size of the buffer
+ * @param[out] frame        Buffer for the frame. Can be NULL.
+ * @param[out] frame_length Length of the stored frame. Can be NULL.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_wol_load_info(async_sess_t *dev_sess, nic_wv_type_t *matched_type,
+    size_t max_length, uint8_t *frame, size_t *frame_length)
+{
+	assert(matched_type);
+	
+	sysarg_t _matched_type;
+	sysarg_t _frame_length;
+	
+	if (frame == NULL)
+		max_length = 0;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	int rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_WOL_LOAD_INFO, max_length, &_matched_type, &_frame_length);
+	if (rc != EOK) {
+		async_exchange_end(exch);
+		return rc;
+	}
+	
+	*matched_type = (nic_wv_type_t) _matched_type;
+	if (frame_length)
+		*frame_length = (size_t) _frame_length;
+	
+	if ((max_length != 0) && (_frame_length != 0))
+		rc = async_data_read_start(exch, frame, max_length);
+	
+	async_exchange_end(exch);
+	return rc;
+}
+
+/** Probe supported options and current setting of offload computations
+ *
+ * @param[in]  dev_sess
+ * @param[out] supported Supported offload options
+ * @param[out] active    Currently active offload options
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_offload_probe(async_sess_t *dev_sess, uint32_t *supported,
+    uint32_t *active)
+{
+	assert(supported);
+	assert(active);
+	
+	sysarg_t _supported;
+	sysarg_t _active;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_1_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_OFFLOAD_PROBE, &_supported, &_active);
+	async_exchange_end(exch);
+	
+	*supported = (uint32_t) _supported;
+	*active = (uint32_t) _active;
+	return rc;
+}
+
+/** Set which offload computations can be performed on the NIC.
+ *
+ * @param[in] dev_sess
+ * @param[in] mask     Mask for the options (only those set here will be set)
+ * @param[in] active   Which options should be enabled and which disabled
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_offload_set(async_sess_t *dev_sess, uint32_t mask, uint32_t active)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_3_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_AUTONEG_RESTART, (sysarg_t) mask, (sysarg_t) active);
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+/** Query the current interrupt/poll mode of the NIC
+ *
+ * @param[in]  dev_sess
+ * @param[out] mode     Current poll mode
+ * @param[out] period   Period used in periodic polling.
+ *                      Can be NULL.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_poll_get_mode(async_sess_t *dev_sess, nic_poll_mode_t *mode,
+    struct timeval *period)
+{
+	assert(mode);
+	
+	sysarg_t _mode;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	int rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_POLL_GET_MODE, period != NULL, &_mode);
+	if (rc != EOK) {
+		async_exchange_end(exch);
+		return rc;
+	}
+	
+	*mode = (nic_poll_mode_t) _mode;
+	
+	if (period != NULL)
+		rc = async_data_read_start(exch, period, sizeof(struct timeval));
+	
+	async_exchange_end(exch);
+	return rc;
+}
+
+/** Set the interrupt/poll mode of the NIC.
+ *
+ * @param[in] dev_sess
+ * @param[in] mode     New poll mode
+ * @param[in] period   Period used in periodic polling. Can be NULL.
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_poll_set_mode(async_sess_t *dev_sess, nic_poll_mode_t mode,
+    const struct timeval *period)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	aid_t message_id = async_send_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	    NIC_POLL_SET_MODE, (sysarg_t) mode, period != NULL, NULL);
+	
+	int rc;
+	if (period)
+		rc = async_data_write_start(exch, period, sizeof(struct timeval));
+	else
+		rc = EOK;
+	
+	async_exchange_end(exch);
+	
+	sysarg_t res;
+	async_wait_for(message_id, &res);
+	
+	if (rc != EOK)
+		return rc;
+	
+	return (int) res;
+}
+
+/** Request the driver to poll the NIC.
+ *
+ * @param[in] dev_sess
+ *
+ * @return EOK If the operation was successfully completed
+ *
+ */
+int nic_poll_now(async_sess_t *dev_sess)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), NIC_POLL_NOW);
+	async_exchange_end(exch);
+	
+	return rc;
+}
 
 static void remote_nic_send_frame(ddf_fun_t *dev, void *iface,
@@ -1198,46 +2490,46 @@
  *
  */
-static remote_iface_func_ptr_t remote_nic_iface_ops[] = {
-	&remote_nic_send_frame,
-	&remote_nic_callback_create,
-	&remote_nic_get_state,
-	&remote_nic_set_state,
-	&remote_nic_get_address,
-	&remote_nic_set_address,
-	&remote_nic_get_stats,
-	&remote_nic_get_device_info,
-	&remote_nic_get_cable_state,
-	&remote_nic_get_operation_mode,
-	&remote_nic_set_operation_mode,
-	&remote_nic_autoneg_enable,
-	&remote_nic_autoneg_disable,
-	&remote_nic_autoneg_probe,
-	&remote_nic_autoneg_restart,
-	&remote_nic_get_pause,
-	&remote_nic_set_pause,
-	&remote_nic_unicast_get_mode,
-	&remote_nic_unicast_set_mode,
-	&remote_nic_multicast_get_mode,
-	&remote_nic_multicast_set_mode,
-	&remote_nic_broadcast_get_mode,
-	&remote_nic_broadcast_set_mode,
-	&remote_nic_defective_get_mode,
-	&remote_nic_defective_set_mode,
-	&remote_nic_blocked_sources_get,
-	&remote_nic_blocked_sources_set,
-	&remote_nic_vlan_get_mask,
-	&remote_nic_vlan_set_mask,
-	&remote_nic_vlan_set_tag,
-	&remote_nic_wol_virtue_add,
-	&remote_nic_wol_virtue_remove,
-	&remote_nic_wol_virtue_probe,
-	&remote_nic_wol_virtue_list,
-	&remote_nic_wol_virtue_get_caps,
-	&remote_nic_wol_load_info,
-	&remote_nic_offload_probe,
-	&remote_nic_offload_set,
-	&remote_nic_poll_get_mode,
-	&remote_nic_poll_set_mode,
-	&remote_nic_poll_now
+static const remote_iface_func_ptr_t remote_nic_iface_ops[] = {
+	[NIC_SEND_MESSAGE] = remote_nic_send_frame,
+	[NIC_CALLBACK_CREATE] = remote_nic_callback_create,
+	[NIC_GET_STATE] = remote_nic_get_state,
+	[NIC_SET_STATE] = remote_nic_set_state,
+	[NIC_GET_ADDRESS] = remote_nic_get_address,
+	[NIC_SET_ADDRESS] = remote_nic_set_address,
+	[NIC_GET_STATS] = remote_nic_get_stats,
+	[NIC_GET_DEVICE_INFO] = remote_nic_get_device_info,
+	[NIC_GET_CABLE_STATE] = remote_nic_get_cable_state,
+	[NIC_GET_OPERATION_MODE] = remote_nic_get_operation_mode,
+	[NIC_SET_OPERATION_MODE] = remote_nic_set_operation_mode,
+	[NIC_AUTONEG_ENABLE] = remote_nic_autoneg_enable,
+	[NIC_AUTONEG_DISABLE] = remote_nic_autoneg_disable,
+	[NIC_AUTONEG_PROBE] = remote_nic_autoneg_probe,
+	[NIC_AUTONEG_RESTART] = remote_nic_autoneg_restart,
+	[NIC_GET_PAUSE] = remote_nic_get_pause,
+	[NIC_SET_PAUSE] = remote_nic_set_pause,
+	[NIC_UNICAST_GET_MODE] = remote_nic_unicast_get_mode,
+	[NIC_UNICAST_SET_MODE] = remote_nic_unicast_set_mode,
+	[NIC_MULTICAST_GET_MODE] = remote_nic_multicast_get_mode,
+	[NIC_MULTICAST_SET_MODE] = remote_nic_multicast_set_mode,
+	[NIC_BROADCAST_GET_MODE] = remote_nic_broadcast_get_mode,
+	[NIC_BROADCAST_SET_MODE] = remote_nic_broadcast_set_mode,
+	[NIC_DEFECTIVE_GET_MODE] = remote_nic_defective_get_mode,
+	[NIC_DEFECTIVE_SET_MODE] = remote_nic_defective_set_mode,
+	[NIC_BLOCKED_SOURCES_GET] = remote_nic_blocked_sources_get,
+	[NIC_BLOCKED_SOURCES_SET] = remote_nic_blocked_sources_set,
+	[NIC_VLAN_GET_MASK] = remote_nic_vlan_get_mask,
+	[NIC_VLAN_SET_MASK] = remote_nic_vlan_set_mask,
+	[NIC_VLAN_SET_TAG] = remote_nic_vlan_set_tag,
+	[NIC_WOL_VIRTUE_ADD] = remote_nic_wol_virtue_add,
+	[NIC_WOL_VIRTUE_REMOVE] = remote_nic_wol_virtue_remove,
+	[NIC_WOL_VIRTUE_PROBE] = remote_nic_wol_virtue_probe,
+	[NIC_WOL_VIRTUE_LIST] = remote_nic_wol_virtue_list,
+	[NIC_WOL_VIRTUE_GET_CAPS] = remote_nic_wol_virtue_get_caps,
+	[NIC_WOL_LOAD_INFO] = remote_nic_wol_load_info,
+	[NIC_OFFLOAD_PROBE] = remote_nic_offload_probe,
+	[NIC_OFFLOAD_SET] = remote_nic_offload_set,
+	[NIC_POLL_GET_MODE] = remote_nic_poll_get_mode,
+	[NIC_POLL_SET_MODE] = remote_nic_poll_set_mode,
+	[NIC_POLL_NOW] = remote_nic_poll_now
 };
 
@@ -1248,7 +2540,6 @@
  *
  */
-remote_iface_t remote_nic_iface = {
-	.method_count = sizeof(remote_nic_iface_ops) /
-	    sizeof(remote_iface_func_ptr_t),
+const remote_iface_t remote_nic_iface = {
+	.method_count = ARRAY_SIZE(remote_nic_iface_ops),
 	.methods = remote_nic_iface_ops
 };
Index: uspace/lib/drv/generic/remote_pci.c
===================================================================
--- uspace/lib/drv/generic/remote_pci.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/remote_pci.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -36,7 +36,91 @@
 #include <async.h>
 #include <errno.h>
+#include <macros.h>
 
 #include "pci_dev_iface.h"
 #include "ddf/driver.h"
+
+typedef enum {
+	IPC_M_CONFIG_SPACE_READ_8,
+	IPC_M_CONFIG_SPACE_READ_16,
+	IPC_M_CONFIG_SPACE_READ_32,
+
+	IPC_M_CONFIG_SPACE_WRITE_8,
+	IPC_M_CONFIG_SPACE_WRITE_16,
+	IPC_M_CONFIG_SPACE_WRITE_32
+} pci_dev_iface_funcs_t;
+
+int pci_config_space_read_8(async_sess_t *sess, uint32_t address, uint8_t *val)
+{
+	sysarg_t res = 0;
+	
+	async_exch_t *exch = async_exchange_begin(sess);
+	int rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
+	    IPC_M_CONFIG_SPACE_READ_8, address, &res);
+	async_exchange_end(exch);
+	
+	*val = (uint8_t) res;
+	return rc;
+}
+
+int pci_config_space_read_16(async_sess_t *sess, uint32_t address,
+    uint16_t *val)
+{
+	sysarg_t res = 0;
+	
+	async_exch_t *exch = async_exchange_begin(sess);
+	int rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
+	    IPC_M_CONFIG_SPACE_READ_16, address, &res);
+	async_exchange_end(exch);
+	
+	*val = (uint16_t) res;
+	return rc;
+}
+
+int pci_config_space_read_32(async_sess_t *sess, uint32_t address,
+    uint32_t *val)
+{
+	sysarg_t res = 0;
+	
+	async_exch_t *exch = async_exchange_begin(sess);
+	int rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
+	    IPC_M_CONFIG_SPACE_READ_32, address, &res);
+	async_exchange_end(exch);
+	
+	*val = (uint32_t) res;
+	return rc;
+}
+
+int pci_config_space_write_8(async_sess_t *sess, uint32_t address, uint8_t val)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
+	    IPC_M_CONFIG_SPACE_WRITE_8, address, val);
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+int pci_config_space_write_16(async_sess_t *sess, uint32_t address,
+    uint16_t val)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
+	    IPC_M_CONFIG_SPACE_WRITE_16, address, val);
+	async_exchange_end(exch);
+	
+	return rc;
+}
+
+int pci_config_space_write_32(async_sess_t *sess, uint32_t address,
+    uint32_t val)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
+	    IPC_M_CONFIG_SPACE_WRITE_32, address, val);
+	async_exchange_end(exch);
+	
+	return rc;
+}
 
 static void remote_config_space_read_8(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
@@ -49,19 +133,18 @@
 
 /** Remote USB interface operations. */
-static remote_iface_func_ptr_t remote_pci_iface_ops [] = {
-	remote_config_space_read_8,
-	remote_config_space_read_16,
-	remote_config_space_read_32,
-
-	remote_config_space_write_8,
-	remote_config_space_write_16,
-	remote_config_space_write_32
+static const remote_iface_func_ptr_t remote_pci_iface_ops [] = {
+	[IPC_M_CONFIG_SPACE_READ_8] = remote_config_space_read_8,
+	[IPC_M_CONFIG_SPACE_READ_16] = remote_config_space_read_16,
+	[IPC_M_CONFIG_SPACE_READ_32] = remote_config_space_read_32,
+
+	[IPC_M_CONFIG_SPACE_WRITE_8] = remote_config_space_write_8,
+	[IPC_M_CONFIG_SPACE_WRITE_16] = remote_config_space_write_16,
+	[IPC_M_CONFIG_SPACE_WRITE_32] = remote_config_space_write_32
 };
 
 /** Remote USB interface structure.
  */
-remote_iface_t remote_pci_iface = {
-	.method_count = sizeof(remote_pci_iface_ops) /
-	    sizeof(remote_pci_iface_ops[0]),
+const remote_iface_t remote_pci_iface = {
+	.method_count = ARRAY_SIZE(remote_pci_iface_ops),
 	.methods = remote_pci_iface_ops
 };
Index: uspace/lib/drv/generic/remote_pio_window.c
===================================================================
--- uspace/lib/drv/generic/remote_pio_window.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/remote_pio_window.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -35,4 +35,5 @@
 #include <async.h>
 #include <errno.h>
+#include <macros.h>
 
 #include "ops/pio_window.h"
@@ -42,11 +43,10 @@
     ipc_call_t *);
 
-static remote_iface_func_ptr_t remote_pio_window_iface_ops [] = {
+static const remote_iface_func_ptr_t remote_pio_window_iface_ops [] = {
 	[PIO_WINDOW_GET] = &remote_pio_window_get
 };
 
-remote_iface_t remote_pio_window_iface = {
-	.method_count = sizeof(remote_pio_window_iface_ops) /
-	    sizeof(remote_iface_func_ptr_t),
+const remote_iface_t remote_pio_window_iface = {
+	.method_count = ARRAY_SIZE(remote_pio_window_iface_ops),
 	.methods = remote_pio_window_iface_ops
 };
Index: uspace/lib/drv/generic/remote_usb.c
===================================================================
--- uspace/lib/drv/generic/remote_usb.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/remote_usb.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -36,4 +36,5 @@
 #include <async.h>
 #include <errno.h>
+#include <macros.h>
 
 #include "usb_iface.h"
@@ -107,5 +108,5 @@
 
 /** Remote USB interface operations. */
-static remote_iface_func_ptr_t remote_usb_iface_ops [] = {
+static const remote_iface_func_ptr_t remote_usb_iface_ops [] = {
 	[IPC_M_USB_GET_MY_ADDRESS] = remote_usb_get_my_address,
 	[IPC_M_USB_GET_MY_INTERFACE] = remote_usb_get_my_interface,
@@ -115,7 +116,6 @@
 /** Remote USB interface structure.
  */
-remote_iface_t remote_usb_iface = {
-	.method_count = sizeof(remote_usb_iface_ops) /
-	    sizeof(remote_usb_iface_ops[0]),
+const remote_iface_t remote_usb_iface = {
+	.method_count = ARRAY_SIZE(remote_usb_iface_ops),
 	.methods = remote_usb_iface_ops
 };
Index: uspace/lib/drv/generic/remote_usbhc.c
===================================================================
--- uspace/lib/drv/generic/remote_usbhc.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/remote_usbhc.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -37,4 +37,5 @@
 #include <errno.h>
 #include <assert.h>
+#include <macros.h>
 
 #include "usbhc_iface.h"
@@ -334,5 +335,5 @@
 
 /** Remote USB host controller interface operations. */
-static remote_iface_func_ptr_t remote_usbhc_iface_ops[] = {
+static const remote_iface_func_ptr_t remote_usbhc_iface_ops[] = {
 	[IPC_M_USBHC_REQUEST_ADDRESS] = remote_usbhc_request_address,
 	[IPC_M_USBHC_RELEASE_ADDRESS] = remote_usbhc_release_address,
@@ -349,7 +350,6 @@
 /** Remote USB host controller interface structure.
  */
-remote_iface_t remote_usbhc_iface = {
-	.method_count = sizeof(remote_usbhc_iface_ops) /
-	    sizeof(remote_usbhc_iface_ops[0]),
+const remote_iface_t remote_usbhc_iface = {
+	.method_count = ARRAY_SIZE(remote_usbhc_iface_ops),
 	.methods = remote_usbhc_iface_ops
 };
Index: uspace/lib/drv/generic/remote_usbhid.c
===================================================================
--- uspace/lib/drv/generic/remote_usbhid.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/generic/remote_usbhid.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -37,7 +37,249 @@
 #include <assert.h>
 #include <stdio.h>
+#include <macros.h>
 
 #include "usbhid_iface.h"
 #include "ddf/driver.h"
+
+/** IPC methods for USB HID device interface. */
+typedef enum {
+	/** Get number of events reported in single burst.
+	 * Parameters: none
+	 * Answer:
+	 * - Size of one report in bytes.
+	 */
+	IPC_M_USBHID_GET_EVENT_LENGTH,
+	/** Get single event from the HID device.
+	 * The word single refers to set of individual events that were
+	 * available at particular point in time.
+	 * Parameters:
+	 * - flags
+	 * The call is followed by data read expecting two concatenated
+	 * arrays.
+	 * Answer:
+	 * - EOK - events returned
+	 * - EAGAIN - no event ready (only in non-blocking mode)
+	 *
+	 * It is okay if the client requests less data. Extra data must
+	 * be truncated by the driver.
+	 *
+	 * @todo Change this comment.
+	 */
+	IPC_M_USBHID_GET_EVENT,
+	
+	/** Get the size of the report descriptor from the HID device.
+	 *
+	 * Parameters:
+	 * - none
+	 * Answer:
+	 * - EOK - method is implemented (expected always)
+	 * Parameters of the answer:
+	 * - Size of the report in bytes.
+	 */
+	IPC_M_USBHID_GET_REPORT_DESCRIPTOR_LENGTH,
+	
+	/** Get the report descriptor from the HID device.
+	 *
+	 * Parameters:
+	 * - none
+	 * The call is followed by data read expecting the descriptor itself.
+	 * Answer:
+	 * - EOK - report descriptor returned.
+	 */
+	IPC_M_USBHID_GET_REPORT_DESCRIPTOR
+} usbhid_iface_funcs_t;
+
+/** Ask for event array length.
+ *
+ * @param dev_sess Session to DDF device providing USB HID interface.
+ *
+ * @return Number of usages returned or negative error code.
+ *
+ */
+int usbhid_dev_get_event_length(async_sess_t *dev_sess, size_t *size)
+{
+	if (!dev_sess)
+		return EINVAL;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	sysarg_t len;
+	int rc = async_req_1_1(exch, DEV_IFACE_ID(USBHID_DEV_IFACE),
+	    IPC_M_USBHID_GET_EVENT_LENGTH, &len);
+	
+	async_exchange_end(exch);
+	
+	if (rc == EOK) {
+		if (size != NULL)
+			*size = (size_t) len;
+	}
+	
+	return rc;
+}
+
+/** Request for next event from HID device.
+ *
+ * @param[in]  dev_sess    Session to DDF device providing USB HID interface.
+ * @param[out] usage_pages Where to store usage pages.
+ * @param[out] usages      Where to store usages (actual data).
+ * @param[in]  usage_count Length of @p usage_pages and @p usages buffer
+ *                         (in items, not bytes).
+ * @param[out] actual_usage_count Number of usages actually returned by the
+ *                                device driver.
+ * @param[in] flags        Flags (see USBHID_IFACE_FLAG_*).
+ *
+ * @return Error code.
+ *
+ */
+int usbhid_dev_get_event(async_sess_t *dev_sess, uint8_t *buf,
+    size_t size, size_t *actual_size, int *event_nr, unsigned int flags)
+{
+	if (!dev_sess)
+		return EINVAL;
+	
+	if (buf == NULL)
+		return ENOMEM;
+	
+	if (size == 0)
+		return EINVAL;
+	
+	size_t buffer_size =  size;
+	uint8_t *buffer = malloc(buffer_size);
+	if (buffer == NULL)
+		return ENOMEM;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	ipc_call_t opening_request_call;
+	aid_t opening_request = async_send_2(exch,
+	    DEV_IFACE_ID(USBHID_DEV_IFACE), IPC_M_USBHID_GET_EVENT,
+	    flags, &opening_request_call);
+	
+	if (opening_request == 0) {
+		async_exchange_end(exch);
+		free(buffer);
+		return ENOMEM;
+	}
+	
+	ipc_call_t data_request_call;
+	aid_t data_request = async_data_read(exch, buffer, buffer_size,
+	    &data_request_call);
+	
+	async_exchange_end(exch);
+	
+	if (data_request == 0) {
+		async_forget(opening_request);
+		free(buffer);
+		return ENOMEM;
+	}
+	
+	sysarg_t data_request_rc;
+	sysarg_t opening_request_rc;
+	async_wait_for(data_request, &data_request_rc);
+	async_wait_for(opening_request, &opening_request_rc);
+	
+	if (data_request_rc != EOK) {
+		/* Prefer return code of the opening request. */
+		if (opening_request_rc != EOK)
+			return (int) opening_request_rc;
+		else
+			return (int) data_request_rc;
+	}
+	
+	if (opening_request_rc != EOK)
+		return (int) opening_request_rc;
+	
+	size_t act_size = IPC_GET_ARG2(data_request_call);
+	
+	/* Copy the individual items. */
+	memcpy(buf, buffer, act_size);
+	
+	if (actual_size != NULL)
+		*actual_size = act_size;
+	
+	if (event_nr != NULL)
+		*event_nr = IPC_GET_ARG1(opening_request_call);
+	
+	return EOK;
+}
+
+int usbhid_dev_get_report_descriptor_length(async_sess_t *dev_sess,
+    size_t *size)
+{
+	if (!dev_sess)
+		return EINVAL;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	sysarg_t arg_size;
+	int rc = async_req_1_1(exch, DEV_IFACE_ID(USBHID_DEV_IFACE),
+	    IPC_M_USBHID_GET_REPORT_DESCRIPTOR_LENGTH, &arg_size);
+	
+	async_exchange_end(exch);
+	
+	if (rc == EOK) {
+		if (size != NULL)
+			*size = (size_t) arg_size;
+	}
+	
+	return rc;
+}
+
+int usbhid_dev_get_report_descriptor(async_sess_t *dev_sess, uint8_t *buf,
+    size_t size, size_t *actual_size)
+{
+	if (!dev_sess)
+		return EINVAL;
+	
+	if (buf == NULL)
+		return ENOMEM;
+	
+	if (size == 0)
+		return EINVAL;
+	
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	
+	aid_t opening_request = async_send_1(exch,
+	    DEV_IFACE_ID(USBHID_DEV_IFACE), IPC_M_USBHID_GET_REPORT_DESCRIPTOR,
+	    NULL);
+	if (opening_request == 0) {
+		async_exchange_end(exch);
+		return ENOMEM;
+	}
+	
+	ipc_call_t data_request_call;
+	aid_t data_request = async_data_read(exch, buf, size,
+	    &data_request_call);
+	
+	async_exchange_end(exch);
+	
+	if (data_request == 0) {
+		async_forget(opening_request);
+		return ENOMEM;
+	}
+	
+	sysarg_t data_request_rc;
+	sysarg_t opening_request_rc;
+	async_wait_for(data_request, &data_request_rc);
+	async_wait_for(opening_request, &opening_request_rc);
+	
+	if (data_request_rc != EOK) {
+		/* Prefer return code of the opening request. */
+		if (opening_request_rc != EOK)
+			return (int) opening_request_rc;
+		else
+			return (int) data_request_rc;
+	}
+	
+	if (opening_request_rc != EOK)
+		return (int) opening_request_rc;
+	
+	size_t act_size = IPC_GET_ARG2(data_request_call);
+	
+	if (actual_size != NULL)
+		*actual_size = act_size;
+	
+	return EOK;
+}
 
 static void remote_usbhid_get_event_length(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
@@ -48,16 +290,16 @@
 
 /** Remote USB HID interface operations. */
-static remote_iface_func_ptr_t remote_usbhid_iface_ops [] = {
-	remote_usbhid_get_event_length,
-	remote_usbhid_get_event,
-	remote_usbhid_get_report_descriptor_length,
-	remote_usbhid_get_report_descriptor
+static const remote_iface_func_ptr_t remote_usbhid_iface_ops [] = {
+	[IPC_M_USBHID_GET_EVENT_LENGTH] = remote_usbhid_get_event_length,
+	[IPC_M_USBHID_GET_EVENT] = remote_usbhid_get_event,
+	[IPC_M_USBHID_GET_REPORT_DESCRIPTOR_LENGTH] =
+	    remote_usbhid_get_report_descriptor_length,
+	[IPC_M_USBHID_GET_REPORT_DESCRIPTOR] = remote_usbhid_get_report_descriptor
 };
 
 /** Remote USB HID interface structure.
  */
-remote_iface_t remote_usbhid_iface = {
-	.method_count = sizeof(remote_usbhid_iface_ops) /
-	    sizeof(remote_usbhid_iface_ops[0]),
+const remote_iface_t remote_usbhid_iface = {
+	.method_count = ARRAY_SIZE(remote_usbhid_iface_ops),
 	.methods = remote_usbhid_iface_ops
 };
Index: uspace/lib/drv/include/ahci_iface.h
===================================================================
--- uspace/lib/drv/include/ahci_iface.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/include/ahci_iface.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -41,4 +41,12 @@
 #include <async.h>
 
+extern async_sess_t* ahci_get_sess(devman_handle_t, char **);
+
+extern int ahci_get_sata_device_name(async_sess_t *, size_t, char *);
+extern int ahci_get_num_blocks(async_sess_t *, uint64_t *);
+extern int ahci_get_block_size(async_sess_t *, size_t *);
+extern int ahci_read_blocks(async_sess_t *, uint64_t, size_t, void *);
+extern int ahci_write_blocks(async_sess_t *, uint64_t, size_t, void *);
+
 /** AHCI device communication interface. */
 typedef struct {
Index: uspace/lib/drv/include/battery_iface.h
===================================================================
--- uspace/lib/drv/include/battery_iface.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/include/battery_iface.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2012 Maurizio Lombardi
+ * 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 LIBDRV_BATTERY_IFACE_H_
+#define LIBDRV_BATTERY_IFACE_H_
+
+#include <async.h>
+
+typedef enum {
+	BATTERY_OK,
+	BATTERY_LOW,
+	BATTERY_NOT_PRESENT,
+} battery_status_t;
+
+typedef enum {
+	BATTERY_STATUS_GET = 0,
+	BATTERY_CHARGE_LEVEL_GET,
+} battery_dev_method_t;
+
+extern int battery_status_get(async_sess_t *, battery_status_t *);
+extern int battery_charge_level_get(async_sess_t *, int *);
+
+#endif
+
Index: uspace/lib/drv/include/char_dev_iface.h
===================================================================
--- uspace/lib/drv/include/char_dev_iface.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/include/char_dev_iface.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,51 @@
+/*
+ * 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 LIBDRV_CHAR_DEV_IFACE_H_
+#define LIBDRV_CHAR_DEV_IFACE_H_
+
+#include <async.h>
+
+typedef enum {
+	CHAR_DEV_READ = 0,
+	CHAR_DEV_WRITE
+} char_dev_method_t;
+
+extern ssize_t char_dev_read(async_sess_t *, void *, size_t);
+extern ssize_t char_dev_write(async_sess_t *, void *, size_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/drv/include/ddf/driver.h
===================================================================
--- uspace/lib/drv/include/ddf/driver.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/include/ddf/driver.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -108,5 +108,5 @@
 	const char *name;
 	/** Generic device driver operations */
-	driver_ops_t *driver_ops;
+	const driver_ops_t *driver_ops;
 } driver_t;
 
@@ -116,5 +116,5 @@
 #endif
 
-extern int ddf_driver_main(driver_t *);
+extern int ddf_driver_main(const driver_t *);
 
 extern void *ddf_dev_data_alloc(ddf_dev_t *, size_t);
Index: uspace/lib/drv/include/ddf/interrupt.h
===================================================================
--- uspace/lib/drv/include/ddf/interrupt.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/include/ddf/interrupt.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -67,5 +67,5 @@
 extern void interrupt_init(void);
 extern int register_interrupt_handler(ddf_dev_t *, int, interrupt_handler_t *,
-    irq_code_t *);
+    const irq_code_t *);
 extern int unregister_interrupt_handler(ddf_dev_t *, int);
 
Index: uspace/lib/drv/include/dev_iface.h
===================================================================
--- uspace/lib/drv/include/dev_iface.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/include/dev_iface.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -55,14 +55,14 @@
 
 typedef struct {
-	size_t method_count;
-	remote_iface_func_ptr_t *methods;
+	const size_t method_count;
+	const remote_iface_func_ptr_t *methods;
 } remote_iface_t;
 
 typedef struct {
-	remote_iface_t *ifaces[DEV_IFACE_COUNT];
+	const remote_iface_t *ifaces[DEV_IFACE_COUNT];
 } iface_dipatch_table_t;
 
-extern remote_iface_t *get_remote_iface(int);
-extern remote_iface_func_ptr_t get_remote_method(remote_iface_t *, sysarg_t);
+extern const remote_iface_t *get_remote_iface(int);
+extern remote_iface_func_ptr_t get_remote_method(const remote_iface_t *, sysarg_t);
 
 
Index: uspace/lib/drv/include/graph_iface.h
===================================================================
--- uspace/lib/drv/include/graph_iface.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/include/graph_iface.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2011 Petr Koupy
+ * 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_GRAPH_DEV_H_
+#define LIBC_DEVICE_GRAPH_DEV_H_
+
+#include <async.h>
+
+extern int graph_dev_connect(async_sess_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/drv/include/nic_iface.h
===================================================================
--- uspace/lib/drv/include/nic_iface.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
+++ uspace/lib/drv/include/nic_iface.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2010 Radim Vansa
+ * 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 LIBDRV_NIC_IFACE_H_
+#define LIBDRV_NIC_IFACE_H_
+
+#include <async.h>
+#include <nic/nic.h>
+#include <ipc/common.h>
+
+
+typedef enum {
+	NIC_EV_ADDR_CHANGED = IPC_FIRST_USER_METHOD,
+	NIC_EV_RECEIVED,
+	NIC_EV_DEVICE_STATE
+} nic_event_t;
+
+extern int nic_send_frame(async_sess_t *, void *, size_t);
+extern int nic_callback_create(async_sess_t *, async_client_conn_t, void *);
+extern int nic_get_state(async_sess_t *, nic_device_state_t *);
+extern int nic_set_state(async_sess_t *, nic_device_state_t);
+extern int nic_get_address(async_sess_t *, nic_address_t *);
+extern int nic_set_address(async_sess_t *, const nic_address_t *);
+extern int nic_get_stats(async_sess_t *, nic_device_stats_t *);
+extern int nic_get_device_info(async_sess_t *, nic_device_info_t *);
+extern int nic_get_cable_state(async_sess_t *, nic_cable_state_t *);
+
+extern int nic_get_operation_mode(async_sess_t *, int *, nic_channel_mode_t *,
+    nic_role_t *);
+extern int nic_set_operation_mode(async_sess_t *, int, nic_channel_mode_t,
+    nic_role_t);
+extern int nic_autoneg_enable(async_sess_t *, uint32_t);
+extern int nic_autoneg_disable(async_sess_t *);
+extern int nic_autoneg_probe(async_sess_t *, uint32_t *, uint32_t *,
+    nic_result_t *, nic_result_t *);
+extern int nic_autoneg_restart(async_sess_t *);
+extern int nic_get_pause(async_sess_t *, nic_result_t *, nic_result_t *,
+    uint16_t *);
+extern int nic_set_pause(async_sess_t *, int, int, uint16_t);
+
+extern int nic_unicast_get_mode(async_sess_t *, nic_unicast_mode_t *, size_t,
+    nic_address_t *, size_t *);
+extern int nic_unicast_set_mode(async_sess_t *, nic_unicast_mode_t,
+    const nic_address_t *, size_t);
+extern int nic_multicast_get_mode(async_sess_t *, nic_multicast_mode_t *,
+    size_t, nic_address_t *, size_t *);
+extern int nic_multicast_set_mode(async_sess_t *, nic_multicast_mode_t,
+    const nic_address_t *, size_t);
+extern int nic_broadcast_get_mode(async_sess_t *, nic_broadcast_mode_t *);
+extern int nic_broadcast_set_mode(async_sess_t *, nic_broadcast_mode_t);
+extern int nic_defective_get_mode(async_sess_t *, uint32_t *);
+extern int nic_defective_set_mode(async_sess_t *, uint32_t);
+extern int nic_blocked_sources_get(async_sess_t *, size_t, nic_address_t *,
+    size_t *);
+extern int nic_blocked_sources_set(async_sess_t *, const nic_address_t *,
+    size_t);
+
+extern int nic_vlan_get_mask(async_sess_t *, nic_vlan_mask_t *);
+extern int nic_vlan_set_mask(async_sess_t *, const nic_vlan_mask_t *);
+extern int nic_vlan_set_tag(async_sess_t *, uint16_t, bool, bool);
+
+extern int nic_wol_virtue_add(async_sess_t *, nic_wv_type_t, const void *,
+    size_t, nic_wv_id_t *);
+extern int nic_wol_virtue_remove(async_sess_t *, nic_wv_id_t);
+extern int nic_wol_virtue_probe(async_sess_t *, nic_wv_id_t, nic_wv_type_t *,
+    size_t, void *, size_t *);
+extern int nic_wol_virtue_list(async_sess_t *, nic_wv_type_t, size_t,
+    nic_wv_id_t *, size_t *);
+extern int nic_wol_virtue_get_caps(async_sess_t *, nic_wv_type_t, int *);
+extern int nic_wol_load_info(async_sess_t *, nic_wv_type_t *, size_t, uint8_t *,
+    size_t *);
+
+extern int nic_offload_probe(async_sess_t *, uint32_t *, uint32_t *);
+extern int nic_offload_set(async_sess_t *, uint32_t, uint32_t);
+
+extern int nic_poll_get_mode(async_sess_t *, nic_poll_mode_t *,
+    struct timeval *);
+extern int nic_poll_set_mode(async_sess_t *, nic_poll_mode_t,
+    const struct timeval *);
+extern int nic_poll_now(async_sess_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/drv/include/ops/battery_dev.h
===================================================================
--- uspace/lib/drv/include/ops/battery_dev.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/include/ops/battery_dev.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -37,5 +37,5 @@
 
 #include "../ddf/driver.h"
-#include "device/battery_dev.h"
+#include "battery_iface.h"
 
 typedef struct {
Index: uspace/lib/drv/include/pci_dev_iface.h
===================================================================
--- uspace/lib/drv/include/pci_dev_iface.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/include/pci_dev_iface.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -40,13 +40,13 @@
 #include "ddf/driver.h"
 
-typedef enum {
-	IPC_M_CONFIG_SPACE_READ_8,
-	IPC_M_CONFIG_SPACE_READ_16,
-	IPC_M_CONFIG_SPACE_READ_32,
+#define PCI_DEVICE_ID  0x02
 
-	IPC_M_CONFIG_SPACE_WRITE_8,
-	IPC_M_CONFIG_SPACE_WRITE_16,
-	IPC_M_CONFIG_SPACE_WRITE_32
-} pci_dev_iface_funcs_t;
+extern int pci_config_space_read_8(async_sess_t *, uint32_t, uint8_t *);
+extern int pci_config_space_read_16(async_sess_t *, uint32_t, uint16_t *);
+extern int pci_config_space_read_32(async_sess_t *, uint32_t, uint32_t *);
+
+extern int pci_config_space_write_8(async_sess_t *, uint32_t, uint8_t);
+extern int pci_config_space_write_16(async_sess_t *, uint32_t, uint16_t);
+extern int pci_config_space_write_32(async_sess_t *, uint32_t, uint32_t);
 
 /** PCI device communication interface. */
Index: uspace/lib/drv/include/remote_ahci.h
===================================================================
--- uspace/lib/drv/include/remote_ahci.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2012 Petr Jerman
- * 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 libdrv
- * @{
- */
-/** @file
- */
-
-#ifndef LIBDRV_REMOTE_AHCI_H_
-#define LIBDRV_REMOTE_AHCI_H_
-
-extern remote_iface_t remote_ahci_iface;
-
-#endif
-
-/**
- * @}
- */
Index: uspace/lib/drv/include/remote_audio_mixer.h
===================================================================
--- uspace/lib/drv/include/remote_audio_mixer.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/*
- * Copyright (c) 2011 Jan Vesely
- * 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 libdrv
- * @{
- */
-/** @file
- */
-
-#ifndef LIBDRV_REMOTE_AUDIO_MIXER_H_
-#define LIBDRV_REMOTE_AUDIO_MIXER_H_
-
-extern remote_iface_t remote_audio_mixer_iface;
-
-#endif
-
-/**
- * @}
- */
-
Index: uspace/lib/drv/include/remote_audio_pcm.h
===================================================================
--- uspace/lib/drv/include/remote_audio_pcm.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2011 Jan Vesely
- * 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 libdrv
- * @{
- */
-/** @file
- */
-
-#ifndef LIBDRV_REMOTE_AUDIO_PCM_H_
-#define LIBDRV_REMOTE_AUDIO_PCM_H_
-
-extern remote_iface_t remote_audio_pcm_iface;
-
-#endif
-
-/**
- * @}
- */
-
Index: uspace/lib/drv/include/remote_battery_dev.h
===================================================================
--- uspace/lib/drv/include/remote_battery_dev.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/*
- * Copyright (c) 2012 Maurizio Lombardi
- * 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 libdrv
- * @{
- */
-/** @file
- */
-
-#ifndef LIBDRV_REMOTE_BATTERY_DEV_H_
-#define LIBDRV_REMOTE_BATTERY_DEV_H_
-
-extern remote_iface_t remote_battery_dev_iface;
-
-#endif
-
-/**
- * @}
- */
-
Index: uspace/lib/drv/include/remote_char_dev.h
===================================================================
--- uspace/lib/drv/include/remote_char_dev.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * 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 libdrv
- * @{
- */
-/** @file
- */
-
-#ifndef LIBDRV_REMOTE_CHAR_DEV_H_
-#define LIBDRV_REMOTE_CHAR_DEV_H_
-
-extern remote_iface_t remote_char_dev_iface;
-
-#endif
-
-/**
- * @}
- */
Index: uspace/lib/drv/include/remote_clock_dev.h
===================================================================
--- uspace/lib/drv/include/remote_clock_dev.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/*
- * Copyright (c) 2012 Maurizio Lombardi
- * 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 libdrv
- * @{
- */
-/** @file
- */
-
-#ifndef LIBDRV_REMOTE_CLOCK_DEV_H_
-#define LIBDRV_REMOTE_CLOCK_DEV_H_
-
-extern remote_iface_t remote_clock_dev_iface;
-
-#endif
-
-/**
- * @}
- */
-
Index: uspace/lib/drv/include/remote_graph_dev.h
===================================================================
--- uspace/lib/drv/include/remote_graph_dev.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2011 Petr Koupy
- * 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 libdrv
- * @{
- */
-/** @file
- */
-
-#ifndef LIBDRV_REMOTE_GRAPH_DEV_H_
-#define LIBDRV_REMOTE_GRAPH_DEV_H_
-
-extern remote_iface_t remote_graph_dev_iface;
-
-#endif
-
-/**
- * @}
- */
Index: uspace/lib/drv/include/remote_hw_res.h
===================================================================
--- uspace/lib/drv/include/remote_hw_res.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * 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 libdrv
- * @{
- */
-/** @file
- */
-
-#ifndef LIBDRV_REMOTE_HW_RES_H_
-#define LIBDRV_REMOTE_HW_RES_H_
-
-extern remote_iface_t remote_hw_res_iface;
-
-#endif
-
-/**
- * @}
- */
Index: uspace/lib/drv/include/remote_nic.h
===================================================================
--- uspace/lib/drv/include/remote_nic.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2011 Radim Vansa
- * 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 libdrv
- * @{
- */
-/** @file
- */
-
-#ifndef LIBDRV_REMOTE_NIC_H_
-#define LIBDRV_REMOTE_NIC_H_
-
-extern remote_iface_t remote_nic_iface;
-
-#endif
-
-/**
- * @}
- */
Index: uspace/lib/drv/include/remote_pci.h
===================================================================
--- uspace/lib/drv/include/remote_pci.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/*
- * Copyright (c) 2011 Jan Vesely
- * 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 libdrv
- * @{
- */
-/** @file
- */
-
-#ifndef LIBDRV_REMOTE_PCI_H_
-#define LIBDRV_REMOTE_PCI_H_
-
-extern remote_iface_t remote_pci_iface;
-
-#endif
-
-/**
- * @}
- */
-
Index: uspace/lib/drv/include/remote_pio_window.h
===================================================================
--- uspace/lib/drv/include/remote_pio_window.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2013 Jakub Jermar 
- * 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 libdrv
- * @{
- */
-/** @file
- */
-
-#ifndef LIBDRV_REMOTE_PIO_WINDOW_H_
-#define LIBDRV_REMOTE_PIO_WINDOW_H_
-
-extern remote_iface_t remote_pio_window_iface;
-
-#endif
-
-/**
- * @}
- */
Index: uspace/lib/drv/include/remote_usb.h
===================================================================
--- uspace/lib/drv/include/remote_usb.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2010 Vojtech Horky
- * 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 libdrv
- * @{
- */
-/** @file
- */
-
-#ifndef LIBDRV_REMOTE_USB_H_
-#define LIBDRV_REMOTE_USB_H_
-
-extern remote_iface_t remote_usb_iface;
-
-#endif
-
-/**
- * @}
- */
Index: uspace/lib/drv/include/remote_usbhc.h
===================================================================
--- uspace/lib/drv/include/remote_usbhc.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2010 Vojtech Horky
- * 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 libdrv
- * @{
- */
-/** @file
- */
-
-#ifndef LIBDRV_REMOTE_USBHC_H_
-#define LIBDRV_REMOTE_USBHC_H_
-
-extern remote_iface_t remote_usbhc_iface;
-
-#endif
-
-/**
- * @}
- */
Index: uspace/lib/drv/include/remote_usbhid.h
===================================================================
--- uspace/lib/drv/include/remote_usbhid.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2011 Vojtech Horky
- * 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 libdrv
- * @{
- */
-/** @file
- */
-
-#ifndef LIBDRV_REMOTE_USBHID_H_
-#define LIBDRV_REMOTE_USBHID_H_
-
-extern remote_iface_t remote_usbhid_iface;
-
-#endif
-
-/**
- * @}
- */
Index: uspace/lib/drv/include/usbhid_iface.h
===================================================================
--- uspace/lib/drv/include/usbhid_iface.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/drv/include/usbhid_iface.h	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -40,54 +40,10 @@
 #include <usb/usb.h>
 
-/** IPC methods for USB HID device interface. */
-typedef enum {
-	/** Get number of events reported in single burst.
-	 * Parameters: none
-	 * Answer:
-	 * - Size of one report in bytes.
-	 */
-	IPC_M_USBHID_GET_EVENT_LENGTH,
-	/** Get single event from the HID device.
-	 * The word single refers to set of individual events that were
-	 * available at particular point in time.
-	 * Parameters:
-	 * - flags
-	 * The call is followed by data read expecting two concatenated
-	 * arrays.
-	 * Answer:
-	 * - EOK - events returned
-	 * - EAGAIN - no event ready (only in non-blocking mode)
-	 *
-	 * It is okay if the client requests less data. Extra data must
-	 * be truncated by the driver.
-	 *
-	 * @todo Change this comment.
-	 */
-	IPC_M_USBHID_GET_EVENT,
-	
-	/** Get the size of the report descriptor from the HID device.
-	 *
-	 * Parameters:
-	 * - none
-	 * Answer:
-	 * - EOK - method is implemented (expected always)
-	 * Parameters of the answer:
-	 * - Size of the report in bytes.
-	 */
-	IPC_M_USBHID_GET_REPORT_DESCRIPTOR_LENGTH,
-	
-	/** Get the report descriptor from the HID device.
-	 *
-	 * Parameters:
-	 * - none
-	 * The call is followed by data read expecting the descriptor itself.
-	 * Answer:
-	 * - EOK - report descriptor returned.
-	 */
-	IPC_M_USBHID_GET_REPORT_DESCRIPTOR
-} usbhid_iface_funcs_t;
-
-/** USB HID interface flag - return immediately if no data are available. */
-#define USBHID_IFACE_FLAG_NON_BLOCKING (1 << 0)
+extern int usbhid_dev_get_event_length(async_sess_t *, size_t *);
+extern int usbhid_dev_get_event(async_sess_t *, uint8_t *, size_t, size_t *,
+    int *, unsigned int);
+extern int usbhid_dev_get_report_descriptor_length(async_sess_t *, size_t *);
+extern int usbhid_dev_get_report_descriptor(async_sess_t *, uint8_t *, size_t,
+    size_t *);
 
 /** USB HID device communication interface. */
Index: uspace/lib/nic/Makefile
===================================================================
--- uspace/lib/nic/Makefile	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/nic/Makefile	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -30,4 +30,5 @@
 LIBRARY = libnic
 EXTRA_CFLAGS += -DLIBNIC_INTERNAL -Iinclude -I$(LIBDRV_PREFIX)/include
+LIBS = $(LIBDRV_PREFIX)/libdrv.a
 
 SOURCES = \
Index: uspace/lib/nic/src/nic_ev.c
===================================================================
--- uspace/lib/nic/src/nic_ev.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/nic/src/nic_ev.c	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -37,5 +37,5 @@
 
 #include <async.h>
-#include <device/nic.h>
+#include <nic_iface.h>
 #include <errno.h>
 #include "nic_ev.h"
Index: uspace/lib/usbhid/Makefile
===================================================================
--- uspace/lib/usbhid/Makefile	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ uspace/lib/usbhid/Makefile	(revision 66be0288c575096c5899a384ac8cd7949709bb0e)
@@ -37,5 +37,4 @@
 SOURCES = \
 	src/hiddescriptor.c \
-	src/hidiface.c \
 	src/hidparser.c \
 	src/hidpath.c \
Index: uspace/lib/usbhid/include/usb/hid/iface.h
===================================================================
--- uspace/lib/usbhid/include/usb/hid/iface.h	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
- * Copyright (c) 2011 Vojtech Horky
- * 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 libusbhid
- * @{
- */
-/** @file
- * Client functions for accessing USB HID interface.
- */
-#ifndef LIBUSBHID_CLASSES_HID_IFACE_H_
-#define LIBUSBHID_CLASSES_HID_IFACE_H_
-
-#include <sys/types.h>
-#include <async.h>
-
-extern int usbhid_dev_get_event_length(async_sess_t *, size_t *);
-extern int usbhid_dev_get_event(async_sess_t *, uint8_t *, size_t, size_t *,
-    int *, unsigned int);
-extern int usbhid_dev_get_report_descriptor_length(async_sess_t *, size_t *);
-extern int usbhid_dev_get_report_descriptor(async_sess_t *, uint8_t *, size_t,
-    size_t *);
-
-#endif
-/**
- * @}
- */
Index: uspace/lib/usbhid/src/hidiface.c
===================================================================
--- uspace/lib/usbhid/src/hidiface.c	(revision 61b5b73da4751fa87cc6b1c1d81fe4796bc905e1)
+++ 	(revision )
@@ -1,239 +1,0 @@
-/*
- * Copyright (c) 2011 Vojtech Horky
- * 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 libusbhid
- * @{
- */
-/** @file
- * Client functions for accessing USB HID interface (implementation).
- */
-
-#include <dev_iface.h>
-#include <usbhid_iface.h>
-#include <usb/hid/iface.h>
-#include <errno.h>
-#include <str_error.h>
-#include <async.h>
-#include <assert.h>
-
-/** Ask for event array length.
- *
- * @param dev_sess Session to DDF device providing USB HID interface.
- *
- * @return Number of usages returned or negative error code.
- *
- */
-int usbhid_dev_get_event_length(async_sess_t *dev_sess, size_t *size)
-{
-	if (!dev_sess)
-		return EINVAL;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	sysarg_t len;
-	int rc = async_req_1_1(exch, DEV_IFACE_ID(USBHID_DEV_IFACE),
-	    IPC_M_USBHID_GET_EVENT_LENGTH, &len);
-	
-	async_exchange_end(exch);
-	
-	if (rc == EOK) {
-		if (size != NULL)
-			*size = (size_t) len;
-	}
-	
-	return rc;
-}
-
-/** Request for next event from HID device.
- *
- * @param[in]  dev_sess    Session to DDF device providing USB HID interface.
- * @param[out] usage_pages Where to store usage pages.
- * @param[out] usages      Where to store usages (actual data).
- * @param[in]  usage_count Length of @p usage_pages and @p usages buffer
- *                         (in items, not bytes).
- * @param[out] actual_usage_count Number of usages actually returned by the
- *                                device driver.
- * @param[in] flags        Flags (see USBHID_IFACE_FLAG_*).
- *
- * @return Error code.
- *
- */
-int usbhid_dev_get_event(async_sess_t *dev_sess, uint8_t *buf,
-    size_t size, size_t *actual_size, int *event_nr, unsigned int flags)
-{
-	if (!dev_sess)
-		return EINVAL;
-	
-	if (buf == NULL)
-		return ENOMEM;
-	
-	if (size == 0)
-		return EINVAL;
-	
-	size_t buffer_size =  size;
-	uint8_t *buffer = malloc(buffer_size);
-	if (buffer == NULL)
-		return ENOMEM;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	ipc_call_t opening_request_call;
-	aid_t opening_request = async_send_2(exch,
-	    DEV_IFACE_ID(USBHID_DEV_IFACE), IPC_M_USBHID_GET_EVENT,
-	    flags, &opening_request_call);
-	
-	if (opening_request == 0) {
-		async_exchange_end(exch);
-		free(buffer);
-		return ENOMEM;
-	}
-	
-	ipc_call_t data_request_call;
-	aid_t data_request = async_data_read(exch, buffer, buffer_size,
-	    &data_request_call);
-	
-	async_exchange_end(exch);
-	
-	if (data_request == 0) {
-		async_forget(opening_request);
-		free(buffer);
-		return ENOMEM;
-	}
-	
-	sysarg_t data_request_rc;
-	sysarg_t opening_request_rc;
-	async_wait_for(data_request, &data_request_rc);
-	async_wait_for(opening_request, &opening_request_rc);
-	
-	if (data_request_rc != EOK) {
-		/* Prefer return code of the opening request. */
-		if (opening_request_rc != EOK)
-			return (int) opening_request_rc;
-		else
-			return (int) data_request_rc;
-	}
-	
-	if (opening_request_rc != EOK)
-		return (int) opening_request_rc;
-	
-	size_t act_size = IPC_GET_ARG2(data_request_call);
-	
-	/* Copy the individual items. */
-	memcpy(buf, buffer, act_size);
-	
-	if (actual_size != NULL)
-		*actual_size = act_size;
-	
-	if (event_nr != NULL)
-		*event_nr = IPC_GET_ARG1(opening_request_call);
-	
-	return EOK;
-}
-
-int usbhid_dev_get_report_descriptor_length(async_sess_t *dev_sess,
-    size_t *size)
-{
-	if (!dev_sess)
-		return EINVAL;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	sysarg_t arg_size;
-	int rc = async_req_1_1(exch, DEV_IFACE_ID(USBHID_DEV_IFACE),
-	    IPC_M_USBHID_GET_REPORT_DESCRIPTOR_LENGTH, &arg_size);
-	
-	async_exchange_end(exch);
-	
-	if (rc == EOK) {
-		if (size != NULL)
-			*size = (size_t) arg_size;
-	}
-	
-	return rc;
-}
-
-int usbhid_dev_get_report_descriptor(async_sess_t *dev_sess, uint8_t *buf,
-    size_t size, size_t *actual_size)
-{
-	if (!dev_sess)
-		return EINVAL;
-	
-	if (buf == NULL)
-		return ENOMEM;
-	
-	if (size == 0)
-		return EINVAL;
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	
-	aid_t opening_request = async_send_1(exch,
-	    DEV_IFACE_ID(USBHID_DEV_IFACE), IPC_M_USBHID_GET_REPORT_DESCRIPTOR,
-	    NULL);
-	if (opening_request == 0) {
-		async_exchange_end(exch);
-		return ENOMEM;
-	}
-	
-	ipc_call_t data_request_call;
-	aid_t data_request = async_data_read(exch, buf, size,
-	    &data_request_call);
-	
-	async_exchange_end(exch);
-	
-	if (data_request == 0) {
-		async_forget(opening_request);
-		return ENOMEM;
-	}
-	
-	sysarg_t data_request_rc;
-	sysarg_t opening_request_rc;
-	async_wait_for(data_request, &data_request_rc);
-	async_wait_for(opening_request, &opening_request_rc);
-	
-	if (data_request_rc != EOK) {
-		/* Prefer return code of the opening request. */
-		if (opening_request_rc != EOK)
-			return (int) opening_request_rc;
-		else
-			return (int) data_request_rc;
-	}
-	
-	if (opening_request_rc != EOK)
-		return (int) opening_request_rc;
-	
-	size_t act_size = IPC_GET_ARG2(data_request_call);
-	
-	if (actual_size != NULL)
-		*actual_size = act_size;
-	
-	return EOK;
-}
-
-/**
- * @}
- */
