Simon Glass | 89d4836 | 2011-02-16 11:14:33 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011 The Chromium OS Authors. |
Simon Glass | 89d4836 | 2011-02-16 11:14:33 -0800 | [diff] [blame] | 3 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Simon Glass | 89d4836 | 2011-02-16 11:14:33 -0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __USB_ETHER_H__ |
| 8 | #define __USB_ETHER_H__ |
| 9 | |
| 10 | #include <net.h> |
| 11 | |
| 12 | /* |
| 13 | * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble |
| 14 | * and FCS/CRC (frame check sequence). |
| 15 | */ |
| 16 | #define ETH_ALEN 6 /* Octets in one ethernet addr */ |
| 17 | #define ETH_HLEN 14 /* Total octets in header. */ |
| 18 | #define ETH_ZLEN 60 /* Min. octets in frame sans FCS */ |
| 19 | #define ETH_DATA_LEN 1500 /* Max. octets in payload */ |
| 20 | #define ETH_FRAME_LEN PKTSIZE_ALIGN /* Max. octets in frame sans FCS */ |
| 21 | #define ETH_FCS_LEN 4 /* Octets in the FCS */ |
| 22 | |
| 23 | struct ueth_data { |
| 24 | /* eth info */ |
| 25 | struct eth_device eth_dev; /* used with eth_register */ |
| 26 | int phy_id; /* mii phy id */ |
| 27 | |
| 28 | /* usb info */ |
| 29 | struct usb_device *pusb_dev; /* this usb_device */ |
| 30 | unsigned char ifnum; /* interface number */ |
| 31 | unsigned char ep_in; /* in endpoint */ |
| 32 | unsigned char ep_out; /* out ....... */ |
| 33 | unsigned char ep_int; /* interrupt . */ |
| 34 | unsigned char subclass; /* as in overview */ |
| 35 | unsigned char protocol; /* .............. */ |
| 36 | unsigned char irqinterval; /* Intervall for IRQ Pipe */ |
| 37 | |
Lucas Stach | e1dbdf9 | 2012-08-22 11:04:57 +0000 | [diff] [blame] | 38 | /* driver private */ |
| 39 | void *dev_priv; |
Simon Glass | 89d4836 | 2011-02-16 11:14:33 -0800 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | /* |
Gerhard Sittig | 440a574 | 2014-03-08 19:46:13 +0100 | [diff] [blame] | 43 | * Function definitions for each USB ethernet driver go here |
| 44 | * (declaration is unconditional, compilation is conditional) |
Simon Glass | 89d4836 | 2011-02-16 11:14:33 -0800 | [diff] [blame] | 45 | */ |
Simon Glass | 9b70e00 | 2011-02-16 11:14:34 -0800 | [diff] [blame] | 46 | void asix_eth_before_probe(void); |
| 47 | int asix_eth_probe(struct usb_device *dev, unsigned int ifnum, |
| 48 | struct ueth_data *ss); |
| 49 | int asix_eth_get_info(struct usb_device *dev, struct ueth_data *ss, |
| 50 | struct eth_device *eth); |
Simon Glass | 89d4836 | 2011-02-16 11:14:33 -0800 | [diff] [blame] | 51 | |
Rene Griessl | e9954b8 | 2014-11-07 16:53:48 +0100 | [diff] [blame] | 52 | void ax88179_eth_before_probe(void); |
| 53 | int ax88179_eth_probe(struct usb_device *dev, unsigned int ifnum, |
| 54 | struct ueth_data *ss); |
| 55 | int ax88179_eth_get_info(struct usb_device *dev, struct ueth_data *ss, |
| 56 | struct eth_device *eth); |
| 57 | |
Gerhard Sittig | df4fb1c | 2014-03-08 19:46:14 +0100 | [diff] [blame] | 58 | void mcs7830_eth_before_probe(void); |
| 59 | int mcs7830_eth_probe(struct usb_device *dev, unsigned int ifnum, |
| 60 | struct ueth_data *ss); |
| 61 | int mcs7830_eth_get_info(struct usb_device *dev, struct ueth_data *ss, |
| 62 | struct eth_device *eth); |
| 63 | |
Simon Glass | 291391b | 2011-06-13 16:13:09 -0700 | [diff] [blame] | 64 | void smsc95xx_eth_before_probe(void); |
| 65 | int smsc95xx_eth_probe(struct usb_device *dev, unsigned int ifnum, |
| 66 | struct ueth_data *ss); |
| 67 | int smsc95xx_eth_get_info(struct usb_device *dev, struct ueth_data *ss, |
| 68 | struct eth_device *eth); |
Simon Glass | 291391b | 2011-06-13 16:13:09 -0700 | [diff] [blame] | 69 | |
Simon Glass | 89d4836 | 2011-02-16 11:14:33 -0800 | [diff] [blame] | 70 | #endif /* __USB_ETHER_H__ */ |