Index: uspace/drv/bus/isa/isa.c
===================================================================
--- uspace/drv/bus/isa/isa.c	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/bus/isa/isa.c	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -401,5 +401,5 @@
 
 	val = skip_spaces(val);
-	irq = (int)strtol(val, &end, 10);
+	irq = (int) strtol(val, &end, 10);
 
 	if (val != end)
Index: uspace/drv/bus/isa/isa.dev
===================================================================
--- uspace/drv/bus/isa/isa.dev	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/bus/isa/isa.dev	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -14,5 +14,4 @@
 	irq 12
 	io_range 060 5
-	
 
 ne2k:
Index: uspace/drv/bus/isa/isa.ma
===================================================================
--- uspace/drv/bus/isa/isa.ma	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/bus/isa/isa.ma	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -1,1 +1,1 @@
-9 pci/ven=8086&dev=7000
+9 pci/class=06&subclass=01
Index: uspace/drv/bus/pci/pciintel/pci.c
===================================================================
--- uspace/drv/bus/pci/pciintel/pci.c	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/bus/pci/pciintel/pci.c	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -92,5 +92,5 @@
 static bool pciintel_enable_interrupt(ddf_fun_t *fnode)
 {
-	/* This is an old ugly way, copied from ne2000 driver */
+	/* This is an old ugly way */
 	assert(fnode);
 	pci_fun_t *dev_data = (pci_fun_t *) fnode->driver_data;
Index: uspace/drv/bus/usb/usbhid/mouse/mousedev.c
===================================================================
--- uspace/drv/bus/usb/usbhid/mouse/mousedev.c	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/bus/usb/usbhid/mouse/mousedev.c	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -167,5 +167,5 @@
 	return result;
 }
-/*----------------------------------------------------------------------------*/
+
 static bool usb_mouse_process_report(usb_hid_dev_t *hid_dev,
     usb_mouse_t *mouse_dev)
@@ -305,5 +305,5 @@
 	return EOK;
 }
-/*----------------------------------------------------------------------------*/
+
 /** Get highest index of a button mentioned in given report.
  *
Index: uspace/drv/char/i8042/buffer.h
===================================================================
--- uspace/drv/char/i8042/buffer.h	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/char/i8042/buffer.h	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -26,8 +26,10 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /**
  * @addtogroup kbd
  * @{
  */
+
 /** @file
  * @brief Cyclic buffer structure.
@@ -46,22 +48,26 @@
  * Attempt to insert byte into the full buffer will block until it can succeed.
  * Attempt to read from empty buffer will block until it can succeed.
+ *
  */
 typedef struct {
-	uint8_t *buffer;         /**< Storage space. */
-	uint8_t *buffer_end;     /**< End of storage place. */
-	fibril_mutex_t guard;    /**< Protects buffer structures. */
-	fibril_condvar_t change; /**< Indicates change (empty/full). */
-	uint8_t *read_head;      /**< Place of the next readable element. */
-	uint8_t *write_head;     /**< Pointer to the next writable place. */
+	uint8_t *buffer;          /**< Storage space. */
+	uint8_t *buffer_end;      /**< End of storage place. */
+	fibril_mutex_t guard;     /**< Protects buffer structures. */
+	fibril_condvar_t change;  /**< Indicates change (empty/full). */
+	uint8_t *read_head;       /**< Place of the next readable element. */
+	uint8_t *write_head;      /**< Pointer to the next writable place. */
 } buffer_t;
 
 /** Initialize cyclic buffer using provided memory space.
+ *
  * @param buffer Cyclic buffer structure to initialize.
- * @param data Memory space to use.
- * @param size Size of the memory place.
+ * @param data   Memory space to use.
+ * @param size   Size of the memory place.
+ *
  */
 static inline void buffer_init(buffer_t *buffer, uint8_t *data, size_t size)
 {
 	assert(buffer);
+	
 	fibril_mutex_initialize(&buffer->guard);
 	fibril_condvar_initialize(&buffer->change);
@@ -74,27 +80,29 @@
 
 /** Write byte to cyclic buffer.
+ *
  * @param buffer Cyclic buffer to write to.
- * @param data Data to write.
+ * @param data   Data to write.
+ *
  */
 static inline void buffer_write(buffer_t *buffer, uint8_t data)
 {
 	fibril_mutex_lock(&buffer->guard);
-
+	
 	/* Next position. */
 	uint8_t *new_head = buffer->write_head + 1;
 	if (new_head == buffer->buffer_end)
 		new_head = buffer->buffer;
-
+	
 	/* Buffer full. */
 	while (new_head == buffer->read_head)
 		fibril_condvar_wait(&buffer->change, &buffer->guard);
-
+	
 	/* Write data. */
 	*buffer->write_head = data;
-
+	
 	/* Buffer was empty. */
 	if (buffer->write_head == buffer->read_head)
 		fibril_condvar_broadcast(&buffer->change);
-
+	
 	/* Move head */
 	buffer->write_head = new_head;
@@ -103,22 +111,26 @@
 
 /** Read byte from cyclic buffer.
+ *
  * @param buffer Cyclic buffer to read from.
+ *
  * @return Byte read.
+ *
  */
 static inline uint8_t buffer_read(buffer_t *buffer)
 {
 	fibril_mutex_lock(&buffer->guard);
+	
 	/* Buffer is empty. */
 	while (buffer->write_head == buffer->read_head)
 		fibril_condvar_wait(&buffer->change, &buffer->guard);
-
+	
 	/* Next position. */
 	uint8_t *new_head = buffer->read_head + 1;
 	if (new_head == buffer->buffer_end)
 		new_head = buffer->buffer;
-
+	
 	/* Read data. */
 	const uint8_t data = *buffer->read_head;
-
+	
 	/* Buffer was full. */
 	uint8_t *new_write_head = buffer->write_head + 1;
@@ -127,12 +139,14 @@
 	if (new_write_head == buffer->read_head)
 		fibril_condvar_broadcast(&buffer->change);
-
+	
 	/* Move head */
 	buffer->read_head = new_head;
-
+	
 	fibril_mutex_unlock(&buffer->guard);
 	return data;
 }
+
 #endif
+
 /**
  * @}
Index: uspace/drv/char/i8042/i8042.c
===================================================================
--- uspace/drv/char/i8042/i8042.c	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/char/i8042/i8042.c	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -29,8 +29,10 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /** @addtogroup kbd_port
  * @ingroup kbd
  * @{
  */
+
 /** @file
  * @brief i8042 PS/2 port driver.
@@ -44,11 +46,55 @@
 #include <str_error.h>
 #include <inttypes.h>
-
 #include <ddf/log.h>
 #include <ddf/interrupt.h>
-
 #include "i8042.h"
 
-#define NAME       "i8042"
+/* Interesting bits for status register */
+#define i8042_OUTPUT_FULL  0x01
+#define i8042_INPUT_FULL   0x02
+#define i8042_AUX_DATA     0x20
+
+/* Command constants */
+#define i8042_CMD_WRITE_CMDB  0x60  /**< Write command byte */
+#define i8042_CMD_WRITE_AUX   0xd4  /**< Write aux device */
+
+/* Command byte fields */
+#define i8042_KBD_IE         0x01
+#define i8042_AUX_IE         0x02
+#define i8042_KBD_DISABLE    0x10
+#define i8042_AUX_DISABLE    0x20
+#define i8042_KBD_TRANSLATE  0x40  /* Use this to switch to XT scancodes */
+
+#define CHECK_RET_DESTROY(ret, msg...) \
+	do { \
+		if (ret != EOK) { \
+			ddf_msg(LVL_ERROR, msg); \
+			if (dev->kbd_fun) { \
+				dev->kbd_fun->driver_data = NULL; \
+				ddf_fun_destroy(dev->kbd_fun); \
+			} \
+			if (dev->aux_fun) { \
+				dev->aux_fun->driver_data = NULL; \
+				ddf_fun_destroy(dev->aux_fun); \
+			} \
+		} \
+	} while (0)
+
+#define CHECK_RET_UNBIND_DESTROY(ret, msg...) \
+	do { \
+		if (ret != EOK) { \
+			ddf_msg(LVL_ERROR, msg); \
+			if (dev->kbd_fun) { \
+				ddf_fun_unbind(dev->kbd_fun); \
+				dev->kbd_fun->driver_data = NULL; \
+				ddf_fun_destroy(dev->kbd_fun); \
+			} \
+			if (dev->aux_fun) { \
+				ddf_fun_unbind(dev->aux_fun); \
+				dev->aux_fun->driver_data = NULL; \
+				ddf_fun_destroy(dev->aux_fun); \
+			} \
+		} \
+	} while (0)
 
 void default_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *);
@@ -59,20 +105,4 @@
 };
 
-/* Interesting bits for status register */
-#define i8042_OUTPUT_FULL	0x01
-#define i8042_INPUT_FULL	0x02
-#define i8042_AUX_DATA		0x20
-
-/* Command constants */
-#define i8042_CMD_WRITE_CMDB	0x60	/**< write command byte */
-#define i8042_CMD_WRITE_AUX	0xd4	/**< write aux device */
-
-/* Command byte fields */
-#define i8042_KBD_IE		0x01
-#define i8042_AUX_IE		0x02
-#define i8042_KBD_DISABLE	0x10
-#define i8042_AUX_DISABLE	0x20
-#define i8042_KBD_TRANSLATE	0x40 /* Use this to switch to XT scancodes */
-
 static const irq_pio_range_t i8042_ranges[] = {
 	{
@@ -86,5 +116,5 @@
 	{
 		.cmd = CMD_PIO_READ_8,
-		.addr = NULL,	/* will be patched in run-time */
+		.addr = NULL,  /* will be patched in run-time */
 		.dstarg = 1
 	},
@@ -102,5 +132,5 @@
 	{
 		.cmd = CMD_PIO_READ_8,
-		.addr = NULL,	/* will be patched in run-time */
+		.addr = NULL,  /* will be patched in run-time */
 		.dstarg = 2
 	},
@@ -118,31 +148,40 @@
 
 /** Interrupt handler routine.
- * Writes new data to the corresponding buffer.
- * @param dev Device that caued the interrupt.
- * @param iid Call id.
+ *
+ * Write new data to the corresponding buffer.
+ *
+ * @param dev  Device that caued the interrupt.
+ * @param iid  Call id.
  * @param call pointerr to call data.
- */
-static void i8042_irq_handler(
-    ddf_dev_t *dev, ipc_callid_t iid, ipc_call_t *call)
-{
-	if (!dev || !dev->driver_data)
+ *
+ */
+static void i8042_irq_handler(ddf_dev_t *dev, ipc_callid_t iid,
+    ipc_call_t *call)
+{
+	if ((!dev) || (!dev->driver_data))
 		return;
+	
 	i8042_t *controller = dev->driver_data;
-
+	
 	const uint8_t status = IPC_GET_ARG1(*call);
 	const uint8_t data = IPC_GET_ARG2(*call);
+	
 	buffer_t *buffer = (status & i8042_AUX_DATA) ?
 	    &controller->aux_buffer : &controller->kbd_buffer;
+	
 	buffer_write(buffer, data);
 }
 
 /** Initialize i8042 driver structure.
- * @param dev Driver structure to initialize.
- * @param regs I/O address of registers.
- * @param reg_size size of the reserved I/O address space.
- * @param irq_kbd IRQ for primary port.
+ *
+ * @param dev       Driver structure to initialize.
+ * @param regs      I/O address of registers.
+ * @param reg_size  size of the reserved I/O address space.
+ * @param irq_kbd   IRQ for primary port.
  * @param irq_mouse IRQ for aux port.
- * @param ddf_dev DDF device structure of the device.
+ * @param ddf_dev   DDF device structure of the device.
+ *
  * @return Error code.
+ *
  */
 int i8042_init(i8042_t *dev, void *regs, size_t reg_size, int irq_kbd,
@@ -151,14 +190,15 @@
 	assert(ddf_dev);
 	assert(dev);
-
+	
 	if (reg_size < sizeof(i8042_regs_t))
 		return EINVAL;
-
-	if (pio_enable(regs, sizeof(i8042_regs_t), (void**)&dev->regs) != 0)
+	
+	if (pio_enable(regs, sizeof(i8042_regs_t), (void **) &dev->regs) != 0)
 		return -1;
-
+	
 	dev->kbd_fun = ddf_fun_create(ddf_dev, fun_inner, "ps2a");
 	if (!dev->kbd_fun)
 		return ENOMEM;
+	
 	int ret = ddf_fun_add_match_id(dev->kbd_fun, "char/xtkbd", 90);
 	if (ret != EOK) {
@@ -166,5 +206,5 @@
 		return ret;
 	}
-
+	
 	dev->aux_fun = ddf_fun_create(ddf_dev, fun_inner, "ps2b");
 	if (!dev->aux_fun) {
@@ -172,5 +212,5 @@
 		return ENOMEM;
 	}
-
+	
 	ret = ddf_fun_add_match_id(dev->aux_fun, "char/ps2mouse", 90);
 	if (ret != EOK) {
@@ -179,35 +219,22 @@
 		return ret;
 	}
-
+	
 	dev->kbd_fun->ops = &ops;
 	dev->aux_fun->ops = &ops;
 	dev->kbd_fun->driver_data = dev;
 	dev->aux_fun->driver_data = dev;
-
+	
 	buffer_init(&dev->kbd_buffer, dev->kbd_data, BUFFER_SIZE);
 	buffer_init(&dev->aux_buffer, dev->aux_data, BUFFER_SIZE);
 	fibril_mutex_initialize(&dev->write_guard);
-
-#define CHECK_RET_DESTROY(ret, msg...) \
-if  (ret != EOK) { \
-	ddf_msg(LVL_ERROR, msg); \
-	if (dev->kbd_fun) { \
-		dev->kbd_fun->driver_data = NULL; \
-		ddf_fun_destroy(dev->kbd_fun); \
-	} \
-	if (dev->aux_fun) { \
-		dev->aux_fun->driver_data = NULL; \
-		ddf_fun_destroy(dev->aux_fun); \
-	} \
-} else (void)0
-
+	
 	ret = ddf_fun_bind(dev->kbd_fun);
-	CHECK_RET_DESTROY(ret,
-	    "Failed to bind keyboard function: %s.", str_error(ret));
-
+	CHECK_RET_DESTROY(ret, "Failed to bind keyboard function: %s.",
+	    str_error(ret));
+	
 	ret = ddf_fun_bind(dev->aux_fun);
-	CHECK_RET_DESTROY(ret,
-	    "Failed to bind mouse function: %s.", str_error(ret));
-
+	CHECK_RET_DESTROY(ret, "Failed to bind mouse function: %s.",
+	    str_error(ret));
+	
 	/* Disable kbd and aux */
 	wait_ready(dev);
@@ -215,23 +242,8 @@
 	wait_ready(dev);
 	pio_write_8(&dev->regs->data, i8042_KBD_DISABLE | i8042_AUX_DISABLE);
-
+	
 	/* Flush all current IO */
 	while (pio_read_8(&dev->regs->status) & i8042_OUTPUT_FULL)
 		(void) pio_read_8(&dev->regs->data);
-
-#define CHECK_RET_UNBIND_DESTROY(ret, msg...) \
-if  (ret != EOK) { \
-	ddf_msg(LVL_ERROR, msg); \
-	if (dev->kbd_fun) { \
-		ddf_fun_unbind(dev->kbd_fun); \
-		dev->kbd_fun->driver_data = NULL; \
-		ddf_fun_destroy(dev->kbd_fun); \
-	} \
-	if (dev->aux_fun) { \
-		ddf_fun_unbind(dev->aux_fun); \
-		dev->aux_fun->driver_data = NULL; \
-		ddf_fun_destroy(dev->aux_fun); \
-	} \
-} else (void)0
 
 	const size_t range_count = sizeof(i8042_ranges) /
@@ -253,14 +265,15 @@
 		.cmds = cmds
 	};
+	
 	ret = register_interrupt_handler(ddf_dev, irq_kbd, i8042_irq_handler,
 	    &irq_code);
-	CHECK_RET_UNBIND_DESTROY(ret,
-	    "Failed set handler for kbd: %s.", str_error(ret));
-
+	CHECK_RET_UNBIND_DESTROY(ret, "Failed set handler for kbd: %s.",
+	    str_error(ret));
+	
 	ret = register_interrupt_handler(ddf_dev, irq_mouse, i8042_irq_handler,
 	    &irq_code);
-	CHECK_RET_UNBIND_DESTROY(ret,
-	    "Failed set handler for mouse: %s.", str_error(ret));
-
+	CHECK_RET_UNBIND_DESTROY(ret, "Failed set handler for mouse: %s.",
+	    str_error(ret));
+	
 	/* Enable interrupts */
 	async_sess_t *parent_sess =
@@ -269,10 +282,10 @@
 	ret = parent_sess ? EOK : ENOMEM;
 	CHECK_RET_UNBIND_DESTROY(ret, "Failed to create parent connection.");
-
+	
 	const bool enabled = hw_res_enable_interrupt(parent_sess);
 	async_hangup(parent_sess);
 	ret = enabled ? EOK : EIO;
 	CHECK_RET_UNBIND_DESTROY(ret, "Failed to enable interrupts: %s.");
-
+	
 	/* Enable port interrupts. */
 	wait_ready(dev);
@@ -281,9 +294,9 @@
 	pio_write_8(&dev->regs->data, i8042_KBD_IE | i8042_KBD_TRANSLATE |
 	    i8042_AUX_IE);
-
+	
 	return EOK;
 }
 
-// TODO use shared instead this
+// FIXME TODO use shared instead this
 enum {
 	IPC_CHAR_READ = DEV_FIRST_CUSTOM_METHOD,
@@ -292,8 +305,11 @@
 
 /** Write data to i8042 port.
- * @param fun DDF function.
+ *
+ * @param fun    DDF function.
  * @param buffer Data source.
- * @param size Data size.
+ * @param size   Data size.
+ *
  * @return Bytes written.
+ *
  */
 static int i8042_write(ddf_fun_t *fun, char *buffer, size_t size)
@@ -301,13 +317,19 @@
 	assert(fun);
 	assert(fun->driver_data);
+	
 	i8042_t *controller = fun->driver_data;
 	fibril_mutex_lock(&controller->write_guard);
+	
 	for (size_t i = 0; i < size; ++i) {
+		if (controller->aux_fun == fun) {
+			wait_ready(controller);
+			pio_write_8(&controller->regs->status,
+			    i8042_CMD_WRITE_AUX);
+		}
+		
 		wait_ready(controller);
-		if (controller->aux_fun == fun)
-			pio_write_8(
-			    &controller->regs->status, i8042_CMD_WRITE_AUX);
 		pio_write_8(&controller->regs->data, buffer[i]);
 	}
+	
 	fibril_mutex_unlock(&controller->write_guard);
 	return size;
@@ -315,8 +337,11 @@
 
 /** Read data from i8042 port.
- * @param fun DDF function.
+ *
+ * @param fun    DDF function.
  * @param buffer Data place.
- * @param size Data place size.
+ * @param size   Data place size.
+ *
  * @return Bytes read.
+ *
  */
 static int i8042_read(ddf_fun_t *fun, char *data, size_t size)
@@ -324,18 +349,21 @@
 	assert(fun);
 	assert(fun->driver_data);
-
+	
 	i8042_t *controller = fun->driver_data;
 	buffer_t *buffer = (fun == controller->aux_fun) ?
 	    &controller->aux_buffer : &controller->kbd_buffer;
-	for (size_t i = 0; i < size; ++i) {
+	
+	for (size_t i = 0; i < size; ++i)
 		*data++ = buffer_read(buffer);
-	}
+	
 	return size;
 }
 
 /** Handle data requests.
- * @param fun ddf_fun_t function.
- * @param id callid
+ *
+ * @param fun  ddf_fun_t function.
+ * @param id   callid
  * @param call IPC request.
+ *
  */
 void default_handler(ddf_fun_t *fun, ipc_callid_t id, ipc_call_t *call)
@@ -343,31 +371,35 @@
 	const sysarg_t method = IPC_GET_IMETHOD(*call);
 	const size_t size = IPC_GET_ARG1(*call);
+	
 	switch (method) {
 	case IPC_CHAR_READ:
 		if (size <= 4 * sizeof(sysarg_t)) {
 			sysarg_t message[4] = {};
-			i8042_read(fun, (char*)message, size);
+			
+			i8042_read(fun, (char *) message, size);
 			async_answer_4(id, size, message[0], message[1],
 			    message[2], message[3]);
-		} else {
+		} else
 			async_answer_0(id, ELIMIT);
-		}
 		break;
-
+	
 	case IPC_CHAR_WRITE:
 		if (size <= 3 * sizeof(sysarg_t)) {
 			const sysarg_t message[3] = {
-				IPC_GET_ARG2(*call), IPC_GET_ARG3(*call),
-				IPC_GET_ARG4(*call) };
-			i8042_write(fun, (char*)message, size);
+				IPC_GET_ARG2(*call),
+				IPC_GET_ARG3(*call),
+				IPC_GET_ARG4(*call)
+			};
+			
+			i8042_write(fun, (char *) message, size);
 			async_answer_0(id, size);
-		} else {
+		} else
 			async_answer_0(id, ELIMIT);
-		}
-
+	
 	default:
 		async_answer_0(id, EINVAL);
 	}
 }
+
 /**
  * @}
Index: uspace/drv/char/i8042/i8042.h
===================================================================
--- uspace/drv/char/i8042/i8042.h	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/char/i8042/i8042.h	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -27,8 +27,10 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /** @addtogroup kbd_port
  * @ingroup  kbd
  * @{
  */
+
 /** @file
  * @brief i8042 port driver.
@@ -41,8 +43,9 @@
 #include <fibril_synch.h>
 #include <ddf/driver.h>
-
 #include "buffer.h"
 
-#define BUFFER_SIZE 12
+#define NAME  "i8042"
+
+#define BUFFER_SIZE  12
 
 /** i8042 HW I/O interface */
@@ -55,9 +58,9 @@
 /** i8042 driver structure. */
 typedef struct i8042 {
-	i8042_regs_t *regs;    /**< I/O registers. */
-	ddf_fun_t *kbd_fun;    /**< Pirmary port device function. */
-	ddf_fun_t *aux_fun;  /**< Auxiliary port device function. */
-	buffer_t kbd_buffer;   /**< Primary port buffer. */
-	buffer_t aux_buffer;   /**< Aux. port buffer. */
+	i8042_regs_t *regs;             /**< I/O registers. */
+	ddf_fun_t *kbd_fun;             /**< Pirmary port device function. */
+	ddf_fun_t *aux_fun;             /**< Auxiliary port device function. */
+	buffer_t kbd_buffer;            /**< Primary port buffer. */
+	buffer_t aux_buffer;            /**< Aux. port buffer. */
 	uint8_t aux_data[BUFFER_SIZE];  /**< Primary port buffer space. */
 	uint8_t kbd_data[BUFFER_SIZE];  /**< Aux. port buffer space. */
@@ -66,5 +69,7 @@
 
 int i8042_init(i8042_t *, void *, size_t, int, int, ddf_dev_t *);
+
 #endif
+
 /**
  * @}
Index: uspace/drv/char/i8042/main.c
===================================================================
--- uspace/drv/char/i8042/main.c	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/char/i8042/main.c	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -26,7 +26,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /** @addtogroup drvi8042
  * @{
  */
+
 /** @file
  * @brief i8042 driver DDF bits.
@@ -41,12 +43,100 @@
 #include <ddf/log.h>
 #include <stdio.h>
-
 #include "i8042.h"
 
-#define NAME "i8042"
+#define CHECK_RET_RETURN(ret, message...) \
+	do { \
+		if (ret != EOK) { \
+			ddf_msg(LVL_ERROR, message); \
+			return ret; \
+		} \
+	} while (0)
 
-static int get_my_registers(const ddf_dev_t *dev,
-    uintptr_t *io_reg_address, size_t *io_reg_size, int *kbd, int *mouse);
-static int i8042_dev_add(ddf_dev_t *device);
+/** Get address of I/O registers.
+ *
+ * @param[in]  dev            Device asking for the addresses.
+ * @param[out] io_reg_address Base address of the memory range.
+ * @param[out] io_reg_size    Size of the memory range.
+ * @param[out] kbd_irq        Primary port IRQ.
+ * @param[out] mouse_irq      Auxiliary port IRQ.
+ *
+ * @return Error code.
+ *
+ */
+static int get_my_registers(const ddf_dev_t *dev, uintptr_t *io_reg_address,
+    size_t *io_reg_size, int *kbd_irq, int *mouse_irq)
+{
+	assert(dev);
+	
+	async_sess_t *parent_sess =
+	    devman_parent_device_connect(EXCHANGE_SERIALIZE, dev->handle,
+	    IPC_FLAG_BLOCKING);
+	if (!parent_sess)
+		return ENOMEM;
+	
+	hw_res_list_parsed_t hw_resources;
+	hw_res_list_parsed_init(&hw_resources);
+	const int ret = hw_res_get_list_parsed(parent_sess, &hw_resources, 0);
+	async_hangup(parent_sess);
+	if (ret != EOK)
+		return ret;
+	
+	if ((hw_resources.irqs.count != 2) ||
+	    (hw_resources.io_ranges.count != 1)) {
+		hw_res_list_parsed_clean(&hw_resources);
+		return EINVAL;
+	}
+	
+	if (io_reg_address)
+		*io_reg_address = hw_resources.io_ranges.ranges[0].address;
+	
+	if (io_reg_size)
+		*io_reg_size = hw_resources.io_ranges.ranges[0].size;
+	
+	if (kbd_irq)
+		*kbd_irq = hw_resources.irqs.irqs[0];
+	
+	if (mouse_irq)
+		*mouse_irq = hw_resources.irqs.irqs[1];
+	
+	hw_res_list_parsed_clean(&hw_resources);
+	return EOK;
+}
+
+/** Initialize a new ddf driver instance of i8042 driver
+ *
+ * @param[in] device DDF instance of the device to initialize.
+ *
+ * @return Error code.
+ *
+ */
+static int i8042_dev_add(ddf_dev_t *device)
+{
+	if (!device)
+		return EINVAL;
+	
+	uintptr_t io_regs = 0;
+	size_t io_size = 0;
+	int kbd = 0;
+	int mouse = 0;
+	
+	int ret = get_my_registers(device, &io_regs, &io_size, &kbd, &mouse);
+	CHECK_RET_RETURN(ret, "Failed to get registers: %s.",
+	    str_error(ret));
+	ddf_msg(LVL_DEBUG, "I/O regs at %p (size %zuB), IRQ kbd %d, IRQ mouse %d.",
+	    (void *) io_regs, io_size, kbd, mouse);
+	
+	i8042_t *i8042 = ddf_dev_data_alloc(device, sizeof(i8042_t));
+	ret = (i8042 == NULL) ? ENOMEM : EOK;
+	CHECK_RET_RETURN(ret, "Failed to allocate i8042 driver instance.");
+	
+	ret = i8042_init(i8042, (void *) io_regs, io_size, kbd, mouse, device);
+	CHECK_RET_RETURN(ret, "Failed to initialize i8042 driver: %s.",
+	    str_error(ret));
+	
+	ddf_msg(LVL_NOTE, "Controlling '%s' (%" PRIun ").",
+	    device->name, device->handle);
+	return EOK;
+}
 
 /** DDF driver operations. */
@@ -61,107 +151,11 @@
 };
 
-/** Initialize global driver structures (NONE).
- *
- * @param[in] argc Nmber of arguments in argv vector (ignored).
- * @param[in] argv Cmdline argument vector (ignored).
- * @return Error code.
- *
- * Driver debug level is set here.
- */
 int main(int argc, char *argv[])
 {
-	printf(NAME ": HelenOS ps/2 driver.\n");
+	printf("%s: HelenOS PS/2 driver.\n", NAME);
 	ddf_log_init(NAME, LVL_NOTE);
 	return ddf_driver_main(&i8042_driver);
 }
 
-/** Initialize a new ddf driver instance of i8042 driver
- *
- * @param[in] device DDF instance of the device to initialize.
- * @return Error code.
- */
-static int i8042_dev_add(ddf_dev_t *device)
-{
-	if (!device)
-		return EINVAL;
-
-#define CHECK_RET_RETURN(ret, message...) \
-if (ret != EOK) { \
-	ddf_msg(LVL_ERROR, message); \
-	return ret; \
-} else (void)0
-
-	uintptr_t io_regs = 0;
-	size_t io_size = 0;
-	int kbd = 0, mouse = 0;
-
-	int ret = get_my_registers(device, &io_regs, &io_size, &kbd, &mouse);
-	CHECK_RET_RETURN(ret,
-	    "Failed to get registers: %s.", str_error(ret));
-	ddf_msg(LVL_DEBUG,
-	    "I/O regs at %p (size %zuB), IRQ kbd %d, IRQ mouse %d.",
-	    (void *) io_regs, io_size, kbd, mouse);
-
-	i8042_t *i8042 = ddf_dev_data_alloc(device, sizeof(i8042_t));
-	ret = (i8042 == NULL) ? ENOMEM : EOK;
-	CHECK_RET_RETURN(ret, "Failed to allocate i8042 driver instance.");
-
-	ret = i8042_init(i8042, (void*)io_regs, io_size, kbd, mouse, device);
-	CHECK_RET_RETURN(ret,
-	    "Failed to initialize i8042 driver: %s.", str_error(ret));
-
-	ddf_msg(LVL_NOTE, "Controlling '%s' (%" PRIun ").",
-	    device->name, device->handle);
-	return EOK;
-}
-
-/** Get address of I/O registers.
- *
- * @param[in] dev Device asking for the addresses.
- * @param[out] io_reg_address Base address of the memory range.
- * @param[out] io_reg_size Size of the memory range.
- * @param[out] kbd_irq Primary port IRQ.
- * @param[out] mouse_irq Auxiliary port IRQ.
- * @return Error code.
- */
-int get_my_registers(const ddf_dev_t *dev, uintptr_t *io_reg_address,
-    size_t *io_reg_size, int *kbd_irq, int *mouse_irq)
-{
-	assert(dev);
-
-	async_sess_t *parent_sess =
-	    devman_parent_device_connect(EXCHANGE_SERIALIZE, dev->handle,
-	    IPC_FLAG_BLOCKING);
-	if (!parent_sess)
-		return ENOMEM;
-
-	hw_res_list_parsed_t hw_resources;
-	hw_res_list_parsed_init(&hw_resources);
-	const int ret = hw_res_get_list_parsed(parent_sess, &hw_resources, 0);
-	async_hangup(parent_sess);
-	if (ret != EOK) {
-		return ret;
-	}
-
-	if (hw_resources.irqs.count != 2 || hw_resources.io_ranges.count != 1) {
-		hw_res_list_parsed_clean(&hw_resources);
-		return EINVAL;
-	}
-
-	if (io_reg_address)
-		*io_reg_address = hw_resources.io_ranges.ranges[0].address;
-
-	if (io_reg_size)
-		*io_reg_size = hw_resources.io_ranges.ranges[0].size;
-
-	if (kbd_irq)
-		*kbd_irq = hw_resources.irqs.irqs[0];
-
-	if (mouse_irq)
-		*mouse_irq = hw_resources.irqs.irqs[1];
-
-	hw_res_list_parsed_clean(&hw_resources);
-	return EOK;
-}
 /**
  * @}
Index: uspace/drv/char/ps2mouse/ps2mouse.c
===================================================================
--- uspace/drv/char/ps2mouse/ps2mouse.c	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/char/ps2mouse/ps2mouse.c	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -116,5 +116,5 @@
 	assert(mouse);
 	assert(dev);
-	mouse->input_sess = NULL;
+	mouse->client_sess = NULL;
 	mouse->parent_sess = devman_parent_device_connect(EXCHANGE_SERIALIZE,
 	    dev->handle, IPC_FLAG_BLOCKING);
@@ -218,8 +218,8 @@
 
 		async_exch_t *exch =
-		    async_exchange_begin(mouse->input_sess);
+		    async_exchange_begin(mouse->client_sess);
 		if (!exch) {
 			ddf_msg(LVL_ERROR,
-			    "Failed to create input exchange.");
+			    "Failed creating exchange.");
 			continue;
 		}
@@ -277,8 +277,8 @@
 
 		async_exch_t *exch =
-		    async_exchange_begin(mouse->input_sess);
+		    async_exchange_begin(mouse->client_sess);
 		if (!exch) {
 			ddf_msg(LVL_ERROR,
-			    "Failed to create input exchange.");
+			    "Failed creating exchange.");
 			continue;
 		}
@@ -386,14 +386,14 @@
 		if (sess == NULL) {
 			ddf_msg(LVL_WARN,
-			    "Failed to create start input session");
+			    "Failed creating client callback session");
 			async_answer_0(icallid, EAGAIN);
 			break;
 		}
-		if (mouse->input_sess == NULL) {
-			mouse->input_sess = sess;
-			ddf_msg(LVL_DEBUG, "Set input session");
+		if (mouse->client_sess == NULL) {
+			mouse->client_sess = sess;
+			ddf_msg(LVL_DEBUG, "Set client session");
 			async_answer_0(icallid, EOK);
 		} else {
-			ddf_msg(LVL_ERROR, "Input session already set");
+			ddf_msg(LVL_ERROR, "Client session already set");
 			async_answer_0(icallid, ELIMIT);
 		}
Index: uspace/drv/char/ps2mouse/ps2mouse.h
===================================================================
--- uspace/drv/char/ps2mouse/ps2mouse.h	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/char/ps2mouse/ps2mouse.h	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -43,5 +43,5 @@
 	ddf_fun_t *mouse_fun;      /**< Mouse function. */
 	async_sess_t *parent_sess; /**< Connection to device providing data. */
-	async_sess_t *input_sess;  /**< Callback connection to consumer. */
+	async_sess_t *client_sess;  /**< Callback connection to client. */
 	fid_t polling_fibril;      /**< Fibril retrieving an parsing data. */
 } ps2_mouse_t;
Index: uspace/drv/char/xtkbd/xtkbd.c
===================================================================
--- uspace/drv/char/xtkbd/xtkbd.c	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/char/xtkbd/xtkbd.c	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -206,5 +206,5 @@
 	assert(kbd);
 	assert(dev);
-	kbd->input_sess = NULL;
+	kbd->client_sess = NULL;
 	kbd->parent_sess = devman_parent_device_connect(EXCHANGE_SERIALIZE,
 	    dev->handle, IPC_FLAG_BLOCKING);
@@ -296,8 +296,8 @@
 		if (key != 0) {
 			async_exch_t *exch =
-			    async_exchange_begin(kbd->input_sess);
+			    async_exchange_begin(kbd->client_sess);
 			if (!exch) {
 				ddf_msg(LVL_ERROR,
-				    "Failed to create input exchange.");
+				    "Failed creating exchange.");
 				continue;
 			}
@@ -352,14 +352,14 @@
 		if (sess == NULL) {
 			ddf_msg(LVL_WARN,
-			    "Failed to create start input session");
+			    "Failed creating callback session");
 			async_answer_0(icallid, EAGAIN);
 			break;
 		}
-		if (kbd->input_sess == NULL) {
-			kbd->input_sess = sess;
-			ddf_msg(LVL_DEBUG, "Set input session");
+		if (kbd->client_sess == NULL) {
+			kbd->client_sess = sess;
+			ddf_msg(LVL_DEBUG, "Set client session");
 			async_answer_0(icallid, EOK);
 		} else {
-			ddf_msg(LVL_ERROR, "Input session already set");
+			ddf_msg(LVL_ERROR, "Client session already set");
 			async_answer_0(icallid, ELIMIT);
 		}
Index: uspace/drv/char/xtkbd/xtkbd.h
===================================================================
--- uspace/drv/char/xtkbd/xtkbd.h	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/char/xtkbd/xtkbd.h	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -43,5 +43,5 @@
 	ddf_fun_t *kbd_fun;        /**< Keyboard function. */
 	async_sess_t *parent_sess; /**< Connection to device providing data. */
-	async_sess_t *input_sess;  /**< Callback connection to consumer. */
+	async_sess_t *client_sess; /**< Callback connection to client. */
 	fid_t polling_fibril;      /**< Fibril retrieving an parsing data. */
 } xt_kbd_t;
Index: uspace/drv/nic/e1k/e1k.c
===================================================================
--- uspace/drv/nic/e1k/e1k.c	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/nic/e1k/e1k.c	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -52,7 +52,4 @@
 #include <nil_remote.h>
 #include <ops/nic.h>
-#include <packet_client.h>
-#include <packet_remote.h>
-#include <net/packet_header.h>
 #include "e1k.h"
 
@@ -62,13 +59,13 @@
 
 /* Must be power of 8 */
-#define E1000_RX_PACKETS_COUNT  128
-#define E1000_TX_PACKETS_COUNT  128
+#define E1000_RX_FRAME_COUNT  128
+#define E1000_TX_FRAME_COUNT  128
 
 #define E1000_RECEIVE_ADDRESS  16
 
-/** Maximum sending packet size */
+/** Maximum sending frame size */
 #define E1000_MAX_SEND_FRAME_SIZE  2048
-/** Maximum receiving packet size */
-#define E1000_MAX_RECEIVE_PACKET_SIZE  2048
+/** Maximum receiving frame size */
+#define E1000_MAX_RECEIVE_FRAME_SIZE  2048
 
 /** nic_driver_data_t* -> e1000_t* cast */
@@ -137,11 +134,13 @@
 	void *rx_ring_virt;
 	
-	/** Packets in rx ring  */
-	packet_t **rx_ring_packets;
+	/** Ring of RX frames, physical address */
+	void **rx_frame_phys;
+	/** Ring of RX frames, virtual address */
+	void **rx_frame_virt;
 	
 	/** VLAN tag */
 	uint16_t vlan_tag;
 	
-	/** Add VLAN tag to packet */
+	/** Add VLAN tag to frame */
 	bool vlan_tag_add;
 	
@@ -488,5 +487,5 @@
 }
 
-/** Get state of acceptance of weird packets
+/** Get state of acceptance of weird frames
  *
  * @param      device Device to check
@@ -506,5 +505,5 @@
 };
 
-/** Set acceptance of weird packets
+/** Set acceptance of weird frames
  *
  * @param device Device to update
@@ -690,5 +689,5 @@
 }
 
-/** Disable receiving packets for default address
+/** Disable receiving frames for default address
  *
  * @param e1000 E1000 data structure
@@ -702,5 +701,5 @@
 }
 
-/** Enable receiving packets for default address
+/** Enable receiving frames for default address
  *
  * @param e1000 E1000 data structure
@@ -762,5 +761,5 @@
 }
 
-/** Enable accepting of broadcast packets
+/** Enable accepting of broadcast frames
  *
  * @param e1000 E1000 data structure
@@ -774,5 +773,5 @@
 }
 
-/** Disable accepting of broadcast packets
+/** Disable accepting of broadcast frames
  *
  * @param e1000 E1000 data structure
@@ -810,5 +809,5 @@
 }
 
-/** Set multicast packets acceptance mode
+/** Set multicast frames acceptance mode
  *
  * @param nic      NIC device to update
@@ -864,5 +863,5 @@
 }
 
-/** Set unicast packets acceptance mode
+/** Set unicast frames acceptance mode
  *
  * @param nic      NIC device to update
@@ -922,5 +921,5 @@
 }
 
-/** Set broadcast packets acceptance mode
+/** Set broadcast frames acceptance mode
  *
  * @param nic  NIC device to update
@@ -1007,5 +1006,5 @@
 	if (vlan_mask) {
 		/*
-		 * Disable receiving, so that packet matching
+		 * Disable receiving, so that frame matching
 		 * partially written VLAN is not received.
 		 */
@@ -1074,7 +1073,7 @@
 }
 
-/** Fill receive descriptor with new empty packet
- *
- * Store packet in e1000->rx_ring_packets
+/** Fill receive descriptor with new empty buffer
+ *
+ * Store frame in e1000->rx_frame_phys
  *
  * @param nic    NIC data stricture
@@ -1085,22 +1084,9 @@
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	packet_t *packet =
-	    nic_alloc_packet(nic, E1000_MAX_RECEIVE_PACKET_SIZE);
-	
-	assert(packet);
-	
-	*(e1000->rx_ring_packets + offset) = packet;
+	
 	e1000_rx_descriptor_t *rx_descriptor = (e1000_rx_descriptor_t *)
 	    (e1000->rx_ring_virt + offset * sizeof(e1000_rx_descriptor_t));
 	
-	void *phys;
-	int rc =
-	    nic_dma_lock_packet(packet, E1000_MAX_RECEIVE_PACKET_SIZE, &phys);
-	
-	if (rc == EOK)
-		rx_descriptor->phys_addr = PTR_TO_U64(phys + packet->data_start);
-	else
-		rx_descriptor->phys_addr = 0;
-	
+	rx_descriptor->phys_addr = PTR_TO_U64(e1000->rx_frame_phys[offset]);
 	rx_descriptor->length = 0;
 	rx_descriptor->checksum = 0;
@@ -1166,10 +1152,10 @@
 }
 
-/** Receive packets
+/** Receive frames
  *
  * @param nic NIC data
  *
  */
-static void e1000_receive_packets(nic_t *nic)
+static void e1000_receive_frames(nic_t *nic)
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
@@ -1178,5 +1164,5 @@
 	
 	uint32_t *tail_addr = E1000_REG_ADDR(e1000, E1000_RDT);
-	uint32_t next_tail = e1000_inc_tail(*tail_addr, E1000_RX_PACKETS_COUNT);
+	uint32_t next_tail = e1000_inc_tail(*tail_addr, E1000_RX_FRAME_COUNT);
 	
 	e1000_rx_descriptor_t *rx_descriptor = (e1000_rx_descriptor_t *)
@@ -1184,16 +1170,18 @@
 	
 	while (rx_descriptor->status & 0x01) {
-		uint32_t packet_size = rx_descriptor->length - E1000_CRC_SIZE;
+		uint32_t frame_size = rx_descriptor->length - E1000_CRC_SIZE;
 		
-		packet_t *packet = *(e1000->rx_ring_packets + next_tail);
-		packet_suffix(packet, packet_size);
-		
-		nic_dma_unlock_packet(packet, E1000_MAX_RECEIVE_PACKET_SIZE);
-		nic_received_packet(nic, packet);
+		nic_frame_t *frame = nic_alloc_frame(nic, frame_size);
+		if (frame != NULL) {
+			memcpy(frame->data, e1000->rx_frame_virt[next_tail], frame_size);
+			nic_received_frame(nic, frame);
+		} else {
+			ddf_msg(LVL_ERROR, "Memory allocation failed. Frame dropped.");
+		}
 		
 		e1000_fill_new_rx_descriptor(nic, next_tail);
 		
-		*tail_addr = e1000_inc_tail(*tail_addr, E1000_RX_PACKETS_COUNT);
-		next_tail = e1000_inc_tail(*tail_addr, E1000_RX_PACKETS_COUNT);
+		*tail_addr = e1000_inc_tail(*tail_addr, E1000_RX_FRAME_COUNT);
+		next_tail = e1000_inc_tail(*tail_addr, E1000_RX_FRAME_COUNT);
 		
 		rx_descriptor = (e1000_rx_descriptor_t *)
@@ -1236,5 +1224,5 @@
 {
 	if (icr & ICR_RXT0)
-		e1000_receive_packets(nic);
+		e1000_receive_frames(nic);
 }
 
@@ -1286,5 +1274,5 @@
 }
 
-/** Force receiving all packets in the receive buffer
+/** Force receiving all frames in the receive buffer
  *
  * @param nic NIC data
@@ -1359,9 +1347,9 @@
 static void e1000_initialize_rx_registers(e1000_t *e1000)
 {
-	E1000_REG_WRITE(e1000, E1000_RDLEN, E1000_RX_PACKETS_COUNT * 16);
+	E1000_REG_WRITE(e1000, E1000_RDLEN, E1000_RX_FRAME_COUNT * 16);
 	E1000_REG_WRITE(e1000, E1000_RDH, 0);
 	
 	/* It is not posible to let HW use all descriptors */
-	E1000_REG_WRITE(e1000, E1000_RDT, E1000_RX_PACKETS_COUNT - 1);
+	E1000_REG_WRITE(e1000, E1000_RDT, E1000_RX_FRAME_COUNT - 1);
 	
 	/* Set Broadcast Enable Bit */
@@ -1383,5 +1371,5 @@
 	
 	int rc = dmamem_map_anonymous(
-	    E1000_RX_PACKETS_COUNT * sizeof(e1000_rx_descriptor_t),
+	    E1000_RX_FRAME_COUNT * sizeof(e1000_rx_descriptor_t),
 	    AS_AREA_READ | AS_AREA_WRITE, 0, &e1000->rx_ring_phys,
 	    &e1000->rx_ring_virt);
@@ -1394,52 +1382,92 @@
 	    (uint32_t) PTR_TO_U64(e1000->rx_ring_phys));
 	
-	e1000->rx_ring_packets =
-	    malloc(E1000_RX_PACKETS_COUNT * sizeof(packet_t *));
-	// FIXME: Check return value
-	
+	e1000->rx_frame_phys =
+	    calloc(E1000_RX_FRAME_COUNT, sizeof(void *));
+	e1000->rx_frame_virt =
+	    calloc(E1000_RX_FRAME_COUNT, sizeof(void *));
+	if (e1000->rx_frame_phys == NULL || e1000->rx_frame_virt == NULL) {
+		rc = ENOMEM;
+		goto error;
+	}
+	
+	size_t i;
+	void *frame_virt;
+	void *frame_phys;
+	
+	for (i = 0; i < E1000_RX_FRAME_COUNT; i++) {
+		rc = dmamem_map_anonymous(
+		    E1000_MAX_SEND_FRAME_SIZE, AS_AREA_READ | AS_AREA_WRITE,
+		    0, &frame_phys, &frame_virt);
+		if (rc != EOK)
+			goto error;
+		
+		e1000->rx_frame_virt[i] = frame_virt;
+		e1000->rx_frame_phys[i] = frame_phys;
+	}
+	
+	/* Write descriptor */
+	for (i = 0; i < E1000_RX_FRAME_COUNT; i++)
+		e1000_fill_new_rx_descriptor(nic, i);
+	
+	e1000_initialize_rx_registers(e1000);
+	
+	fibril_mutex_unlock(&e1000->rx_lock);
+	return EOK;
+	
+error:
+	for (i = 0; i < E1000_RX_FRAME_COUNT; i++) {
+		if (e1000->rx_frame_virt[i] != NULL) {
+			dmamem_unmap_anonymous(e1000->rx_frame_virt[i]);
+			e1000->rx_frame_virt[i] = NULL;
+			e1000->rx_frame_phys[i] = NULL;
+		}
+	}
+	
+	if (e1000->rx_frame_phys != NULL) {
+		free(e1000->rx_frame_phys);
+		e1000->rx_frame_phys = NULL;
+	}
+	
+	if (e1000->rx_frame_virt != NULL) {
+		free(e1000->rx_frame_virt);
+		e1000->rx_frame_phys = NULL;
+	}
+	
+	return rc;
+}
+
+/** Uninitialize receive structure
+ *
+ * @param nic NIC data
+ *
+ */
+static void e1000_uninitialize_rx_structure(nic_t *nic)
+{
+	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
+	
+	/* Write descriptor */
+	for (unsigned int offset = 0; offset < E1000_RX_FRAME_COUNT; offset++) {
+		dmamem_unmap_anonymous(e1000->rx_frame_virt[offset]);
+		e1000->rx_frame_virt[offset] = NULL;
+		e1000->rx_frame_phys[offset] = NULL;
+	}
+	
+	free(e1000->rx_frame_virt);
+	free(e1000->rx_frame_phys);
+	e1000->rx_frame_virt = NULL;
+	e1000->rx_frame_phys = NULL;
+	dmamem_unmap_anonymous(e1000->rx_ring_virt);
+}
+
+/** Clear receive descriptor ring
+ *
+ * @param e1000 E1000 data
+ *
+ */
+static void e1000_clear_rx_ring(e1000_t *e1000)
+{
 	/* Write descriptor */
 	for (unsigned int offset = 0;
-	    offset < E1000_RX_PACKETS_COUNT;
-	    offset++)
-		e1000_fill_new_rx_descriptor(nic, offset);
-	
-	e1000_initialize_rx_registers(e1000);
-	
-	fibril_mutex_unlock(&e1000->rx_lock);
-	return EOK;
-}
-
-/** Uninitialize receive structure
- *
- * @param nic NIC data
- *
- */
-static void e1000_uninitialize_rx_structure(nic_t *nic)
-{
-	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	
-	/* Write descriptor */
-	for (unsigned int offset = 0;
-	    offset < E1000_RX_PACKETS_COUNT;
-	    offset++) {
-		packet_t *packet = *(e1000->rx_ring_packets + offset);
-		nic_dma_unlock_packet(packet, E1000_MAX_RECEIVE_PACKET_SIZE);
-		nic_release_packet(nic, packet);
-	}
-	
-	free(e1000->rx_ring_packets);
-	dmamem_unmap_anonymous(e1000->rx_ring_virt);
-}
-
-/** Clear receive descriptor ring
- *
- * @param e1000 E1000 data
- *
- */
-static void e1000_clear_rx_ring(e1000_t *e1000)
-{
-	/* Write descriptor */
-	for (unsigned int offset = 0;
-	    offset < E1000_RX_PACKETS_COUNT;
+	    offset < E1000_RX_FRAME_COUNT;
 	    offset++)
 		e1000_clear_rx_descriptor(e1000, offset);
@@ -1510,5 +1538,5 @@
 static void e1000_initialize_tx_registers(e1000_t *e1000)
 {
-	E1000_REG_WRITE(e1000, E1000_TDLEN, E1000_TX_PACKETS_COUNT * 16);
+	E1000_REG_WRITE(e1000, E1000_TDLEN, E1000_TX_FRAME_COUNT * 16);
 	E1000_REG_WRITE(e1000, E1000_TDH, 0);
 	E1000_REG_WRITE(e1000, E1000_TDT, 0);
@@ -1542,5 +1570,5 @@
 	
 	int rc = dmamem_map_anonymous(
-	    E1000_TX_PACKETS_COUNT * sizeof(e1000_tx_descriptor_t),
+	    E1000_TX_FRAME_COUNT * sizeof(e1000_tx_descriptor_t),
 	    AS_AREA_READ | AS_AREA_WRITE, 0, &e1000->tx_ring_phys,
 	    &e1000->tx_ring_virt);
@@ -1549,8 +1577,8 @@
 	
 	bzero(e1000->tx_ring_virt,
-	    E1000_TX_PACKETS_COUNT * sizeof(e1000_tx_descriptor_t));
-	
-	e1000->tx_frame_phys = calloc(E1000_TX_PACKETS_COUNT, sizeof(void *));
-	e1000->tx_frame_virt = calloc(E1000_TX_PACKETS_COUNT, sizeof(void *));
+	    E1000_TX_FRAME_COUNT * sizeof(e1000_tx_descriptor_t));
+	
+	e1000->tx_frame_phys = calloc(E1000_TX_FRAME_COUNT, sizeof(void *));
+	e1000->tx_frame_virt = calloc(E1000_TX_FRAME_COUNT, sizeof(void *));
 
 	if (e1000->tx_frame_phys == NULL || e1000->tx_frame_virt == NULL) {
@@ -1559,5 +1587,5 @@
 	}
 	
-	for (i = 0; i < E1000_TX_PACKETS_COUNT; i++) {
+	for (i = 0; i < E1000_TX_FRAME_COUNT; i++) {
 		rc = dmamem_map_anonymous(
 		    E1000_MAX_SEND_FRAME_SIZE, AS_AREA_READ | AS_AREA_WRITE,
@@ -1584,5 +1612,5 @@
 	
 	if (e1000->tx_frame_phys != NULL && e1000->tx_frame_virt != NULL) {
-		for (i = 0; i < E1000_TX_PACKETS_COUNT; i++) {
+		for (i = 0; i < E1000_TX_FRAME_COUNT; i++) {
 			if (e1000->tx_frame_virt[i] != NULL) {
 				dmamem_unmap_anonymous(e1000->tx_frame_virt[i]);
@@ -1615,5 +1643,5 @@
 	size_t i;
 	
-	for (i = 0; i < E1000_TX_PACKETS_COUNT; i++) {
+	for (i = 0; i < E1000_TX_FRAME_COUNT; i++) {
 		dmamem_unmap_anonymous(e1000->tx_frame_virt[i]);
 		e1000->tx_frame_virt[i] = NULL;
@@ -1630,4 +1658,5 @@
 		e1000->tx_frame_phys = NULL;
 	}
+	
 	dmamem_unmap_anonymous(e1000->tx_ring_virt);
 }
@@ -1642,5 +1671,5 @@
 	/* Write descriptor */
 	for (unsigned int offset = 0;
-	    offset < E1000_TX_PACKETS_COUNT;
+	    offset < E1000_TX_FRAME_COUNT;
 	    offset++)
 		e1000_clear_tx_descriptor(nic, offset);
@@ -1699,5 +1728,5 @@
 }
 
-/** Activate the device to receive and transmit packets
+/** Activate the device to receive and transmit frames
  *
  * @param nic NIC driver data
@@ -2040,5 +2069,4 @@
 	case E1000_82545:
 	case E1000_82546:
-	case E1000_82572:
 		e1000->info.eerd_start = 0x01;
 		e1000->info.eerd_done = 0x10;
@@ -2047,4 +2075,5 @@
 		break;
 	case E1000_82547:
+	case E1000_82572:
 	case E1000_80003ES2:
 		e1000->info.eerd_start = 0x01;
@@ -2085,4 +2114,5 @@
 int e1000_dev_add(ddf_dev_t *dev)
 {
+	ddf_fun_t *fun;
 	assert(dev);
 	
@@ -2115,11 +2145,14 @@
 	e1000_initialize_vlan(e1000);
 	
-	rc = nic_register_as_ddf_fun(nic, &e1000_dev_ops);
-	if (rc != EOK)
+	fun = ddf_fun_create(nic_get_ddf_dev(nic), fun_exposed, "port0");
+	if (fun == NULL)
 		goto err_tx_structure;
+	nic_set_ddf_fun(nic, fun);
+	fun->ops = &e1000_dev_ops;
+	fun->driver_data = nic;
 	
 	rc = e1000_register_int_handler(nic);
 	if (rc != EOK)
-		goto err_tx_structure;
+		goto err_fun_create;
 	
 	rc = nic_connect_to_services(nic);
@@ -2144,10 +2177,24 @@
 		goto err_rx_structure;
 	
+	rc = ddf_fun_bind(fun);
+	if (rc != EOK)
+		goto err_fun_bind;
+	
+	rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);
+	if (rc != EOK)
+		goto err_add_to_cat;
+	
 	return EOK;
 	
+err_add_to_cat:
+	ddf_fun_unbind(fun);
+err_fun_bind:
 err_rx_structure:
 	e1000_uninitialize_rx_structure(nic);
 err_irq:
 	unregister_interrupt_handler(dev, DRIVER_DATA_DEV(dev)->irq);
+err_fun_create:
+	ddf_fun_destroy(fun);
+	nic_set_ddf_fun(nic, NULL);
 err_tx_structure:
 	e1000_uninitialize_tx_structure(e1000);
@@ -2295,5 +2342,5 @@
 	
 	if (!descriptor_available) {
-		/* Packet lost */
+		/* Frame lost */
 		fibril_mutex_unlock(&e1000->tx_lock);
 		return;
@@ -2324,5 +2371,5 @@
 	
 	tdt++;
-	if (tdt == E1000_TX_PACKETS_COUNT)
+	if (tdt == E1000_TX_FRAME_COUNT)
 		tdt = 0;
 	
Index: uspace/drv/nic/e1k/e1k.h
===================================================================
--- uspace/drv/nic/e1k/e1k.h	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/nic/e1k/e1k.h	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -39,5 +39,5 @@
 #include <stdint.h>
 
-/** Ethernet CRC size after packet received in rx_descriptor */
+/** Ethernet CRC size after frame received in rx_descriptor */
 #define E1000_CRC_SIZE  4
 
@@ -109,5 +109,5 @@
 /** Transmit descriptor COMMAND field bits */
 typedef enum {
-	TXDESCRIPTOR_COMMAND_VLE = (1 << 6),   /**< VLAN Packet Enable */
+	TXDESCRIPTOR_COMMAND_VLE = (1 << 6),   /**< VLAN frame Enable */
 	TXDESCRIPTOR_COMMAND_RS = (1 << 3),    /**< Report Status */
 	TXDESCRIPTOR_COMMAND_IFCS = (1 << 1),  /**< Insert FCS */
Index: uspace/drv/nic/lo/lo.c
===================================================================
--- uspace/drv/nic/lo/lo.c	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/nic/lo/lo.c	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -42,5 +42,4 @@
 #include <async.h>
 #include <nic.h>
-#include <packet_client.h>
 
 #define NAME  "lo"
@@ -61,17 +60,6 @@
 static void lo_send_frame(nic_t *nic_data, void *data, size_t size)
 {
-	packet_t *packet;
-	int rc;
-
-	packet = nic_alloc_packet(nic_data, size);
-	if (packet == NULL)
-		return;
-
-	rc = packet_copy_data(packet, data, size);
-	if (rc != EOK)
-		return;
-
 	nic_report_send_ok(nic_data, 1, size);
-	nic_received_noneth_packet(nic_data, packet);
+	nic_received_noneth_frame(nic_data, data, size);
 }
 
@@ -92,36 +80,61 @@
 static int lo_dev_add(ddf_dev_t *dev)
 {
-	nic_t *nic_data = nic_create_and_bind(dev);
-	if (nic_data == NULL) {
+	ddf_fun_t *fun = NULL;
+	bool bound = false;
+	
+	nic_t *nic = nic_create_and_bind(dev);
+	if (nic == NULL) {
 		printf("%s: Failed to initialize\n", NAME);
 		return ENOMEM;
 	}
 	
-	dev->driver_data = nic_data;
-	nic_set_send_frame_handler(nic_data, lo_send_frame);
+	dev->driver_data = nic;
+	nic_set_send_frame_handler(nic, lo_send_frame);
 	
-	int rc = nic_connect_to_services(nic_data);
+	int rc = nic_connect_to_services(nic);
 	if (rc != EOK) {
 		printf("%s: Failed to connect to services\n", NAME);
-		nic_unbind_and_destroy(dev);
-		return rc;
+		goto error;
 	}
 	
-	rc = nic_register_as_ddf_fun(nic_data, &lo_dev_ops);
+	fun = ddf_fun_create(nic_get_ddf_dev(nic), fun_exposed, "port0");
+	if (fun == NULL) {
+		printf("%s: Failed creating function\n", NAME);
+		rc = ENOMEM;
+		goto error;
+	}
+	nic_set_ddf_fun(nic, fun);
+	fun->ops = &lo_dev_ops;
+	fun->driver_data = nic;
+	
+	rc = nic_report_address(nic, &lo_addr);
 	if (rc != EOK) {
-		printf("%s: Failed to register as DDF function\n", NAME);
-		nic_unbind_and_destroy(dev);
-		return rc;
+		printf("%s: Failed to setup loopback address\n", NAME);
+		goto error;
 	}
 	
-	rc = nic_report_address(nic_data, &lo_addr);
+	rc = ddf_fun_bind(fun);
 	if (rc != EOK) {
-		printf("%s: Failed to setup loopback address\n", NAME);
-		nic_unbind_and_destroy(dev);
-		return rc;
+		printf("%s: Failed binding function\n", NAME);
+		goto error;
 	}
+	bound = true;
+	
+	rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);
+	if (rc != EOK)
+		goto error;
 	
 	printf("%s: Adding loopback device '%s'\n", NAME, dev->name);
 	return EOK;
+	
+error:
+	if (bound)
+		ddf_fun_unbind(fun);
+	
+	if (fun != NULL)
+		ddf_fun_destroy(fun);
+	
+	nic_unbind_and_destroy(dev);
+	return rc;
 }
 
Index: uspace/drv/nic/ne2k/dp8390.c
===================================================================
--- uspace/drv/nic/ne2k/dp8390.c	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/nic/ne2k/dp8390.c	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -59,6 +59,4 @@
 #include <stdio.h>
 #include <libarch/ddi.h>
-#include <net/packet.h>
-#include <packet_client.h>
 #include "dp8390.h"
 
@@ -76,5 +74,5 @@
 	uint8_t status;
 	
-	/** Pointer to next packet */
+	/** Pointer to next frame */
 	uint8_t next;
 	
@@ -393,6 +391,6 @@
 	/*
 	 * Reset the transmit ring. If we were transmitting a frame,
-	 * we pretend that the packet is processed. Higher layers will
-	 * retransmit if the packet wasn't actually sent.
+	 * we pretend that the frame is processed. Higher layers will
+	 * retransmit if the frame wasn't actually sent.
 	 */
 	ne2k->sq.dirty = false;
@@ -448,6 +446,5 @@
 		return NULL;
 	
-	void *buf = packet_suffix(frame->packet, length);
-	bzero(buf, length);
+	bzero(frame->data, length);
 	uint8_t last = page + length / DP_PAGE;
 	
@@ -455,10 +452,10 @@
 		size_t left = (ne2k->stop_page - page) * DP_PAGE
 		    - sizeof(recv_header_t);
-		ne2k_download(ne2k, buf, page * DP_PAGE + sizeof(recv_header_t),
+		ne2k_download(ne2k, frame->data, page * DP_PAGE + sizeof(recv_header_t),
 		    left);
-		ne2k_download(ne2k, buf + left, ne2k->start_page * DP_PAGE,
+		ne2k_download(ne2k, frame->data + left, ne2k->start_page * DP_PAGE,
 		    length - left);
 	} else {
-		ne2k_download(ne2k, buf, page * DP_PAGE + sizeof(recv_header_t),
+		ne2k_download(ne2k, frame->data, page * DP_PAGE + sizeof(recv_header_t),
 		    length);
 	}
@@ -541,5 +538,5 @@
 		 * Update the boundary pointer
 		 * to the value of the page
-		 * prior to the next packet to
+		 * prior to the next frame to
 		 * be processed.
 		 */
@@ -584,5 +581,5 @@
 		fibril_mutex_lock(&ne2k->sq_mutex);
 		if (ne2k->sq.dirty) {
-			/* Prepare the buffer for next packet */
+			/* Prepare the buffer for next frame */
 			ne2k->sq.dirty = false;
 			ne2k->sq.size = 0;
Index: uspace/drv/nic/ne2k/dp8390.h
===================================================================
--- uspace/drv/nic/ne2k/dp8390.h	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/nic/ne2k/dp8390.h	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -264,5 +264,4 @@
 extern void ne2k_send(nic_t *, void *, size_t);
 extern void ne2k_interrupt(nic_t *, uint8_t, uint8_t);
-extern packet_t *ne2k_alloc_packet(nic_t *, size_t);
 
 extern void ne2k_set_accept_mcast(ne2k_t *, int);
Index: uspace/drv/nic/ne2k/ne2k.c
===================================================================
--- uspace/drv/nic/ne2k/ne2k.c	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/nic/ne2k/ne2k.c	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -286,5 +286,5 @@
 	/* Note: some frame with previous physical address may slip to NIL here
 	 * (for a moment the filtering is not exact), but ethernet should be OK with
-	 * that. Some packet may also be lost, but this is not a problem.
+	 * that. Some frames may also be lost, but this is not a problem.
 	 */
 	ne2k_set_physical_address((ne2k_t *) nic_get_specific(nic_data), address);
@@ -363,4 +363,6 @@
 static int ne2k_dev_add(ddf_dev_t *dev)
 {
+	ddf_fun_t *fun;
+	
 	/* Allocate driver data for the device. */
 	nic_t *nic_data = nic_create_and_bind(dev);
@@ -396,5 +398,5 @@
 	}
 	
-	rc = nic_register_as_ddf_fun(nic_data, &ne2k_dev_ops);
+	rc = nic_connect_to_services(nic_data);
 	if (rc != EOK) {
 		ne2k_dev_cleanup(dev);
@@ -402,7 +404,24 @@
 	}
 	
-	rc = nic_connect_to_services(nic_data);
-	if (rc != EOK) {
+	fun = ddf_fun_create(nic_get_ddf_dev(nic_data), fun_exposed, "port0");
+	if (fun == NULL) {
 		ne2k_dev_cleanup(dev);
+		return ENOMEM;
+	}
+	nic_set_ddf_fun(nic_data, fun);
+	fun->ops = &ne2k_dev_ops;
+	fun->driver_data = nic_data;
+	
+	rc = ddf_fun_bind(fun);
+	if (rc != EOK) {
+		ddf_fun_destroy(fun);
+		ne2k_dev_cleanup(dev);
+		return rc;
+	}
+	
+	rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);
+	if (rc != EOK) {
+		ddf_fun_unbind(fun);
+		ddf_fun_destroy(fun);
 		return rc;
 	}
Index: uspace/drv/nic/rtl8139/defs.h
===================================================================
--- uspace/drv/nic/rtl8139/defs.h	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/nic/rtl8139/defs.h	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -29,29 +29,33 @@
 /** @file rtl8139_defs.h
  *
- *  Registers, bit positions and masks definition of the RTL8139 network family 
- *  cards
- */
-
-#ifndef RTL8139_DEFS_H_INCLUDED_
-#define RTL8139_DEFS_H_INCLUDED_
+ * Registers, bit positions and masks definition
+ * of the RTL8139 network family cards
+ */
+
+#ifndef RTL8139_DEFS_H_
+#define RTL8139_DEFS_H_
+
 #include <sys/types.h>
 #include <libarch/ddi.h>
 
-
-/** The size of RTL8139 registers address space */
-#define RTL8139_IO_SIZE 256
-
-/** The maximal transmitted packet length in bytes allowed according to RTL8139
- *  documentation (see SIZE part of TSD documentation)
- */
-#define RTL8139_PACKET_MAX_LENGTH 1792
-
+/** Size of RTL8139 registers address space */
+#define RTL8139_IO_SIZE  256
+
+/** Maximal transmitted frame length
+ *
+ * Maximal transmitted frame length in bytes
+ * allowed according to the RTL8139 documentation
+ * (see SIZE part of TSD documentation).
+ *
+ */
+#define RTL8139_FRAME_MAX_LENGTH  1792
 
 /** HW version
  *
- *  as can be detected from HWVERID part of TCR
- *  (Transmit Configuration Register)
- */
-enum rtl8139_version_id {
+ * As can be detected from HWVERID part of TCR
+ * (Transmit Configuration Register).
+ *
+ */
+typedef enum {
 	RTL8139 = 0,          /**< RTL8139 */
 	RTL8139A,             /**< RTL8139A */
@@ -66,7 +70,5 @@
 	RTL8101,              /**< RTL8101 */
 	RTL8139_VER_COUNT     /**< Count of known RTL versions, the last value */
-};
-
-extern const char* model_names[RTL8139_VER_COUNT];
+} rtl8139_version_id_t;
 
 /** Registers of RTL8139 family card offsets from the memory address base */
@@ -75,5 +77,5 @@
 	MAC0  = IDR0,    /**< Alias for IDR0 */
 
-	// 0x6 - 0x7 reserved
+	// 0x06 - 0x07 reserved
 
 	MAR0    = 0x08,  /**< Multicast mask registers 8 1b registers sequence */
@@ -94,5 +96,5 @@
 
 	CR      = 0x37,  /**< Command register, 1b */
-	CAPR    = 0x38,  /**< Current address of packet read, 2b */
+	CAPR    = 0x38,  /**< Current address of frame read, 2b */
 	CBA     = 0x3a,  /**< Current buffer address, 2b */
 
@@ -213,4 +215,5 @@
 	pio_write_8(io_base + CR9346, RTL8139_REGS_LOCKED);
 }
+
 /** Allow to change Config0-4 and BMCR register  */
 static inline void rtl8139_regs_unlock(void *io_base)
@@ -282,5 +285,5 @@
 	RCR_MulERINT = 1 << 17,    /**< Multiple early interrupt select */
 
-	/** Minimal error packet length (1 = 8B, 0 = 64B). If AER/AR is set, RER8
+	/** Minimal error frame length (1 = 8B, 0 = 64B). If AER/AR is set, RER8
 	 * is "Don't care"
 	 */
@@ -302,10 +305,10 @@
 
 	RCR_WRAP              = 1 << 7,  /**< Rx buffer wrapped */
-	RCR_ACCEPT_ERROR      = 1 << 5,  /**< Accept error packet */
-	RCR_ACCEPT_RUNT       = 1 << 4,  /**< Accept Runt (8-64 bytes) packets */
+	RCR_ACCEPT_ERROR      = 1 << 5,  /**< Accept error frame */
+	RCR_ACCEPT_RUNT       = 1 << 4,  /**< Accept Runt (8-64 bytes) frames */
 	RCR_ACCEPT_BROADCAST  = 1 << 3,  /**< Accept broadcast */
 	RCR_ACCEPT_MULTICAST  = 1 << 2,  /**< Accept multicast */
 	RCR_ACCEPT_PHYS_MATCH = 1 << 1,  /**< Accept device MAC address match */
-	RCR_ACCEPT_ALL_PHYS   = 1 << 0,  /**< Accept all packets with 
+	RCR_ACCEPT_ALL_PHYS   = 1 << 0,  /**< Accept all frames with 
 	                                  * phys. desticnation 
 									  */
@@ -362,5 +365,5 @@
 	ANAR_ACK          = (1 << 14),  /**< Capability reception acknowledge */
 	ANAR_REMOTE_FAULT = (1 << 13),  /**< Remote fault detection capability */
-	ANAR_PAUSE        = (1 << 10),  /**< Symetric pause packet capability */
+	ANAR_PAUSE        = (1 << 10),  /**< Symetric pause frame capability */
 	ANAR_100T4        = (1 << 9),   /**< T4, not supported by the device */
 	ANAR_100TX_FD     = (1 << 8),   /**< 100BASE_TX full duplex */
@@ -399,5 +402,5 @@
 	CONFIG3_GNT_SELECT = (1 << 7),  /**< Gnt select */
 	CONFIG3_PARM_EN    = (1 << 6),  /**< Parameter enabled (100MBit mode) */
-	CONFIG3_MAGIC      = (1 << 5),  /**< WoL Magic packet enable */
+	CONFIG3_MAGIC      = (1 << 5),  /**< WoL Magic frame enable */
 	CONFIG3_LINK_UP    = (1 << 4),  /**< Wakeup if link is reestablished */
 	CONFIG3_CLKRUN_EN  = (1 << 2),  /**< CLKRUN enabled */ /* TODO: check what does it mean */
@@ -416,9 +419,9 @@
 };
 
-/** Maximal runt packet size + 1 */
-#define RTL8139_RUNT_MAX_SIZE 64
-
-/** Bits in packet header */
-enum rtl8139_packet_header {
+/** Maximal runt frame size + 1 */
+#define RTL8139_RUNT_MAX_SIZE  64
+
+/** Bits in frame header */
+enum rtl8139_frame_header {
 	RSR_MAR  = (1 << 15),  /**< Multicast received */
 	RSR_PAM  = (1 << 14),  /**< Physical address match */
@@ -426,10 +429,10 @@
 
 	RSR_ISE  = (1 << 5),   /**< Invalid symbol error, 100BASE-TX only */
-	RSR_RUNT = (1 << 4),   /**< Runt packet (< RTL8139_RUNT_MAX_SIZE bytes) */
-
-	RSR_LONG = (1 << 3),   /**< Long packet (size > 4k bytes) */
+	RSR_RUNT = (1 << 4),   /**< Runt frame (< RTL8139_RUNT_MAX_SIZE bytes) */
+
+	RSR_LONG = (1 << 3),   /**< Long frame (size > 4k bytes) */
 	RSR_CRC  = (1 << 2),   /**< CRC error */
 	RSR_FAE  = (1 << 1),   /**< Frame alignment error */
-	RSR_ROK  = (1 << 0)    /**< Good packet received */
+	RSR_ROK  = (1 << 0)    /**< Good frame received */
 };
 
@@ -451,5 +454,5 @@
 									  */
 
-	APPEND_CRC = 1 << 16,        /**< Append CRC at the end of a packet */
+	APPEND_CRC = 1 << 16,        /**< Append CRC at the end of a frame */
 
 	MXTxDMA_SHIFT = 8,  /**< Max. DMA Burst per TxDMA shift, burst = 16^value */
@@ -459,5 +462,5 @@
 	TX_RETRY_COUNT_SIZE  = 4,            /**< Retries before aborting size */
 
-	CLEAR_ABORT = 1 << 0    /**< Retransmit aborted packet at the last 
+	CLEAR_ABORT = 1 << 0    /**< Retransmit aborted frame at the last 
 	                          *  transmitted descriptor 
 							  */
@@ -470,19 +473,21 @@
 
 /** Mapping of HW version -> version ID */
-struct rtl8139_hwver_map { 
-	uint32_t hwverid;                /**< HW version value in the register */
-	enum rtl8139_version_id ver_id;  /**< appropriate version id */
+struct rtl8139_hwver_map {
+	uint32_t hwverid;             /**< HW version value in the register */
+	rtl8139_version_id_t ver_id;  /**< appropriate version id */
 };
 
 /** Mapping of HW version -> version ID */
 extern const struct rtl8139_hwver_map rtl8139_versions[RTL8139_VER_COUNT + 1];
-
-/** Size in the packet header while copying from RxFIFO to Rx buffer */
-#define RTL8139_EARLY_SIZE UINT16_C(0xfff0)
-/** The only supported pause packet time value */
-#define RTL8139_PAUSE_VAL UINT16_C(0xFFFF)
-
-/** Size of the packet header in front of the received frame */
-#define RTL_PACKET_HEADER_SIZE 4
+extern const char* model_names[RTL8139_VER_COUNT];
+
+/** Size in the frame header while copying from RxFIFO to Rx buffer */
+#define RTL8139_EARLY_SIZE  UINT16_C(0xfff0)
+
+/** The only supported pause frame time value */
+#define RTL8139_PAUSE_VAL  UINT16_C(0xFFFF)
+
+/** Size of the frame header in front of the received frame */
+#define RTL_FRAME_HEADER_SIZE  4
 
 /** 8k buffer */
Index: uspace/drv/nic/rtl8139/driver.c
===================================================================
--- uspace/drv/nic/rtl8139/driver.c	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/nic/rtl8139/driver.c	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -39,5 +39,4 @@
 #include <io/log.h>
 #include <nic.h>
-#include <packet_client.h>
 #include <device/pci.h>
 
@@ -56,21 +55,28 @@
 /** Global mutex for work with shared irq structure */
 FIBRIL_MUTEX_INITIALIZE(irq_reg_lock);
+
 /** Lock interrupt structure mutex */
-#define RTL8139_IRQ_STRUCT_LOCK() fibril_mutex_lock(&irq_reg_lock)
+#define RTL8139_IRQ_STRUCT_LOCK() \
+	fibril_mutex_lock(&irq_reg_lock)
+
 /** Unlock interrupt structure mutex */
-#define RTL8139_IRQ_STRUCT_UNLOCK() fibril_mutex_unlock(&irq_reg_lock)
+#define RTL8139_IRQ_STRUCT_UNLOCK() \
+	fibril_mutex_unlock(&irq_reg_lock)
 
 /** PCI clock frequency in kHz */
-#define RTL8139_PCI_FREQ_KHZ 33000
-
-#define RTL8139_AUTONEG_CAPS (ETH_AUTONEG_10BASE_T_HALF \
-    | ETH_AUTONEG_10BASE_T_FULL | ETH_AUTONEG_100BASE_TX_HALF \
-    | ETH_AUTONEG_100BASE_TX_FULL | ETH_AUTONEG_PAUSE_SYMETRIC)
+#define RTL8139_PCI_FREQ_KHZ  33000
+
+#define RTL8139_AUTONEG_CAPS (ETH_AUTONEG_10BASE_T_HALF | \
+	ETH_AUTONEG_10BASE_T_FULL | ETH_AUTONEG_100BASE_TX_HALF | \
+	ETH_AUTONEG_100BASE_TX_FULL | ETH_AUTONEG_PAUSE_SYMETRIC)
 
 /** Lock transmitter and receiver data
- *  This function shall be called whenever both transmitter and receiver locking
- *  to force safe lock ordering (deadlock prevention)
- *
- *  @param rtl8139  RTL8139 private data
+ *
+ * This function shall be called whenever
+ * both transmitter and receiver locking
+ * to force safe lock ordering (deadlock prevention)
+ *
+ * @param rtl8139 RTL8139 private data
+ *
  */
 inline static void rtl8139_lock_all(rtl8139_t *rtl8139)
@@ -83,5 +89,6 @@
 /** Unlock transmitter and receiver data
  *
- *  @param rtl8139  RTL8139 private data
+ * @param rtl8139 RTL8139 private data
+ *
  */
 inline static void rtl8139_unlock_all(rtl8139_t *rtl8139)
@@ -152,5 +159,5 @@
 }
 
-/** Update the mask of accepted packets in the RCR register according to
+/** Update the mask of accepted frames in the RCR register according to
  * rcr_accept_mode value in rtl8139_t
  *
@@ -170,5 +177,5 @@
 }
 
-/** Fill the mask of accepted multicast packets in the card registers
+/** Fill the mask of accepted multicast frames in the card registers
  *
  *  @param rtl8139  The rtl8139 private data
@@ -394,5 +401,5 @@
 #define rtl8139_tbuf_busy(tsd) ((pio_read_32(tsd) & TSD_OWN) == 0)
 
-/** Send packet with the hardware
+/** Send frame with the hardware
  *
  * note: the main_lock is locked when framework calls this function
@@ -412,5 +419,5 @@
 	ddf_msg(LVL_DEBUG, "Sending frame");
 
-	if (size > RTL8139_PACKET_MAX_LENGTH) {
+	if (size > RTL8139_FRAME_MAX_LENGTH) {
 		ddf_msg(LVL_ERROR, "Send frame: frame too long, %zu bytes",
 		    size);
@@ -437,5 +444,5 @@
 	fibril_mutex_unlock(&rtl8139->tx_lock);
 
-	/* Get address of the buffer descriptor and packet data */
+	/* Get address of the buffer descriptor and frame data */
 	void *tsd = rtl8139->io_port + TSD0 + tx_curr * 4;
 	void *buf_addr = rtl8139->tx_buff[tx_curr];
@@ -458,5 +465,5 @@
 	pio_write_32(tsd, tsd_value);
 	return;
-
+	
 err_busy_no_inc:
 err_size:
@@ -505,32 +512,26 @@
 }
 
-/** Create packet structure from the buffer data
+/** Create frame structure from the buffer data
  *
  * @param nic_data      NIC driver data
  * @param rx_buffer     The receiver buffer
  * @param rx_size       The buffer size
- * @param packet_start  The offset where packet data start
- * @param packet_size   The size of the packet data
- *
- * @return The packet   list node (not connected)
- */
-static nic_frame_t *rtl8139_read_packet(nic_t *nic_data,
-    void *rx_buffer, size_t rx_size, size_t packet_start, size_t packet_size)
-{
-	nic_frame_t *frame = nic_alloc_frame(nic_data, packet_size);
+ * @param frame_start   The offset where packet data start
+ * @param frame_size    The size of the frame data
+ *
+ * @return The frame list node (not connected)
+ *
+ */
+static nic_frame_t *rtl8139_read_frame(nic_t *nic_data,
+    void *rx_buffer, size_t rx_size, size_t frame_start, size_t frame_size)
+{
+	nic_frame_t *frame = nic_alloc_frame(nic_data, frame_size);
 	if (! frame) {
-		ddf_msg(LVL_ERROR, "Can not allocate frame for received packet.");
+		ddf_msg(LVL_ERROR, "Can not allocate frame for received frame.");
 		return NULL;
 	}
 
-	void *packet_data = packet_suffix(frame->packet, packet_size);
-	if (!packet_data) {
-		ddf_msg(LVL_ERROR, "Can not get the packet suffix.");
-		nic_release_frame(nic_data, frame);
-		return NULL;
-	}
-
-	void *ret = rtl8139_memcpy_wrapped(packet_data, rx_buffer, packet_start,
-	    RxBUF_SIZE, packet_size);
+	void *ret = rtl8139_memcpy_wrapped(frame->data, rx_buffer, frame_start,
+	    RxBUF_SIZE, frame_size);
 	if (ret == NULL) {
 		nic_release_frame(nic_data, frame);
@@ -568,10 +569,10 @@
 }
 
-/** Receive all packets in queue
+/** Receive all frames in queue
  *
  *  @param nic_data  The controller data
- *  @return The linked list of packet_list_t nodes, each containing one packet
- */
-static nic_frame_list_t *rtl8139_packet_receive(nic_t *nic_data)
+ *  @return The linked list of nic_frame_list_t nodes, each containing one frame
+ */
+static nic_frame_list_t *rtl8139_frame_receive(nic_t *nic_data)
 {
 	rtl8139_t *rtl8139 = nic_get_specific(nic_data);
@@ -581,5 +582,5 @@
 	nic_frame_list_t *frames = nic_alloc_frame_list();
 	if (!frames)
-		ddf_msg(LVL_ERROR, "Can not allocate frame list for received packets.");
+		ddf_msg(LVL_ERROR, "Can not allocate frame list for received frames.");
 
 	void *rx_buffer = rtl8139->rx_buff_virt;
@@ -605,12 +606,12 @@
 	while (!rtl8139_hw_buffer_empty(rtl8139)) {
 		void *rx_ptr = rx_buffer + rx_offset % RxBUF_SIZE;
-		uint32_t packet_header = uint32_t_le2host( *((uint32_t*)rx_ptr) );
-		uint16_t size = packet_header >> 16;
-		uint16_t packet_size = size - RTL8139_CRC_SIZE;
-		/* received packet flags in packet header */
-		uint16_t rcs = (uint16_t) packet_header;
+		uint32_t frame_header = uint32_t_le2host( *((uint32_t*)rx_ptr) );
+		uint16_t size = frame_header >> 16;
+		uint16_t frame_size = size - RTL8139_CRC_SIZE;
+		/* received frame flags in frame header */
+		uint16_t rcs = (uint16_t) frame_header;
 
 		if (size == RTL8139_EARLY_SIZE) {
-			/* The packet copying is still in progress, break receiving */
+			/* The frame copying is still in progress, break receiving */
 			ddf_msg(LVL_DEBUG, "Early threshold reached, not completely coppied");
 			break;
@@ -618,7 +619,7 @@
 
 		/* Check if the header is valid, otherwise we are lost in the buffer */
-		if (size == 0 || size > RTL8139_PACKET_MAX_LENGTH) {
+		if (size == 0 || size > RTL8139_FRAME_MAX_LENGTH) {
 			ddf_msg(LVL_ERROR, "Receiver error -> receiver reset (size: %4"PRIu16", "
-			    "header 0x%4"PRIx16". Offset: %zu)", size, packet_header, 
+			    "header 0x%4"PRIx16". Offset: %zu)", size, frame_header, 
 			    rx_offset);
 			goto rx_err;
@@ -629,11 +630,11 @@
 		}
 
-		cur_read += size + RTL_PACKET_HEADER_SIZE;
+		cur_read += size + RTL_FRAME_HEADER_SIZE;
 		if (cur_read > max_read)
 			break;
 
 		if (frames) {
-			nic_frame_t *frame = rtl8139_read_packet(nic_data, rx_buffer,
-			    RxBUF_SIZE, rx_offset + RTL_PACKET_HEADER_SIZE, packet_size);
+			nic_frame_t *frame = rtl8139_read_frame(nic_data, rx_buffer,
+			    RxBUF_SIZE, rx_offset + RTL_FRAME_HEADER_SIZE, frame_size);
 
 			if (frame)
@@ -642,7 +643,7 @@
 
 		/* Update offset */
-		rx_offset = ALIGN_UP(rx_offset + size + RTL_PACKET_HEADER_SIZE, 4);
-
-		/* Write lesser value to prevent overflow into unread packet
+		rx_offset = ALIGN_UP(rx_offset + size + RTL_FRAME_HEADER_SIZE, 4);
+
+		/* Write lesser value to prevent overflow into unread frame
 		 * (the recomendation from the RealTech rtl8139 programming guide)
 		 */
@@ -735,5 +736,5 @@
 		tx_used++;
 
-		/* If the packet was sent */
+		/* If the frame was sent */
 		if (tsd_value & TSD_TOK) {
 			size_t size = REG_GET_VAL(tsd_value, TSD_SIZE);
@@ -765,9 +766,9 @@
 }
 
-/** Receive all packets from the buffer
+/** Receive all frames from the buffer
  *
  *  @param rtl8139  driver private data
  */
-static void rtl8139_receive_packets(nic_t *nic_data)
+static void rtl8139_receive_frames(nic_t *nic_data)
 {
 	assert(nic_data);
@@ -777,5 +778,5 @@
 
 	fibril_mutex_lock(&rtl8139->rx_lock);
-	nic_frame_list_t *frames = rtl8139_packet_receive(nic_data);
+	nic_frame_list_t *frames = rtl8139_frame_receive(nic_data);
 	fibril_mutex_unlock(&rtl8139->rx_lock);
 
@@ -833,5 +834,5 @@
 	}
 
-	/* Check transmittion interrupts first to allow transmit next packets
+	/* Check transmittion interrupts first to allow transmit next frames
 	 * sooner
 	 */
@@ -840,5 +841,5 @@
 	}
 	if (isr & INT_ROK) {
-		rtl8139_receive_packets(nic_data);
+		rtl8139_receive_frames(nic_data);
 	}
 	if (isr & (INT_RER | INT_RXOVW | INT_FIFOOVW)) {
@@ -942,5 +943,5 @@
 }
 
-/** Activate the device to receive and transmit packets
+/** Activate the device to receive and transmit frames
  *
  *  @param nic_data  The nic driver data
@@ -1222,15 +1223,15 @@
 		goto failed;
 
-	/* Set default packet acceptance */
+	/* Set default frame acceptance */
 	rtl8139->rcr_data.ucast_mask = RTL8139_RCR_UCAST_DEFAULT;
 	rtl8139->rcr_data.mcast_mask = RTL8139_RCR_MCAST_DEFAULT;
 	rtl8139->rcr_data.bcast_mask = RTL8139_RCR_BCAST_DEFAULT;
 	rtl8139->rcr_data.defect_mask = RTL8139_RCR_DEFECT_DEFAULT;
-	/* Set receiver early treshold to 8/16 of packet length */
+	/* Set receiver early treshold to 8/16 of frame length */
 	rtl8139->rcr_data.rcr_base = (0x8 << RCR_ERTH_SHIFT);
 
 	ddf_msg(LVL_DEBUG, "The device is initialized");
 	return ret;
-
+	
 failed:
 	ddf_msg(LVL_ERROR, "The device initialization failed");
@@ -1297,4 +1298,6 @@
 int rtl8139_dev_add(ddf_dev_t *dev)
 {
+	ddf_fun_t *fun;
+
 	assert(dev);
 	ddf_msg(LVL_NOTE, "RTL8139_dev_add %s (handle = %d)", dev->name, dev->handle);
@@ -1333,8 +1336,22 @@
 	}
 
-	rc = nic_register_as_ddf_fun(nic_data, &rtl8139_dev_ops);
+	fun = ddf_fun_create(nic_get_ddf_dev(nic_data), fun_exposed, "port0");
+	if (fun == NULL) {
+		ddf_msg(LVL_ERROR, "Failed creating device function");
+		goto err_srv;
+	}
+	nic_set_ddf_fun(nic_data, fun);
+	fun->ops = &rtl8139_dev_ops;
+	fun->driver_data = nic_data;
+
+	rc = ddf_fun_bind(fun);
 	if (rc != EOK) {
-		ddf_msg(LVL_ERROR, "Failed to register as DDF function - error %d", rc);
-		goto err_irq;
+		ddf_msg(LVL_ERROR, "Failed binding device function");
+		goto err_fun_create;
+	}
+	rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);
+	if (rc != EOK) {
+		ddf_msg(LVL_ERROR, "Failed adding function to category");
+		goto err_fun_bind;
 	}
 
@@ -1343,5 +1360,11 @@
 
 	return EOK;
-
+	
+err_fun_bind:
+	ddf_fun_unbind(fun);
+err_fun_create:
+	ddf_fun_destroy(fun);
+err_srv:
+	/* XXX Disconnect from services */
 err_irq:
 	unregister_interrupt_handler(dev, rtl8139->irq);
@@ -1486,5 +1509,5 @@
 };
 
-/** Check if pause packet operations are valid in current situation 
+/** Check if pause frame operations are valid in current situation 
  *
  *  @param rtl8139  RTL8139 private structure
@@ -1511,5 +1534,5 @@
 }
 
-/** Get current pause packet configuration
+/** Get current pause frame configuration
  *
  *  Values are filled with NIC_RESULT_NOT_AVAILABLE if the value has no sense in
@@ -1517,7 +1540,7 @@
  *
  *  @param[in]  fun         The DDF structure of the RTL8139
- *  @param[out] we_send     Sign if local constroller sends pause packets
- *  @param[out] we_receive  Sign if local constroller receives pause packets
- *  @param[out] time        Time filled in pause packets. 0xFFFF in rtl8139
+ *  @param[out] we_send     Sign if local constroller sends pause frame
+ *  @param[out] we_receive  Sign if local constroller receives pause frame
+ *  @param[out] time        Time filled in pause frames. 0xFFFF in rtl8139
  *
  *  @return EOK if succeed
@@ -1549,12 +1572,12 @@
 };
 
-/** Set current pause packet configuration
+/** Set current pause frame configuration
  *
  *  @param fun            The DDF structure of the RTL8139
- *  @param allow_send     Sign if local constroller sends pause packets
- *  @param allow_receive  Sign if local constroller receives pause packets
+ *  @param allow_send     Sign if local constroller sends pause frame
+ *  @param allow_receive  Sign if local constroller receives pause frames
  *  @param time           Time to use, ignored (not supported by device)
  *
- *  @return EOK if succeed, INVAL if the pause packet has no sence
+ *  @return EOK if succeed, INVAL if the pause frame has no sence
  */
 static int rtl8139_pause_set(ddf_fun_t *fun, int allow_send, int allow_receive, 
@@ -1805,5 +1828,5 @@
 }
 
-/** Set unicast packets acceptance mode
+/** Set unicast frames acceptance mode
  *
  *  @param nic_data  The nic device to update
@@ -1863,5 +1886,5 @@
 }
 
-/** Set multicast packets acceptance mode
+/** Set multicast frames acceptance mode
  *
  *  @param nic_data  The nic device to update
@@ -1908,5 +1931,5 @@
 }
 
-/** Set broadcast packets acceptance mode
+/** Set broadcast frames acceptance mode
  *
  *  @param nic_data  The nic device to update
@@ -1938,5 +1961,5 @@
 }
 
-/** Get state of acceptance of weird packets
+/** Get state of acceptance of weird frames
  *
  *  @param[in]  device  The device to check
@@ -1960,5 +1983,5 @@
 };
 
-/** Set acceptance of weird packets
+/** Set acceptance of weird frames
  *
  *  @param device  The device to update
@@ -2136,5 +2159,5 @@
 }
 
-/** Force receiving all packets in the receive buffer
+/** Force receiving all frames in the receive buffer
  *
  *  @param device  The device to receive
Index: uspace/drv/nic/rtl8139/driver.h
===================================================================
--- uspace/drv/nic/rtl8139/driver.h	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/nic/rtl8139/driver.h	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -30,36 +30,40 @@
 #define RTL8139_DRIVER_H_
 
+#include <sys/types.h>
+#include <stdint.h>
 #include "defs.h"
 #include "general.h"
-#include <sys/types.h>
-#include <stdint.h>
 
 /** The driver name */
-#define NAME "rtl8139"
+#define NAME  "rtl8139"
+
 /** Transmittion buffers count */
-#define TX_BUFF_COUNT 4
-/** Size of buffer for one packet
- *  - 2kB
- */
-#define TX_BUFF_SIZE (2 * 1024)
-/** Count of pages to allocate for TxBuffers */
-#define TX_PAGES 2
+#define TX_BUFF_COUNT  4
+
+/** Size of buffer for one frame (2kB) */
+#define TX_BUFF_SIZE  (2 * 1024)
+
+/** Number of pages to allocate for TxBuffers */
+#define TX_PAGES  2
 
 /** Size of the CRC after the received frame in the receiver buffer */
-#define RTL8139_CRC_SIZE 4
-
-/** The default mode of accepting unicast packets */
-#define RTL8139_RCR_UCAST_DEFAULT RCR_ACCEPT_PHYS_MATCH
-/** The default mode of accepting multicast packets */
-#define RTL8139_RCR_MCAST_DEFAULT 0
-/** The default mode of accepting broadcast packets */
-#define RTL8139_RCR_BCAST_DEFAULT RCR_ACCEPT_BROADCAST
-/** The default mode of accepting defect packets */
-#define RTL8139_RCR_DEFECT_DEFAULT 0
+#define RTL8139_CRC_SIZE  4
+
+/** The default mode of accepting unicast frames */
+#define RTL8139_RCR_UCAST_DEFAULT  RCR_ACCEPT_PHYS_MATCH
+
+/** The default mode of accepting multicast frames */
+#define RTL8139_RCR_MCAST_DEFAULT  0
+
+/** The default mode of accepting broadcast frames */
+#define RTL8139_RCR_BCAST_DEFAULT  RCR_ACCEPT_BROADCAST
+
+/** The default mode of accepting defect frames */
+#define RTL8139_RCR_DEFECT_DEFAULT  0
 
 /** Mask for accepting all multicast */
-#define RTL8139_MCAST_MASK_PROMISC UINT64_MAX
-
-/** Data  */
+#define RTL8139_MCAST_MASK_PROMISC  UINT64_MAX
+
+/** Data */
 struct rtl8139_rcr_data {
 	/** Configuration part of RCR */
@@ -112,5 +116,5 @@
 	size_t tx_used;
 
-	/** Buffer for receiving packets */
+	/** Buffer for receiving frames */
 	void *rx_buff_phys;
 	void *rx_buff_virt;
@@ -134,7 +138,6 @@
 
 	/** Version of RT8139 controller */
-	enum rtl8139_version_id hw_version;
+	rtl8139_version_id_t hw_version;
 } rtl8139_t;
-
 
 /* ***** Pointers casting - for both amd64 and ia32 ***** */
@@ -160,6 +163,4 @@
  */
 #define IOADDR_TO_PTR(ioaddr) ((void*)((size_t)(ioaddr)))
-
-
 
 /* ***** Bit operation macros ***** */
@@ -177,5 +178,5 @@
  * @return New value
  */
-#define bit_set_part_g( src, value, mask, type ) \
+#define bit_set_part_g(src, value, mask, type) \
 	((type)(((src) & ~((type)(mask))) | ((value) & (type)(mask))))
 
@@ -237,4 +238,3 @@
 	bit_set_part_32(tsd_value, (size) << TSD_SIZE_SHIFT, TSD_SIZE_MASK << TSD_SIZE_SHIFT)
 
-
 #endif
Index: uspace/drv/nic/rtl8139/general.h
===================================================================
--- uspace/drv/nic/rtl8139/general.h	(revision e7778478ec6096c87bc7a5be1c827fff262b0cce)
+++ uspace/drv/nic/rtl8139/general.h	(revision 21063c2d25089e16cf80d5afdb1d0db1822696bd)
@@ -29,5 +29,5 @@
 /** @file
  *
- *  General functions and structures used in rtl8139 driver
+ * General functions and structures used in rtl8139 driver
  */
 
@@ -37,30 +37,30 @@
 #include <unistd.h>
 
-extern void* rtl8139_memcpy_wrapped(void *dest, const void *src_buf,
-    size_t src_offset, size_t src_size, size_t data_size);
-
+/** Number of microseconds in second */
+#define RTL8139_USEC_IN_SEC  1000000
 
 /** Structure for HW timer control */
-typedef struct rtl8139_timer_act {
+typedef struct {
 	/** Register value set in the last timer period */
 	uint32_t last_val;
+	
 	/** Register value set in the common timer period */
 	uint32_t full_val;
-
+	
 	/** Amount of full register periods in timer period */
 	size_t full_skips;
+	
 	/** Remaining full register periods to the next period end */
 	size_t full_skips_remains;
+	
 	/** Mark if there is a last run */
 	int last_run;
 } rtl8139_timer_act_t;
 
-/** Count of microseconds in second */
-#define RTL8139_USEC_IN_SEC 1000000
-
-extern int rtl8139_timer_act_init(rtl8139_timer_act_t *ta, uint32_t timer_freq,
-    const struct timeval *time);
-extern int rtl8139_timer_act_step(rtl8139_timer_act_t *ta, uint32_t *new_reg);
-
+extern void *rtl8139_memcpy_wrapped(void *, const void *, size_t, size_t,
+    size_t);
+extern int rtl8139_timer_act_init(rtl8139_timer_act_t *, uint32_t,
+    const struct timeval *);
+extern int rtl8139_timer_act_step(rtl8139_timer_act_t *, uint32_t *);
 
 #endif
