--- r8169.c 2015-11-21 22:27:27.530227533 +0100 +++ r8169.c 2015-11-21 22:52:53.178319309 +0100 @@ -26,7 +26,6 @@ #include #include -#include #include #include @@ -1011,34 +1010,6 @@ static int rtl8169_set_settings(struct n return ret; } -static u32 rtl8169_get_rx_csum(struct net_device *dev) -{ - struct rtl8169_private *tp = netdev_priv(dev); - - return tp->cp_cmd & RxChkSum; -} - -static int rtl8169_set_rx_csum(struct net_device *dev, u32 data) -{ - struct rtl8169_private *tp = netdev_priv(dev); - void __iomem *ioaddr = tp->mmio_addr; - unsigned long flags; - - spin_lock_irqsave(&tp->lock, flags); - - if (data) - tp->cp_cmd |= RxChkSum; - else - tp->cp_cmd &= ~RxChkSum; - - RTL_W16(CPlusCmd, tp->cp_cmd); - RTL_R16(CPlusCmd); - - spin_unlock_irqrestore(&tp->lock, flags); - - return 0; -} - #ifdef CONFIG_R8169_VLAN static inline u32 rtl8169_tx_vlan_tag(struct rtl8169_private *tp, @@ -1278,11 +1249,6 @@ static const struct ethtool_ops rtl8169_ .set_settings = rtl8169_set_settings, .get_msglevel = rtl8169_get_msglevel, .set_msglevel = rtl8169_set_msglevel, - .get_rx_csum = rtl8169_get_rx_csum, - .set_rx_csum = rtl8169_set_rx_csum, - .set_tx_csum = ethtool_op_set_tx_csum, - .set_sg = ethtool_op_set_sg, - .set_tso = ethtool_op_set_tso, .get_regs = rtl8169_get_regs, .get_wol = rtl8169_get_wol, .set_wol = rtl8169_set_wol, @@ -2991,7 +2957,7 @@ static const struct net_device_ops rtl81 .ndo_change_mtu = rtl8169_change_mtu, .ndo_set_mac_address = rtl_set_mac_address, .ndo_do_ioctl = rtl8169_ioctl, - .ndo_set_multicast_list = rtl_set_rx_mode, + .ndo_set_rx_mode = rtl_set_rx_mode, #ifdef CONFIG_R8169_VLAN .ndo_vlan_rx_register = rtl8169_vlan_rx_register, #endif @@ -3001,7 +2967,7 @@ static const struct net_device_ops rtl81 }; -static int __devinit +static int rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { const struct rtl_cfg_info *cfg = rtl_cfg_infos + ent->driver_data; @@ -3182,7 +3148,7 @@ rtl8169_init_one(struct pci_dev *pdev, c dev->dev_addr[i] = RTL_R8(MAC0 + i); memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); - SET_ETHTOOL_OPS(dev, &rtl8169_ethtool_ops); + dev->ethtool_ops = &rtl8169_ethtool_ops; dev->watchdog_timeo = RTL8169_TX_TIMEOUT; dev->irq = pdev->irq; dev->base_addr = (unsigned long) ioaddr; @@ -3247,7 +3213,7 @@ err_out_free_dev_1: goto out; } -static void __devexit rtl8169_remove_one(struct pci_dev *pdev) +static void rtl8169_remove_one(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); struct rtl8169_private *tp = netdev_priv(dev); @@ -3322,8 +3288,6 @@ static int rtl8169_open(struct net_devic if (retval < 0) goto err_free_rx_1; - INIT_DELAYED_WORK(&tp->task, NULL); - smp_mb(); retval = request_irq(dev->irq, rtl8169_interrupt, @@ -4149,7 +4113,7 @@ static void rtl8169_schedule_work(struct { struct rtl8169_private *tp = netdev_priv(dev); - PREPARE_DELAYED_WORK(&tp->task, task); + INIT_WORK(&tp->task.work, task); schedule_delayed_work(&tp->task, 4); } @@ -4257,7 +4221,7 @@ static int rtl8169_xmit_frags(struct rtl txd = tp->TxDescArray + entry; len = frag->size; - addr = ((void *) page_address(frag->page)) + frag->page_offset; + addr = skb_frag_address(frag); mapping = pci_map_single(tp->pci_dev, addr, len, PCI_DMA_TODEVICE); /* anti gcc 2.95.3 bugware (sic) */ @@ -5019,7 +4983,7 @@ static struct pci_driver rtl8169_pci_dri .name = MODULENAME, .id_table = rtl8169_pci_tbl, .probe = rtl8169_init_one, - .remove = __devexit_p(rtl8169_remove_one), + .remove = rtl8169_remove_one, .shutdown = rtl_shutdown, .driver.pm = RTL8169_PM_OPS, };