浏览代码

update AT91SAM9260 macb driver

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2023 bbd45198-f89e-11dd-88c7-29a3b14d5316
luohui2320@gmail.com 13 年之前
父节点
当前提交
ce4ef74ef4
共有 3 个文件被更改,包括 8 次插入7 次删除
  1. 2 3
      bsp/at91sam9260/application.c
  2. 5 3
      bsp/at91sam9260/macb.c
  3. 1 1
      bsp/at91sam9260/macb.h

+ 2 - 3
bsp/at91sam9260/application.c

@@ -43,7 +43,7 @@
 
 
 #ifdef RT_USING_LWIP
 #ifdef RT_USING_LWIP
 #include <netif/ethernetif.h>
 #include <netif/ethernetif.h>
-#include <arch/sys_arch_init.h>
+//#include <arch/sys_arch_init.h>
 #include "macb.h"
 #include "macb.h"
 #endif
 #endif
 
 
@@ -128,10 +128,9 @@ void rt_init_thread_entry(void* parameter)
 		eth_system_device_init();
 		eth_system_device_init();
 		rt_hw_macb_init();
 		rt_hw_macb_init();
 		/* re-init device driver */
 		/* re-init device driver */
-		//rt_device_init_all();
+		rt_device_init_all();
 		/* init lwip system */
 		/* init lwip system */
 		lwip_sys_init();
 		lwip_sys_init();
-		rt_kprintf("TCP/IP initialized!\n");
 	}
 	}
 #endif
 #endif
 
 

+ 5 - 3
bsp/at91sam9260/macb.c

@@ -324,13 +324,15 @@ void macb_update_link(struct rt_macb_eth *macb)
 			rt_kprintf("%s: link up (%dMbps/%s-duplex)\n",
 			rt_kprintf("%s: link up (%dMbps/%s-duplex)\n",
 					dev->parent.name, macb->speed,
 					dev->parent.name, macb->speed,
 					DUPLEX_FULL == macb->duplex ? "Full":"Half");
 					DUPLEX_FULL == macb->duplex ? "Full":"Half");
-			macb->parent.link_status = 1;
+			//macb->parent.link_status = 1;
+			//netif_set_link_up(macb->parent.netif);
 		} else {
 		} else {
 			rt_kprintf("%s: link down\n", dev->parent.name);
 			rt_kprintf("%s: link down\n", dev->parent.name);
-					macb->parent.link_status = 0;
+					//macb->parent.link_status = 0;
+			//netif_set_link_down(macb->parent.netif);
 		}
 		}
 
 
-		eth_device_linkchange(&macb->parent, RT_TRUE);
+		//eth_device_linkchange(&macb->parent, RT_TRUE);
 	}
 	}
 
 
 }
 }

+ 1 - 1
bsp/at91sam9260/macb.h

@@ -330,7 +330,7 @@ struct dma_desc {
 #define MACB_TX_USED_OFFSET			31
 #define MACB_TX_USED_OFFSET			31
 #define MACB_TX_USED_SIZE			1
 #define MACB_TX_USED_SIZE			1
 
 
-void rt_hw_macb_init();
+extern void rt_hw_macb_init();
 
 
 #endif /* _MACB_H */
 #endif /* _MACB_H */