aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-11-20 01:24:29 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-20 01:42:56 -0500
commit0edc352743156a39dfc3f21206b2bf7b9f371832 (patch)
treee8afd7f033154b149b921f50515035e933e562f0 /drivers/net
parentafe29f7a61b7b9b9dae9f443c34733c2b4f461ba (diff)
ixgb: 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')
-rw-r--r--drivers/net/ixgb/ixgb_main.c31
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c32
2 files changed, 36 insertions, 27 deletions
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index cb7d1a6d343..3ca9daa70b3 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -321,6 +321,23 @@ ixgb_reset(struct ixgb_adapter *adapter)
321 } 321 }
322} 322}
323 323
324static const struct net_device_ops ixgb_netdev_ops = {
325 .ndo_open = ixgb_open,
326 .ndo_stop = ixgb_close,
327 .ndo_get_stats = ixgb_get_stats,
328 .ndo_set_multicast_list = ixgb_set_multi,
329 .ndo_validate_addr = eth_validate_addr,
330 .ndo_set_mac_address = ixgb_set_mac,
331 .ndo_change_mtu = ixgb_change_mtu,
332 .ndo_tx_timeout = ixgb_tx_timeout,
333 .ndo_vlan_rx_register = ixgb_vlan_rx_register,
334 .ndo_vlan_rx_add_vid = ixgb_vlan_rx_add_vid,
335 .ndo_vlan_rx_kill_vid = ixgb_vlan_rx_kill_vid,
336#ifdef CONFIG_NET_POLL_CONTROLLER
337 .ndo_poll_controller = ixgb_netpoll,
338#endif
339};
340
324/** 341/**
325 * ixgb_probe - Device Initialization Routine 342 * ixgb_probe - Device Initialization Routine
326 * @pdev: PCI device information struct 343 * @pdev: PCI device information struct
@@ -396,23 +413,11 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
396 } 413 }
397 } 414 }
398 415
399 netdev->open = &ixgb_open; 416 netdev->netdev_ops = &ixgb_netdev_ops;
400 netdev->stop = &ixgb_close;
401 netdev->hard_start_xmit = &ixgb_xmit_frame; 417 netdev->hard_start_xmit = &ixgb_xmit_frame;
402 netdev->get_stats = &ixgb_get_stats;
403 netdev->set_multicast_list = &ixgb_set_multi;
404 netdev->set_mac_address = &ixgb_set_mac;
405 netdev->change_mtu = &ixgb_change_mtu;
406 ixgb_set_ethtool_ops(netdev); 418 ixgb_set_ethtool_ops(netdev);
407 netdev->tx_timeout = &ixgb_tx_timeout;
408 netdev->watchdog_timeo = 5 * HZ; 419 netdev->watchdog_timeo = 5 * HZ;
409 netif_napi_add(netdev, &adapter->napi, ixgb_clean, 64); 420 netif_napi_add(netdev, &adapter->napi, ixgb_clean, 64);
410 netdev->vlan_rx_register = ixgb_vlan_rx_register;
411 netdev->vlan_rx_add_vid = ixgb_vlan_rx_add_vid;
412 netdev->vlan_rx_kill_vid = ixgb_vlan_rx_kill_vid;
413#ifdef CONFIG_NET_POLL_CONTROLLER
414 netdev->poll_controller = ixgb_netpoll;
415#endif
416 421
417 strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); 422 strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
418 423
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index d1f80dd88bc..6fb873889e7 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3727,6 +3727,23 @@ static int ixgbe_link_config(struct ixgbe_hw *hw)
3727 return hw->mac.ops.setup_link_speed(hw, autoneg, true, true); 3727 return hw->mac.ops.setup_link_speed(hw, autoneg, true, true);
3728} 3728}
3729 3729
3730static const struct net_device_ops ixgbe_netdev_ops = {
3731 .ndo_open = ixgbe_open,
3732 .ndo_stop = ixgbe_close,
3733 .ndo_get_stats = ixgbe_get_stats,
3734 .ndo_set_multicast_list = ixgbe_set_rx_mode,
3735 .ndo_validate_addr = eth_validate_addr,
3736 .ndo_set_mac_address = ixgbe_set_mac,
3737 .ndo_change_mtu = ixgbe_change_mtu,
3738 .ndo_tx_timeout = ixgbe_tx_timeout,
3739 .ndo_vlan_rx_register = ixgbe_vlan_rx_register,
3740 .ndo_vlan_rx_add_vid = ixgbe_vlan_rx_add_vid,
3741 .ndo_vlan_rx_kill_vid = ixgbe_vlan_rx_kill_vid,
3742#ifdef CONFIG_NET_POLL_CONTROLLER
3743 .ndo_poll_controller = ixgbe_netpoll,
3744#endif
3745};
3746
3730/** 3747/**
3731 * ixgbe_probe - Device Initialization Routine 3748 * ixgbe_probe - Device Initialization Routine
3732 * @pdev: PCI device information struct 3749 * @pdev: PCI device information struct
@@ -3808,23 +3825,10 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
3808 continue; 3825 continue;
3809 } 3826 }
3810 3827
3811 netdev->open = &ixgbe_open; 3828 netdev->netdev_ops = &ixgbe_netdev_ops;
3812 netdev->stop = &ixgbe_close;
3813 netdev->hard_start_xmit = &ixgbe_xmit_frame; 3829 netdev->hard_start_xmit = &ixgbe_xmit_frame;
3814 netdev->get_stats = &ixgbe_get_stats;
3815 netdev->set_rx_mode = &ixgbe_set_rx_mode;
3816 netdev->set_multicast_list = &ixgbe_set_rx_mode;
3817 netdev->set_mac_address = &ixgbe_set_mac;
3818 netdev->change_mtu = &ixgbe_change_mtu;
3819 ixgbe_set_ethtool_ops(netdev); 3830 ixgbe_set_ethtool_ops(netdev);
3820 netdev->tx_timeout = &ixgbe_tx_timeout;
3821 netdev->watchdog_timeo = 5 * HZ; 3831 netdev->watchdog_timeo = 5 * HZ;
3822 netdev->vlan_rx_register = ixgbe_vlan_rx_register;
3823 netdev->vlan_rx_add_vid = ixgbe_vlan_rx_add_vid;
3824 netdev->vlan_rx_kill_vid = ixgbe_vlan_rx_kill_vid;
3825#ifdef CONFIG_NET_POLL_CONTROLLER
3826 netdev->poll_controller = ixgbe_netpoll;
3827#endif
3828 strcpy(netdev->name, pci_name(pdev)); 3832 strcpy(netdev->name, pci_name(pdev));
3829 3833
3830 adapter->bd_number = cards_found; 3834 adapter->bd_number = cards_found;