usb_ether.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) 2011 The Chromium OS Authors.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef __USB_ETHER_H__
  7. #define __USB_ETHER_H__
  8. #include <net.h>
  9. /*
  10. * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
  11. * and FCS/CRC (frame check sequence).
  12. */
  13. #define ETH_ALEN 6 /* Octets in one ethernet addr */
  14. #define ETH_HLEN 14 /* Total octets in header. */
  15. #define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
  16. #define ETH_DATA_LEN 1500 /* Max. octets in payload */
  17. #define ETH_FRAME_LEN PKTSIZE_ALIGN /* Max. octets in frame sans FCS */
  18. #define ETH_FCS_LEN 4 /* Octets in the FCS */
  19. struct ueth_data {
  20. /* eth info */
  21. struct eth_device eth_dev; /* used with eth_register */
  22. int phy_id; /* mii phy id */
  23. /* usb info */
  24. struct usb_device *pusb_dev; /* this usb_device */
  25. unsigned char ifnum; /* interface number */
  26. unsigned char ep_in; /* in endpoint */
  27. unsigned char ep_out; /* out ....... */
  28. unsigned char ep_int; /* interrupt . */
  29. unsigned char subclass; /* as in overview */
  30. unsigned char protocol; /* .............. */
  31. unsigned char irqinterval; /* Intervall for IRQ Pipe */
  32. /* driver private */
  33. void *dev_priv;
  34. };
  35. /*
  36. * Function definitions for each USB ethernet driver go here, bracketed by
  37. * #ifdef CONFIG_USB_ETHER_xxx...#endif
  38. */
  39. #ifdef CONFIG_USB_ETHER_ASIX
  40. void asix_eth_before_probe(void);
  41. int asix_eth_probe(struct usb_device *dev, unsigned int ifnum,
  42. struct ueth_data *ss);
  43. int asix_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
  44. struct eth_device *eth);
  45. #endif
  46. #ifdef CONFIG_USB_ETHER_SMSC95XX
  47. void smsc95xx_eth_before_probe(void);
  48. int smsc95xx_eth_probe(struct usb_device *dev, unsigned int ifnum,
  49. struct ueth_data *ss);
  50. int smsc95xx_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
  51. struct eth_device *eth);
  52. #endif
  53. #endif /* __USB_ETHER_H__ */