Index: UsbWattMeter/trunk/lwip-1.4.1/ports/grsakura/ether_phy.c
===================================================================
--- UsbWattMeter/trunk/lwip-1.4.1/ports/grsakura/ether_phy.c	(revision 326)
+++ UsbWattMeter/trunk/lwip-1.4.1/ports/grsakura/ether_phy.c	(revision 327)
@@ -121,15 +121,4 @@
 	switch(state){
 	case PHY_STATE_RESET:
-#ifndef __RX
-		reset++;
-		if(reset < 2){
-#endif
-		/* リンク完了の確認 */
-		if(!phy_is_link(phy_addr))
-			return PHY_STATE_RESET;
-#ifndef __RX
-		}
-		reset = 0;
-#endif
 		/* オートネゴシエーションのお知らせを有効に設定 */
 		phy_write_reg(phy_addr, PHY_AN_ADVERTISEMENT_REGISTER, 
@@ -140,4 +129,17 @@
 		phy_write_reg(phy_addr, PHY_CONTROL_REGISTER, PHY_CONTROL_SPEED_SELECT | PHY_CONTROL_A_N_ENABLE);
 
+		/* continue; */
+	case PHY_STATE_LINKE_WAIT:
+#ifndef __RX
+		reset++;
+		if(reset < 2){
+#endif
+		/* リンク完了の確認 */
+		if(!phy_is_link(phy_addr))
+			return PHY_STATE_LINKE_WAIT;
+#ifndef __RX
+		}
+		reset = 0;
+#endif
 		/* continue; */
 	case PHY_STATE_LINKED:
Index: UsbWattMeter/trunk/lwip-1.4.1/ports/grsakura/ether_phy.h
===================================================================
--- UsbWattMeter/trunk/lwip-1.4.1/ports/grsakura/ether_phy.h	(revision 326)
+++ UsbWattMeter/trunk/lwip-1.4.1/ports/grsakura/ether_phy.h	(revision 327)
@@ -54,4 +54,5 @@
 	PHY_STATE_RESETING,
 	PHY_STATE_RESET,
+	PHY_STATE_LINKE_WAIT,
 	PHY_STATE_LINKED,
 	PHY_STATE_NEGOTIATED,
Index: UsbWattMeter/trunk/lwip-1.4.1/ports/grsakura/if_rx62n.c
===================================================================
--- UsbWattMeter/trunk/lwip-1.4.1/ports/grsakura/if_rx62n.c	(revision 326)
+++ UsbWattMeter/trunk/lwip-1.4.1/ports/grsakura/if_rx62n.c	(revision 327)
@@ -306,4 +306,7 @@
   }
 
+  /* 送受信を有効 */
+  rx62n_set_ecmr(netif, 1);
+
   /* NIC からの割り込みを許可する。*/
   ret = ena_int(INTNO_IF_RX62N_TRX);
@@ -507,9 +510,10 @@
 	struct ethernetif *ethernetif;
 	PHY_MODE_T mode;
+	uint8_t phy_addr = 0;
 
 	ethernetif = netif->state;
 
 	if(ethernetif->state == PHY_STATE_NEGOTIATED){
-		ethernetif->link_now = phy_is_link(0);
+		ethernetif->link_now = phy_is_link(phy_addr);
 		if(!ethernetif->link_now)
 			ethernetif->state = PHY_STATE_RESET;
@@ -518,5 +522,5 @@
 
 	/* PHYの初期化 */
-	ethernetif->state = phy_initialize(ethernetif->state, 0, &mode);
+	ethernetif->state = phy_initialize(ethernetif->state, phy_addr, &mode);
 	if(ethernetif->state != PHY_STATE_NEGOTIATED){
 		return false;
@@ -547,52 +551,51 @@
 
   if(ethernetif->link_pre != ethernetif->link_now){
-    if(rx62n_link(netif)){
-      bool_t cng = ethernetif->link_pre != ethernetif->link_now;
-      ethernetif->link_pre = ethernetif->link_now;
-      /* リンク状態に変化あり */
-      if(cng){
-        if (ethernetif->link_pre) {
-          netif_set_link_up(netif);
-        }
-        else {
-          netif_set_link_down(netif);
-        }
+    ethernetif->link_pre = ethernetif->link_now;
+    /* リンク状態に変化あり */
+    if (rx62n_link(netif)) {
+      netif_set_link_up(netif);
+    }
+    else {
+      netif_set_link_down(netif);
+    }
+
+    if (ethernetif->state != PHY_STATE_NEGOTIATED) {
+      ethernetif->link_pre = !ethernetif->link_now;
+      sig_sem(ethernetif->sem_rev);
+    }
+
+    return;
+  }
+
+  for (;;) {
+    /* move received packet into a new pbuf */
+    p = low_level_input(netif);
+    /* no packet could be read, silently ignore this */
+    if (p == NULL) return;
+    /* points to packet payload, which starts with an Ethernet header */
+    ethhdr = p->payload;
+
+    switch (htons(ethhdr->type)) {
+      /* IP or ARP packet? */
+    case ETHTYPE_IP:
+    case ETHTYPE_ARP:
+#if PPPOE_SUPPORT
+      /* PPPoE packet? */
+    case ETHTYPE_PPPOEDISC:
+    case ETHTYPE_PPPOE:
+#endif /* PPPOE_SUPPORT */
+      /* full packet send to tcpip_thread to process */
+      if (netif->input(p, netif) != ERR_OK) {
+        LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
+        pbuf_free(p);
+        p = NULL;
       }
-    }
-
-    if (ethernetif->state != PHY_STATE_NEGOTIATED)
-      sig_sem(ethernetif->sem_rev);
-
-    return;
-  }
-
-  /* move received packet into a new pbuf */
-  p = low_level_input(netif);
-  /* no packet could be read, silently ignore this */
-  if (p == NULL) return;
-  /* points to packet payload, which starts with an Ethernet header */
-  ethhdr = p->payload;
-
-  switch (htons(ethhdr->type)) {
-    /* IP or ARP packet? */
-  case ETHTYPE_IP:
-  case ETHTYPE_ARP:
-#if PPPOE_SUPPORT
-    /* PPPoE packet? */
-  case ETHTYPE_PPPOEDISC:
-  case ETHTYPE_PPPOE:
-#endif /* PPPOE_SUPPORT */
-    /* full packet send to tcpip_thread to process */
-    if (netif->input(p, netif) != ERR_OK) {
-      LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
+      break;
+
+    default:
       pbuf_free(p);
       p = NULL;
-    }
-    break;
-
-  default:
-    pbuf_free(p);
-    p = NULL;
-    break;
+      break;
+    }
   }
 }
