iPXE
lan78xx.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Michael Brown <mbrown@fensystems.co.uk>.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  * 02110-1301, USA.
18  *
19  * You can also choose to distribute this program under the terms of
20  * the Unmodified Binary Distribution Licence (as given in the file
21  * COPYING.UBDL), provided that you have satisfied its requirements.
22  */
23 
24 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
25 
26 #include <string.h>
27 #include <unistd.h>
28 #include <errno.h>
29 #include <ipxe/ethernet.h>
30 #include <ipxe/usb.h>
31 #include <ipxe/usbnet.h>
32 #include "lan78xx.h"
33 
34 /** @file
35  *
36  * Microchip LAN78xx USB Ethernet driver
37  *
38  */
39 
40 /******************************************************************************
41  *
42  * MAC address
43  *
44  ******************************************************************************
45  */
46 
47 /**
48  * Fetch MAC address from EEPROM
49  *
50  * @v smscusb SMSC USB device
51  * @ret rc Return status code
52  */
53 static int lan78xx_eeprom_fetch_mac ( struct smscusb_device *smscusb ) {
54  uint32_t hw_cfg;
55  uint32_t orig_hw_cfg;
56  int rc;
57 
58  /* Read original HW_CFG value */
59  if ( ( rc = smscusb_readl ( smscusb, LAN78XX_HW_CFG, &hw_cfg ) ) != 0 )
60  goto err_read_hw_cfg;
61  orig_hw_cfg = hw_cfg;
62 
63  /* Temporarily disable LED0 and LED1 (which share physical
64  * pins with EEDO and EECLK respectively).
65  */
67  if ( ( rc = smscusb_writel ( smscusb, LAN78XX_HW_CFG, hw_cfg ) ) != 0 )
68  goto err_write_hw_cfg;
69 
70  /* Fetch MAC address from EEPROM */
71  if ( ( rc = smscusb_eeprom_fetch_mac ( smscusb,
72  LAN78XX_E2P_BASE ) ) != 0 )
73  goto err_fetch_mac;
74 
75  err_fetch_mac:
76  smscusb_writel ( smscusb, LAN78XX_HW_CFG, orig_hw_cfg );
77  err_write_hw_cfg:
78  err_read_hw_cfg:
79  return rc;
80 }
81 
82 /**
83  * Fetch MAC address
84  *
85  * @v smscusb SMSC USB device
86  * @ret rc Return status code
87  */
88 static int lan78xx_fetch_mac ( struct smscusb_device *smscusb ) {
89  struct net_device *netdev = smscusb->netdev;
90  int rc;
91 
92  /* Read MAC address from EEPROM, if present */
93  if ( ( rc = lan78xx_eeprom_fetch_mac ( smscusb ) ) == 0 )
94  return 0;
95 
96  /* Read MAC address from OTP, if present */
97  if ( ( rc = smscusb_otp_fetch_mac ( smscusb, LAN78XX_OTP_BASE ) ) == 0 )
98  return 0;
99 
100  /* Read MAC address from device tree, if present */
101  if ( ( rc = smscusb_fdt_fetch_mac ( smscusb ) ) == 0 )
102  return 0;
103 
104  /* Otherwise, generate a random MAC address */
106  DBGC ( smscusb, "LAN78XX %p using random MAC %s\n",
107  smscusb, eth_ntoa ( netdev->hw_addr ) );
108  return 0;
109 }
110 
111 /******************************************************************************
112  *
113  * Device reset
114  *
115  ******************************************************************************
116  */
117 
118 /**
119  * Reset device
120  *
121  * @v smscusb SMSC USB device
122  * @ret rc Return status code
123  */
124 static int lan78xx_reset ( struct smscusb_device *smscusb ) {
125  uint32_t hw_cfg;
126  unsigned int i;
127  int rc;
128 
129  /* Reset device */
130  if ( ( rc = smscusb_writel ( smscusb, LAN78XX_HW_CFG,
131  LAN78XX_HW_CFG_LRST ) ) != 0 )
132  return rc;
133 
134  /* Wait for reset to complete */
135  for ( i = 0 ; i < LAN78XX_RESET_MAX_WAIT_MS ; i++ ) {
136 
137  /* Check if reset has completed */
138  if ( ( rc = smscusb_readl ( smscusb, LAN78XX_HW_CFG,
139  &hw_cfg ) ) != 0 )
140  return rc;
141  if ( ! ( hw_cfg & LAN78XX_HW_CFG_LRST ) )
142  return 0;
143 
144  /* Delay */
145  mdelay ( 1 );
146  }
147 
148  DBGC ( smscusb, "LAN78XX %p timed out waiting for reset\n",
149  smscusb );
150  return -ETIMEDOUT;
151 }
152 
153 /******************************************************************************
154  *
155  * Network device interface
156  *
157  ******************************************************************************
158  */
159 
160 /**
161  * Open network device
162  *
163  * @v netdev Network device
164  * @ret rc Return status code
165  */
166 static int lan78xx_open ( struct net_device *netdev ) {
167  struct smscusb_device *smscusb = netdev->priv;
168  uint32_t usb_cfg0;
169  int rc;
170 
171  /* Clear stored interrupt status */
172  smscusb->int_sts = 0;
173 
174  /* Configure bulk IN empty response */
175  if ( ( rc = smscusb_readl ( smscusb, LAN78XX_USB_CFG0,
176  &usb_cfg0 ) ) != 0 )
177  goto err_usb_cfg0_read;
178  usb_cfg0 |= LAN78XX_USB_CFG0_BIR;
179  if ( ( rc = smscusb_writel ( smscusb, LAN78XX_USB_CFG0,
180  usb_cfg0 ) ) != 0 )
181  goto err_usb_cfg0_write;
182 
183  /* Open USB network device */
184  if ( ( rc = usbnet_open ( &smscusb->usbnet ) ) != 0 ) {
185  DBGC ( smscusb, "LAN78XX %p could not open: %s\n",
186  smscusb, strerror ( rc ) );
187  goto err_open;
188  }
189 
190  /* Configure interrupt endpoint */
191  if ( ( rc = smscusb_writel ( smscusb, LAN78XX_INT_EP_CTL,
193  LAN78XX_INT_EP_CTL_PHY_EN ) ) ) != 0 )
194  goto err_int_ep_ctl;
195 
196  /* Configure bulk IN delay */
197  if ( ( rc = smscusb_writel ( smscusb, LAN78XX_BULK_IN_DLY,
198  LAN78XX_BULK_IN_DLY_SET ( 0 ) ) ) != 0 )
199  goto err_bulk_in_dly;
200 
201  /* Enable automatic speed and duplex detection */
202  if ( ( rc = smscusb_writel ( smscusb, LAN78XX_MAC_CR,
205  LAN78XX_MAC_CR_ASD ) ) ) != 0 )
206  goto err_mac_cr;
207 
208  /* Configure receive filters */
209  if ( ( rc = smscusb_writel ( smscusb, LAN78XX_RFE_CTL,
212  LAN78XX_RFE_CTL_AU ) ) ) != 0 )
213  goto err_rfe_ctl;
214 
215  /* Configure receive FIFO */
216  if ( ( rc = smscusb_writel ( smscusb, LAN78XX_FCT_RX_CTL,
218  LAN78XX_FCT_RX_CTL_BAD ) ) ) != 0 )
219  goto err_fct_rx_ctl;
220 
221  /* Configure transmit FIFO */
222  if ( ( rc = smscusb_writel ( smscusb, LAN78XX_FCT_TX_CTL,
223  LAN78XX_FCT_TX_CTL_EN ) ) != 0 )
224  goto err_fct_tx_ctl;
225 
226  /* Configure receive datapath */
227  if ( ( rc = smscusb_writel ( smscusb, LAN78XX_MAC_RX,
230  LAN78XX_MAC_RX_EN ) ) ) != 0 )
231  goto err_mac_rx;
232 
233  /* Configure transmit datapath */
234  if ( ( rc = smscusb_writel ( smscusb, LAN78XX_MAC_TX,
235  LAN78XX_MAC_TX_EN ) ) != 0 )
236  goto err_mac_tx;
237 
238  /* Set MAC address */
239  if ( ( rc = smscusb_set_address ( smscusb,
240  LAN78XX_RX_ADDR_BASE ) ) != 0 )
241  goto err_set_address;
242 
243  /* Set MAC address perfect filter */
244  if ( ( rc = smscusb_set_filter ( smscusb,
245  LAN78XX_ADDR_FILT_BASE ) ) != 0 )
246  goto err_set_filter;
247 
248  /* Enable PHY interrupts and update link status */
249  if ( ( rc = smscusb_mii_open ( smscusb, LAN78XX_MII_PHY_INTR_MASK,
253  LAN78XX_PHY_INTR_ANEG_DONE ) ) ) != 0 )
254  goto err_mii_open;
255 
256  return 0;
257 
258  err_mii_open:
259  err_set_filter:
260  err_set_address:
261  err_mac_tx:
262  err_mac_rx:
263  err_fct_tx_ctl:
264  err_fct_rx_ctl:
265  err_rfe_ctl:
266  err_mac_cr:
267  err_bulk_in_dly:
268  err_int_ep_ctl:
269  usbnet_close ( &smscusb->usbnet );
270  err_open:
271  err_usb_cfg0_write:
272  err_usb_cfg0_read:
273  lan78xx_reset ( smscusb );
274  return rc;
275 }
276 
277 /**
278  * Close network device
279  *
280  * @v netdev Network device
281  */
282 static void lan78xx_close ( struct net_device *netdev ) {
283  struct smscusb_device *smscusb = netdev->priv;
284 
285  /* Close USB network device */
286  usbnet_close ( &smscusb->usbnet );
287 
288  /* Dump statistics (for debugging) */
289  if ( DBG_LOG )
290  smsc75xx_dump_statistics ( smscusb );
291 
292  /* Reset device */
293  lan78xx_reset ( smscusb );
294 }
295 
296 /** LAN78xx network device operations */
298  .open = lan78xx_open,
299  .close = lan78xx_close,
300  .transmit = smsc75xx_transmit,
301  .poll = smsc75xx_poll,
302 };
303 
304 /******************************************************************************
305  *
306  * USB interface
307  *
308  ******************************************************************************
309  */
310 
311 /**
312  * Probe device
313  *
314  * @v func USB function
315  * @v config Configuration descriptor
316  * @ret rc Return status code
317  */
318 static int lan78xx_probe ( struct usb_function *func,
319  struct usb_configuration_descriptor *config ) {
320  struct net_device *netdev;
321  struct smscusb_device *smscusb;
322  int rc;
323 
324  /* Allocate and initialise structure */
325  netdev = alloc_etherdev ( sizeof ( *smscusb ) );
326  if ( ! netdev ) {
327  rc = -ENOMEM;
328  goto err_alloc;
329  }
331  netdev->dev = &func->dev;
332  smscusb = netdev->priv;
333  memset ( smscusb, 0, sizeof ( *smscusb ) );
334  smscusb_init ( smscusb, netdev, func, &smsc75xx_in_operations );
337  usb_refill_init ( &smscusb->usbnet.in, 0, SMSC75XX_IN_MTU,
339  DBGC ( smscusb, "LAN78XX %p on %s\n", smscusb, func->name );
340 
341  /* Describe USB network device */
342  if ( ( rc = usbnet_describe ( &smscusb->usbnet, config ) ) != 0 ) {
343  DBGC ( smscusb, "LAN78XX %p could not describe: %s\n",
344  smscusb, strerror ( rc ) );
345  goto err_describe;
346  }
347 
348  /* Reset device */
349  if ( ( rc = lan78xx_reset ( smscusb ) ) != 0 )
350  goto err_reset;
351 
352  /* Read MAC address */
353  if ( ( rc = lan78xx_fetch_mac ( smscusb ) ) != 0 )
354  goto err_fetch_mac;
355 
356  /* Register network device */
357  if ( ( rc = register_netdev ( netdev ) ) != 0 )
358  goto err_register;
359 
360  usb_func_set_drvdata ( func, netdev );
361  return 0;
362 
364  err_register:
365  err_fetch_mac:
366  err_reset:
367  err_describe:
369  netdev_put ( netdev );
370  err_alloc:
371  return rc;
372 }
373 
374 /**
375  * Remove device
376  *
377  * @v func USB function
378  */
379 static void lan78xx_remove ( struct usb_function *func ) {
380  struct net_device *netdev = usb_func_get_drvdata ( func );
381 
384  netdev_put ( netdev );
385 }
386 
387 /** LAN78xx device IDs */
388 static struct usb_device_id lan78xx_ids[] = {
389  {
390  .name = "lan7800",
391  .vendor = 0x0424,
392  .product = 0x7800,
393  },
394  {
395  .name = "lan7850",
396  .vendor = 0x0424,
397  .product = 0x7850,
398  },
399 };
400 
401 /** LAN78xx driver */
402 struct usb_driver lan78xx_driver __usb_driver = {
403  .ids = lan78xx_ids,
404  .id_count = ( sizeof ( lan78xx_ids ) / sizeof ( lan78xx_ids[0] ) ),
405  .class = USB_CLASS_ID ( 0xff, 0x00, 0xff ),
406  .score = USB_SCORE_NORMAL,
407  .probe = lan78xx_probe,
408  .remove = lan78xx_remove,
409 };
int smscusb_set_address(struct smscusb_device *smscusb, unsigned int addr_base)
Set receive address.
Definition: smscusb.c:686
A USB driver.
Definition: usb.h:1363
#define SMSC75XX_IN_MAX_FILL
Bulk IN maximum fill level.
Definition: smsc75xx.h:209
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
A USB device ID.
Definition: usb.h:1317
static void * usb_func_get_drvdata(struct usb_function *func)
Get USB function driver private data.
Definition: usb.h:701
#define LAN78XX_HW_CFG_LED1_EN
LED1 enable.
Definition: lan78xx.h:17
const char * name
Name.
Definition: usb.h:659
int(* open)(struct net_device *netdev)
Open network device.
Definition: netdevice.h:222
#define LAN78XX_PHY_INTR_ANEG_ERR
PHY interrupt: auto-negotiation failure.
Definition: lan78xx.h:89
const char * name
Name.
Definition: usb.h:1319
Error codes.
static int lan78xx_probe(struct usb_function *func, struct usb_configuration_descriptor *config)
Probe device.
Definition: lan78xx.c:318
static int lan78xx_fetch_mac(struct smscusb_device *smscusb)
Fetch MAC address.
Definition: lan78xx.c:88
#define LAN78XX_PHY_INTR_ENABLE
PHY interrupt: global enable.
Definition: lan78xx.h:83
An SMSC USB device.
Definition: smscusb.h:147
#define LAN78XX_MAC_CR_ASD
Auto speed.
Definition: lan78xx.h:56
#define LAN78XX_ADDR_FILT_BASE
MAC address perfect filter register base.
Definition: lan78xx.h:95
#define LAN78XX_FCT_RX_CTL_BAD
Store bad frames.
Definition: lan78xx.h:46
#define LAN78XX_HW_CFG_LED0_EN
LED1 enable.
Definition: lan78xx.h:18
#define LAN78XX_USB_CFG0
USB configuration register 0.
Definition: lan78xx.h:34
struct usb_driver lan78xx_driver __usb_driver
LAN78xx driver.
Definition: lan78xx.c:402
static void smscusb_init(struct smscusb_device *smscusb, struct net_device *netdev, struct usb_function *func, struct usb_endpoint_driver_operations *in)
Initialise SMSC USB device.
Definition: smscusb.h:259
#define DBGC(...)
Definition: compiler.h:505
#define LAN78XX_MAC_CR_ADP
Duplex polarity.
Definition: lan78xx.h:54
int smsc75xx_transmit(struct net_device *netdev, struct io_buffer *iobuf)
Transmit packet.
Definition: smsc75xx.c:403
#define SMSC75XX_IN_MTU
Bulk IN buffer size.
Definition: smsc75xx.h:212
#define LAN78XX_FCT_RX_CTL
FIFO controller RX FIFO control register.
Definition: lan78xx.h:44
#define LAN78XX_FCT_TX_CTL
FIFO controller TX FIFO control register.
Definition: lan78xx.h:49
#define LAN78XX_USB_CFG0_BIR
Bulk IN use NAK.
Definition: lan78xx.h:35
static int smscusb_writel(struct smscusb_device *smscusb, unsigned int address, uint32_t value)
Write register.
Definition: smscusb.h:182
#define LAN78XX_MAC_CR
MAC control register.
Definition: lan78xx.h:53
struct usb_endpoint_driver_operations smsc75xx_in_operations
Bulk IN endpoint operations.
Definition: smsc75xx.c:233
#define LAN78XX_FCT_RX_CTL_EN
FCT RX enable.
Definition: lan78xx.h:45
#define LAN78XX_INT_EP_CTL
Interrupt endpoint control register.
Definition: lan78xx.h:22
static void smscusb_mii_init(struct smscusb_device *smscusb, unsigned int mii_base, unsigned int phy_source)
Initialise SMSC USB device MII interface.
Definition: smscusb.h:280
#define LAN78XX_MII_BASE
MII register base.
Definition: lan78xx.h:74
int smscusb_mii_open(struct smscusb_device *smscusb, unsigned int phy_mask, unsigned int intrs)
Enable PHY interrupts and update link status.
Definition: smscusb.c:655
#define LAN78XX_MAC_RX_FCS
FCS stripping.
Definition: lan78xx.h:63
static void lan78xx_remove(struct usb_function *func)
Remove device.
Definition: lan78xx.c:379
#define LAN78XX_E2P_BASE
EEPROM register base.
Definition: lan78xx.h:31
static struct usb_device_id lan78xx_ids[]
LAN78xx device IDs.
Definition: lan78xx.c:388
int smscusb_set_filter(struct smscusb_device *smscusb, unsigned int filt_base)
Set receive filter.
Definition: smscusb.c:718
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
Definition: netdevice.h:498
#define LAN78XX_MII_PHY_INTR_MASK
PHY interrupt mask MII register.
Definition: lan78xx.h:77
uint32_t int_sts
Interrupt status.
Definition: smscusb.h:165
#define ENOMEM
Not enough space.
Definition: errno.h:534
#define LAN78XX_HW_CFG
Hardware configuration register.
Definition: lan78xx.h:16
static int lan78xx_open(struct net_device *netdev)
Open network device.
Definition: lan78xx.c:166
struct usbnet_device usbnet
USB network device.
Definition: smscusb.h:155
#define LAN78XX_MAC_RX
MAC receive register.
Definition: lan78xx.h:59
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
Definition: netdevice.h:555
Ethernet protocol.
#define LAN78XX_MAC_RX_MAX_SIZE_DEFAULT
Definition: lan78xx.h:61
#define LAN78XX_HW_CFG_LRST
Soft lite reset.
Definition: lan78xx.h:19
void * priv
Driver private data.
Definition: netdevice.h:425
int smsc75xx_dump_statistics(struct smscusb_device *smscusb)
Dump statistics (for debugging)
Definition: smsc75xx.c:63
static void usb_refill_init(struct usb_endpoint *ep, size_t reserve, size_t len, unsigned int max)
Initialise USB endpoint refill.
Definition: usb.h:601
static struct net_device * netdev
Definition: gdbudp.c:52
#define LAN78XX_MAC_RX_EN
RX enable.
Definition: lan78xx.h:64
void smsc75xx_poll(struct net_device *netdev)
Poll for completed and received packets.
Definition: smsc75xx.c:419
static int smscusb_readl(struct smscusb_device *smscusb, unsigned int address, uint32_t *value)
Read register.
Definition: smscusb.h:203
static void usb_func_set_drvdata(struct usb_function *func, void *priv)
Set USB function driver private data.
Definition: usb.h:690
void unregister_netdev(struct net_device *netdev)
Unregister network device.
Definition: netdevice.c:844
#define LAN78XX_RFE_CTL_AM
Accept multicast.
Definition: lan78xx.h:40
int smscusb_eeprom_fetch_mac(struct smscusb_device *smscusb, unsigned int e2p_base)
Fetch MAC address from EEPROM.
Definition: smscusb.c:215
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
int register_netdev(struct net_device *netdev)
Register network device.
Definition: netdevice.c:667
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
Definition: ethernet.c:175
#define LAN78XX_RFE_CTL_AU
Accept unicast.
Definition: lan78xx.h:41
#define USB_CLASS_ID(base, subclass, protocol)
Construct USB class ID.
Definition: usb.h:1345
A network device.
Definition: netdevice.h:348
#define LAN78XX_FCT_TX_CTL_EN
FCT TX enable.
Definition: lan78xx.h:50
struct usb_endpoint in
Bulk IN endpoint.
Definition: usbnet.h:29
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
Definition: netdevice.h:511
Normal driver.
Definition: usb.h:1406
unsigned int uint32_t
Definition: stdint.h:12
Network device operations.
Definition: netdevice.h:213
struct device * dev
Underlying hardware device.
Definition: netdevice.h:360
#define LAN78XX_RFE_CTL
Receive filtering engine control register.
Definition: lan78xx.h:38
static int lan78xx_eeprom_fetch_mac(struct smscusb_device *smscusb)
Fetch MAC address from EEPROM.
Definition: lan78xx.c:53
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
Definition: timer.c:78
USB network devices.
A USB configuration descriptor.
Definition: usb.h:195
int smscusb_otp_fetch_mac(struct smscusb_device *smscusb, unsigned int otp_base)
Fetch MAC address from OTP.
Definition: smscusb.c:400
#define LAN78XX_MAC_TX_EN
TX enable.
Definition: lan78xx.h:68
Microchip LAN78xx USB Ethernet driver.
Universal Serial Bus (USB)
#define LAN78XX_PHY_INTR_LINK
PHY interrupt: link state change.
Definition: lan78xx.h:86
#define LAN78XX_RFE_CTL_AB
Accept broadcast.
Definition: lan78xx.h:39
#define LAN78XX_INT_EP_CTL_RDFO_EN
RX FIFO overflow.
Definition: lan78xx.h:23
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
Definition: ethernet.c:264
#define LAN78XX_BULK_IN_DLY_SET(ticks)
Delay / 16.7ns.
Definition: lan78xx.h:28
static void lan78xx_close(struct net_device *netdev)
Close network device.
Definition: lan78xx.c:282
static int lan78xx_reset(struct smscusb_device *smscusb)
Reset device.
Definition: lan78xx.c:124
#define LAN78XX_OTP_BASE
OTP register base.
Definition: lan78xx.h:98
int usbnet_describe(struct usbnet_device *usbnet, struct usb_configuration_descriptor *config)
Describe USB network device interfaces.
Definition: usbnet.c:277
#define LAN78XX_RX_ADDR_BASE
MAC receive address register base.
Definition: lan78xx.h:71
static struct net_device_operations lan78xx_operations
LAN78xx network device operations.
Definition: lan78xx.c:297
struct net_device * netdev
Network device.
Definition: smscusb.h:153
#define LAN78XX_PHY_INTR_ANEG_DONE
PHY interrupt: auto-negotiation complete.
Definition: lan78xx.h:92
void usbnet_close(struct usbnet_device *usbnet)
Close USB network device.
Definition: usbnet.c:127
struct device dev
Generic device.
Definition: usb.h:665
A USB function.
Definition: usb.h:657
#define LAN78XX_MII_PHY_INTR_SOURCE
PHY interrupt source MII register.
Definition: lan78xx.h:80
#define DBG_LOG
Definition: compiler.h:317
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
Definition: netdevice.h:375
int smscusb_fdt_fetch_mac(struct smscusb_device *smscusb)
Fetch MAC address from device tree.
Definition: smscusb.c:456
#define ETIMEDOUT
Connection timed out.
Definition: errno.h:669
String functions.
#define LAN78XX_MAC_TX
MAC transmit register.
Definition: lan78xx.h:67
#define LAN78XX_RESET_MAX_WAIT_MS
Maximum time to wait for reset (in milliseconds)
Definition: lan78xx.h:101
void eth_random_addr(void *hw_addr)
Generate random Ethernet address.
Definition: ethernet.c:159
#define LAN78XX_INT_EP_CTL_PHY_EN
PHY interrupt.
Definition: lan78xx.h:24
#define LAN78XX_BULK_IN_DLY
Bulk IN delay register.
Definition: lan78xx.h:27
#define LAN78XX_MAC_CR_ADD
Auto duplex.
Definition: lan78xx.h:55
struct usb_device_id * ids
USB ID table.
Definition: usb.h:1365
void * memset(void *dest, int character, size_t len) __nonnull
int usbnet_open(struct usbnet_device *usbnet)
Open USB network device.
Definition: usbnet.c:54