Commit 9897d583 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by David S. Miller

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: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f9ce416a
...@@ -4293,7 +4293,6 @@ int qeth_set_access_ctrl_online(struct qeth_card *card, int fallback) ...@@ -4293,7 +4293,6 @@ int qeth_set_access_ctrl_online(struct qeth_card *card, int fallback)
} }
return rc; return rc;
} }
EXPORT_SYMBOL_GPL(qeth_set_access_ctrl_online);
void qeth_tx_timeout(struct net_device *dev) void qeth_tx_timeout(struct net_device *dev)
{ {
...@@ -5009,6 +5008,15 @@ int qeth_core_hardsetup_card(struct qeth_card *card, bool *carrier_ok) ...@@ -5009,6 +5008,15 @@ int qeth_core_hardsetup_card(struct qeth_card *card, bool *carrier_ok)
goto out; goto out;
} }
} }
if (!qeth_is_diagass_supported(card, QETH_DIAGS_CMD_TRAP) ||
(card->info.hwtrap && qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM)))
card->info.hwtrap = 0;
rc = qeth_set_access_ctrl_online(card, 0);
if (rc)
goto out;
return 0; return 0;
out: out:
dev_warn(&card->gdev->dev, "The qeth device driver failed to recover " dev_warn(&card->gdev->dev, "The qeth device driver failed to recover "
......
...@@ -759,14 +759,6 @@ static int qeth_l2_setup_netdev(struct qeth_card *card, bool carrier_ok) ...@@ -759,14 +759,6 @@ static int qeth_l2_setup_netdev(struct qeth_card *card, bool carrier_ok)
return rc; return rc;
} }
static int qeth_l2_start_ipassists(struct qeth_card *card)
{
/* configure isolation level */
if (qeth_set_access_ctrl_online(card, 0))
return -ENODEV;
return 0;
}
static void qeth_l2_trace_features(struct qeth_card *card) static void qeth_l2_trace_features(struct qeth_card *card)
{ {
/* Set BridgePort features */ /* Set BridgePort features */
...@@ -797,13 +789,6 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev) ...@@ -797,13 +789,6 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev)
goto out_remove; goto out_remove;
} }
if (qeth_is_diagass_supported(card, QETH_DIAGS_CMD_TRAP)) {
if (card->info.hwtrap &&
qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM))
card->info.hwtrap = 0;
} else
card->info.hwtrap = 0;
qeth_bridgeport_query_support(card); qeth_bridgeport_query_support(card);
if (card->options.sbp.supported_funcs) if (card->options.sbp.supported_funcs)
dev_info(&card->gdev->dev, dev_info(&card->gdev->dev,
...@@ -825,12 +810,6 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev) ...@@ -825,12 +810,6 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev)
/* softsetup */ /* softsetup */
QETH_CARD_TEXT(card, 2, "softsetp"); QETH_CARD_TEXT(card, 2, "softsetp");
if (IS_OSD(card) || IS_OSX(card)) {
rc = qeth_l2_start_ipassists(card);
if (rc)
goto out_remove;
}
rc = qeth_init_qdio_queues(card); rc = qeth_init_qdio_queues(card);
if (rc) { if (rc) {
QETH_CARD_TEXT_(card, 2, "6err%d", rc); QETH_CARD_TEXT_(card, 2, "6err%d", rc);
......
...@@ -953,8 +953,6 @@ static int qeth_l3_start_ipassists(struct qeth_card *card) ...@@ -953,8 +953,6 @@ static int qeth_l3_start_ipassists(struct qeth_card *card)
{ {
QETH_CARD_TEXT(card, 3, "strtipas"); QETH_CARD_TEXT(card, 3, "strtipas");
if (qeth_set_access_ctrl_online(card, 0))
return -EIO;
qeth_l3_start_ipa_arp_processing(card); /* go on*/ qeth_l3_start_ipa_arp_processing(card); /* go on*/
qeth_l3_start_ipa_source_mac(card); /* go on*/ qeth_l3_start_ipa_source_mac(card); /* go on*/
qeth_l3_start_ipa_vlan(card); /* go on*/ qeth_l3_start_ipa_vlan(card); /* go on*/
...@@ -2313,13 +2311,6 @@ static int qeth_l3_set_online(struct ccwgroup_device *gdev) ...@@ -2313,13 +2311,6 @@ static int qeth_l3_set_online(struct ccwgroup_device *gdev)
goto out_remove; goto out_remove;
} }
if (qeth_is_diagass_supported(card, QETH_DIAGS_CMD_TRAP)) {
if (card->info.hwtrap &&
qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM))
card->info.hwtrap = 0;
} else
card->info.hwtrap = 0;
card->state = CARD_STATE_HARDSETUP; card->state = CARD_STATE_HARDSETUP;
qeth_print_status_message(card); qeth_print_status_message(card);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment