From fea7d02bfd41a73be2d4fb2c0ecfe2b8628be68b Mon Sep 17 00:00:00 2001 From: "mbbill@gmail.com" Date: Mon, 19 Sep 2011 14:14:31 +0000 Subject: [PATCH] update lwip1.4 for old drivers compatibility git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1714 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- .../net/lwip-1.4.0/src/netif/ethernetif.c | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/components/net/lwip-1.4.0/src/netif/ethernetif.c b/components/net/lwip-1.4.0/src/netif/ethernetif.c index 56f20c5d1..0dcf637e3 100644 --- a/components/net/lwip-1.4.0/src/netif/ethernetif.c +++ b/components/net/lwip-1.4.0/src/netif/ethernetif.c @@ -81,6 +81,37 @@ static char eth_rx_thread_mb_pool[RT_LWIP_ETHTHREAD_MBOX_SIZE * 4]; static char eth_rx_thread_stack[RT_LWIP_ETHTHREAD_STACKSIZE]; +/* Ugly hacks for old drivers compatible */ +/* ===================================== */ +#if 1 +static struct eth_device * ptmpdev; +struct eth_device * get_eth_dev(void) +{ + return ptmpdev; +} +int eth_device_init(struct eth_device * dev, char *name) +{ + ptmpdev = dev; + dev->parent.type = RT_Device_Class_NetIf; + rt_device_register(&(dev->parent), "eth0", RT_DEVICE_FLAG_RDWR); + return 0; +} +void lwip_sys_init(void) +{ + lwip_enetif_init(); +} +void eth_system_device_init() +{ +} +rt_err_t eth_device_ready(struct eth_device* dev) +{ + return eth_rx_ready(dev); +} +#endif +/* ===================================== */ + + + /* ethernet buffer */ static void eth_rx_thread_entry(void* parameter) { -- GitLab