Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
[safe/jmp/linux-2.6] / drivers / net / typhoon.c
index 6f191e9..3af9a95 100644 (file)
@@ -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)
 {
@@ -2497,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);