Index: uspace/drv/nic/rtl8139/defs.h
===================================================================
--- uspace/drv/nic/rtl8139/defs.h	(revision 5cc9eba114f1b3db3d9b0fce528eeec326c97785)
+++ uspace/drv/nic/rtl8139/defs.h	(revision 9cd81655f6cba65cbde69068b36eff82d99f80b8)
@@ -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 frame length in bytes allowed according to RTL8139
- *  documentation (see SIZE part of TSD documentation)
- */
-#define RTL8139_FRAME_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 */
@@ -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)
@@ -417,5 +420,5 @@
 
 /** Maximal runt frame size + 1 */
-#define RTL8139_RUNT_MAX_SIZE 64
+#define RTL8139_RUNT_MAX_SIZE  64
 
 /** Bits in frame header */
@@ -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];
+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)
+#define RTL8139_EARLY_SIZE  UINT16_C(0xfff0)
+
 /** The only supported pause frame time value */
-#define RTL8139_PAUSE_VAL UINT16_C(0xFFFF)
+#define RTL8139_PAUSE_VAL  UINT16_C(0xFFFF)
 
 /** Size of the frame header in front of the received frame */
-#define RTL_FRAME_HEADER_SIZE 4
+#define RTL_FRAME_HEADER_SIZE  4
 
 /** 8k buffer */
Index: uspace/drv/nic/rtl8139/driver.c
===================================================================
--- uspace/drv/nic/rtl8139/driver.c	(revision 5cc9eba114f1b3db3d9b0fce528eeec326c97785)
+++ uspace/drv/nic/rtl8139/driver.c	(revision 9cd81655f6cba65cbde69068b36eff82d99f80b8)
@@ -55,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)
@@ -82,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)
@@ -457,5 +465,5 @@
 	pio_write_32(tsd, tsd_value);
 	return;
-
+	
 err_busy_no_inc:
 err_size:
@@ -513,4 +521,5 @@
  *
  * @return The frame list node (not connected)
+ *
  */
 static nic_frame_t *rtl8139_read_frame(nic_t *nic_data,
@@ -1215,5 +1224,5 @@
 	ddf_msg(LVL_DEBUG, "The device is initialized");
 	return ret;
-
+	
 failed:
 	ddf_msg(LVL_ERROR, "The device initialization failed");
@@ -1342,5 +1351,5 @@
 
 	return EOK;
-
+	
 err_fun_bind:
 	ddf_fun_unbind(fun);
Index: uspace/drv/nic/rtl8139/driver.h
===================================================================
--- uspace/drv/nic/rtl8139/driver.h	(revision 5cc9eba114f1b3db3d9b0fce528eeec326c97785)
+++ uspace/drv/nic/rtl8139/driver.h	(revision 9cd81655f6cba65cbde69068b36eff82d99f80b8)
@@ -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 frame
- *  - 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
+#define RTL8139_CRC_SIZE  4
 
 /** The default mode of accepting unicast frames */
-#define RTL8139_RCR_UCAST_DEFAULT RCR_ACCEPT_PHYS_MATCH
+#define RTL8139_RCR_UCAST_DEFAULT  RCR_ACCEPT_PHYS_MATCH
+
 /** The default mode of accepting multicast frames */
-#define RTL8139_RCR_MCAST_DEFAULT 0
+#define RTL8139_RCR_MCAST_DEFAULT  0
+
 /** The default mode of accepting broadcast frames */
-#define RTL8139_RCR_BCAST_DEFAULT RCR_ACCEPT_BROADCAST
+#define RTL8139_RCR_BCAST_DEFAULT  RCR_ACCEPT_BROADCAST
+
 /** The default mode of accepting defect frames */
-#define RTL8139_RCR_DEFECT_DEFAULT 0
+#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 */
@@ -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 5cc9eba114f1b3db3d9b0fce528eeec326c97785)
+++ uspace/drv/nic/rtl8139/general.h	(revision 9cd81655f6cba65cbde69068b36eff82d99f80b8)
@@ -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
