1
2
3
4
5
6#ifndef __USB_ETHER_H__
7#define __USB_ETHER_H__
8
9#include <net.h>
10
11
12struct ueth_data {
13
14#ifdef CONFIG_DM_ETH
15 uint8_t *rxbuf;
16 int rxsize;
17 int rxlen;
18 int rxptr;
19#else
20 struct eth_device eth_dev;
21
22 void *dev_priv;
23#endif
24 int phy_id;
25
26
27 struct usb_device *pusb_dev;
28 unsigned char ifnum;
29 unsigned char ep_in;
30 unsigned char ep_out;
31 unsigned char ep_int;
32 unsigned char subclass;
33 unsigned char protocol;
34 unsigned char irqinterval;
35};
36
37#ifdef CONFIG_DM_ETH
38
39
40
41
42
43
44
45
46
47
48int usb_ether_register(struct udevice *dev, struct ueth_data *ueth, int rxsize);
49
50
51
52
53
54
55
56int usb_ether_deregister(struct ueth_data *ueth);
57
58
59
60
61
62
63
64
65
66
67
68int usb_ether_receive(struct ueth_data *ueth, int rxsize);
69
70
71
72
73
74
75
76
77
78
79
80
81
82int usb_ether_get_rx_bytes(struct ueth_data *ueth, uint8_t **ptrp);
83
84
85
86
87
88
89
90
91
92
93
94void usb_ether_advance_rxbuf(struct ueth_data *ueth, int num_bytes);
95#else
96
97
98
99
100void asix_eth_before_probe(void);
101int asix_eth_probe(struct usb_device *dev, unsigned int ifnum,
102 struct ueth_data *ss);
103int asix_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
104 struct eth_device *eth);
105
106void ax88179_eth_before_probe(void);
107int ax88179_eth_probe(struct usb_device *dev, unsigned int ifnum,
108 struct ueth_data *ss);
109int ax88179_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
110 struct eth_device *eth);
111
112void mcs7830_eth_before_probe(void);
113int mcs7830_eth_probe(struct usb_device *dev, unsigned int ifnum,
114 struct ueth_data *ss);
115int mcs7830_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
116 struct eth_device *eth);
117
118void smsc95xx_eth_before_probe(void);
119int smsc95xx_eth_probe(struct usb_device *dev, unsigned int ifnum,
120 struct ueth_data *ss);
121int smsc95xx_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
122 struct eth_device *eth);
123
124void r8152_eth_before_probe(void);
125int r8152_eth_probe(struct usb_device *dev, unsigned int ifnum,
126 struct ueth_data *ss);
127int r8152_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
128 struct eth_device *eth);
129#endif
130
131#endif
132