X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fnet%2Ftyphoon.c;h=3af9a9516ccb530e03fe7d5b1947018569fec773;hb=702403af28ef647b090b49bb61abebb45150ce7f;hp=734ce0977f02891e1c6d7a0ac0ba666e3f36ec49;hpb=2be4ff2f084842839b041b793ed6237e8d1d315a;p=linux-2.6-omap-h63xx.git diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c index 734ce0977f0..3af9a9516cc 100644 --- a/drivers/net/typhoon.c +++ b/drivers/net/typhoon.c @@ -1729,7 +1729,6 @@ typhoon_rx(struct typhoon *tp, struct basic_ring *rxRing, volatile __le32 * read netif_receive_skb(new_skb); spin_unlock(&tp->state_lock); - tp->dev->last_rx = jiffies; received++; budget--; } @@ -1756,7 +1755,6 @@ static int typhoon_poll(struct napi_struct *napi, int budget) { struct typhoon *tp = container_of(napi, struct typhoon, napi); - struct net_device *dev = tp->dev; struct typhoon_indexes *indexes = tp->indexes; int work_done; @@ -1785,7 +1783,7 @@ typhoon_poll(struct napi_struct *napi, int budget) } if (work_done < budget) { - netif_rx_complete(dev, napi); + netif_rx_complete(napi); iowrite32(TYPHOON_INTR_NONE, tp->ioaddr + TYPHOON_REG_INTR_MASK); typhoon_post_pci_writes(tp->ioaddr); @@ -1798,7 +1796,7 @@ static irqreturn_t typhoon_interrupt(int irq, void *dev_instance) { struct net_device *dev = dev_instance; - struct typhoon *tp = dev->priv; + struct typhoon *tp = netdev_priv(dev); void __iomem *ioaddr = tp->ioaddr; u32 intr_status; @@ -1808,10 +1806,10 @@ typhoon_interrupt(int irq, void *dev_instance) iowrite32(intr_status, ioaddr + TYPHOON_REG_INTR_STATUS); - if (netif_rx_schedule_prep(dev, &tp->napi)) { + if (netif_rx_schedule_prep(&tp->napi)) { iowrite32(TYPHOON_INTR_ALL, ioaddr + TYPHOON_REG_INTR_MASK); typhoon_post_pci_writes(ioaddr); - __netif_rx_schedule(dev, &tp->napi); + __netif_rx_schedule(&tp->napi); } else { printk(KERN_ERR "%s: Error, poll already scheduled\n", dev->name); @@ -2298,6 +2296,19 @@ out: return mode; } +static const struct net_device_ops typhoon_netdev_ops = { + .ndo_open = typhoon_open, + .ndo_stop = typhoon_close, + .ndo_start_xmit = typhoon_start_tx, + .ndo_set_multicast_list = typhoon_set_rx_mode, + .ndo_tx_timeout = typhoon_tx_timeout, + .ndo_get_stats = typhoon_get_stats, + .ndo_validate_addr = eth_validate_addr, + .ndo_set_mac_address = typhoon_set_mac_address, + .ndo_change_mtu = eth_change_mtu, + .ndo_vlan_rx_register = typhoon_vlan_rx_register, +}; + static int __devinit typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { @@ -2311,7 +2322,6 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) struct cmd_desc xp_cmd; struct resp_desc xp_resp[3]; int err = 0; - DECLARE_MAC_BUF(mac); if(!did_version++) printk(KERN_INFO "%s", version); @@ -2498,16 +2508,9 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) } /* The chip-specific entries in the device structure. */ - dev->open = typhoon_open; - dev->hard_start_xmit = typhoon_start_tx; - dev->stop = typhoon_close; - dev->set_multicast_list = typhoon_set_rx_mode; - dev->tx_timeout = typhoon_tx_timeout; + dev->netdev_ops = &typhoon_netdev_ops; netif_napi_add(dev, &tp->napi, typhoon_poll, 16); dev->watchdog_timeo = TX_TIMEOUT; - dev->get_stats = typhoon_get_stats; - dev->set_mac_address = typhoon_set_mac_address; - dev->vlan_rx_register = typhoon_vlan_rx_register; SET_ETHTOOL_OPS(dev, &typhoon_ethtool_ops); @@ -2526,11 +2529,11 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) pci_set_drvdata(pdev, dev); - printk(KERN_INFO "%s: %s at %s 0x%llx, %s\n", + printk(KERN_INFO "%s: %s at %s 0x%llx, %pM\n", dev->name, typhoon_card_info[card_id].name, use_mmio ? "MMIO" : "IO", (unsigned long long)pci_resource_start(pdev, use_mmio), - print_mac(mac, dev->dev_addr)); + dev->dev_addr); /* xp_resp still contains the response to the READ_VERSIONS command. * For debugging, let the user know what version he has.