usb_ether.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright (c) 2011 The Chromium OS Authors.
  3. * See file CREDITS for list of people who contributed to this
  4. * project.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  19. * MA 02111-1307 USA
  20. */
  21. #ifndef __USB_ETHER_H__
  22. #define __USB_ETHER_H__
  23. #include <net.h>
  24. /*
  25. * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
  26. * and FCS/CRC (frame check sequence).
  27. */
  28. #define ETH_ALEN 6 /* Octets in one ethernet addr */
  29. #define ETH_HLEN 14 /* Total octets in header. */
  30. #define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
  31. #define ETH_DATA_LEN 1500 /* Max. octets in payload */
  32. #define ETH_FRAME_LEN PKTSIZE_ALIGN /* Max. octets in frame sans FCS */
  33. #define ETH_FCS_LEN 4 /* Octets in the FCS */
  34. struct ueth_data {
  35. /* eth info */
  36. struct eth_device eth_dev; /* used with eth_register */
  37. int phy_id; /* mii phy id */
  38. /* usb info */
  39. struct usb_device *pusb_dev; /* this usb_device */
  40. unsigned char ifnum; /* interface number */
  41. unsigned char ep_in; /* in endpoint */
  42. unsigned char ep_out; /* out ....... */
  43. unsigned char ep_int; /* interrupt . */
  44. unsigned char subclass; /* as in overview */
  45. unsigned char protocol; /* .............. */
  46. unsigned char irqinterval; /* Intervall for IRQ Pipe */
  47. /* driver private */
  48. void *dev_priv;
  49. };
  50. /*
  51. * Function definitions for each USB ethernet driver go here, bracketed by
  52. * #ifdef CONFIG_USB_ETHER_xxx...#endif
  53. */
  54. #ifdef CONFIG_USB_ETHER_ASIX
  55. void asix_eth_before_probe(void);
  56. int asix_eth_probe(struct usb_device *dev, unsigned int ifnum,
  57. struct ueth_data *ss);
  58. int asix_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
  59. struct eth_device *eth);
  60. #endif
  61. #ifdef CONFIG_USB_ETHER_SMSC95XX
  62. void smsc95xx_eth_before_probe(void);
  63. int smsc95xx_eth_probe(struct usb_device *dev, unsigned int ifnum,
  64. struct ueth_data *ss);
  65. int smsc95xx_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
  66. struct eth_device *eth);
  67. #endif
  68. #endif /* __USB_ETHER_H__ */