s390/qeth: remove HARDSETUP state
authorJulian Wiedmann <jwi@linux.ibm.com>
Sat, 25 Jan 2020 15:53:03 +0000 (16:53 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 26 Jan 2020 14:20:32 +0000 (15:20 +0100)
qeth_l?_stop_card() is _never_ called while in HARDSETUP state, and
there's no other usage of the card state that relies on the
DOWN -> HARDSETUP -> SOFTSETUP transition.

As related cleanup, remove the check in qeth_realloc_buffer_pool() as it
is already done by the callers.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_core.h
drivers/s390/net/qeth_core_main.c
drivers/s390/net/qeth_core_sys.c
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c

index 950d015513734c435cd5c348d84ad884b179dff9..9575a627a1e18d446cf79dd7cb4011dfa2f2accf 100644 (file)
@@ -558,7 +558,6 @@ enum qeth_channel_states {
  */
 enum qeth_card_states {
        CARD_STATE_DOWN,
-       CARD_STATE_HARDSETUP,
        CARD_STATE_SOFTSETUP,
 };
 
index 0f5f36e63823e97dab1752382ba606a497426429..9639938581f58e3b0c4151260ce34046b49eeced 100644 (file)
@@ -247,9 +247,6 @@ int qeth_realloc_buffer_pool(struct qeth_card *card, int bufcnt)
 {
        QETH_CARD_TEXT(card, 2, "realcbp");
 
-       if (card->state != CARD_STATE_DOWN)
-               return -EPERM;
-
        /* TODO: steel/add buffers from/to a running card's buffer pool (?) */
        qeth_clear_working_pool_list(card);
        qeth_free_buffer_pool(card);
index 7bd86027f5595d53d44aec78f88059bf204d0fe3..2bd9993aa60b8c89546331a25c6013b43646def6 100644 (file)
@@ -24,8 +24,6 @@ static ssize_t qeth_dev_state_show(struct device *dev,
        switch (card->state) {
        case CARD_STATE_DOWN:
                return sprintf(buf, "DOWN\n");
-       case CARD_STATE_HARDSETUP:
-               return sprintf(buf, "HARDSETUP\n");
        case CARD_STATE_SOFTSETUP:
                if (card->dev->flags & IFF_UP)
                        return sprintf(buf, "UP (LAN %s)\n",
index d5ffd40937d3bef8227f749d5218f4a592139d16..692bd26234018f2a260fa16d3085616390a6fab9 100644 (file)
@@ -283,9 +283,6 @@ static void qeth_l2_stop_card(struct qeth_card *card)
 
        if (card->state == CARD_STATE_SOFTSETUP) {
                qeth_clear_ipacmd_list(card);
-               card->state = CARD_STATE_HARDSETUP;
-       }
-       if (card->state == CARD_STATE_HARDSETUP) {
                qeth_drain_output_queues(card);
                card->state = CARD_STATE_DOWN;
        }
@@ -776,7 +773,6 @@ static int qeth_l2_set_online(struct qeth_card *card)
        qeth_trace_features(card);
        qeth_l2_trace_features(card);
 
-       card->state = CARD_STATE_HARDSETUP;
        qeth_print_status_message(card);
 
        /* softsetup */
index eb2d9c427b109f83e7fccf6b3191ccb025749920..317d56647a4a3b8965b155be0fcfc83b0bdc157e 100644 (file)
@@ -901,7 +901,7 @@ out:
        return rc;
 }
 
-static int qeth_l3_start_ipassists(struct qeth_card *card)
+static void qeth_l3_start_ipassists(struct qeth_card *card)
 {
        QETH_CARD_TEXT(card, 3, "strtipas");
 
@@ -911,7 +911,6 @@ static int qeth_l3_start_ipassists(struct qeth_card *card)
        qeth_l3_start_ipa_multicast(card);              /* go on*/
        qeth_l3_start_ipa_ipv6(card);           /* go on*/
        qeth_l3_start_ipa_broadcast(card);              /* go on*/
-       return 0;
 }
 
 static int qeth_l3_iqd_read_initial_mac_cb(struct qeth_card *card,
@@ -1178,9 +1177,6 @@ static void qeth_l3_stop_card(struct qeth_card *card)
        if (card->state == CARD_STATE_SOFTSETUP) {
                qeth_l3_clear_ip_htable(card, 1);
                qeth_clear_ipacmd_list(card);
-               card->state = CARD_STATE_HARDSETUP;
-       }
-       if (card->state == CARD_STATE_HARDSETUP) {
                qeth_drain_output_queues(card);
                card->state = CARD_STATE_DOWN;
        }
@@ -2068,7 +2064,6 @@ static int qeth_l3_set_online(struct qeth_card *card)
                goto out_remove;
        }
 
-       card->state = CARD_STATE_HARDSETUP;
        qeth_print_status_message(card);
 
        /* softsetup */
@@ -2078,11 +2073,8 @@ static int qeth_l3_set_online(struct qeth_card *card)
        if (rc)
                QETH_CARD_TEXT_(card, 2, "2err%04x", rc);
        if (!card->options.sniffer) {
-               rc = qeth_l3_start_ipassists(card);
-               if (rc) {
-                       QETH_CARD_TEXT_(card, 2, "3err%d", rc);
-                       goto out_remove;
-               }
+               qeth_l3_start_ipassists(card);
+
                rc = qeth_l3_setrouting_v4(card);
                if (rc)
                        QETH_CARD_TEXT_(card, 2, "4err%04x", rc);