aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net
diff options
context:
space:
mode:
authorFrank Blaschka <frank.blaschka@de.ibm.com>2009-01-08 13:50:55 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-08 13:50:55 -0500
commit8403b13c7627df7104e450cbc845627bf25c8cd6 (patch)
tree4551a2f572d6a8f7da7a547d1fbde7a465ea23d3 /drivers/s390/net
parentcc883d16c3b7434c7da2c45b54a49c2a99e83db7 (diff)
qeth: convert to net_device_ops
qeth_l2, qeth_l3 convert to net_device_ops. qeth_l3 remove vlan neigh_setup hack since it does not work any longer with the new net_device_ops. Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net')
-rw-r--r--drivers/s390/net/qeth_l2_main.c27
-rw-r--r--drivers/s390/net/qeth_l3_main.c53
2 files changed, 34 insertions, 46 deletions
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 21627ba3093b..e873d45f1a71 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -918,6 +918,21 @@ static struct ethtool_ops qeth_l2_osn_ops = {
918 .get_drvinfo = qeth_core_get_drvinfo, 918 .get_drvinfo = qeth_core_get_drvinfo,
919}; 919};
920 920
921static struct net_device_ops qeth_l2_netdev_ops = {
922 .ndo_open = qeth_l2_open,
923 .ndo_stop = qeth_l2_stop,
924 .ndo_get_stats = qeth_get_stats,
925 .ndo_start_xmit = qeth_l2_hard_start_xmit,
926 .ndo_validate_addr = eth_validate_addr,
927 .ndo_set_multicast_list = qeth_l2_set_multicast_list,
928 .ndo_do_ioctl = qeth_l2_do_ioctl,
929 .ndo_set_mac_address = qeth_l2_set_mac_address,
930 .ndo_change_mtu = qeth_change_mtu,
931 .ndo_vlan_rx_add_vid = qeth_l2_vlan_rx_add_vid,
932 .ndo_vlan_rx_kill_vid = qeth_l2_vlan_rx_kill_vid,
933 .ndo_tx_timeout = qeth_tx_timeout,
934};
935
921static int qeth_l2_setup_netdev(struct qeth_card *card) 936static int qeth_l2_setup_netdev(struct qeth_card *card)
922{ 937{
923 switch (card->info.type) { 938 switch (card->info.type) {
@@ -939,19 +954,9 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
939 return -ENODEV; 954 return -ENODEV;
940 955
941 card->dev->ml_priv = card; 956 card->dev->ml_priv = card;
942 card->dev->tx_timeout = &qeth_tx_timeout;
943 card->dev->watchdog_timeo = QETH_TX_TIMEOUT; 957 card->dev->watchdog_timeo = QETH_TX_TIMEOUT;
944 card->dev->open = qeth_l2_open;
945 card->dev->stop = qeth_l2_stop;
946 card->dev->hard_start_xmit = qeth_l2_hard_start_xmit;
947 card->dev->do_ioctl = qeth_l2_do_ioctl;
948 card->dev->get_stats = qeth_get_stats;
949 card->dev->change_mtu = qeth_change_mtu;
950 card->dev->set_multicast_list = qeth_l2_set_multicast_list;
951 card->dev->vlan_rx_kill_vid = qeth_l2_vlan_rx_kill_vid;
952 card->dev->vlan_rx_add_vid = qeth_l2_vlan_rx_add_vid;
953 card->dev->set_mac_address = qeth_l2_set_mac_address;
954 card->dev->mtu = card->info.initial_mtu; 958 card->dev->mtu = card->info.initial_mtu;
959 card->dev->netdev_ops = &qeth_l2_netdev_ops;
955 if (card->info.type != QETH_CARD_TYPE_OSN) 960 if (card->info.type != QETH_CARD_TYPE_OSN)
956 SET_ETHTOOL_OPS(card->dev, &qeth_l2_ethtool_ops); 961 SET_ETHTOOL_OPS(card->dev, &qeth_l2_ethtool_ops);
957 else 962 else
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index cfda1ecffdf2..eeeb35b07296 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -1831,28 +1831,6 @@ static void qeth_l3_vlan_rx_register(struct net_device *dev,
1831 1831
1832static void qeth_l3_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) 1832static void qeth_l3_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
1833{ 1833{
1834 struct net_device *vlandev;
1835 struct qeth_card *card = dev->ml_priv;
1836 struct in_device *in_dev;
1837
1838 if (card->info.type == QETH_CARD_TYPE_IQD)
1839 return;
1840
1841 vlandev = vlan_group_get_device(card->vlangrp, vid);
1842 vlandev->neigh_setup = qeth_l3_neigh_setup;
1843
1844 in_dev = in_dev_get(vlandev);
1845#ifdef CONFIG_SYSCTL
1846 neigh_sysctl_unregister(in_dev->arp_parms);
1847#endif
1848 neigh_parms_release(&arp_tbl, in_dev->arp_parms);
1849
1850 in_dev->arp_parms = neigh_parms_alloc(vlandev, &arp_tbl);
1851#ifdef CONFIG_SYSCTL
1852 neigh_sysctl_register(vlandev, in_dev->arp_parms, NET_IPV4,
1853 NET_IPV4_NEIGH, "ipv4", NULL, NULL);
1854#endif
1855 in_dev_put(in_dev);
1856 return; 1834 return;
1857} 1835}
1858 1836
@@ -2918,6 +2896,21 @@ qeth_l3_neigh_setup(struct net_device *dev, struct neigh_parms *np)
2918 return 0; 2896 return 0;
2919} 2897}
2920 2898
2899static struct net_device_ops qeth_l3_netdev_ops = {
2900 .ndo_open = qeth_l3_open,
2901 .ndo_stop = qeth_l3_stop,
2902 .ndo_get_stats = qeth_get_stats,
2903 .ndo_start_xmit = qeth_l3_hard_start_xmit,
2904 .ndo_validate_addr = eth_validate_addr,
2905 .ndo_set_multicast_list = qeth_l3_set_multicast_list,
2906 .ndo_do_ioctl = qeth_l3_do_ioctl,
2907 .ndo_change_mtu = qeth_change_mtu,
2908 .ndo_vlan_rx_register = qeth_l3_vlan_rx_register,
2909 .ndo_vlan_rx_add_vid = qeth_l3_vlan_rx_add_vid,
2910 .ndo_vlan_rx_kill_vid = qeth_l3_vlan_rx_kill_vid,
2911 .ndo_tx_timeout = qeth_tx_timeout,
2912};
2913
2921static int qeth_l3_setup_netdev(struct qeth_card *card) 2914static int qeth_l3_setup_netdev(struct qeth_card *card)
2922{ 2915{
2923 if (card->info.type == QETH_CARD_TYPE_OSAE) { 2916 if (card->info.type == QETH_CARD_TYPE_OSAE) {
@@ -2932,7 +2925,8 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
2932 card->dev = alloc_etherdev(0); 2925 card->dev = alloc_etherdev(0);
2933 if (!card->dev) 2926 if (!card->dev)
2934 return -ENODEV; 2927 return -ENODEV;
2935 card->dev->neigh_setup = qeth_l3_neigh_setup; 2928 qeth_l3_netdev_ops.ndo_neigh_setup =
2929 qeth_l3_neigh_setup;
2936 2930
2937 /*IPv6 address autoconfiguration stuff*/ 2931 /*IPv6 address autoconfiguration stuff*/
2938 qeth_l3_get_unique_id(card); 2932 qeth_l3_get_unique_id(card);
@@ -2949,21 +2943,10 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
2949 } else 2943 } else
2950 return -ENODEV; 2944 return -ENODEV;
2951 2945
2952 card->dev->hard_start_xmit = qeth_l3_hard_start_xmit;
2953 card->dev->ml_priv = card; 2946 card->dev->ml_priv = card;
2954 card->dev->tx_timeout = &qeth_tx_timeout;
2955 card->dev->watchdog_timeo = QETH_TX_TIMEOUT; 2947 card->dev->watchdog_timeo = QETH_TX_TIMEOUT;
2956 card->dev->open = qeth_l3_open;
2957 card->dev->stop = qeth_l3_stop;
2958 card->dev->do_ioctl = qeth_l3_do_ioctl;
2959 card->dev->get_stats = qeth_get_stats;
2960 card->dev->change_mtu = qeth_change_mtu;
2961 card->dev->set_multicast_list = qeth_l3_set_multicast_list;
2962 card->dev->vlan_rx_register = qeth_l3_vlan_rx_register;
2963 card->dev->vlan_rx_add_vid = qeth_l3_vlan_rx_add_vid;
2964 card->dev->vlan_rx_kill_vid = qeth_l3_vlan_rx_kill_vid;
2965 card->dev->mtu = card->info.initial_mtu; 2948 card->dev->mtu = card->info.initial_mtu;
2966 card->dev->set_mac_address = NULL; 2949 card->dev->netdev_ops = &qeth_l3_netdev_ops;
2967 SET_ETHTOOL_OPS(card->dev, &qeth_l3_ethtool_ops); 2950 SET_ETHTOOL_OPS(card->dev, &qeth_l3_ethtool_ops);
2968 card->dev->features |= NETIF_F_HW_VLAN_TX | 2951 card->dev->features |= NETIF_F_HW_VLAN_TX |
2969 NETIF_F_HW_VLAN_RX | 2952 NETIF_F_HW_VLAN_RX |