aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-11-21 20:28:55 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-21 20:28:55 -0500
commit040250959da9b96e2fd30415e4ca15257a3460e4 (patch)
tree7bab240a700fd7e94dc08b0c5c88be27ee36de8e /drivers/net
parente48714baac0e81ed9e19a5785eee52e1eca8f56e (diff)
s2io: convert to net_device_ops
Convert this driver to network device ops. Compile teseted 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/s2io.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 62369341cb2c..a4642054a0d0 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -352,9 +352,10 @@ static void do_s2io_copy_mac_addr(struct s2io_nic *sp, int offset, u64 mac_addr)
352 sp->def_mac_addr[offset].mac_addr[1] = (u8) (mac_addr >> 32); 352 sp->def_mac_addr[offset].mac_addr[1] = (u8) (mac_addr >> 32);
353 sp->def_mac_addr[offset].mac_addr[0] = (u8) (mac_addr >> 40); 353 sp->def_mac_addr[offset].mac_addr[0] = (u8) (mac_addr >> 40);
354} 354}
355
355/* Add the vlan */ 356/* Add the vlan */
356static void s2io_vlan_rx_register(struct net_device *dev, 357static void s2io_vlan_rx_register(struct net_device *dev,
357 struct vlan_group *grp) 358 struct vlan_group *grp)
358{ 359{
359 int i; 360 int i;
360 struct s2io_nic *nic = netdev_priv(dev); 361 struct s2io_nic *nic = netdev_priv(dev);
@@ -372,7 +373,7 @@ static void s2io_vlan_rx_register(struct net_device *dev,
372} 373}
373 374
374/* Unregister the vlan */ 375/* Unregister the vlan */
375static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned long vid) 376static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
376{ 377{
377 int i; 378 int i;
378 struct s2io_nic *nic = netdev_priv(dev); 379 struct s2io_nic *nic = netdev_priv(dev);
@@ -7717,6 +7718,24 @@ static int rts_ds_steer(struct s2io_nic *nic, u8 ds_codepoint, u8 ring)
7717 S2IO_BIT_RESET); 7718 S2IO_BIT_RESET);
7718} 7719}
7719 7720
7721static const struct net_device_ops s2io_netdev_ops = {
7722 .ndo_open = s2io_open,
7723 .ndo_stop = s2io_close,
7724 .ndo_get_stats = s2io_get_stats,
7725 .ndo_start_xmit = s2io_xmit,
7726 .ndo_validate_addr = eth_validate_addr,
7727 .ndo_set_multicast_list = s2io_set_multicast,
7728 .ndo_do_ioctl = s2io_ioctl,
7729 .ndo_set_mac_address = s2io_set_mac_addr,
7730 .ndo_change_mtu = s2io_change_mtu,
7731 .ndo_vlan_rx_register = s2io_vlan_rx_register,
7732 .ndo_vlan_rx_kill_vid = s2io_vlan_rx_kill_vid,
7733 .ndo_tx_timeout = s2io_tx_watchdog,
7734#ifdef CONFIG_NET_POLL_CONTROLLER
7735 .ndo_poll_controller = s2io_netpoll,
7736#endif
7737};
7738
7720/** 7739/**
7721 * s2io_init_nic - Initialization of the adapter . 7740 * s2io_init_nic - Initialization of the adapter .
7722 * @pdev : structure containing the PCI related information of the device. 7741 * @pdev : structure containing the PCI related information of the device.
@@ -7942,26 +7961,9 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
7942 } 7961 }
7943 7962
7944 /* Driver entry points */ 7963 /* Driver entry points */
7945 dev->open = &s2io_open; 7964 dev->netdev_ops = &s2io_netdev_ops;
7946 dev->stop = &s2io_close;
7947 dev->hard_start_xmit = &s2io_xmit;
7948 dev->get_stats = &s2io_get_stats;
7949 dev->set_multicast_list = &s2io_set_multicast;
7950 dev->do_ioctl = &s2io_ioctl;
7951 dev->set_mac_address = &s2io_set_mac_addr;
7952 dev->change_mtu = &s2io_change_mtu;
7953 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); 7965 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
7954 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 7966 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
7955 dev->vlan_rx_register = s2io_vlan_rx_register;
7956 dev->vlan_rx_kill_vid = (void *)s2io_vlan_rx_kill_vid;
7957
7958 /*
7959 * will use eth_mac_addr() for dev->set_mac_address
7960 * mac address will be set every time dev->open() is called
7961 */
7962#ifdef CONFIG_NET_POLL_CONTROLLER
7963 dev->poll_controller = s2io_netpoll;
7964#endif
7965 7967
7966 dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; 7968 dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
7967 if (sp->high_dma_flag == TRUE) 7969 if (sp->high_dma_flag == TRUE)
@@ -7972,7 +7974,6 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
7972 dev->features |= NETIF_F_UFO; 7974 dev->features |= NETIF_F_UFO;
7973 dev->features |= NETIF_F_HW_CSUM; 7975 dev->features |= NETIF_F_HW_CSUM;
7974 } 7976 }
7975 dev->tx_timeout = &s2io_tx_watchdog;
7976 dev->watchdog_timeo = WATCH_DOG_TIMEOUT; 7977 dev->watchdog_timeo = WATCH_DOG_TIMEOUT;
7977 INIT_WORK(&sp->rst_timer_task, s2io_restart_nic); 7978 INIT_WORK(&sp->rst_timer_task, s2io_restart_nic);
7978 INIT_WORK(&sp->set_link_task, s2io_set_link); 7979 INIT_WORK(&sp->set_link_task, s2io_set_link);