uip_ethernetif.h 671 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef __NETIF_ETHERNETIF_H__
  2. #define __NETIF_ETHERNETIF_H__
  3. //#include "lwip/netif.h"
  4. #include "uip_netif.h"
  5. #include <rtthread.h>
  6. #define NIOCTL_GADDR 0x01
  7. #define ETHERNET_MTU 1500
  8. struct eth_device
  9. {
  10. /* inherit from rt_device */
  11. struct rt_device parent;
  12. struct eth_addr *ethaddr;
  13. struct netif *netif;
  14. struct rt_semaphore tx_ack;
  15. /* eth device interface */
  16. struct pbuf* (*eth_rx)(rt_device_t dev);
  17. rt_err_t (*eth_tx)(rt_device_t dev, struct pbuf* p);
  18. };
  19. rt_err_t eth_device_ready(struct eth_device* dev);
  20. rt_err_t eth_device_init(struct eth_device* dev, const char* name);
  21. rt_err_t eth_system_device_init(void);
  22. #endif /* __NETIF_ETHERNETIF_H__ */