]> err.no Git - linux-2.6/commitdiff
[PATCH] s390: qeth driver fixes
authorUrsula Braun <braunu@de.ibm.com>
Wed, 24 May 2006 07:51:11 +0000 (09:51 +0200)
committerJeff Garzik <jeff@garzik.org>
Sat, 27 May 2006 01:56:40 +0000 (21:56 -0400)
From: Frank Pavlic <fpavlic@de.ibm.com>

- correct checking of sscanf-%n value in qeth_string_to_ipaddr().
- don't use netif_stop_queue outside the hard_start_xmit routine.
  Rather use netif_tx_disable.
- don't call qeth_netdev_init on a recovery.

Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/s390/net/qeth.h
drivers/s390/net/qeth_main.c

index 4df0fcd7b10b18a092aaeba16d6e1f80b120b9e4..65e2b1bc08a5a77f38b88a67ccca8c2f9474dc72 100644 (file)
@@ -1099,7 +1099,7 @@ qeth_string_to_ipaddr4(const char *buf, __u8 *addr)
 
        rc = sscanf(buf, "%d.%d.%d.%d%n", 
                    &in[0], &in[1], &in[2], &in[3], &count);
-       if (rc != 4  || count
+       if (rc != 4  || count<=0)
                return -EINVAL;
        for (count = 0; count < 4; count++) {
                if (in[count] > 255)
index cb14642d97aa8300a12e37238933b91271077d9c..0f6648fdec1dac8127a25873bb0a42a0ad4b656a 100644 (file)
@@ -3817,7 +3817,7 @@ qeth_stop(struct net_device *dev)
 
        card = (struct qeth_card *) dev->priv;
 
-       netif_stop_queue(dev);
+       netif_tx_disable(dev);
        card->dev->flags &= ~IFF_UP;
        if (card->state == CARD_STATE_UP)
                card->state = CARD_STATE_SOFTSETUP;
@@ -6359,12 +6359,9 @@ qeth_netdev_init(struct net_device *dev)
        dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid;
        dev->vlan_rx_add_vid = qeth_vlan_rx_add_vid;
 #endif
-       dev->hard_header = card->orig_hard_header;
        if (qeth_get_netdev_flags(card) & IFF_NOARP) {
                dev->rebuild_header = NULL;
                dev->hard_header = NULL;
-               if (card->options.fake_ll)
-                       dev->hard_header = qeth_fake_header;
                dev->header_cache_update = NULL;
                dev->hard_header_cache = NULL;
        }
@@ -6477,6 +6474,9 @@ retry:
        /*network device will be recovered*/
        if (card->dev) {
                card->dev->hard_header = card->orig_hard_header;
+               if (card->options.fake_ll && 
+                   (qeth_get_netdev_flags(card) & IFF_NOARP))
+                       card->dev->hard_header = qeth_fake_header;
                return 0;
        }
        /* at first set_online allocate netdev */
@@ -7031,7 +7031,7 @@ qeth_softsetup_ipv6(struct qeth_card *card)
 
        QETH_DBF_TEXT(trace,3,"softipv6");
 
-       netif_stop_queue(card->dev);
+       netif_tx_disable(card->dev);
        rc = qeth_send_startlan(card, QETH_PROT_IPV6);
        if (rc) {
                PRINT_ERR("IPv6 startlan failed on %s\n",
@@ -7352,7 +7352,8 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type)
                card->options.large_send = type;
                return 0;
        }
-       netif_stop_queue(card->dev);
+       if (card->state == CARD_STATE_UP)
+               netif_tx_disable(card->dev);
        card->options.large_send = type;
        switch (card->options.large_send) {
        case QETH_LARGE_SEND_EDDP:
@@ -7374,7 +7375,8 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type)
                card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG);
                break;
        }
-       netif_wake_queue(card->dev);
+       if (card->state == CARD_STATE_UP)
+               netif_wake_queue(card->dev);
        return rc;
 }
 
@@ -7427,7 +7429,7 @@ qeth_softsetup_card(struct qeth_card *card)
        if ((rc = qeth_setrouting_v6(card)))
                QETH_DBF_TEXT_(setup, 2, "5err%d", rc);
 out:
-       netif_stop_queue(card->dev);
+       netif_tx_disable(card->dev);
        return 0;
 }
 
@@ -7736,10 +7738,8 @@ static int
 qeth_register_netdev(struct qeth_card *card)
 {
        QETH_DBF_TEXT(setup, 3, "regnetd");
-       if (card->dev->reg_state != NETREG_UNINITIALIZED) {
-               qeth_netdev_init(card->dev);
+       if (card->dev->reg_state != NETREG_UNINITIALIZED) 
                return 0;
-       }
        /* sysfs magic */
        SET_NETDEV_DEV(card->dev, &card->gdev->dev);
        return register_netdev(card->dev);