Simon Glass | 89d4836 | 2011-02-16 11:14:33 -0800 | [diff] [blame] | 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 | |
| 22 | #ifndef __USB_ETHER_H__ |
| 23 | #define __USB_ETHER_H__ |
| 24 | |
| 25 | #include <net.h> |
| 26 | |
| 27 | /* |
| 28 | * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble |
| 29 | * and FCS/CRC (frame check sequence). |
| 30 | */ |
| 31 | #define ETH_ALEN 6 /* Octets in one ethernet addr */ |
| 32 | #define ETH_HLEN 14 /* Total octets in header. */ |
| 33 | #define ETH_ZLEN 60 /* Min. octets in frame sans FCS */ |
| 34 | #define ETH_DATA_LEN 1500 /* Max. octets in payload */ |
| 35 | #define ETH_FRAME_LEN PKTSIZE_ALIGN /* Max. octets in frame sans FCS */ |
| 36 | #define ETH_FCS_LEN 4 /* Octets in the FCS */ |
| 37 | |
| 38 | struct ueth_data { |
| 39 | /* eth info */ |
| 40 | struct eth_device eth_dev; /* used with eth_register */ |
| 41 | int phy_id; /* mii phy id */ |
| 42 | |
| 43 | /* usb info */ |
| 44 | struct usb_device *pusb_dev; /* this usb_device */ |
| 45 | unsigned char ifnum; /* interface number */ |
| 46 | unsigned char ep_in; /* in endpoint */ |
| 47 | unsigned char ep_out; /* out ....... */ |
| 48 | unsigned char ep_int; /* interrupt . */ |
| 49 | unsigned char subclass; /* as in overview */ |
| 50 | unsigned char protocol; /* .............. */ |
| 51 | unsigned char irqinterval; /* Intervall for IRQ Pipe */ |
| 52 | |
Lucas Stach | e1dbdf9 | 2012-08-22 11:04:57 +0000 | [diff] [blame] | 53 | /* driver private */ |
| 54 | void *dev_priv; |
Simon Glass | 89d4836 | 2011-02-16 11:14:33 -0800 | [diff] [blame] | 55 | }; |
| 56 | |
| 57 | /* |
| 58 | * Function definitions for each USB ethernet driver go here, bracketed by |
| 59 | * #ifdef CONFIG_USB_ETHER_xxx...#endif |
| 60 | */ |
Simon Glass | 9b70e00 | 2011-02-16 11:14:34 -0800 | [diff] [blame] | 61 | #ifdef CONFIG_USB_ETHER_ASIX |
| 62 | void asix_eth_before_probe(void); |
| 63 | int asix_eth_probe(struct usb_device *dev, unsigned int ifnum, |
| 64 | struct ueth_data *ss); |
| 65 | int asix_eth_get_info(struct usb_device *dev, struct ueth_data *ss, |
| 66 | struct eth_device *eth); |
| 67 | #endif |
Simon Glass | 89d4836 | 2011-02-16 11:14:33 -0800 | [diff] [blame] | 68 | |
Simon Glass | 291391b | 2011-06-13 16:13:09 -0700 | [diff] [blame] | 69 | #ifdef CONFIG_USB_ETHER_SMSC95XX |
| 70 | void smsc95xx_eth_before_probe(void); |
| 71 | int smsc95xx_eth_probe(struct usb_device *dev, unsigned int ifnum, |
| 72 | struct ueth_data *ss); |
| 73 | int smsc95xx_eth_get_info(struct usb_device *dev, struct ueth_data *ss, |
| 74 | struct eth_device *eth); |
| 75 | #endif |
| 76 | |
Simon Glass | 89d4836 | 2011-02-16 11:14:33 -0800 | [diff] [blame] | 77 | #endif /* __USB_ETHER_H__ */ |