diff options
-rw-r--r-- | drivers/net/r8169.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index d132fe7d475e..27f90b2139c0 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -1397,41 +1397,6 @@ static void rtl8169_netpoll(struct net_device *dev) | |||
1397 | } | 1397 | } |
1398 | #endif | 1398 | #endif |
1399 | 1399 | ||
1400 | static void __rtl8169_set_mac_addr(struct net_device *dev, void __iomem *ioaddr) | ||
1401 | { | ||
1402 | unsigned int i, j; | ||
1403 | |||
1404 | RTL_W8(Cfg9346, Cfg9346_Unlock); | ||
1405 | for (i = 0; i < 2; i++) { | ||
1406 | __le32 l = 0; | ||
1407 | |||
1408 | for (j = 0; j < 4; j++) { | ||
1409 | l <<= 8; | ||
1410 | l |= dev->dev_addr[4*i + j]; | ||
1411 | } | ||
1412 | RTL_W32(MAC0 + 4*i, cpu_to_be32(l)); | ||
1413 | } | ||
1414 | RTL_W8(Cfg9346, Cfg9346_Lock); | ||
1415 | } | ||
1416 | |||
1417 | static int rtl8169_set_mac_addr(struct net_device *dev, void *p) | ||
1418 | { | ||
1419 | struct rtl8169_private *tp = netdev_priv(dev); | ||
1420 | struct sockaddr *addr = p; | ||
1421 | |||
1422 | if (!is_valid_ether_addr(addr->sa_data)) | ||
1423 | return -EINVAL; | ||
1424 | |||
1425 | memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); | ||
1426 | |||
1427 | if (netif_running(dev)) { | ||
1428 | spin_lock_irq(&tp->lock); | ||
1429 | __rtl8169_set_mac_addr(dev, tp->mmio_addr); | ||
1430 | spin_unlock_irq(&tp->lock); | ||
1431 | } | ||
1432 | return 0; | ||
1433 | } | ||
1434 | |||
1435 | static void rtl8169_release_board(struct pci_dev *pdev, struct net_device *dev, | 1400 | static void rtl8169_release_board(struct pci_dev *pdev, struct net_device *dev, |
1436 | void __iomem *ioaddr) | 1401 | void __iomem *ioaddr) |
1437 | { | 1402 | { |
@@ -1681,7 +1646,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1681 | dev->stop = rtl8169_close; | 1646 | dev->stop = rtl8169_close; |
1682 | dev->tx_timeout = rtl8169_tx_timeout; | 1647 | dev->tx_timeout = rtl8169_tx_timeout; |
1683 | dev->set_multicast_list = rtl8169_set_rx_mode; | 1648 | dev->set_multicast_list = rtl8169_set_rx_mode; |
1684 | dev->set_mac_address = rtl8169_set_mac_addr; | ||
1685 | dev->watchdog_timeo = RTL8169_TX_TIMEOUT; | 1649 | dev->watchdog_timeo = RTL8169_TX_TIMEOUT; |
1686 | dev->irq = pdev->irq; | 1650 | dev->irq = pdev->irq; |
1687 | dev->base_addr = (unsigned long) ioaddr; | 1651 | dev->base_addr = (unsigned long) ioaddr; |
@@ -1929,8 +1893,6 @@ rtl8169_hw_start(struct net_device *dev) | |||
1929 | /* Enable all known interrupts by setting the interrupt mask. */ | 1893 | /* Enable all known interrupts by setting the interrupt mask. */ |
1930 | RTL_W16(IntrMask, rtl8169_intr_mask); | 1894 | RTL_W16(IntrMask, rtl8169_intr_mask); |
1931 | 1895 | ||
1932 | __rtl8169_set_mac_addr(dev, ioaddr); | ||
1933 | |||
1934 | netif_start_queue(dev); | 1896 | netif_start_queue(dev); |
1935 | } | 1897 | } |
1936 | 1898 | ||