aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-11-21 20:31:27 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-21 20:31:27 -0500
commit0421eae68ffaf5ecfac860ee86e6a92e5b32a992 (patch)
tree01002b2c8f04d29aec7b814ecd72b7b2da1f590a
parent3addc568a656e9c8e313e78cfe7ea1e289bf6fd8 (diff)
bnx2: convert to net_device_ops
Convert driver to new net_device_ops. Compile tested only. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/bnx2.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index fe802215214f..8f1cd7cfa09d 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -7707,6 +7707,25 @@ bnx2_init_napi(struct bnx2 *bp)
7707 } 7707 }
7708} 7708}
7709 7709
7710static const struct net_device_ops bnx2_netdev_ops = {
7711 .ndo_open = bnx2_open,
7712 .ndo_start_xmit = bnx2_start_xmit,
7713 .ndo_stop = bnx2_close,
7714 .ndo_get_stats = bnx2_get_stats,
7715 .ndo_set_rx_mode = bnx2_set_rx_mode,
7716 .ndo_do_ioctl = bnx2_ioctl,
7717 .ndo_validate_addr = eth_validate_addr,
7718 .ndo_set_mac_address = bnx2_change_mac_addr,
7719 .ndo_change_mtu = bnx2_change_mtu,
7720 .ndo_tx_timeout = bnx2_tx_timeout,
7721#ifdef BCM_VLAN
7722 .ndo_vlan_rx_register = bnx2_vlan_rx_register,
7723#endif
7724#if defined(HAVE_POLL_CONTROLLER) || defined(CONFIG_NET_POLL_CONTROLLER)
7725 .ndo_poll_controller = poll_bnx2,
7726#endif
7727};
7728
7710static int __devinit 7729static int __devinit
7711bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 7730bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
7712{ 7731{
@@ -7731,28 +7750,13 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
7731 return rc; 7750 return rc;
7732 } 7751 }
7733 7752
7734 dev->open = bnx2_open; 7753 dev->netdev_ops = &bnx2_netdev_ops;
7735 dev->hard_start_xmit = bnx2_start_xmit;
7736 dev->stop = bnx2_close;
7737 dev->get_stats = bnx2_get_stats;
7738 dev->set_rx_mode = bnx2_set_rx_mode;
7739 dev->do_ioctl = bnx2_ioctl;
7740 dev->set_mac_address = bnx2_change_mac_addr;
7741 dev->change_mtu = bnx2_change_mtu;
7742 dev->tx_timeout = bnx2_tx_timeout;
7743 dev->watchdog_timeo = TX_TIMEOUT; 7754 dev->watchdog_timeo = TX_TIMEOUT;
7744#ifdef BCM_VLAN
7745 dev->vlan_rx_register = bnx2_vlan_rx_register;
7746#endif
7747 dev->ethtool_ops = &bnx2_ethtool_ops; 7755 dev->ethtool_ops = &bnx2_ethtool_ops;
7748 7756
7749 bp = netdev_priv(dev); 7757 bp = netdev_priv(dev);
7750 bnx2_init_napi(bp); 7758 bnx2_init_napi(bp);
7751 7759
7752#if defined(HAVE_POLL_CONTROLLER) || defined(CONFIG_NET_POLL_CONTROLLER)
7753 dev->poll_controller = poll_bnx2;
7754#endif
7755
7756 pci_set_drvdata(pdev, dev); 7760 pci_set_drvdata(pdev, dev);
7757 7761
7758 memcpy(dev->dev_addr, bp->mac_addr, 6); 7762 memcpy(dev->dev_addr, bp->mac_addr, 6);