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