s390/qeth: consolidate some duplicated HW cmd code
authorJulian Wiedmann <jwi@linux.ibm.com>
Thu, 31 Oct 2019 12:42:18 +0000 (13:42 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 31 Oct 2019 19:32:59 +0000 (12:32 -0700)
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 <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_core_main.c
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c

index d4e66707a03fe27ab41201252c771a1e48153f3a..d51dcb3c5a01076bf85440494a80c5d8ece16814 100644 (file)
@@ -4293,7 +4293,6 @@ int qeth_set_access_ctrl_online(struct qeth_card *card, int fallback)
        }
        return rc;
 }
-EXPORT_SYMBOL_GPL(qeth_set_access_ctrl_online);
 
 void qeth_tx_timeout(struct net_device *dev)
 {
@@ -5009,6 +5008,15 @@ retriable:
                        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;
 out:
        dev_warn(&card->gdev->dev, "The qeth device driver failed to recover "
index bd8143e51747a785070c347b68f5d9314d2846f3..8f3093d24b122eae0a6c41510fc01d83ae697592 100644 (file)
@@ -759,14 +759,6 @@ add_napi:
        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)
 {
        /* Set BridgePort features */
@@ -797,13 +789,6 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev)
                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);
        if (card->options.sbp.supported_funcs)
                dev_info(&card->gdev->dev,
@@ -825,12 +810,6 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev)
        /* softsetup */
        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);
        if (rc) {
                QETH_CARD_TEXT_(card, 2, "6err%d", rc);
index d7bfc7a0e4c07575f660766ded2fbdf425c272ef..acae44a699ad98c39ce4d8eff28d31caf8697977 100644 (file)
@@ -953,8 +953,6 @@ static int qeth_l3_start_ipassists(struct qeth_card *card)
 {
        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_source_mac(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)
                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;
        qeth_print_status_message(card);