]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
tg3: convert to net_device_ops
authorStephen Hemminger <shemminger@vyatta.com>
Thu, 20 Nov 2008 06:25:36 +0000 (22:25 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Nov 2008 06:42:57 +0000 (22:42 -0800)
Convert this driver to network device ops.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tg3.c

index e05849ee9000fe93dab53ca869097f43c04af95f..4b97cb60136103c2da4984a50e939b1bc5f2cbfc 100644 (file)
@@ -13343,6 +13343,24 @@ static void __devinit tg3_init_coal(struct tg3 *tp)
        }
 }
 
+static const struct net_device_ops tg3_netdev_ops = {
+       .ndo_open               = tg3_open,
+       .ndo_stop               = tg3_close,
+       .ndo_get_stats          = tg3_get_stats,
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_set_multicast_list = tg3_set_rx_mode,
+       .ndo_set_mac_address    = tg3_set_mac_addr,
+       .ndo_do_ioctl           = tg3_ioctl,
+       .ndo_tx_timeout         = tg3_tx_timeout,
+       .ndo_change_mtu         = tg3_change_mtu,
+#if TG3_VLAN_TAG_USED
+       .ndo_vlan_rx_register   = tg3_vlan_rx_register,
+#endif
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       .ndo_poll_controller    = tg3_poll_controller,
+#endif
+};
+
 static int __devinit tg3_init_one(struct pci_dev *pdev,
                                  const struct pci_device_id *ent)
 {
@@ -13400,7 +13418,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
 
 #if TG3_VLAN_TAG_USED
        dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
-       dev->vlan_rx_register = tg3_vlan_rx_register;
 #endif
 
        tp = netdev_priv(dev);
@@ -13458,21 +13475,11 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
        tp->rx_jumbo_pending = TG3_DEF_RX_JUMBO_RING_PENDING;
        tp->tx_pending = TG3_DEF_TX_RING_PENDING;
 
-       dev->open = tg3_open;
-       dev->stop = tg3_close;
-       dev->get_stats = tg3_get_stats;
-       dev->set_multicast_list = tg3_set_rx_mode;
-       dev->set_mac_address = tg3_set_mac_addr;
-       dev->do_ioctl = tg3_ioctl;
-       dev->tx_timeout = tg3_tx_timeout;
+       dev->netdev_ops = &tg3_netdev_ops;
        netif_napi_add(dev, &tp->napi, tg3_poll, 64);
        dev->ethtool_ops = &tg3_ethtool_ops;
        dev->watchdog_timeo = TG3_TX_TIMEOUT;
-       dev->change_mtu = tg3_change_mtu;
        dev->irq = pdev->irq;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       dev->poll_controller = tg3_poll_controller;
-#endif
 
        err = tg3_get_invariants(tp);
        if (err) {