mcs7830.c (2b4731b153b4621064d9e899a92f6c03199630f1) | mcs7830.c (2674e7ea22ba0e22a2d1603bd51e0b8f6442a267) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * MOSCHIP MCS7830 based (7730/7830/7832) USB 2.0 Ethernet Devices 4 * 5 * based on usbnet.c, asix.c and the vendor provided mcs7830 driver 6 * 7 * Copyright (C) 2010 Andreas Mohr <andi@lisas.de> 8 * Copyright (C) 2006 Arnd Bergmann <arnd@arndb.de> --- 459 unchanged lines hidden (view full) --- 468 .ndo_eth_ioctl = mcs7830_ioctl, 469 .ndo_set_rx_mode = mcs7830_set_multicast, 470 .ndo_set_mac_address = mcs7830_set_mac_address, 471}; 472 473static int mcs7830_bind(struct usbnet *dev, struct usb_interface *udev) 474{ 475 struct net_device *net = dev->net; | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * MOSCHIP MCS7830 based (7730/7830/7832) USB 2.0 Ethernet Devices 4 * 5 * based on usbnet.c, asix.c and the vendor provided mcs7830 driver 6 * 7 * Copyright (C) 2010 Andreas Mohr <andi@lisas.de> 8 * Copyright (C) 2006 Arnd Bergmann <arnd@arndb.de> --- 459 unchanged lines hidden (view full) --- 468 .ndo_eth_ioctl = mcs7830_ioctl, 469 .ndo_set_rx_mode = mcs7830_set_multicast, 470 .ndo_set_mac_address = mcs7830_set_mac_address, 471}; 472 473static int mcs7830_bind(struct usbnet *dev, struct usb_interface *udev) 474{ 475 struct net_device *net = dev->net; |
476 u8 addr[ETH_ALEN]; |
|
476 int ret; 477 int retry; 478 479 /* Initial startup: Gather MAC address setting from EEPROM */ 480 ret = -EINVAL; 481 for (retry = 0; retry < 5 && ret; retry++) | 477 int ret; 478 int retry; 479 480 /* Initial startup: Gather MAC address setting from EEPROM */ 481 ret = -EINVAL; 482 for (retry = 0; retry < 5 && ret; retry++) |
482 ret = mcs7830_hif_get_mac_address(dev, net->dev_addr); | 483 ret = mcs7830_hif_get_mac_address(dev, addr); |
483 if (ret) { 484 dev_warn(&dev->udev->dev, "Cannot read MAC address\n"); 485 goto out; 486 } | 484 if (ret) { 485 dev_warn(&dev->udev->dev, "Cannot read MAC address\n"); 486 goto out; 487 } |
488 eth_hw_addr_set(net, addr); |
|
487 488 mcs7830_data_set_multicast(net); 489 490 ret = mcs7830_apply_base_config(dev); 491 if (ret) 492 goto out; 493 494 net->ethtool_ops = &mcs7830_ethtool_ops; --- 137 unchanged lines hidden --- | 489 490 mcs7830_data_set_multicast(net); 491 492 ret = mcs7830_apply_base_config(dev); 493 if (ret) 494 goto out; 495 496 net->ethtool_ops = &mcs7830_ethtool_ops; --- 137 unchanged lines hidden --- |