]> err.no Git - linux-2.6/commitdiff
qeth: provide specific message for OSA-adapters exclusively used
authorUrsula Braun <braunu@de.ibm.com>
Wed, 29 Aug 2007 09:26:57 +0000 (11:26 +0200)
committerJeff Garzik <jeff@garzik.org>
Fri, 31 Aug 2007 10:52:58 +0000 (06:52 -0400)
Exclusive usage of OSA-cards has been introduced. Even though Linux
does not make use of it, qeth should be prepared to receive a bad RC
for some initialization steps. A meaningful message is now given,
if an OSA-device is set online, even though the OSA-adapter is already
exclusively used by another host.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/s390/net/qeth_main.c
drivers/s390/net/qeth_mpc.h

index 45a8b9f78b16cf749c96c37cd30dd07763d3953d..617fbfd767fa36b1bafbeff8ad5834eebce36105 100644 (file)
@@ -1541,16 +1541,21 @@ qeth_idx_write_cb(struct qeth_channel *channel, struct qeth_cmd_buffer *iob)
        card = CARD_FROM_CDEV(channel->ccwdev);
 
        if (!(QETH_IS_IDX_ACT_POS_REPLY(iob->data))) {
-               PRINT_ERR("IDX_ACTIVATE on write channel device %s: negative "
-                         "reply\n", CARD_WDEV_ID(card));
+               if (QETH_IDX_ACT_CAUSE_CODE(iob->data) == 0x19)
+                       PRINT_ERR("IDX_ACTIVATE on write channel device %s: "
+                               "adapter exclusively used by another host\n",
+                               CARD_WDEV_ID(card));
+               else
+                       PRINT_ERR("IDX_ACTIVATE on write channel device %s: "
+                               "negative reply\n", CARD_WDEV_ID(card));
                goto out;
        }
        memcpy(&temp, QETH_IDX_ACT_FUNC_LEVEL(iob->data), 2);
        if ((temp & ~0x0100) != qeth_peer_func_level(card->info.func_level)) {
                PRINT_WARN("IDX_ACTIVATE on write channel device %s: "
-                          "function level mismatch "
-                          "(sent: 0x%x, received: 0x%x)\n",
-                          CARD_WDEV_ID(card), card->info.func_level, temp);
+                       "function level mismatch "
+                       "(sent: 0x%x, received: 0x%x)\n",
+                       CARD_WDEV_ID(card), card->info.func_level, temp);
                goto out;
        }
        channel->state = CH_STATE_UP;
@@ -1596,8 +1601,13 @@ qeth_idx_read_cb(struct qeth_channel *channel, struct qeth_cmd_buffer *iob)
                        goto out;
        }
        if (!(QETH_IS_IDX_ACT_POS_REPLY(iob->data))) {
-               PRINT_ERR("IDX_ACTIVATE on read channel device %s: negative "
-                         "reply\n", CARD_RDEV_ID(card));
+               if (QETH_IDX_ACT_CAUSE_CODE(iob->data) == 0x19)
+                       PRINT_ERR("IDX_ACTIVATE on read channel device %s: "
+                               "adapter exclusively used by another host\n",
+                               CARD_RDEV_ID(card));
+               else
+                       PRINT_ERR("IDX_ACTIVATE on read channel device %s: "
+                               "negative reply\n", CARD_RDEV_ID(card));
                goto out;
        }
 
@@ -1612,8 +1622,8 @@ qeth_idx_read_cb(struct qeth_channel *channel, struct qeth_cmd_buffer *iob)
        memcpy(&temp, QETH_IDX_ACT_FUNC_LEVEL(iob->data), 2);
        if (temp != qeth_peer_func_level(card->info.func_level)) {
                PRINT_WARN("IDX_ACTIVATE on read channel device %s: function "
-                          "level mismatch (sent: 0x%x, received: 0x%x)\n",
-                          CARD_RDEV_ID(card), card->info.func_level, temp);
+                       "level mismatch (sent: 0x%x, received: 0x%x)\n",
+                       CARD_RDEV_ID(card), card->info.func_level, temp);
                goto out;
        }
        memcpy(&card->token.issuer_rm_r,
index 1d8083c91765891197ee83114d07e6eaad16d256..6de2da5ed5fd6da2234c050efbf912b4caee9231 100644 (file)
@@ -565,6 +565,7 @@ extern unsigned char IDX_ACTIVATE_WRITE[];
 #define QETH_IDX_ACT_QDIO_DEV_REALADDR(buffer) (buffer+0x20)
 #define QETH_IS_IDX_ACT_POS_REPLY(buffer) (((buffer)[0x08]&3)==2)
 #define QETH_IDX_REPLY_LEVEL(buffer) (buffer+0x12)
+#define QETH_IDX_ACT_CAUSE_CODE(buffer) (buffer)[0x09]
 
 #define PDU_ENCAPSULATION(buffer) \
        (buffer + *(buffer + (*(buffer+0x0b)) + \