diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-11-20 01:26:51 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-20 01:42:57 -0500 |
commit | b94426bd9d16fb2753ada1255c7a432f49dfebcb (patch) | |
tree | 534ecdf9ffdbb3ecbde0cacd1258f53e6857c11d /drivers/net/forcedeth.c | |
parent | 7c7d64b8c00bcf9519e5ec38368bc7afdc185c51 (diff) |
forcedeth: convert to net_device_ops
Convert this driver to network device ops. Compile tested only.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/forcedeth.c')
-rw-r--r-- | drivers/net/forcedeth.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 765210ea097..dd2e1f670b0 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -5408,6 +5408,21 @@ static int nv_close(struct net_device *dev) | |||
5408 | return 0; | 5408 | return 0; |
5409 | } | 5409 | } |
5410 | 5410 | ||
5411 | static const struct net_device_ops nv_netdev_ops = { | ||
5412 | .ndo_open = nv_open, | ||
5413 | .ndo_stop = nv_close, | ||
5414 | .ndo_get_stats = nv_get_stats, | ||
5415 | .ndo_tx_timeout = nv_tx_timeout, | ||
5416 | .ndo_change_mtu = nv_change_mtu, | ||
5417 | .ndo_validate_addr = eth_validate_addr, | ||
5418 | .ndo_set_mac_address = nv_set_mac_address, | ||
5419 | .ndo_set_multicast_list = nv_set_multicast, | ||
5420 | .ndo_vlan_rx_register = nv_vlan_rx_register, | ||
5421 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
5422 | .ndo_poll_controller = nv_poll_controller, | ||
5423 | #endif | ||
5424 | }; | ||
5425 | |||
5411 | static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) | 5426 | static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) |
5412 | { | 5427 | { |
5413 | struct net_device *dev; | 5428 | struct net_device *dev; |
@@ -5527,7 +5542,6 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
5527 | if (id->driver_data & DEV_HAS_VLAN) { | 5542 | if (id->driver_data & DEV_HAS_VLAN) { |
5528 | np->vlanctl_bits = NVREG_VLANCONTROL_ENABLE; | 5543 | np->vlanctl_bits = NVREG_VLANCONTROL_ENABLE; |
5529 | dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX; | 5544 | dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX; |
5530 | dev->vlan_rx_register = nv_vlan_rx_register; | ||
5531 | } | 5545 | } |
5532 | 5546 | ||
5533 | np->msi_flags = 0; | 5547 | np->msi_flags = 0; |
@@ -5577,25 +5591,16 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
5577 | if (!np->rx_skb || !np->tx_skb) | 5591 | if (!np->rx_skb || !np->tx_skb) |
5578 | goto out_freering; | 5592 | goto out_freering; |
5579 | 5593 | ||
5580 | dev->open = nv_open; | ||
5581 | dev->stop = nv_close; | ||
5582 | |||
5583 | if (!nv_optimized(np)) | 5594 | if (!nv_optimized(np)) |
5584 | dev->hard_start_xmit = nv_start_xmit; | 5595 | dev->hard_start_xmit = nv_start_xmit; |
5585 | else | 5596 | else |
5586 | dev->hard_start_xmit = nv_start_xmit_optimized; | 5597 | dev->hard_start_xmit = nv_start_xmit_optimized; |
5587 | dev->get_stats = nv_get_stats; | 5598 | |
5588 | dev->change_mtu = nv_change_mtu; | 5599 | dev->netdev_ops = &nv_netdev_ops; |
5589 | dev->set_mac_address = nv_set_mac_address; | ||
5590 | dev->set_multicast_list = nv_set_multicast; | ||
5591 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
5592 | dev->poll_controller = nv_poll_controller; | ||
5593 | #endif | ||
5594 | #ifdef CONFIG_FORCEDETH_NAPI | 5600 | #ifdef CONFIG_FORCEDETH_NAPI |
5595 | netif_napi_add(dev, &np->napi, nv_napi_poll, RX_WORK_PER_LOOP); | 5601 | netif_napi_add(dev, &np->napi, nv_napi_poll, RX_WORK_PER_LOOP); |
5596 | #endif | 5602 | #endif |
5597 | SET_ETHTOOL_OPS(dev, &ops); | 5603 | SET_ETHTOOL_OPS(dev, &ops); |
5598 | dev->tx_timeout = nv_tx_timeout; | ||
5599 | dev->watchdog_timeo = NV_WATCHDOG_TIMEO; | 5604 | dev->watchdog_timeo = NV_WATCHDOG_TIMEO; |
5600 | 5605 | ||
5601 | pci_set_drvdata(pci_dev, dev); | 5606 | pci_set_drvdata(pci_dev, dev); |