Skip to content

Commit 1034051

Browse files
julianwiedmanndavem330
authored andcommitted
s390/qeth: issue STARTLAN as first IPA command
STARTLAN needs to be the first IPA command after MPC initialization completes. So move the qeth_send_startlan() call from the layer disciplines into the core path, right after the MPC handshake. While at it, replace the magic LAN OFFLINE return code with the existing enum. Signed-off-by: Julian Wiedmann <[email protected]> Reviewed-by: Thomas Richter <[email protected]> Reviewed-by: Ursula Braun <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ac988d7 commit 1034051

File tree

4 files changed

+17
-35
lines changed

4 files changed

+17
-35
lines changed

drivers/s390/net/qeth_core.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,6 @@ void qeth_clear_thread_running_bit(struct qeth_card *, unsigned long);
913913
int qeth_core_hardsetup_card(struct qeth_card *);
914914
void qeth_print_status_message(struct qeth_card *);
915915
int qeth_init_qdio_queues(struct qeth_card *);
916-
int qeth_send_startlan(struct qeth_card *);
917916
int qeth_send_ipa_cmd(struct qeth_card *, struct qeth_cmd_buffer *,
918917
int (*reply_cb)
919918
(struct qeth_card *, struct qeth_reply *, unsigned long),

drivers/s390/net/qeth_core_main.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2944,7 +2944,7 @@ int qeth_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
29442944
}
29452945
EXPORT_SYMBOL_GPL(qeth_send_ipa_cmd);
29462946

2947-
int qeth_send_startlan(struct qeth_card *card)
2947+
static int qeth_send_startlan(struct qeth_card *card)
29482948
{
29492949
int rc;
29502950
struct qeth_cmd_buffer *iob;
@@ -2957,7 +2957,6 @@ int qeth_send_startlan(struct qeth_card *card)
29572957
rc = qeth_send_ipa_cmd(card, iob, NULL, NULL);
29582958
return rc;
29592959
}
2960-
EXPORT_SYMBOL_GPL(qeth_send_startlan);
29612960

29622961
static int qeth_default_setadapterparms_cb(struct qeth_card *card,
29632962
struct qeth_reply *reply, unsigned long data)
@@ -5087,6 +5086,20 @@ int qeth_core_hardsetup_card(struct qeth_card *card)
50875086
goto out;
50885087
}
50895088

5089+
rc = qeth_send_startlan(card);
5090+
if (rc) {
5091+
QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc);
5092+
if (rc == IPA_RC_LAN_OFFLINE) {
5093+
dev_warn(&card->gdev->dev,
5094+
"The LAN is offline\n");
5095+
card->lan_online = 0;
5096+
} else {
5097+
rc = -ENODEV;
5098+
goto out;
5099+
}
5100+
} else
5101+
card->lan_online = 1;
5102+
50905103
card->options.ipa4.supported_funcs = 0;
50915104
card->options.ipa6.supported_funcs = 0;
50925105
card->options.adp.supported_funcs = 0;
@@ -5098,14 +5111,14 @@ int qeth_core_hardsetup_card(struct qeth_card *card)
50985111
if (qeth_is_supported(card, IPA_SETADAPTERPARMS)) {
50995112
rc = qeth_query_setadapterparms(card);
51005113
if (rc < 0) {
5101-
QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc);
5114+
QETH_DBF_TEXT_(SETUP, 2, "7err%d", rc);
51025115
goto out;
51035116
}
51045117
}
51055118
if (qeth_adp_supported(card, IPA_SETADP_SET_DIAG_ASSIST)) {
51065119
rc = qeth_query_setdiagass(card);
51075120
if (rc < 0) {
5108-
QETH_DBF_TEXT_(SETUP, 2, "7err%d", rc);
5121+
QETH_DBF_TEXT_(SETUP, 2, "8err%d", rc);
51095122
goto out;
51105123
}
51115124
}

drivers/s390/net/qeth_l2_main.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,21 +1177,6 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
11771177
/* softsetup */
11781178
QETH_DBF_TEXT(SETUP, 2, "softsetp");
11791179

1180-
rc = qeth_send_startlan(card);
1181-
if (rc) {
1182-
QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
1183-
if (rc == 0xe080) {
1184-
dev_warn(&card->gdev->dev,
1185-
"The LAN is offline\n");
1186-
card->lan_online = 0;
1187-
goto contin;
1188-
}
1189-
rc = -ENODEV;
1190-
goto out_remove;
1191-
} else
1192-
card->lan_online = 1;
1193-
1194-
contin:
11951180
if ((card->info.type == QETH_CARD_TYPE_OSD) ||
11961181
(card->info.type == QETH_CARD_TYPE_OSX)) {
11971182
rc = qeth_l2_start_ipassists(card);

drivers/s390/net/qeth_l3_main.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3227,21 +3227,6 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode)
32273227
/* softsetup */
32283228
QETH_DBF_TEXT(SETUP, 2, "softsetp");
32293229

3230-
rc = qeth_send_startlan(card);
3231-
if (rc) {
3232-
QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
3233-
if (rc == 0xe080) {
3234-
dev_warn(&card->gdev->dev,
3235-
"The LAN is offline\n");
3236-
card->lan_online = 0;
3237-
goto contin;
3238-
}
3239-
rc = -ENODEV;
3240-
goto out_remove;
3241-
} else
3242-
card->lan_online = 1;
3243-
3244-
contin:
32453230
rc = qeth_l3_setadapter_parms(card);
32463231
if (rc)
32473232
QETH_DBF_TEXT_(SETUP, 2, "2err%04x", rc);

0 commit comments

Comments
 (0)