Index: uspace/srv/hw/netif/dp8390/dp8390.c
===================================================================
--- uspace/srv/hw/netif/dp8390/dp8390.c	(revision abe95c994cf957914577df157995e7966c0c7ecb)
+++ uspace/srv/hw/netif/dp8390/dp8390.c	(revision 43b431487f6256d3deef05500d017651d44ead5b)
@@ -81,5 +81,5 @@
 
 /** NE2000 retry count */
-#define NE2K_RETRY  100
+#define NE2K_RETRY  0x1000
 
 /** NE2000 error messages rate limiting */
@@ -186,4 +186,22 @@
 		memcpy(&word, buf, 1);
 		pio_write_16(ne2k->data_port, word);
+	}
+}
+
+static void ne2k_init(ne2k_t *ne2k)
+{
+	unsigned int i;
+	
+	/* Reset the ethernet card */
+	uint8_t val = pio_read_8(ne2k->port + NE2K_RESET);
+	usleep(2000);
+	pio_write_8(ne2k->port + NE2K_RESET, val);
+	usleep(2000);
+	
+	/* Reset the DP8390 */
+	pio_write_8(ne2k->port + DP_CR, CR_STP | CR_DM_ABORT);
+	for (i = 0; i < NE2K_RETRY; i++) {
+		if (pio_read_8(ne2k->port + DP_ISR) != 0)
+			break;
 	}
 }
@@ -210,19 +228,8 @@
 	ne2k->up = false;
 	
-	/* Reset the ethernet card */
-	uint8_t val = pio_read_8(ne2k->port + NE2K_RESET);
-	usleep(2000);
-	pio_write_8(ne2k->port + NE2K_RESET, val);
-	usleep(2000);
-	
-	/* Reset the DP8390 */
-	pio_write_8(ne2k->port + DP_CR, CR_STP | CR_DM_ABORT);
-	for (i = 0; i < 0x1000; i++) {
-		if (pio_read_8(ne2k->port + DP_ISR) != 0)
-			break;
-	}
+	ne2k_init(ne2k);
 	
 	/* Check if the DP8390 is really there */
-	val = pio_read_8(ne2k->port + DP_CR);
+	uint8_t val = pio_read_8(ne2k->port + DP_CR);
 	if ((val & (CR_STP | CR_DM_ABORT)) != (CR_STP | CR_DM_ABORT))
 		return EXDEV;
@@ -242,4 +249,23 @@
 	for (i = 0; i < ETH_ADDR; i++)
 		ne2k->mac[i] = pio_read_16(ne2k->data_port);
+	
+	ne2k->probed = true;
+	return EOK;
+}
+
+/** Start the network interface.
+ *
+ * @param[in,out] ne2k Network interface structure.
+ *
+ * @return EOK on success.
+ * @return EXDEV if the network interface is disabled.
+ *
+ */
+int ne2k_up(ne2k_t *ne2k)
+{
+	if (!ne2k->probed)
+		return EXDEV;
+	
+	ne2k_init(ne2k);
 	
 	/*
@@ -329,24 +355,4 @@
 	
 	/* Finish the initialization */
-	ne2k->probed = true;
-	return EOK;
-}
-
-/** Start the network interface.
- *
- * @param[in,out] ne2k Network interface structure.
- *
- * @return EOK on success.
- * @return EXDEV if the network interface is disabled.
- *
- */
-int ne2k_up(ne2k_t *ne2k)
-{
-	if (!ne2k->probed)
-		return EXDEV;
-	
-	pio_write_8(ne2k->port + DP_CR, CR_PS_P0 | CR_STA);
-	pio_write_8(ne2k->port + DP_RCR, RCR_AB);
-	
 	ne2k->up = true;
 	return EOK;
@@ -362,10 +368,5 @@
 	if ((ne2k->probed) && (ne2k->up)) {
 		pio_write_8(ne2k->port + DP_CR, CR_STP | CR_DM_ABORT);
-		
-		/* Reset the ethernet card */
-		uint8_t val = pio_read_8(ne2k->port + NE2K_RESET);
-		usleep(2000);
-		pio_write_8(ne2k->port + NE2K_RESET, val);
-		
+		ne2k_init(ne2k);
 		ne2k->up = false;
 	}
@@ -420,5 +421,5 @@
 	pio_write_8(ne2k->port + DP_RBCR1, 0);
 	
-	for (i = 0; i < 0x1000; i++) {
+	for (i = 0; i < NE2K_RETRY; i++) {
 		if ((pio_read_8(ne2k->port + DP_ISR) & ISR_RST) != 0)
 			break;
@@ -430,5 +431,5 @@
 	
 	/* Acknowledge the ISR_RDC (remote DMA) interrupt */
-	for (i = 0; i < 0x1000; i++) {
+	for (i = 0; i < NE2K_RETRY; i++) {
 		if ((pio_read_8(ne2k->port + DP_ISR) & ISR_RDC) != 0)
 			break;
Index: uspace/srv/hw/netif/dp8390/ne2000.c
===================================================================
--- uspace/srv/hw/netif/dp8390/ne2000.c	(revision abe95c994cf957914577df157995e7966c0c7ecb)
+++ uspace/srv/hw/netif/dp8390/ne2000.c	(revision 43b431487f6256d3deef05500d017651d44ead5b)
@@ -293,8 +293,8 @@
 		}
 		
+		change_state(device, NETIF_ACTIVE);
+		
 		if (irc_service)
 			async_msg_1(irc_phone, IRC_ENABLE_INTERRUPT, ne2k->irq);
-		
-		change_state(device, NETIF_ACTIVE);
 	}
 	
