diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-11-21 20:32:54 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-21 20:32:54 -0500 |
commit | c3ecb9f3235ce6e39249690cdd24d678894c2c72 (patch) | |
tree | 82f8c9e0a624f19a07eadd2fe6dc796bca20fb6b /drivers/net/sfc/efx.c | |
parent | 1abd266f091e4f281a7c1e8813106fdf1528bb56 (diff) |
sfc: convert to net_device_ops
Convert driver to new net_device_ops. Compile tested only.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/efx.c')
-rw-r--r-- | drivers/net/sfc/efx.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index ac7bdbf3fd4a..e5024bb8a46e 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c | |||
@@ -1433,12 +1433,28 @@ static void efx_set_multicast_list(struct net_device *net_dev) | |||
1433 | falcon_set_multicast_hash(efx); | 1433 | falcon_set_multicast_hash(efx); |
1434 | } | 1434 | } |
1435 | 1435 | ||
1436 | static const struct net_device_ops efx_netdev_ops = { | ||
1437 | .ndo_open = efx_net_open, | ||
1438 | .ndo_stop = efx_net_stop, | ||
1439 | .ndo_get_stats = efx_net_stats, | ||
1440 | .ndo_tx_timeout = efx_watchdog, | ||
1441 | .ndo_start_xmit = efx_hard_start_xmit, | ||
1442 | .ndo_validate_addr = eth_validate_addr, | ||
1443 | .ndo_do_ioctl = efx_ioctl, | ||
1444 | .ndo_change_mtu = efx_change_mtu, | ||
1445 | .ndo_set_mac_address = efx_set_mac_address, | ||
1446 | .ndo_set_multicast_list = efx_set_multicast_list, | ||
1447 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
1448 | .ndo_poll_controller = efx_netpoll, | ||
1449 | #endif | ||
1450 | }; | ||
1451 | |||
1436 | static int efx_netdev_event(struct notifier_block *this, | 1452 | static int efx_netdev_event(struct notifier_block *this, |
1437 | unsigned long event, void *ptr) | 1453 | unsigned long event, void *ptr) |
1438 | { | 1454 | { |
1439 | struct net_device *net_dev = ptr; | 1455 | struct net_device *net_dev = ptr; |
1440 | 1456 | ||
1441 | if (net_dev->open == efx_net_open && event == NETDEV_CHANGENAME) { | 1457 | if (net_dev->netdev_ops == &efx_netdev_ops && event == NETDEV_CHANGENAME) { |
1442 | struct efx_nic *efx = netdev_priv(net_dev); | 1458 | struct efx_nic *efx = netdev_priv(net_dev); |
1443 | 1459 | ||
1444 | strcpy(efx->name, net_dev->name); | 1460 | strcpy(efx->name, net_dev->name); |
@@ -1459,18 +1475,7 @@ static int efx_register_netdev(struct efx_nic *efx) | |||
1459 | 1475 | ||
1460 | net_dev->watchdog_timeo = 5 * HZ; | 1476 | net_dev->watchdog_timeo = 5 * HZ; |
1461 | net_dev->irq = efx->pci_dev->irq; | 1477 | net_dev->irq = efx->pci_dev->irq; |
1462 | net_dev->open = efx_net_open; | 1478 | net_dev->netdev_ops = &efx_netdev_ops; |
1463 | net_dev->stop = efx_net_stop; | ||
1464 | net_dev->get_stats = efx_net_stats; | ||
1465 | net_dev->tx_timeout = &efx_watchdog; | ||
1466 | net_dev->hard_start_xmit = efx_hard_start_xmit; | ||
1467 | net_dev->do_ioctl = efx_ioctl; | ||
1468 | net_dev->change_mtu = efx_change_mtu; | ||
1469 | net_dev->set_mac_address = efx_set_mac_address; | ||
1470 | net_dev->set_multicast_list = efx_set_multicast_list; | ||
1471 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
1472 | net_dev->poll_controller = efx_netpoll; | ||
1473 | #endif | ||
1474 | SET_NETDEV_DEV(net_dev, &efx->pci_dev->dev); | 1479 | SET_NETDEV_DEV(net_dev, &efx->pci_dev->dev); |
1475 | SET_ETHTOOL_OPS(net_dev, &efx_ethtool_ops); | 1480 | SET_ETHTOOL_OPS(net_dev, &efx_ethtool_ops); |
1476 | 1481 | ||