aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_l2_main.c
diff options
context:
space:
mode:
authorUrsula Braun <ursula.braun@de.ibm.com>2010-11-25 21:41:19 -0500
committerDavid S. Miller <davem@davemloft.net>2010-11-28 21:13:17 -0500
commit2b6203bb7d85e6a2ca2088b8684f30be70246ddf (patch)
treeb6f8bfcb5e70535085c3f18a2eda8f05ec6ba2dd /drivers/s390/net/qeth_l2_main.c
parentcdac082e051136a021f28d0f63c56e916b541253 (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/net/qeth_l2_main.c')
-rw-r--r--drivers/s390/net/qeth_l2_main.c11
1 files changed, 6 insertions, 5 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
1021contin:
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);
1058out:
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;