uip_eth.h 726 B

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