diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-11-20 01:25:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-20 01:42:57 -0500 |
commit | 7c7d64b8c00bcf9519e5ec38368bc7afdc185c51 (patch) | |
tree | c9ded8839ed5a813e1af75c62a82402db4b1c678 /drivers/net/tg3.c | |
parent | 0edc352743156a39dfc3f21206b2bf7b9f371832 (diff) |
tg3: convert to net_device_ops
Convert this driver to network device ops.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r-- | drivers/net/tg3.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index e05849ee9000..4b97cb601361 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -13343,6 +13343,24 @@ static void __devinit tg3_init_coal(struct tg3 *tp) | |||
13343 | } | 13343 | } |
13344 | } | 13344 | } |
13345 | 13345 | ||
13346 | static const struct net_device_ops tg3_netdev_ops = { | ||
13347 | .ndo_open = tg3_open, | ||
13348 | .ndo_stop = tg3_close, | ||
13349 | .ndo_get_stats = tg3_get_stats, | ||
13350 | .ndo_validate_addr = eth_validate_addr, | ||
13351 | .ndo_set_multicast_list = tg3_set_rx_mode, | ||
13352 | .ndo_set_mac_address = tg3_set_mac_addr, | ||
13353 | .ndo_do_ioctl = tg3_ioctl, | ||
13354 | .ndo_tx_timeout = tg3_tx_timeout, | ||
13355 | .ndo_change_mtu = tg3_change_mtu, | ||
13356 | #if TG3_VLAN_TAG_USED | ||
13357 | .ndo_vlan_rx_register = tg3_vlan_rx_register, | ||
13358 | #endif | ||
13359 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
13360 | .ndo_poll_controller = tg3_poll_controller, | ||
13361 | #endif | ||
13362 | }; | ||
13363 | |||
13346 | static int __devinit tg3_init_one(struct pci_dev *pdev, | 13364 | static int __devinit tg3_init_one(struct pci_dev *pdev, |
13347 | const struct pci_device_id *ent) | 13365 | const struct pci_device_id *ent) |
13348 | { | 13366 | { |
@@ -13400,7 +13418,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13400 | 13418 | ||
13401 | #if TG3_VLAN_TAG_USED | 13419 | #if TG3_VLAN_TAG_USED |
13402 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | 13420 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; |
13403 | dev->vlan_rx_register = tg3_vlan_rx_register; | ||
13404 | #endif | 13421 | #endif |
13405 | 13422 | ||
13406 | tp = netdev_priv(dev); | 13423 | tp = netdev_priv(dev); |
@@ -13458,21 +13475,11 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13458 | tp->rx_jumbo_pending = TG3_DEF_RX_JUMBO_RING_PENDING; | 13475 | tp->rx_jumbo_pending = TG3_DEF_RX_JUMBO_RING_PENDING; |
13459 | tp->tx_pending = TG3_DEF_TX_RING_PENDING; | 13476 | tp->tx_pending = TG3_DEF_TX_RING_PENDING; |
13460 | 13477 | ||
13461 | dev->open = tg3_open; | 13478 | dev->netdev_ops = &tg3_netdev_ops; |
13462 | dev->stop = tg3_close; | ||
13463 | dev->get_stats = tg3_get_stats; | ||
13464 | dev->set_multicast_list = tg3_set_rx_mode; | ||
13465 | dev->set_mac_address = tg3_set_mac_addr; | ||
13466 | dev->do_ioctl = tg3_ioctl; | ||
13467 | dev->tx_timeout = tg3_tx_timeout; | ||
13468 | netif_napi_add(dev, &tp->napi, tg3_poll, 64); | 13479 | netif_napi_add(dev, &tp->napi, tg3_poll, 64); |
13469 | dev->ethtool_ops = &tg3_ethtool_ops; | 13480 | dev->ethtool_ops = &tg3_ethtool_ops; |
13470 | dev->watchdog_timeo = TG3_TX_TIMEOUT; | 13481 | dev->watchdog_timeo = TG3_TX_TIMEOUT; |
13471 | dev->change_mtu = tg3_change_mtu; | ||
13472 | dev->irq = pdev->irq; | 13482 | dev->irq = pdev->irq; |
13473 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
13474 | dev->poll_controller = tg3_poll_controller; | ||
13475 | #endif | ||
13476 | 13483 | ||
13477 | err = tg3_get_invariants(tp); | 13484 | err = tg3_get_invariants(tp); |
13478 | if (err) { | 13485 | if (err) { |