qeth: fix usage of netdev_ops
authorFrank Blaschka <frank.blaschka@de.ibm.com>
Fri, 9 Jan 2009 03:44:00 +0000 (03:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Jan 2009 08:05:16 +0000 (00:05 -0800)
Have separate netdev_ops for OSA and HiperSocket/TR.

Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c

index c4f1b04..07ab8a5 100644 (file)
@@ -916,7 +916,7 @@ static struct ethtool_ops qeth_l2_osn_ops = {
        .get_drvinfo = qeth_core_get_drvinfo,
 };
 
-static struct net_device_ops qeth_l2_netdev_ops = {
+static const struct net_device_ops qeth_l2_netdev_ops = {
        .ndo_open               = qeth_l2_open,
        .ndo_stop               = qeth_l2_stop,
        .ndo_get_stats          = qeth_get_stats,
index 68d623a..3d04920 100644 (file)
@@ -2894,7 +2894,7 @@ qeth_l3_neigh_setup(struct net_device *dev, struct neigh_parms *np)
        return 0;
 }
 
-static struct net_device_ops qeth_l3_netdev_ops = {
+static const struct net_device_ops qeth_l3_netdev_ops = {
        .ndo_open               = qeth_l3_open,
        .ndo_stop               = qeth_l3_stop,
        .ndo_get_stats          = qeth_get_stats,
@@ -2909,6 +2909,22 @@ static struct net_device_ops qeth_l3_netdev_ops = {
        .ndo_tx_timeout         = qeth_tx_timeout,
 };
 
+static const struct net_device_ops qeth_l3_osa_netdev_ops = {
+       .ndo_open               = qeth_l3_open,
+       .ndo_stop               = qeth_l3_stop,
+       .ndo_get_stats          = qeth_get_stats,
+       .ndo_start_xmit         = qeth_l3_hard_start_xmit,
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_set_multicast_list = qeth_l3_set_multicast_list,
+       .ndo_do_ioctl           = qeth_l3_do_ioctl,
+       .ndo_change_mtu         = qeth_change_mtu,
+       .ndo_vlan_rx_register   = qeth_l3_vlan_rx_register,
+       .ndo_vlan_rx_add_vid    = qeth_l3_vlan_rx_add_vid,
+       .ndo_vlan_rx_kill_vid   = qeth_l3_vlan_rx_kill_vid,
+       .ndo_tx_timeout         = qeth_tx_timeout,
+       .ndo_neigh_setup        = qeth_l3_neigh_setup,
+};
+
 static int qeth_l3_setup_netdev(struct qeth_card *card)
 {
        if (card->info.type == QETH_CARD_TYPE_OSAE) {
@@ -2919,12 +2935,12 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
 #endif
                        if (!card->dev)
                                return -ENODEV;
+                       card->dev->netdev_ops = &qeth_l3_netdev_ops;
                } else {
                        card->dev = alloc_etherdev(0);
                        if (!card->dev)
                                return -ENODEV;
-                       qeth_l3_netdev_ops.ndo_neigh_setup =
-                               qeth_l3_neigh_setup;
+                       card->dev->netdev_ops = &qeth_l3_osa_netdev_ops;
 
                        /*IPv6 address autoconfiguration stuff*/
                        qeth_l3_get_unique_id(card);
@@ -2937,6 +2953,7 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
                if (!card->dev)
                        return -ENODEV;
                card->dev->flags |= IFF_NOARP;
+               card->dev->netdev_ops = &qeth_l3_netdev_ops;
                qeth_l3_iqd_read_initial_mac(card);
        } else
                return -ENODEV;
@@ -2944,7 +2961,6 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
        card->dev->ml_priv = card;
        card->dev->watchdog_timeo = QETH_TX_TIMEOUT;
        card->dev->mtu = card->info.initial_mtu;
-       card->dev->netdev_ops = &qeth_l3_netdev_ops;
        SET_ETHTOOL_OPS(card->dev, &qeth_l3_ethtool_ops);
        card->dev->features |=  NETIF_F_HW_VLAN_TX |
                                NETIF_F_HW_VLAN_RX |