summaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_l2_main.c
diff options
context:
space:
mode:
authorUrsula Braun <ursula.braun@de.ibm.com>2009-11-12 00:11:43 +0000
committerDavid S. Miller <davem@davemloft.net>2009-11-16 02:42:07 -0800
commitaa90922479513db0d080239324d0d04701418ba5 (patch)
tree6399b72c47c9826049a62d8217f1613f729c47dd /drivers/s390/net/qeth_l2_main.c
parentf20b04597b9f75dce16c898abb487eff06ddf677 (diff)
downloadblackbird-obmc-linux-aa90922479513db0d080239324d0d04701418ba5.tar.gz
blackbird-obmc-linux-aa90922479513db0d080239324d0d04701418ba5.zip
qeth: Recognize return codes of ccw_device_set_online
Setting a qeth device online requires to call function ccw_device_set_online() for read-, write-, and data-subchannel. Failures should be detected immediately without an attempt to invoke follow-on activity qeth_qdio_clear_card()., In addition, ccw_device_set_online calls are consolidated in qeth_core_main.c only. 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.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index a63a3dfcdf63..372f2c0cd547 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -940,30 +940,17 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
qeth_set_allowed_threads(card, QETH_RECOVER_THREAD, 1);
recover_flag = card->state;
- rc = ccw_device_set_online(CARD_RDEV(card));
- if (rc) {
- QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
- return -EIO;
- }
- rc = ccw_device_set_online(CARD_WDEV(card));
- if (rc) {
- QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
- return -EIO;
- }
- rc = ccw_device_set_online(CARD_DDEV(card));
- if (rc) {
- QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
- return -EIO;
- }
-
rc = qeth_core_hardsetup_card(card);
if (rc) {
QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc);
+ rc = -ENODEV;
goto out_remove;
}
- if (!card->dev && qeth_l2_setup_netdev(card))
+ if (!card->dev && qeth_l2_setup_netdev(card)) {
+ rc = -ENODEV;
goto out_remove;
+ }
if (card->info.type != QETH_CARD_TYPE_OSN)
qeth_l2_send_setmac(card, &card->dev->dev_addr[0]);
@@ -983,6 +970,7 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
card->lan_online = 0;
return 0;
}
+ rc = -ENODEV;
goto out_remove;
} else
card->lan_online = 1;
@@ -999,6 +987,7 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
rc = qeth_init_qdio_queues(card);
if (rc) {
QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc);
+ rc = -ENODEV;
goto out_remove;
}
card->state = CARD_STATE_SOFTSETUP;
@@ -1020,6 +1009,7 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
/* let user_space know that device is online */
kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE);
return 0;
+
out_remove:
card->use_hard_stop = 1;
qeth_l2_stop_card(card, 0);
@@ -1030,7 +1020,7 @@ out_remove:
card->state = CARD_STATE_RECOVER;
else
card->state = CARD_STATE_DOWN;
- return -ENODEV;
+ return rc;
}
static int qeth_l2_set_online(struct ccwgroup_device *gdev)
OpenPOWER on IntegriCloud