Skip to content

Commit 9897d58

Browse files
julianwiedmanndavem330
authored andcommitted
s390/qeth: consolidate some duplicated HW cmd code
When setting a device online, both subdrivers have the same code to program the HW trap and Isolation mode. Move that code into a single place. Signed-off-by: Julian Wiedmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f9ce416 commit 9897d58

File tree

3 files changed

+9
-31
lines changed

3 files changed

+9
-31
lines changed

drivers/s390/net/qeth_core_main.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4293,7 +4293,6 @@ int qeth_set_access_ctrl_online(struct qeth_card *card, int fallback)
42934293
}
42944294
return rc;
42954295
}
4296-
EXPORT_SYMBOL_GPL(qeth_set_access_ctrl_online);
42974296

42984297
void qeth_tx_timeout(struct net_device *dev)
42994298
{
@@ -5009,6 +5008,15 @@ int qeth_core_hardsetup_card(struct qeth_card *card, bool *carrier_ok)
50095008
goto out;
50105009
}
50115010
}
5011+
5012+
if (!qeth_is_diagass_supported(card, QETH_DIAGS_CMD_TRAP) ||
5013+
(card->info.hwtrap && qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM)))
5014+
card->info.hwtrap = 0;
5015+
5016+
rc = qeth_set_access_ctrl_online(card, 0);
5017+
if (rc)
5018+
goto out;
5019+
50125020
return 0;
50135021
out:
50145022
dev_warn(&card->gdev->dev, "The qeth device driver failed to recover "

drivers/s390/net/qeth_l2_main.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -759,14 +759,6 @@ static int qeth_l2_setup_netdev(struct qeth_card *card, bool carrier_ok)
759759
return rc;
760760
}
761761

762-
static int qeth_l2_start_ipassists(struct qeth_card *card)
763-
{
764-
/* configure isolation level */
765-
if (qeth_set_access_ctrl_online(card, 0))
766-
return -ENODEV;
767-
return 0;
768-
}
769-
770762
static void qeth_l2_trace_features(struct qeth_card *card)
771763
{
772764
/* Set BridgePort features */
@@ -797,13 +789,6 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev)
797789
goto out_remove;
798790
}
799791

800-
if (qeth_is_diagass_supported(card, QETH_DIAGS_CMD_TRAP)) {
801-
if (card->info.hwtrap &&
802-
qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM))
803-
card->info.hwtrap = 0;
804-
} else
805-
card->info.hwtrap = 0;
806-
807792
qeth_bridgeport_query_support(card);
808793
if (card->options.sbp.supported_funcs)
809794
dev_info(&card->gdev->dev,
@@ -825,12 +810,6 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev)
825810
/* softsetup */
826811
QETH_CARD_TEXT(card, 2, "softsetp");
827812

828-
if (IS_OSD(card) || IS_OSX(card)) {
829-
rc = qeth_l2_start_ipassists(card);
830-
if (rc)
831-
goto out_remove;
832-
}
833-
834813
rc = qeth_init_qdio_queues(card);
835814
if (rc) {
836815
QETH_CARD_TEXT_(card, 2, "6err%d", rc);

drivers/s390/net/qeth_l3_main.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -953,8 +953,6 @@ static int qeth_l3_start_ipassists(struct qeth_card *card)
953953
{
954954
QETH_CARD_TEXT(card, 3, "strtipas");
955955

956-
if (qeth_set_access_ctrl_online(card, 0))
957-
return -EIO;
958956
qeth_l3_start_ipa_arp_processing(card); /* go on*/
959957
qeth_l3_start_ipa_source_mac(card); /* go on*/
960958
qeth_l3_start_ipa_vlan(card); /* go on*/
@@ -2313,13 +2311,6 @@ static int qeth_l3_set_online(struct ccwgroup_device *gdev)
23132311
goto out_remove;
23142312
}
23152313

2316-
if (qeth_is_diagass_supported(card, QETH_DIAGS_CMD_TRAP)) {
2317-
if (card->info.hwtrap &&
2318-
qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM))
2319-
card->info.hwtrap = 0;
2320-
} else
2321-
card->info.hwtrap = 0;
2322-
23232314
card->state = CARD_STATE_HARDSETUP;
23242315
qeth_print_status_message(card);
23252316

0 commit comments

Comments
 (0)