blob: 23507e19e6024918e7617a4a4a98f87e69c774f9 [file] [log] [blame]
Simon Glass89d48362011-02-16 11:14:33 -08001/*
2 * Copyright (c) 2011 The Chromium OS Authors.
Simon Glass89d48362011-02-16 11:14:33 -08003 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Simon Glass89d48362011-02-16 11:14:33 -08005 */
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 */
Simon Glass89d48362011-02-16 11:14:33 -080021
22struct ueth_data {
23 /* eth info */
24 struct eth_device eth_dev; /* used with eth_register */
25 int phy_id; /* mii phy id */
26
27 /* usb info */
28 struct usb_device *pusb_dev; /* this usb_device */
29 unsigned char ifnum; /* interface number */
30 unsigned char ep_in; /* in endpoint */
31 unsigned char ep_out; /* out ....... */
32 unsigned char ep_int; /* interrupt . */
33 unsigned char subclass; /* as in overview */
34 unsigned char protocol; /* .............. */
35 unsigned char irqinterval; /* Intervall for IRQ Pipe */
36
Lucas Stache1dbdf92012-08-22 11:04:57 +000037 /* driver private */
38 void *dev_priv;
Simon Glass89d48362011-02-16 11:14:33 -080039};
40
41/*
Gerhard Sittig440a5742014-03-08 19:46:13 +010042 * Function definitions for each USB ethernet driver go here
43 * (declaration is unconditional, compilation is conditional)
Simon Glass89d48362011-02-16 11:14:33 -080044 */
Simon Glass9b70e002011-02-16 11:14:34 -080045void asix_eth_before_probe(void);
46int asix_eth_probe(struct usb_device *dev, unsigned int ifnum,
47 struct ueth_data *ss);
48int asix_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
49 struct eth_device *eth);
Simon Glass89d48362011-02-16 11:14:33 -080050
Rene Griessle9954b82014-11-07 16:53:48 +010051void ax88179_eth_before_probe(void);
52int ax88179_eth_probe(struct usb_device *dev, unsigned int ifnum,
53 struct ueth_data *ss);
54int ax88179_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
55 struct eth_device *eth);
56
Gerhard Sittigdf4fb1c2014-03-08 19:46:14 +010057void mcs7830_eth_before_probe(void);
58int mcs7830_eth_probe(struct usb_device *dev, unsigned int ifnum,
59 struct ueth_data *ss);
60int mcs7830_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
61 struct eth_device *eth);
62
Simon Glass291391b2011-06-13 16:13:09 -070063void smsc95xx_eth_before_probe(void);
64int smsc95xx_eth_probe(struct usb_device *dev, unsigned int ifnum,
65 struct ueth_data *ss);
66int smsc95xx_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
67 struct eth_device *eth);
Simon Glass291391b2011-06-13 16:13:09 -070068
Simon Glass89d48362011-02-16 11:14:33 -080069#endif /* __USB_ETHER_H__ */