diff options
author | Ursula Braun <ursula.braun@de.ibm.com> | 2010-11-25 21:41:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-28 21:13:17 -0500 |
commit | 2b6203bb7d85e6a2ca2088b8684f30be70246ddf (patch) | |
tree | b6f8bfcb5e70535085c3f18a2eda8f05ec6ba2dd /drivers/s390 | |
parent | cdac082e051136a021f28d0f63c56e916b541253 (diff) |
qeth: enable interface setup if LAN is offline
Device initialization of a qeth device contains a STARTLAN step.
This step may fail, if cable is not yet plugged in. The qeth device
stays in state HARDSETUP until cable is plugged in. This prevents
further preparational initialization steps of the qeth device and
its network interface. This patch makes sure initialization of qeth
device continues, even though cable is not yet plugged in.
Once carrier is available, qeth is notified, triggers a recovery
which results in a working network interface.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/net/qeth_l2_main.c | 11 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l3_main.c | 11 |
2 files changed, 12 insertions, 10 deletions
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 847e8797073c..7a7a1b664781 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
@@ -849,8 +849,6 @@ static int qeth_l2_open(struct net_device *dev) | |||
849 | card->state = CARD_STATE_UP; | 849 | card->state = CARD_STATE_UP; |
850 | netif_start_queue(dev); | 850 | netif_start_queue(dev); |
851 | 851 | ||
852 | if (!card->lan_online && netif_carrier_ok(dev)) | ||
853 | netif_carrier_off(dev); | ||
854 | if (qdio_stop_irq(card->data.ccwdev, 0) >= 0) { | 852 | if (qdio_stop_irq(card->data.ccwdev, 0) >= 0) { |
855 | napi_enable(&card->napi); | 853 | napi_enable(&card->napi); |
856 | napi_schedule(&card->napi); | 854 | napi_schedule(&card->napi); |
@@ -1013,13 +1011,14 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode) | |||
1013 | dev_warn(&card->gdev->dev, | 1011 | dev_warn(&card->gdev->dev, |
1014 | "The LAN is offline\n"); | 1012 | "The LAN is offline\n"); |
1015 | card->lan_online = 0; | 1013 | card->lan_online = 0; |
1016 | goto out; | 1014 | goto contin; |
1017 | } | 1015 | } |
1018 | rc = -ENODEV; | 1016 | rc = -ENODEV; |
1019 | goto out_remove; | 1017 | goto out_remove; |
1020 | } else | 1018 | } else |
1021 | card->lan_online = 1; | 1019 | card->lan_online = 1; |
1022 | 1020 | ||
1021 | contin: | ||
1023 | if ((card->info.type == QETH_CARD_TYPE_OSD) || | 1022 | if ((card->info.type == QETH_CARD_TYPE_OSD) || |
1024 | (card->info.type == QETH_CARD_TYPE_OSX)) | 1023 | (card->info.type == QETH_CARD_TYPE_OSX)) |
1025 | /* configure isolation level */ | 1024 | /* configure isolation level */ |
@@ -1038,7 +1037,10 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode) | |||
1038 | goto out_remove; | 1037 | goto out_remove; |
1039 | } | 1038 | } |
1040 | card->state = CARD_STATE_SOFTSETUP; | 1039 | card->state = CARD_STATE_SOFTSETUP; |
1041 | netif_carrier_on(card->dev); | 1040 | if (card->lan_online) |
1041 | netif_carrier_on(card->dev); | ||
1042 | else | ||
1043 | netif_carrier_off(card->dev); | ||
1042 | 1044 | ||
1043 | qeth_set_allowed_threads(card, 0xffffffff, 0); | 1045 | qeth_set_allowed_threads(card, 0xffffffff, 0); |
1044 | if (recover_flag == CARD_STATE_RECOVER) { | 1046 | if (recover_flag == CARD_STATE_RECOVER) { |
@@ -1055,7 +1057,6 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode) | |||
1055 | } | 1057 | } |
1056 | /* let user_space know that device is online */ | 1058 | /* let user_space know that device is online */ |
1057 | kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE); | 1059 | kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE); |
1058 | out: | ||
1059 | mutex_unlock(&card->conf_mutex); | 1060 | mutex_unlock(&card->conf_mutex); |
1060 | mutex_unlock(&card->discipline_mutex); | 1061 | mutex_unlock(&card->discipline_mutex); |
1061 | return 0; | 1062 | return 0; |
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 65291db324f5..3ddd5add7984 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -3177,8 +3177,6 @@ static int qeth_l3_open(struct net_device *dev) | |||
3177 | card->state = CARD_STATE_UP; | 3177 | card->state = CARD_STATE_UP; |
3178 | netif_start_queue(dev); | 3178 | netif_start_queue(dev); |
3179 | 3179 | ||
3180 | if (!card->lan_online && netif_carrier_ok(dev)) | ||
3181 | netif_carrier_off(dev); | ||
3182 | if (qdio_stop_irq(card->data.ccwdev, 0) >= 0) { | 3180 | if (qdio_stop_irq(card->data.ccwdev, 0) >= 0) { |
3183 | napi_enable(&card->napi); | 3181 | napi_enable(&card->napi); |
3184 | napi_schedule(&card->napi); | 3182 | napi_schedule(&card->napi); |
@@ -3450,13 +3448,14 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode) | |||
3450 | dev_warn(&card->gdev->dev, | 3448 | dev_warn(&card->gdev->dev, |
3451 | "The LAN is offline\n"); | 3449 | "The LAN is offline\n"); |
3452 | card->lan_online = 0; | 3450 | card->lan_online = 0; |
3453 | goto out; | 3451 | goto contin; |
3454 | } | 3452 | } |
3455 | rc = -ENODEV; | 3453 | rc = -ENODEV; |
3456 | goto out_remove; | 3454 | goto out_remove; |
3457 | } else | 3455 | } else |
3458 | card->lan_online = 1; | 3456 | card->lan_online = 1; |
3459 | 3457 | ||
3458 | contin: | ||
3460 | rc = qeth_l3_setadapter_parms(card); | 3459 | rc = qeth_l3_setadapter_parms(card); |
3461 | if (rc) | 3460 | if (rc) |
3462 | QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc); | 3461 | QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc); |
@@ -3481,10 +3480,13 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode) | |||
3481 | goto out_remove; | 3480 | goto out_remove; |
3482 | } | 3481 | } |
3483 | card->state = CARD_STATE_SOFTSETUP; | 3482 | card->state = CARD_STATE_SOFTSETUP; |
3484 | netif_carrier_on(card->dev); | ||
3485 | 3483 | ||
3486 | qeth_set_allowed_threads(card, 0xffffffff, 0); | 3484 | qeth_set_allowed_threads(card, 0xffffffff, 0); |
3487 | qeth_l3_set_ip_addr_list(card); | 3485 | qeth_l3_set_ip_addr_list(card); |
3486 | if (card->lan_online) | ||
3487 | netif_carrier_on(card->dev); | ||
3488 | else | ||
3489 | netif_carrier_off(card->dev); | ||
3488 | if (recover_flag == CARD_STATE_RECOVER) { | 3490 | if (recover_flag == CARD_STATE_RECOVER) { |
3489 | if (recovery_mode) | 3491 | if (recovery_mode) |
3490 | qeth_l3_open(card->dev); | 3492 | qeth_l3_open(card->dev); |
@@ -3497,7 +3499,6 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode) | |||
3497 | } | 3499 | } |
3498 | /* let user_space know that device is online */ | 3500 | /* let user_space know that device is online */ |
3499 | kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE); | 3501 | kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE); |
3500 | out: | ||
3501 | mutex_unlock(&card->conf_mutex); | 3502 | mutex_unlock(&card->conf_mutex); |
3502 | mutex_unlock(&card->discipline_mutex); | 3503 | mutex_unlock(&card->discipline_mutex); |
3503 | return 0; | 3504 | return 0; |