blob: 678c9dff25245ffbc64c46972ee116e344e8bdce [file] [log] [blame]
Simon Glass1e9961d2011-02-16 11:14:33 -08001/*
2 * Copyright (c) 2011 The Chromium OS Authors.
Simon Glass1e9961d2011-02-16 11:14:33 -08003 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Simon Glass1e9961d2011-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 */
21#define ETH_FCS_LEN 4 /* Octets in the FCS */
22
23struct 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 Stach36267c42012-08-22 11:04:57 +000038 /* driver private */
39 void *dev_priv;
Simon Glass1e9961d2011-02-16 11:14:33 -080040};
41
42/*
43 * Function definitions for each USB ethernet driver go here, bracketed by
44 * #ifdef CONFIG_USB_ETHER_xxx...#endif
45 */
Simon Glass246d6932011-02-16 11:14:34 -080046#ifdef CONFIG_USB_ETHER_ASIX
47void asix_eth_before_probe(void);
48int asix_eth_probe(struct usb_device *dev, unsigned int ifnum,
49 struct ueth_data *ss);
50int asix_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
51 struct eth_device *eth);
52#endif
Simon Glass1e9961d2011-02-16 11:14:33 -080053
Simon Glass246c1192011-06-13 16:13:09 -070054#ifdef CONFIG_USB_ETHER_SMSC95XX
55void smsc95xx_eth_before_probe(void);
56int smsc95xx_eth_probe(struct usb_device *dev, unsigned int ifnum,
57 struct ueth_data *ss);
58int smsc95xx_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
59 struct eth_device *eth);
60#endif
61
Simon Glass1e9961d2011-02-16 11:14:33 -080062#endif /* __USB_ETHER_H__ */