usb_ether.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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
  37. * (declaration is unconditional, compilation is conditional)
  38. */
  39. void asix_eth_before_probe(void);
  40. int asix_eth_probe(struct usb_device *dev, unsigned int ifnum,
  41. struct ueth_data *ss);
  42. int asix_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
  43. struct eth_device *eth);
  44. void mcs7830_eth_before_probe(void);
  45. int mcs7830_eth_probe(struct usb_device *dev, unsigned int ifnum,
  46. struct ueth_data *ss);
  47. int mcs7830_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
  48. struct eth_device *eth);
  49. void smsc95xx_eth_before_probe(void);
  50. int smsc95xx_eth_probe(struct usb_device *dev, unsigned int ifnum,
  51. struct ueth_data *ss);
  52. int smsc95xx_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
  53. struct eth_device *eth);
  54. #endif /* __USB_ETHER_H__ */