Skip to content

Commit

Permalink
bnx2: convert to net_device_ops
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Nov 22, 2008
1 parent 3addc56 commit 0421eae
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -7707,6 +7707,25 @@ bnx2_init_napi(struct bnx2 *bp)
}
}

static const struct net_device_ops bnx2_netdev_ops = {
.ndo_open = bnx2_open,
.ndo_start_xmit = bnx2_start_xmit,
.ndo_stop = bnx2_close,
.ndo_get_stats = bnx2_get_stats,
.ndo_set_rx_mode = bnx2_set_rx_mode,
.ndo_do_ioctl = bnx2_ioctl,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = bnx2_change_mac_addr,
.ndo_change_mtu = bnx2_change_mtu,
.ndo_tx_timeout = bnx2_tx_timeout,
#ifdef BCM_VLAN
.ndo_vlan_rx_register = bnx2_vlan_rx_register,
#endif
#if defined(HAVE_POLL_CONTROLLER) || defined(CONFIG_NET_POLL_CONTROLLER)
.ndo_poll_controller = poll_bnx2,
#endif
};

static int __devinit
bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
Expand All @@ -7731,28 +7750,13 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
return rc;
}

dev->open = bnx2_open;
dev->hard_start_xmit = bnx2_start_xmit;
dev->stop = bnx2_close;
dev->get_stats = bnx2_get_stats;
dev->set_rx_mode = bnx2_set_rx_mode;
dev->do_ioctl = bnx2_ioctl;
dev->set_mac_address = bnx2_change_mac_addr;
dev->change_mtu = bnx2_change_mtu;
dev->tx_timeout = bnx2_tx_timeout;
dev->netdev_ops = &bnx2_netdev_ops;
dev->watchdog_timeo = TX_TIMEOUT;
#ifdef BCM_VLAN
dev->vlan_rx_register = bnx2_vlan_rx_register;
#endif
dev->ethtool_ops = &bnx2_ethtool_ops;

bp = netdev_priv(dev);
bnx2_init_napi(bp);

#if defined(HAVE_POLL_CONTROLLER) || defined(CONFIG_NET_POLL_CONTROLLER)
dev->poll_controller = poll_bnx2;
#endif

pci_set_drvdata(pdev, dev);

memcpy(dev->dev_addr, bp->mac_addr, 6);
Expand Down

0 comments on commit 0421eae

Please sign in to comment.