Index: uspace/srv/hw/netif/dp8390/dp8390.c
===================================================================
--- uspace/srv/hw/netif/dp8390/dp8390.c	(revision 95ff5c43b51057d82e0ec748e9fb178b5a42d3b5)
+++ uspace/srv/hw/netif/dp8390/dp8390.c	(revision d3c9b60b2c598e68e712e63a807e118aa657ead4)
@@ -332,5 +332,5 @@
 {
 	int dp_rcr_reg;
-	int i;//, r;
+	int i;
 	
 	/* General initialization */
@@ -343,11 +343,14 @@
 			printf("%x%c", dep->de_address.ea_addr[i], i < 5 ? ':' : '\n');
 	}
-
-	/* Initialization of the dp8390 following the mandatory procedure
+	
+	/*
+	 * Initialization of the dp8390 following the mandatory procedure
 	 * in reference manual ("DP8390D/NS32490D NIC Network Interface
 	 * Controller", National Semiconductor, July 1995, Page 29).
 	 */
+	
 	/* Step 1: */
 	outb_reg0(dep, DP_CR, CR_PS_P0 | CR_STP | CR_DM_ABORT);
+	
 	/* Step 2: */
 	if (dep->de_16bit)
@@ -355,30 +358,41 @@
 	else
 		outb_reg0(dep, DP_DCR, DCR_BYTEWIDE | DCR_8BYTES | DCR_BMS);
+	
 	/* Step 3: */
 	outb_reg0(dep, DP_RBCR0, 0);
 	outb_reg0(dep, DP_RBCR1, 0);
+	
 	/* 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);
+	
 	/* Step 5: */
 	outb_reg0(dep, DP_TCR, TCR_INTERNAL);
+	
 	/* Step 6: */
 	outb_reg0(dep, DP_BNRY, dep->de_startpage);
 	outb_reg0(dep, DP_PSTART, dep->de_startpage);
 	outb_reg0(dep, DP_PSTOP, dep->de_stoppage);
+	
 	/* Step 7: */
 	outb_reg0(dep, DP_ISR, 0xFF);
+	
 	/* Step 8: */
 	outb_reg0(dep, DP_IMR, IMR_PRXE | IMR_PTXE | IMR_RXEE | IMR_TXEE |
-		IMR_OVWE | IMR_CNTE);
+	    IMR_OVWE | IMR_CNTE);
+	
 	/* Step 9: */
 	outb_reg0(dep, DP_CR, CR_PS_P1 | CR_DM_ABORT | CR_STP);
-
+	
 	outb_reg1(dep, DP_PAR0, dep->de_address.ea_addr[0]);
 	outb_reg1(dep, DP_PAR1, dep->de_address.ea_addr[1]);
@@ -387,5 +401,5 @@
 	outb_reg1(dep, DP_PAR4, dep->de_address.ea_addr[4]);
 	outb_reg1(dep, DP_PAR5, dep->de_address.ea_addr[5]);
-
+	
 	outb_reg1(dep, DP_MAR0, 0xff);
 	outb_reg1(dep, DP_MAR1, 0xff);
@@ -396,57 +410,36 @@
 	outb_reg1(dep, DP_MAR6, 0xff);
 	outb_reg1(dep, DP_MAR7, 0xff);
-
+	
 	outb_reg1(dep, DP_CURR, dep->de_startpage + 1);
+	
 	/* Step 10: */
 	outb_reg0(dep, DP_CR, CR_DM_ABORT | CR_STA);
+	
 	/* Step 11: */
 	outb_reg0(dep, DP_TCR, TCR_NORMAL);
-
-	inb_reg0(dep, DP_CNTR0);		/* reset counters by reading */
+	
+	inb_reg0(dep, DP_CNTR0);  /* Reset counters by reading */
 	inb_reg0(dep, DP_CNTR1);
 	inb_reg0(dep, DP_CNTR2);
-
+	
 	/* Finish the initialization. */
 	dep->de_flags |= DEF_ENABLED;
-	for (i= 0; i<dep->de_sendq_nr; i++)
+	for (i = 0; i < dep->de_sendq_nr; i++)
 		dep->de_sendq[i].sq_filled= 0;
-	dep->de_sendq_head= 0;
-	dep->de_sendq_tail= 0;
-	if (dep->de_16bit)
-	{
+	
+	dep->de_sendq_head = 0;
+	dep->de_sendq_tail = 0;
+	
+	if (dep->de_16bit) {
 		dep->de_user2nicf= dp_pio16_user2nic;
-//		dep->de_user2nicf_s= dp_pio16_user2nic_s;
 		dep->de_nic2userf= dp_pio16_nic2user;
-//		dep->de_nic2userf_s= dp_pio16_nic2user_s;
 		dep->de_getblockf= dp_pio16_getblock;
-	}
-	else
-	{
+	} else {
 		dep->de_user2nicf= dp_pio8_user2nic;
-//		dep->de_user2nicf_s= dp_pio8_user2nic_s;
 		dep->de_nic2userf= dp_pio8_nic2user;
-//		dep->de_nic2userf_s= dp_pio8_nic2user_s;
 		dep->de_getblockf= dp_pio8_getblock;
 	}
-
-	/* Set the interrupt handler and policy. Do not automatically 
-	 * reenable interrupts. Return the IRQ line number on interrupts.
- 	 */
-/* 	dep->de_hook = dep->de_irq;
-	r= sys_irqsetpolicy(dep->de_irq, 0, &dep->de_hook);
-	if (r != OK)
-		panic("DP8390", "sys_irqsetpolicy failed", r);
-
-	r= sys_irqenable(&dep->de_hook);
-	if (r != OK)
-	{
-		panic("DP8390", "unable enable interrupts", r);
-	}
-*/
-}
-
-/*===========================================================================*
- *				dp_reinit				     *
- *===========================================================================*/
+}
+
 static void dp_reinit(dep)
 dpeth_t *dep;
Index: uspace/srv/hw/netif/dp8390/dp8390.h
===================================================================
--- uspace/srv/hw/netif/dp8390/dp8390.h	(revision 95ff5c43b51057d82e0ec748e9fb178b5a42d3b5)
+++ uspace/srv/hw/netif/dp8390/dp8390.h	(revision d3c9b60b2c598e68e712e63a807e118aa657ead4)
@@ -222,5 +222,5 @@
 struct dpeth;
 struct iovec_dat;
-//struct iovec_dat_s;
+
 _PROTOTYPE(typedef void (*dp_initf_t), (struct dpeth *dep)		);
 _PROTOTYPE(typedef void (*dp_stopf_t), (struct dpeth *dep)		);
@@ -228,28 +228,12 @@
 			struct iovec_dat *iovp, vir_bytes offset,
 			int nic_addr, vir_bytes count) );
-//_PROTOTYPE(typedef void (*dp_user2nicf_s_t), (struct dpeth *dep,
-//			struct iovec_dat_s *iovp, vir_bytes offset,
-//			int nic_addr, vir_bytes count)			);
 _PROTOTYPE(typedef void (*dp_nic2userf_t), (struct dpeth *dep,
 			int nic_addr, struct iovec_dat *iovp,
 			vir_bytes offset, vir_bytes count) );
-//_PROTOTYPE(typedef void (*dp_nic2userf_s_t), (struct dpeth *dep,
-//			int nic_addr, struct iovec_dat_s *iovp,
-//			vir_bytes offset, vir_bytes count)		);
-//#if 0
-//_PROTOTYPE(typedef void (*dp_getheaderf_t), (struct dpeth *dep,
-//			int page, struct dp_rcvhdr *h, u16_t *eth_type)	);
-//#endif
 _PROTOTYPE(typedef void (*dp_getblock_t), (struct dpeth *dep,
 		int page, size_t offset, size_t size, void *dst)	);
 
-/* iovectors are handled IOVEC_NR entries at a time. */
-//#define IOVEC_NR	16
-// no vectors allowed
-#define IOVEC_NR	1
-
-/*
-typedef int irq_hook_t;
-*/
+#define IOVEC_NR  1
+
 typedef struct iovec_dat
 {
@@ -275,5 +259,5 @@
 /** Maximum number of waiting packets to be sent or received.
  */
-#define MAX_PACKETS	4
+#define MAX_PACKETS  4
 
 typedef struct dpeth
@@ -282,11 +266,13 @@
 	 */
 	packet_t *packet_queue;
+	
 	/** Outgoing packets count.
 	 */
 	int packet_count;
-
+	
 	/** Received packets queue.
 	 */
 	packet_t *received_queue;
+	
 	/** Received packets count.
 	 */
@@ -304,9 +290,8 @@
 	int de_irq;
 	int de_int_pending;
-//	irq_hook_t de_hook;
 	dp_initf_t de_initf; 
 	dp_stopf_t de_stopf; 
 	char de_name[sizeof("dp8390#n")];
-
+	
 	/* The initf function fills the following fields. Only cards that do
 	 * programmed I/O fill in the de_pata_port field.
@@ -322,19 +307,16 @@
 	int de_startpage;
 	int de_stoppage;
-
-	/* should be here - read even for ne2k isa init... */
-	char de_pci;			/* TRUE iff PCI device */
-
+	
 	/* Do it yourself send queue */
-	struct sendq
-	{
+	struct sendq {
 		int sq_filled;		/* this buffer contains a packet */
 		int sq_size;		/* with this size */
 		int sq_sendpage;	/* starting page of the buffer */
 	} de_sendq[SENDQ_NR];
+	
 	int de_sendq_nr;
 	int de_sendq_head;		/* Enqueue at the head */
 	int de_sendq_tail;		/* Dequeue at the tail */
-
+	
 	/* Fields for internal use by the dp8390 driver. */
 	int de_flags;
@@ -342,17 +324,11 @@
 	eth_stat_t de_stat;
 	iovec_dat_t de_read_iovec;
-//	iovec_dat_s_t de_read_iovec_s;
-//	int de_safecopy_read;
 	iovec_dat_t de_write_iovec;
-//	iovec_dat_s_t de_write_iovec_s;
 	iovec_dat_t de_tmp_iovec;
-//	iovec_dat_s_t de_tmp_iovec_s;
 	vir_bytes de_read_s;
 //	int de_client;
 //	message de_sendmsg;
 	dp_user2nicf_t de_user2nicf; 
-//	dp_user2nicf_s_t de_user2nicf_s; 
 	dp_nic2userf_t de_nic2userf;
-//	dp_nic2userf_s_t de_nic2userf_s; 
 	dp_getblock_t de_getblockf;
 } dpeth_t;
Index: uspace/srv/hw/netif/dp8390/ne2000.c
===================================================================
--- uspace/srv/hw/netif/dp8390/ne2000.c	(revision 95ff5c43b51057d82e0ec748e9fb178b5a42d3b5)
+++ uspace/srv/hw/netif/dp8390/ne2000.c	(revision d3c9b60b2c598e68e712e63a807e118aa657ead4)
@@ -73,9 +73,5 @@
 void ne_init(struct dpeth *dep);
 
-/*===========================================================================*
- *				ne_probe				     *
- *===========================================================================*/
-int ne_probe(dep)
-dpeth_t *dep;
+int ne_probe(dpeth_t *dep)
 {
 	int byte;
@@ -83,15 +79,15 @@
 	int loc1, loc2;
 	testf_t f;
-
-	dep->de_dp8390_port= dep->de_base_port + NE_DP8390;
-
-	/* We probe for an ne1000 or an ne2000 by testing whether the
+	
+	dep->de_dp8390_port = dep->de_base_port + NE_DP8390;
+	
+	/*
+	 * We probe for an ne1000 or an ne2000 by testing whether the
 	 * on board is reachable through the dp8390. Note that the
 	 * ne1000 is an 8bit card and has a memory region distict from
 	 * the 16bit ne2000
 	 */
-
-	for (dep->de_16bit= 0; dep->de_16bit < 2; dep->de_16bit++)
-	{
+	
+	for (dep->de_16bit = 0; dep->de_16bit < 2; dep->de_16bit++) {
 		/* Reset the ethernet card */
 		byte= inb_ne(dep, NE_RESET);
@@ -99,68 +95,56 @@
 		outb_ne(dep, NE_RESET, byte);
 		milli_delay(2);
-
+		
 		/* Reset the dp8390 */
 		outb_reg0(dep, DP_CR, CR_STP | CR_DM_ABORT);
-		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 */
-
+		
 		/* Check if the dp8390 is really there */
-		if ((inb_reg0(dep, DP_CR) &(CR_STP|CR_DM_ABORT)) !=
-			(CR_STP|CR_DM_ABORT))
-		{
+		if ((inb_reg0(dep, DP_CR) & (CR_STP | CR_DM_ABORT)) !=
+		    (CR_STP | CR_DM_ABORT))
 			return 0;
-		}
-
+		
 		/* Disable the receiver and init TCR and DCR. */
 		outb_reg0(dep, DP_RCR, RCR_MON);
 		outb_reg0(dep, DP_TCR, TCR_NORMAL);
-		if (dep->de_16bit)
-		{
+		if (dep->de_16bit) {
 			outb_reg0(dep, DP_DCR, DCR_WORDWIDE | DCR_8BYTES |
-				DCR_BMS);
-		}
-		else
-		{
+			    DCR_BMS);
+		} else {
 			outb_reg0(dep, DP_DCR, DCR_BYTEWIDE | DCR_8BYTES |
-				DCR_BMS);
-		}
-
-		if (dep->de_16bit)
-		{
+			    DCR_BMS);
+		}
+		
+		if (dep->de_16bit) {
 			loc1= NE2000_START;
 			loc2= NE2000_START + NE2000_SIZE - 4;
 			f= test_16;
-		}
-		else
-		{
+		} else {
 			loc1= NE1000_START;
 			loc2= NE1000_START + NE1000_SIZE - 4;
 			f= test_8;
 		}
-		if (f(dep, loc1, pat0) && f(dep, loc1, pat1) && 
-			f(dep, loc1, pat2) && f(dep, loc1, pat3) && 
-			f(dep, loc2, pat0) && f(dep, loc2, pat1) && 
-			f(dep, loc2, pat2) && f(dep, loc2, pat3))
-		{
+		
+		if (f(dep, loc1, pat0) && f(dep, loc1, pat1) &&
+		    f(dep, loc1, pat2) && f(dep, loc1, pat3) &&
+		    f(dep, loc2, pat0) && f(dep, loc2, pat1) &&
+		    f(dep, loc2, pat2) && f(dep, loc2, pat3)) {
 			/* We don't need a memory segment */
-			dep->de_linmem= 0;
-			if (!dep->de_pci)
-				dep->de_initf= ne_init;
-			dep->de_stopf= ne_stop;
+			dep->de_linmem = 0;
+			dep->de_initf = ne_init;
+			dep->de_stopf = ne_stop;
 			return 1;
 		}
 	}
+	
 	return 0;
 }
 
-/*===========================================================================*
- *				ne_init					     *
- *===========================================================================*/
-void ne_init(dep)
-dpeth_t *dep;
+void ne_init(dpeth_t *dep)
 {
 	int i;
 	int word, sendq_nr;
-
+	
 	/* Setup a transfer to get the ethernet address. */
 	if (dep->de_16bit)
@@ -168,52 +152,45 @@
 	else
 		outb_reg0(dep, DP_RBCR0, 6);
+	
 	outb_reg0(dep, DP_RBCR1, 0);
 	outb_reg0(dep, DP_RSAR0, 0);
 	outb_reg0(dep, DP_RSAR1, 0);
 	outb_reg0(dep, DP_CR, CR_DM_RR | CR_PS_P0 | CR_STA);
-
-	for (i= 0; i<6; i++)
-	{
-		if (dep->de_16bit)
-		{
-			word= inw_ne(dep, NE_DATA);
-			dep->de_address.ea_addr[i]= word;
-		}
-		else
-		{
+	
+	for (i = 0; i < 6; i++) {
+		if (dep->de_16bit) {
+			word = inw_ne(dep, NE_DATA);
+			dep->de_address.ea_addr[i] = word;
+		} else
 			dep->de_address.ea_addr[i] = inb_ne(dep, NE_DATA);
-		}
-	}
+	}
+	
 	dep->de_data_port= dep->de_base_port + NE_DATA;
-	if (dep->de_16bit)
-	{
+	if (dep->de_16bit) {
 		dep->de_ramsize= NE2000_SIZE;
 		dep->de_offset_page= NE2000_START / DP_PAGESIZE;
-	}
-	else
-	{
+	} else {
 		dep->de_ramsize= NE1000_SIZE;
 		dep->de_offset_page= NE1000_START / DP_PAGESIZE;
 	}
-
+	
 	/* Allocate one send buffer (1.5KB) per 8KB of on board memory. */
 	sendq_nr= dep->de_ramsize / 0x2000;
+	
 	if (sendq_nr < 1)
-		sendq_nr= 1;
+		sendq_nr = 1;
 	else if (sendq_nr > SENDQ_NR)
-		sendq_nr= SENDQ_NR;
-	dep->de_sendq_nr= sendq_nr;
-	for (i= 0; i<sendq_nr; i++)
-	{
-		dep->de_sendq[i].sq_sendpage= dep->de_offset_page +
-			i*SENDQ_PAGES;	
-	}
-
-	dep->de_startpage= dep->de_offset_page + i*SENDQ_PAGES;
-	dep->de_stoppage= dep->de_offset_page + dep->de_ramsize / DP_PAGESIZE;
-
+		sendq_nr = SENDQ_NR;
+	
+	dep->de_sendq_nr = sendq_nr;
+	for (i = 0; i < sendq_nr; i++)
+		dep->de_sendq[i].sq_sendpage= dep->de_offset_page + i * SENDQ_PAGES;
+	
+	dep->de_startpage = dep->de_offset_page + i * SENDQ_PAGES;
+	dep->de_stoppage = dep->de_offset_page + dep->de_ramsize / DP_PAGESIZE;
+	
 	/* Can't override the default IRQ. */
 	dep->de_irq &= ~DEI_DEFAULT;
-
+	
 	if (!debug)
 	{
