X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fnet%2F8139cp.c;h=dd7ac8290aecfc7323554e90ab0850fe64713346;hb=bb758e9637e5ddcff84a97177415499ae1fed498;hp=85fa40a0a667309ea6ba16854ad881d44e24f7b5;hpb=33217379becdee25021cabb25032b3bf703d0e96;p=linux-2.6-omap-h63xx.git diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 85fa40a0a66..dd7ac8290ae 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c @@ -457,7 +457,6 @@ static inline void cp_rx_skb (struct cp_private *cp, struct sk_buff *skb, cp->dev->stats.rx_packets++; cp->dev->stats.rx_bytes += skb->len; - cp->dev->last_rx = jiffies; #if CP_VLAN_TAG_USED if (cp->vlgrp && (desc->opts2 & cpu_to_le32(RxVlanTagged))) { @@ -605,7 +604,7 @@ rx_next: spin_lock_irqsave(&cp->lock, flags); cpw16_f(IntrMask, cp_intr_mask); - __netif_rx_complete(dev, napi); + __netif_rx_complete(napi); spin_unlock_irqrestore(&cp->lock, flags); } @@ -642,9 +641,9 @@ static irqreturn_t cp_interrupt (int irq, void *dev_instance) } if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr)) - if (netif_rx_schedule_prep(dev, &cp->napi)) { + if (netif_rx_schedule_prep(&cp->napi)) { cpw16_f(IntrMask, cp_norx_intr_mask); - __netif_rx_schedule(dev, &cp->napi); + __netif_rx_schedule(&cp->napi); } if (status & (TxOK | TxErr | TxEmpty | SWInt)) @@ -1818,6 +1817,26 @@ static void cp_set_d3_state (struct cp_private *cp) pci_set_power_state (cp->pdev, PCI_D3hot); } +static const struct net_device_ops cp_netdev_ops = { + .ndo_open = cp_open, + .ndo_stop = cp_close, + .ndo_validate_addr = eth_validate_addr, + .ndo_set_multicast_list = cp_set_rx_mode, + .ndo_get_stats = cp_get_stats, + .ndo_do_ioctl = cp_ioctl, + .ndo_start_xmit = cp_start_xmit, + .ndo_tx_timeout = cp_tx_timeout, +#if CP_VLAN_TAG_USED + .ndo_vlan_rx_register = cp_vlan_rx_register, +#endif +#ifdef BROKEN + .ndo_change_mtu = cp_change_mtu, +#endif +#ifdef CONFIG_NET_POLL_CONTROLLER + .ndo_poll_controller = cp_poll_controller, +#endif +}; + static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) { struct net_device *dev; @@ -1826,7 +1845,6 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) void __iomem *regs; resource_size_t pciaddr; unsigned int addr_len, i, pci_using_dac; - DECLARE_MAC_BUF(mac); #ifndef MODULE static int version_printed; @@ -1836,10 +1854,9 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) if (pdev->vendor == PCI_VENDOR_ID_REALTEK && pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pdev->revision < 0x20) { - dev_err(&pdev->dev, - "This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n", + dev_info(&pdev->dev, + "This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip, use 8139too\n", pdev->vendor, pdev->device, pdev->revision); - dev_err(&pdev->dev, "Try the \"8139too\" driver instead.\n"); return -ENODEV; } @@ -1932,26 +1949,13 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) cpu_to_le16(read_eeprom (regs, i + 7, addr_len)); memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); - dev->open = cp_open; - dev->stop = cp_close; - dev->set_multicast_list = cp_set_rx_mode; - dev->hard_start_xmit = cp_start_xmit; - dev->get_stats = cp_get_stats; - dev->do_ioctl = cp_ioctl; -#ifdef CONFIG_NET_POLL_CONTROLLER - dev->poll_controller = cp_poll_controller; -#endif + dev->netdev_ops = &cp_netdev_ops; netif_napi_add(dev, &cp->napi, cp_rx_poll, 16); -#ifdef BROKEN - dev->change_mtu = cp_change_mtu; -#endif dev->ethtool_ops = &cp_ethtool_ops; - dev->tx_timeout = cp_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; #if CP_VLAN_TAG_USED dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; - dev->vlan_rx_register = cp_vlan_rx_register; #endif if (pci_using_dac) @@ -1968,10 +1972,10 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) goto err_out_iomap; printk (KERN_INFO "%s: RTL-8139C+ at 0x%lx, " - "%s, IRQ %d\n", + "%pM, IRQ %d\n", dev->name, dev->base_addr, - print_mac(mac, dev->dev_addr), + dev->dev_addr, dev->irq); pci_set_drvdata(pdev, dev);