Index: uspace/srv/net/netif/dp8390/dp8390.c
===================================================================
--- uspace/srv/net/netif/dp8390/dp8390.c	(revision 1e2e0c1eeb07d0d3faf4a5b53314c73e3b0c1a2a)
+++ uspace/srv/net/netif/dp8390/dp8390.c	(revision 771599490c9c1e7f468c40fc138f10e8ac0282dc)
@@ -67,5 +67,5 @@
  *  @returns EINVAL 
  */
-int	queue_packet( dpeth_t * dep, packet_t packet );
+int queue_packet(dpeth_t * dep, packet_t packet);
 
 /** Reads a memory block byte by byte.
@@ -74,5 +74,5 @@
  *  @param[in] size The memory block size in bytes.
  */
-static void outsb( port_t port, void * buf, size_t size );
+static void outsb(port_t port, void * buf, size_t size);
 
 /** Reads a memory block word by word.
@@ -81,5 +81,5 @@
  *  @param[in] size The memory block size in bytes.
  */
-static void outsw( port_t port, void * buf, size_t size );
+static void outsw(port_t port, void * buf, size_t size);
 
 //static u16_t eth_ign_proto;
@@ -98,7 +98,7 @@
 //{
 	/* I/O port, IRQ,  Buffer address,  Env. var. */
-/*	{  0x280,     3,    0xD0000,        "DPETH0"	},
-	{  0x300,     5,    0xC8000,        "DPETH1"	},
-	{  0x380,    10,    0xD8000,        "DPETH2"	},
+/*	{ 0x280,     3,    0xD0000,        "DPETH0"	},
+	{ 0x300,     5,    0xC8000,        "DPETH1"	},
+	{ 0x380,    10,    0xD8000,        "DPETH2"	},
 };
 */
@@ -126,93 +126,93 @@
 
 //#if ENABLE_PCI
-//_PROTOTYPE( static void pci_conf, (void)				);
+//_PROTOTYPE(static void pci_conf, (void)				);
 //#endif
-//_PROTOTYPE( static void do_vwrite, (message *mp, int from_int,
+//_PROTOTYPE(static void do_vwrite, (message *mp, int from_int,
 //							int vectored)	);
-//_PROTOTYPE( static void do_vwrite_s, (message *mp, int from_int)	);
-//_PROTOTYPE( static void do_vread, (message *mp, int vectored)		);
-//_PROTOTYPE( static void do_vread_s, (message *mp)			);
-//_PROTOTYPE( static void do_init, (message *mp)				);
-//_PROTOTYPE( static void do_int, (dpeth_t *dep)				);
-//_PROTOTYPE( static void do_getstat, (message *mp)			);
-//_PROTOTYPE( static void do_getstat_s, (message *mp)			);
-//_PROTOTYPE( static void do_getname, (message *mp)			);
-//_PROTOTYPE( static void do_stop, (message *mp)				);
-_PROTOTYPE( static void dp_init, (dpeth_t *dep)				);
-//_PROTOTYPE( static void dp_confaddr, (dpeth_t *dep)			);
-_PROTOTYPE( static void dp_reinit, (dpeth_t *dep)			);
-_PROTOTYPE( static void dp_reset, (dpeth_t *dep)			);
-//_PROTOTYPE( static void dp_check_ints, (dpeth_t *dep)			);
-_PROTOTYPE( static void dp_recv, (dpeth_t *dep)				);
-_PROTOTYPE( static void dp_send, (dpeth_t *dep)				);
-//_PROTOTYPE( static void dp8390_stop, (void)				);
-_PROTOTYPE( static void dp_getblock, (dpeth_t *dep, int page,
+//_PROTOTYPE(static void do_vwrite_s, (message *mp, int from_int)	);
+//_PROTOTYPE(static void do_vread, (message *mp, int vectored)		);
+//_PROTOTYPE(static void do_vread_s, (message *mp)			);
+//_PROTOTYPE(static void do_init, (message *mp)				);
+//_PROTOTYPE(static void do_int, (dpeth_t *dep)				);
+//_PROTOTYPE(static void do_getstat, (message *mp)			);
+//_PROTOTYPE(static void do_getstat_s, (message *mp)			);
+//_PROTOTYPE(static void do_getname, (message *mp)			);
+//_PROTOTYPE(static void do_stop, (message *mp)				);
+_PROTOTYPE(static void dp_init, (dpeth_t *dep)				);
+//_PROTOTYPE(static void dp_confaddr, (dpeth_t *dep)			);
+_PROTOTYPE(static void dp_reinit, (dpeth_t *dep)			);
+_PROTOTYPE(static void dp_reset, (dpeth_t *dep)			);
+//_PROTOTYPE(static void dp_check_ints, (dpeth_t *dep)			);
+_PROTOTYPE(static void dp_recv, (dpeth_t *dep)				);
+_PROTOTYPE(static void dp_send, (dpeth_t *dep)				);
+//_PROTOTYPE(static void dp8390_stop, (void)				);
+_PROTOTYPE(static void dp_getblock, (dpeth_t *dep, int page,
 				size_t offset, size_t size, void *dst)	);
-_PROTOTYPE( static void dp_pio8_getblock, (dpeth_t *dep, int page,
+_PROTOTYPE(static void dp_pio8_getblock, (dpeth_t *dep, int page,
 				size_t offset, size_t size, void *dst)	);
-_PROTOTYPE( static void dp_pio16_getblock, (dpeth_t *dep, int page,
+_PROTOTYPE(static void dp_pio16_getblock, (dpeth_t *dep, int page,
 				size_t offset, size_t size, void *dst)	);
-_PROTOTYPE( static int dp_pkt2user, (dpeth_t *dep, int page,
-							int length)	);
-//_PROTOTYPE( static int dp_pkt2user_s, (dpeth_t *dep, int page,
+_PROTOTYPE(static int dp_pkt2user, (dpeth_t *dep, int page,
+							int length) );
+//_PROTOTYPE(static int dp_pkt2user_s, (dpeth_t *dep, int page,
 //							int length)	);
-_PROTOTYPE( static void dp_user2nic, (dpeth_t *dep, iovec_dat_t *iovp, 
-		vir_bytes offset, int nic_addr, vir_bytes count)	);
-//_PROTOTYPE( static void dp_user2nic_s, (dpeth_t *dep, iovec_dat_s_t *iovp, 
+_PROTOTYPE(static void dp_user2nic, (dpeth_t *dep, iovec_dat_t *iovp, 
+		vir_bytes offset, int nic_addr, vir_bytes count) );
+//_PROTOTYPE(static void dp_user2nic_s, (dpeth_t *dep, iovec_dat_s_t *iovp, 
 //		vir_bytes offset, int nic_addr, vir_bytes count)	);
-_PROTOTYPE( static void dp_pio8_user2nic, (dpeth_t *dep,
+_PROTOTYPE(static void dp_pio8_user2nic, (dpeth_t *dep,
 				iovec_dat_t *iovp, vir_bytes offset,
-				int nic_addr, vir_bytes count)		);
-//_PROTOTYPE( static void dp_pio8_user2nic_s, (dpeth_t *dep,
+				int nic_addr, vir_bytes count) );
+//_PROTOTYPE(static void dp_pio8_user2nic_s, (dpeth_t *dep,
 //				iovec_dat_s_t *iovp, vir_bytes offset,
 //				int nic_addr, vir_bytes count)		);
-_PROTOTYPE( static void dp_pio16_user2nic, (dpeth_t *dep,
+_PROTOTYPE(static void dp_pio16_user2nic, (dpeth_t *dep,
 				iovec_dat_t *iovp, vir_bytes offset,
-				int nic_addr, vir_bytes count)		);
-//_PROTOTYPE( static void dp_pio16_user2nic_s, (dpeth_t *dep,
+				int nic_addr, vir_bytes count) );
+//_PROTOTYPE(static void dp_pio16_user2nic_s, (dpeth_t *dep,
 //				iovec_dat_s_t *iovp, vir_bytes offset,
 //				int nic_addr, vir_bytes count)		);
-_PROTOTYPE( static void dp_nic2user, (dpeth_t *dep, int nic_addr, 
+_PROTOTYPE(static void dp_nic2user, (dpeth_t *dep, int nic_addr, 
 		iovec_dat_t *iovp, vir_bytes offset, vir_bytes count)	);
-//_PROTOTYPE( static void dp_nic2user_s, (dpeth_t *dep, int nic_addr, 
+//_PROTOTYPE(static void dp_nic2user_s, (dpeth_t *dep, int nic_addr, 
 //		iovec_dat_s_t *iovp, vir_bytes offset, vir_bytes count)	);
-_PROTOTYPE( static void dp_pio8_nic2user, (dpeth_t *dep, int nic_addr, 
+_PROTOTYPE(static void dp_pio8_nic2user, (dpeth_t *dep, int nic_addr, 
 		iovec_dat_t *iovp, vir_bytes offset, vir_bytes count)	);
-//_PROTOTYPE( static void dp_pio8_nic2user_s, (dpeth_t *dep, int nic_addr, 
+//_PROTOTYPE(static void dp_pio8_nic2user_s, (dpeth_t *dep, int nic_addr, 
 //		iovec_dat_s_t *iovp, vir_bytes offset, vir_bytes count)	);
-_PROTOTYPE( static void dp_pio16_nic2user, (dpeth_t *dep, int nic_addr, 
+_PROTOTYPE(static void dp_pio16_nic2user, (dpeth_t *dep, int nic_addr, 
 		iovec_dat_t *iovp, vir_bytes offset, vir_bytes count)	);
-//_PROTOTYPE( static void dp_pio16_nic2user_s, (dpeth_t *dep, int nic_addr, 
+//_PROTOTYPE(static void dp_pio16_nic2user_s, (dpeth_t *dep, int nic_addr, 
 //		iovec_dat_s_t *iovp, vir_bytes offset, vir_bytes count)	);
-_PROTOTYPE( static void dp_next_iovec, (iovec_dat_t *iovp)		);
-//_PROTOTYPE( static void dp_next_iovec_s, (iovec_dat_s_t *iovp)		);
-_PROTOTYPE( static void conf_hw, (dpeth_t *dep)				);
-//_PROTOTYPE( static void update_conf, (dpeth_t *dep, dp_conf_t *dcp)	);
-_PROTOTYPE( static void map_hw_buffer, (dpeth_t *dep)			);
-//_PROTOTYPE( static int calc_iovec_size, (iovec_dat_t *iovp)		);
-//_PROTOTYPE( static int calc_iovec_size_s, (iovec_dat_s_t *iovp)		);
-_PROTOTYPE( static void reply, (dpeth_t *dep, int err, int may_block)	);
-//_PROTOTYPE( static void mess_reply, (message *req, message *reply)	);
-_PROTOTYPE( static void get_userdata, (int user_proc,
+_PROTOTYPE(static void dp_next_iovec, (iovec_dat_t *iovp)		);
+//_PROTOTYPE(static void dp_next_iovec_s, (iovec_dat_s_t *iovp)		);
+_PROTOTYPE(static void conf_hw, (dpeth_t *dep)				);
+//_PROTOTYPE(static void update_conf, (dpeth_t *dep, dp_conf_t *dcp)	);
+_PROTOTYPE(static void map_hw_buffer, (dpeth_t *dep)			);
+//_PROTOTYPE(static int calc_iovec_size, (iovec_dat_t *iovp)		);
+//_PROTOTYPE(static int calc_iovec_size_s, (iovec_dat_s_t *iovp)		);
+_PROTOTYPE(static void reply, (dpeth_t *dep, int err, int may_block)	);
+//_PROTOTYPE(static void mess_reply, (message *req, message *reply)	);
+_PROTOTYPE(static void get_userdata, (int user_proc,
 		vir_bytes user_addr, vir_bytes count, void *loc_addr)	);
-//_PROTOTYPE( static void get_userdata_s, (int user_proc,
+//_PROTOTYPE(static void get_userdata_s, (int user_proc,
 //		cp_grant_id_t grant, vir_bytes offset, vir_bytes count,
 //		void *loc_addr)	);
-//_PROTOTYPE( static void put_userdata, (int user_proc,
+//_PROTOTYPE(static void put_userdata, (int user_proc,
 //		vir_bytes user_addr, vir_bytes count, void *loc_addr)	);
-//_PROTOTYPE( static void put_userdata_s, (int user_proc,
+//_PROTOTYPE(static void put_userdata_s, (int user_proc,
 //		cp_grant_id_t grant, size_t count, void *loc_addr)	);
-_PROTOTYPE( static void insb, (port_t port, void *buf, size_t size)				);
-_PROTOTYPE( static void insw, (port_t port, void *buf, size_t size)				);
-//_PROTOTYPE( static void do_vir_insb, (port_t port, int proc,
+_PROTOTYPE(static void insb, (port_t port, void *buf, size_t size)				);
+_PROTOTYPE(static void insw, (port_t port, void *buf, size_t size)				);
+//_PROTOTYPE(static void do_vir_insb, (port_t port, int proc,
 //					vir_bytes buf, size_t size)	);
-//_PROTOTYPE( static void do_vir_insw, (port_t port, int proc,
+//_PROTOTYPE(static void do_vir_insw, (port_t port, int proc,
 //					vir_bytes buf, size_t size)	);
-//_PROTOTYPE( static void do_vir_outsb, (port_t port, int proc,
+//_PROTOTYPE(static void do_vir_outsb, (port_t port, int proc,
 //					vir_bytes buf, size_t size)	);
-//_PROTOTYPE( static void do_vir_outsw, (port_t port, int proc,
+//_PROTOTYPE(static void do_vir_outsw, (port_t port, int proc,
 //					vir_bytes buf, size_t size)	);
 
-int do_probe( dpeth_t * dep ){
+int do_probe(dpeth_t * dep){
 	/* This is the default, try to (re)locate the device. */
 	conf_hw(dep);
@@ -230,5 +230,5 @@
  *				dp8390_dump				     *
  *===========================================================================*/
-void dp8390_dump( dpeth_t * dep )
+void dp8390_dump(dpeth_t * dep)
 {
 //	dpeth_t *dep;
@@ -282,5 +282,5 @@
  *				do_init					     *
  *===========================================================================*/
-int do_init( dpeth_t * dep, int mode ){
+int do_init(dpeth_t * dep, int mode){
 	if (dep->de_mode == DEM_DISABLED)
 	{
@@ -303,13 +303,13 @@
 	}
 	assert(dep->de_mode == DEM_ENABLED);
-	assert(dep->de_flags & DEF_ENABLED);
+	assert(dep->de_flags &DEF_ENABLED);
 
 	dep->de_flags &= ~(DEF_PROMISC | DEF_MULTI | DEF_BROAD);
 
-	if (mode & DL_PROMISC_REQ)
+	if (mode &DL_PROMISC_REQ)
 		dep->de_flags |= DEF_PROMISC | DEF_MULTI | DEF_BROAD;
-	if (mode & DL_MULTI_REQ)
+	if (mode &DL_MULTI_REQ)
 		dep->de_flags |= DEF_MULTI;
-	if (mode & DL_BROAD_REQ)
+	if (mode &DL_BROAD_REQ)
 		dep->de_flags |= DEF_BROAD;
 
@@ -329,8 +329,8 @@
  *				do_stop					     *
  *===========================================================================*/
-void do_stop( dpeth_t * dep ){
-	if(( dep->de_mode != DEM_SINK ) && ( dep->de_mode == DEM_ENABLED ) && ( dep->de_flags & DEF_ENABLED )){
-		outb_reg0( dep, DP_CR, CR_STP | CR_DM_ABORT );
-		( dep->de_stopf )( dep );
+void do_stop(dpeth_t * dep){
+	if((dep->de_mode != DEM_SINK) && (dep->de_mode == DEM_ENABLED) && (dep->de_flags &DEF_ENABLED)){
+		outb_reg0(dep, DP_CR, CR_STP | CR_DM_ABORT);
+		(dep->de_stopf)(dep);
 
 		dep->de_flags = DEF_EMPTY;
@@ -338,20 +338,20 @@
 }
 
-int queue_packet( dpeth_t * dep, packet_t packet ){
-	packet_t	tmp;
-
-	if( dep->packet_count >= MAX_PACKETS ){
-		netif_pq_release( packet_get_id( packet ));
+int queue_packet(dpeth_t * dep, packet_t packet){
+	packet_t tmp;
+
+	if(dep->packet_count >= MAX_PACKETS){
+		netif_pq_release(packet_get_id(packet));
 		return ELIMIT;
 	}
 
 	tmp = dep->packet_queue;
-	while( pq_next( tmp )){
-		tmp = pq_next( tmp );
-	}
-	if( pq_add( & tmp, packet, 0, 0 ) != EOK ){
+	while(pq_next(tmp)){
+		tmp = pq_next(tmp);
+	}
+	if(pq_add(&tmp, packet, 0, 0) != EOK){
 		return EINVAL;
 	}
-	if( ! dep->packet_count ){
+	if(! dep->packet_count){
 		dep->packet_queue = packet;
 	}
@@ -363,5 +363,5 @@
  *			based on	do_vwrite				     *
  *===========================================================================*/
-int do_pwrite( dpeth_t * dep, packet_t packet, int from_int )
+int do_pwrite(dpeth_t * dep, packet_t packet, int from_int)
 {
 //	int port, count, size;
@@ -386,9 +386,9 @@
 	}
 	assert(dep->de_mode == DEM_ENABLED);
-	assert(dep->de_flags & DEF_ENABLED);
-	if( dep->packet_queue && ( ! from_int )){
-//	if (dep->de_flags & DEF_SEND_AVAIL){
+	assert(dep->de_flags &DEF_ENABLED);
+	if(dep->packet_queue && (! from_int)){
+//	if (dep->de_flags &DEF_SEND_AVAIL){
 //		panic("", "dp8390: send already in progress", NO_NUM);
-		return queue_packet( dep, packet );
+		return queue_packet(dep, packet);
 	}
 
@@ -402,7 +402,7 @@
 //		reply(dep, OK, FALSE);
 //		return;
-//		return queue_packet( dep, packet );
+//		return queue_packet(dep, packet);
 //	}
-//	assert(!(dep->de_flags & DEF_PACK_SEND));
+//	assert(!(dep->de_flags &DEF_PACK_SEND));
 
 /*	if (vectored)
@@ -419,5 +419,5 @@
 	}
 	else
-	{  
+	{ 
 		dep->de_write_iovec.iod_iovec[0].iov_addr =
 			(vir_bytes) mp->DL_ADDR;
@@ -430,6 +430,6 @@
 	}
 */
-	size = packet_get_data_length( packet );
-	dep->de_write_iovec.iod_iovec[0].iov_addr = ( vir_bytes ) packet_get_data( packet );
+	size = packet_get_data_length(packet);
+	dep->de_write_iovec.iod_iovec[0].iov_addr = (vir_bytes) packet_get_data(packet);
 	dep->de_write_iovec.iod_iovec[0].iov_size = size;
 	dep->de_write_iovec.iod_iovec_s = 1;
@@ -449,5 +449,5 @@
 		outb_reg0(dep, DP_TPSR, dep->de_sendq[sendq_head].sq_sendpage);
 		outb_reg0(dep, DP_TBCR1, size >> 8);
-		outb_reg0(dep, DP_TBCR0, size & 0xff);
+		outb_reg0(dep, DP_TBCR0, size &0xff);
 		outb_reg0(dep, DP_CR, CR_TXP | CR_EXTRA);/* there it goes.. */
 	}
@@ -470,5 +470,5 @@
 
 	assert(dep->de_mode == DEM_ENABLED);
-	assert(dep->de_flags & DEF_ENABLED);
+	assert(dep->de_flags &DEF_ENABLED);
 	return EOK;
 }
@@ -516,9 +516,9 @@
 	/* Step 4: */
 	dp_rcr_reg = 0;
-	if (dep->de_flags & DEF_PROMISC)
+	if (dep->de_flags &DEF_PROMISC)
 		dp_rcr_reg |= RCR_AB | RCR_PRO | RCR_AM;
-	if (dep->de_flags & DEF_BROAD)
+	if (dep->de_flags &DEF_BROAD)
 		dp_rcr_reg |= RCR_AB;
-	if (dep->de_flags & DEF_MULTI)
+	if (dep->de_flags &DEF_MULTI)
 		dp_rcr_reg |= RCR_AM;
 	outb_reg0(dep, DP_RCR, dp_rcr_reg);
@@ -621,9 +621,9 @@
 
 	dp_rcr_reg = 0;
-	if (dep->de_flags & DEF_PROMISC)
+	if (dep->de_flags &DEF_PROMISC)
 		dp_rcr_reg |= RCR_AB | RCR_PRO | RCR_AM;
-	if (dep->de_flags & DEF_BROAD)
+	if (dep->de_flags &DEF_BROAD)
 		dp_rcr_reg |= RCR_AB;
-	if (dep->de_flags & DEF_MULTI)
+	if (dep->de_flags &DEF_MULTI)
 		dp_rcr_reg |= RCR_AM;
 	outb_reg0(dep, DP_RCR, dp_rcr_reg);
@@ -642,5 +642,5 @@
 	outb_reg0(dep, DP_RBCR0, 0);
 	outb_reg0(dep, DP_RBCR1, 0);
-	for (i= 0; i < 0x1000 && ((inb_reg0(dep, DP_ISR) & ISR_RST) == 0); i++)
+	for (i= 0; i < 0x1000 && ((inb_reg0(dep, DP_ISR) &ISR_RST) == 0); i++)
 		; /* Do nothing */
 	outb_reg0(dep, DP_TCR, TCR_1EXTERNAL|TCR_OFST);
@@ -649,7 +649,7 @@
 
 	/* Acknowledge the ISR_RDC (remote dma) interrupt. */
-	for (i= 0; i < 0x1000 && ((inb_reg0(dep, DP_ISR) & ISR_RDC) == 0); i++)
+	for (i= 0; i < 0x1000 && ((inb_reg0(dep, DP_ISR) &ISR_RDC) == 0); i++)
 		; /* Do nothing */
-	outb_reg0(dep, DP_ISR, inb_reg0(dep, DP_ISR) & ~ISR_RDC);
+	outb_reg0(dep, DP_ISR, inb_reg0(dep, DP_ISR) &~ISR_RDC);
 
 	/* Reset the transmit ring. If we were transmitting a packet, we
@@ -674,5 +674,5 @@
 	int size, sendq_tail;
 
-	if (!(dep->de_flags & DEF_ENABLED))
+	if (!(dep->de_flags &DEF_ENABLED))
 		panic("", "dp8390: got premature interrupt", NO_NUM);
 
@@ -683,10 +683,10 @@
 			break;
 		outb_reg0(dep, DP_ISR, isr);
-		if (isr & (ISR_PTX|ISR_TXE))
-		{
-			if (isr & ISR_TXE)
+		if (isr &(ISR_PTX|ISR_TXE))
+		{
+			if (isr &ISR_TXE)
 			{
 #if DEBUG
- { printf("%s: got send Error\n", dep->de_name); }
+ {printf("%s: got send Error\n", dep->de_name);}
 #endif
 				dep->de_stat.ets_sendErr++;
@@ -696,7 +696,7 @@
 				tsr = inb_reg0(dep, DP_TSR);
 
-				if (tsr & TSR_PTX) dep->de_stat.ets_packetT++;
+				if (tsr &TSR_PTX) dep->de_stat.ets_packetT++;
 #if 0	/* Reserved in later manuals, should be ignored */
-				if (!(tsr & TSR_DFR))
+				if (!(tsr &TSR_DFR))
 				{
 					/* In most (all?) implementations of
@@ -707,8 +707,8 @@
 				}
 #endif
-				if (tsr & TSR_COL) dep->de_stat.ets_collision++;
-				if (tsr & TSR_ABT) dep->de_stat.ets_transAb++;
-				if (tsr & TSR_CRS) dep->de_stat.ets_carrSense++;
-				if (tsr & TSR_FU
+				if (tsr &TSR_COL) dep->de_stat.ets_collision++;
+				if (tsr &TSR_ABT) dep->de_stat.ets_transAb++;
+				if (tsr &TSR_CRS) dep->de_stat.ets_carrSense++;
+				if (tsr &TSR_FU
 					&& ++dep->de_stat.ets_fifoUnder <= 10)
 				{
@@ -716,5 +716,5 @@
 						dep->de_name);
 				}
-				if (tsr & TSR_CDH
+				if (tsr &TSR_CDH
 					&& ++dep->de_stat.ets_CDheartbeat <= 10)
 				{
@@ -722,5 +722,5 @@
 						dep->de_name);
 				}
-				if (tsr & TSR_OWC) dep->de_stat.ets_OWC++;
+				if (tsr &TSR_OWC) dep->de_stat.ets_OWC++;
 			}
 			sendq_tail= dep->de_sendq_tail;
@@ -747,20 +747,20 @@
 					dep->de_sendq[sendq_tail].sq_sendpage);
 				outb_reg0(dep, DP_TBCR1, size >> 8);
-				outb_reg0(dep, DP_TBCR0, size & 0xff);
+				outb_reg0(dep, DP_TBCR0, size &0xff);
 				outb_reg0(dep, DP_CR, CR_TXP | CR_EXTRA);
 			}
-//			if (dep->de_flags & DEF_SEND_AVAIL)
+//			if (dep->de_flags &DEF_SEND_AVAIL)
 				dp_send(dep);
 		}
 
-		if (isr & ISR_PRX)
+		if (isr &ISR_PRX)
 		{
 			/* Only call dp_recv if there is a read request */
-//			if (dep->de_flags) & DEF_READING)
+//			if (dep->de_flags) &DEF_READING)
 				dp_recv(dep);
 		}
 		
-		if (isr & ISR_RXE) dep->de_stat.ets_recvErr++;
-		if (isr & ISR_CNT)
+		if (isr &ISR_RXE) dep->de_stat.ets_recvErr++;
+		if (isr &ISR_CNT)
 		{
 			dep->de_stat.ets_CRCerr += inb_reg0(dep, DP_CNTR0);
@@ -768,12 +768,12 @@
 			dep->de_stat.ets_missedP += inb_reg0(dep, DP_CNTR2);
 		}
-		if (isr & ISR_OVW)
+		if (isr &ISR_OVW)
 		{
 			dep->de_stat.ets_OVW++;
 #if 0
-			{ printW(); printf(
-				"%s: got overwrite warning\n", dep->de_name); }
+			{printW(); printf(
+				"%s: got overwrite warning\n", dep->de_name);}
 #endif
-/*			if (dep->de_flags & DEF_READING)
+/*			if (dep->de_flags &DEF_READING)
 			{
 				printf(
@@ -782,9 +782,9 @@
 			}
 */		}
-		if (isr & ISR_RDC)
+		if (isr &ISR_RDC)
 		{
 			/* Nothing to do */
 		}
-		if (isr & ISR_RST)
+		if (isr &ISR_RST)
 		{
 			/* this means we got an interrupt but the ethernet 
@@ -794,6 +794,6 @@
 			 */
 #if 0
-			 { printW(); printf(
-				"%s: NIC stopped\n", dep->de_name); }
+			 {printW(); printf(
+				"%s: NIC stopped\n", dep->de_name);}
 #endif
 			dep->de_flags |= DEF_STOPPED;
@@ -802,7 +802,7 @@
 		isr = inb_reg0(dep, DP_ISR);
 	}
-//	if ((dep->de_flags & (DEF_READING|DEF_STOPPED)) == 
+//	if ((dep->de_flags &(DEF_READING|DEF_STOPPED)) == 
 //						(DEF_READING|DEF_STOPPED))
-	if ((dep->de_flags & DEF_STOPPED) == DEF_STOPPED )
+	if ((dep->de_flags &DEF_STOPPED) == DEF_STOPPED)
 	{
 		/* The chip is stopped, and all arrived packets are 
@@ -874,5 +874,5 @@
 			dep->de_stat.ets_packetR++;
 		}
-*/		else if (header.dr_status & RSR_FO)
+*/		else if (header.dr_status &RSR_FO)
 		{
 			/* This is very serious, so we issue a warning and
@@ -883,6 +883,6 @@
 			next = curr;
 		}
-		else if ((header.dr_status & RSR_PRX) &&
-					   (dep->de_flags & DEF_ENABLED))
+		else if ((header.dr_status &RSR_PRX) && 
+					   (dep->de_flags &DEF_ENABLED))
 		{
 //			if (dep->de_safecopy_read)
@@ -914,15 +914,15 @@
 	packet_t packet;
 
-//	if (!(dep->de_flags & DEF_SEND_AVAIL))
+//	if (!(dep->de_flags &DEF_SEND_AVAIL))
 //		return;
 
-	if( dep->packet_queue ){
+	if(dep->packet_queue){
 		packet = dep->packet_queue;
-		dep->packet_queue = pq_detach( packet );
-		do_pwrite( dep, packet, TRUE );
-		netif_pq_release( packet_get_id( packet ));
+		dep->packet_queue = pq_detach(packet);
+		do_pwrite(dep, packet, TRUE);
+		netif_pq_release(packet_get_id(packet));
 		-- dep->packet_count;
 	}
-//	if( ! dep->packet_queue ){
+//	if(! dep->packet_queue){
 //		dep->de_flags &= ~DEF_SEND_AVAIL;
 //	}
@@ -967,7 +967,7 @@
 {
 	offset = page * DP_PAGESIZE + offset;
-	outb_reg0(dep, DP_RBCR0, size & 0xFF);
+	outb_reg0(dep, DP_RBCR0, size &0xFF);
 	outb_reg0(dep, DP_RBCR1, size >> 8);
-	outb_reg0(dep, DP_RSAR0, offset & 0xFF);
+	outb_reg0(dep, DP_RSAR0, offset &0xFF);
 	outb_reg0(dep, DP_RSAR1, offset >> 8);
 	outb_reg0(dep, DP_CR, CR_DM_RR | CR_PS_P0 | CR_STA);
@@ -987,11 +987,11 @@
 {
 	offset = page * DP_PAGESIZE + offset;
-	outb_reg0(dep, DP_RBCR0, size & 0xFF);
+	outb_reg0(dep, DP_RBCR0, size &0xFF);
 	outb_reg0(dep, DP_RBCR1, size >> 8);
-	outb_reg0(dep, DP_RSAR0, offset & 0xFF);
+	outb_reg0(dep, DP_RSAR0, offset &0xFF);
 	outb_reg0(dep, DP_RSAR1, offset >> 8);
 	outb_reg0(dep, DP_CR, CR_DM_RR | CR_PS_P0 | CR_STA);
 
-	assert (!(size & 1));
+	assert (!(size &1));
 	insw(dep->de_data_port, dst, size);
 }
@@ -1005,12 +1005,14 @@
 {
 	int last, count;
-	packet_t	packet;
-
-//	if (!(dep->de_flags & DEF_READING))
+	packet_t packet;
+
+//	if (!(dep->de_flags &DEF_READING))
 //		return EGENERIC;
 
-	packet = netif_packet_get_1( length );
-	if( ! packet ) return ENOMEM;
-	dep->de_read_iovec.iod_iovec[0].iov_addr = ( vir_bytes ) packet_suffix( packet, length );
+	packet = netif_packet_get_1(length);
+	if(! packet){
+		return ENOMEM;
+	}
+	dep->de_read_iovec.iod_iovec[0].iov_addr = (vir_bytes) packet_suffix(packet, length);
 	dep->de_read_iovec.iod_iovec[0].iov_size = length;
 	dep->de_read_iovec.iod_iovec_s = 1;
@@ -1028,5 +1030,5 @@
 			sizeof(dp_rcvhdr_t), &dep->de_tmp_iovec, 0, count);
 		(dep->de_nic2userf)(dep, dep->de_startpage * DP_PAGESIZE, 
-				&dep->de_read_iovec, count, length - count);
+			&dep->de_read_iovec, count, length - count);
 	}
 	else
@@ -1040,12 +1042,12 @@
 //	dep->de_flags &= ~DEF_READING;
 
-	if( dep->received_count >= MAX_PACKETS ){
-		netif_pq_release( packet_get_id( packet ));
+	if(dep->received_count >= MAX_PACKETS){
+		netif_pq_release(packet_get_id(packet));
 		return ELIMIT;
 	}else{
-		if( pq_add( & dep->received_queue, packet, 0, 0 ) == EOK ){
+		if(pq_add(&dep->received_queue, packet, 0, 0) == EOK){
 			++ dep->received_count;
 		}else{
-			netif_pq_release( packet_get_id( packet ));
+			netif_pq_release(packet_get_id(packet));
 		}
 	}
@@ -1119,7 +1121,7 @@
 	outb_reg0(dep, DP_ISR, ISR_RDC);
 
-	outb_reg0(dep, DP_RBCR0, count & 0xFF);
+	outb_reg0(dep, DP_RBCR0, count &0xFF);
 	outb_reg0(dep, DP_RBCR1, count >> 8);
-	outb_reg0(dep, DP_RSAR0, nic_addr & 0xFF);
+	outb_reg0(dep, DP_RSAR0, nic_addr &0xFF);
 	outb_reg0(dep, DP_RSAR1, nic_addr >> 8);
 	outb_reg0(dep, DP_CR, CR_DM_RW | CR_PS_P0 | CR_STA);
@@ -1154,5 +1156,5 @@
 	for (i= 0; i<100; i++)
 	{
-		if (inb_reg0(dep, DP_ISR) & ISR_RDC)
+		if (inb_reg0(dep, DP_ISR) &ISR_RDC)
 			break;
 	}
@@ -1181,11 +1183,11 @@
 	int odd_byte;
 
-	ecount= (count+1) & ~1;
+	ecount= (count+1) &~1;
 	odd_byte= 0;
 
 	outb_reg0(dep, DP_ISR, ISR_RDC);
-	outb_reg0(dep, DP_RBCR0, ecount & 0xFF);
+	outb_reg0(dep, DP_RBCR0, ecount &0xFF);
 	outb_reg0(dep, DP_RBCR1, ecount >> 8);
-	outb_reg0(dep, DP_RSAR0, nic_addr & 0xFF);
+	outb_reg0(dep, DP_RSAR0, nic_addr &0xFF);
 	outb_reg0(dep, DP_RSAR1, nic_addr >> 8);
 	outb_reg0(dep, DP_CR, CR_DM_RW | CR_PS_P0 | CR_STA);
@@ -1234,5 +1236,5 @@
 				continue;
 		}
-		ecount= bytes & ~1;
+		ecount= bytes &~1;
 		if (ecount != 0)
 		{
@@ -1271,5 +1273,5 @@
 	for (i= 0; i<100; i++)
 	{
-		if (inb_reg0(dep, DP_ISR) & ISR_RDC)
+		if (inb_reg0(dep, DP_ISR) &ISR_RDC)
 			break;
 	}
@@ -1343,7 +1345,7 @@
 	vir_bytes bytes;
 
-	outb_reg0(dep, DP_RBCR0, count & 0xFF);
+	outb_reg0(dep, DP_RBCR0, count &0xFF);
 	outb_reg0(dep, DP_RBCR1, count >> 8);
-	outb_reg0(dep, DP_RSAR0, nic_addr & 0xFF);
+	outb_reg0(dep, DP_RSAR0, nic_addr &0xFF);
 	outb_reg0(dep, DP_RSAR1, nic_addr >> 8);
 	outb_reg0(dep, DP_CR, CR_DM_RR | CR_PS_P0 | CR_STA);
@@ -1395,10 +1397,10 @@
 	int odd_byte;
 
-	ecount= (count+1) & ~1;
+	ecount= (count+1) &~1;
 	odd_byte= 0;
 
-	outb_reg0(dep, DP_RBCR0, ecount & 0xFF);
+	outb_reg0(dep, DP_RBCR0, ecount &0xFF);
 	outb_reg0(dep, DP_RBCR1, ecount >> 8);
-	outb_reg0(dep, DP_RSAR0, nic_addr & 0xFF);
+	outb_reg0(dep, DP_RSAR0, nic_addr &0xFF);
 	outb_reg0(dep, DP_RSAR1, nic_addr >> 8);
 	outb_reg0(dep, DP_CR, CR_DM_RR | CR_PS_P0 | CR_STA);
@@ -1445,5 +1447,5 @@
 				continue;
 		}
-		ecount= bytes & ~1;
+		ecount= bytes &~1;
 		if (ecount != 0)
 		{
@@ -1502,5 +1504,5 @@
 dpeth_t *dep;
 {
-//	static eth_stat_t empty_stat = {0, 0, 0, 0, 0, 0 	/* ,... */ };
+//	static eth_stat_t empty_stat = {0, 0, 0, 0, 0, 0 	/* ,... */};
 
 //	int ifnr;
@@ -1551,5 +1553,5 @@
 		return;
 	}else{
-		printf( "map_hw_buffer: no buffer!\n" );
+		printf("map_hw_buffer: no buffer!\n");
 	}
 
@@ -1584,7 +1586,7 @@
 
 	status = 0;
-	if (dep->de_flags & DEF_PACK_SEND)
+	if (dep->de_flags &DEF_PACK_SEND)
 		status |= DL_PACK_SEND;
-	if (dep->de_flags & DEF_PACK_RECV)
+	if (dep->de_flags &DEF_PACK_RECV)
 		status |= DL_PACK_RECV;
 
@@ -1633,6 +1635,6 @@
 	size_t i;
 
-	for( i = 0; i < size; ++ i ){
-		*(( uint8_t * ) buf + i ) = inb( port );
+	for(i = 0; i < size; ++ i){
+		*((uint8_t *) buf + i) = inb(port);
 	}
 }
@@ -1642,6 +1644,6 @@
 	size_t i;
 
-	for( i = 0; i * 2 < size; ++ i ){
-		*(( uint16_t * ) buf + i ) = inw( port );
+	for(i = 0; i * 2 < size; ++ i){
+		*((uint16_t *) buf + i) = inw(port);
 	}
 }
@@ -1651,6 +1653,6 @@
 	size_t i;
 
-	for( i = 0; i < size; ++ i ){
-		outb( port, *(( uint8_t * ) buf + i ));
+	for(i = 0; i < size; ++ i){
+		outb(port, *((uint8_t *) buf + i));
 	}
 }
@@ -1660,6 +1662,6 @@
 	size_t i;
 
-	for( i = 0; i * 2 < size; ++ i ){
-		outw( port, *(( uint16_t * ) buf + i ));
+	for(i = 0; i * 2 < size; ++ i){
+		outw(port, *((uint16_t *) buf + i));
 	}
 }
