aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/scsi_transport_spi.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index 0b29ee9989a4..4855d1602d6b 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -1089,17 +1089,19 @@ EXPORT_SYMBOL_GPL(spi_populate_ppr_msg);
1089 1089
1090#ifdef CONFIG_SCSI_CONSTANTS 1090#ifdef CONFIG_SCSI_CONSTANTS
1091static const char * const one_byte_msgs[] = { 1091static const char * const one_byte_msgs[] = {
1092/* 0x00 */ "Command Complete", NULL, "Save Pointers", 1092/* 0x00 */ "Task Complete", NULL /* Extended Message */, "Save Pointers",
1093/* 0x03 */ "Restore Pointers", "Disconnect", "Initiator Error", 1093/* 0x03 */ "Restore Pointers", "Disconnect", "Initiator Error",
1094/* 0x06 */ "Abort", "Message Reject", "Nop", "Message Parity Error", 1094/* 0x06 */ "Abort Task Set", "Message Reject", "Nop", "Message Parity Error",
1095/* 0x0a */ "Linked Command Complete", "Linked Command Complete w/flag", 1095/* 0x0a */ "Linked Command Complete", "Linked Command Complete w/flag",
1096/* 0x0c */ "Bus device reset", "Abort Tag", "Clear Queue", 1096/* 0x0c */ "Target Reset", "Abort Task", "Clear Task Set",
1097/* 0x0f */ "Initiate Recovery", "Release Recovery" 1097/* 0x0f */ "Initiate Recovery", "Release Recovery",
1098/* 0x11 */ "Terminate Process", "Continue Task", "Target Transfer Disable",
1099/* 0x14 */ NULL, NULL, "Clear ACA", "LUN Reset"
1098}; 1100};
1099 1101
1100static const char * const two_byte_msgs[] = { 1102static const char * const two_byte_msgs[] = {
1101/* 0x20 */ "Simple Queue Tag", "Head of Queue Tag", "Ordered Queue Tag", 1103/* 0x20 */ "Simple Queue Tag", "Head of Queue Tag", "Ordered Queue Tag",
1102/* 0x23 */ "Ignore Wide Residue" 1104/* 0x23 */ "Ignore Wide Residue", "ACA"
1103}; 1105};
1104 1106
1105static const char * const extended_msgs[] = { 1107static const char * const extended_msgs[] = {
@@ -1131,7 +1133,7 @@ static void print_ptr(const unsigned char *msg, int msb, const char *desc)
1131 1133
1132int spi_print_msg(const unsigned char *msg) 1134int spi_print_msg(const unsigned char *msg)
1133{ 1135{
1134 int len = 0, i; 1136 int len = 1, i;
1135 if (msg[0] == EXTENDED_MESSAGE) { 1137 if (msg[0] == EXTENDED_MESSAGE) {
1136 len = 2 + msg[1]; 1138 len = 2 + msg[1];
1137 if (len == 2) 1139 if (len == 2)
@@ -1168,14 +1170,14 @@ int spi_print_msg(const unsigned char *msg)
1168 (msg[0] & 0x40) ? "" : "not ", 1170 (msg[0] & 0x40) ? "" : "not ",
1169 (msg[0] & 0x20) ? "target routine" : "lun", 1171 (msg[0] & 0x20) ? "target routine" : "lun",
1170 msg[0] & 0x7); 1172 msg[0] & 0x7);
1171 len = 1;
1172 /* Normal One byte */ 1173 /* Normal One byte */
1173 } else if (msg[0] < 0x1f) { 1174 } else if (msg[0] < 0x1f) {
1174 if (msg[0] < ARRAY_SIZE(one_byte_msgs)) 1175 if (msg[0] < ARRAY_SIZE(one_byte_msgs) && one_byte_msgs[msg[0]])
1175 printk("%s ", one_byte_msgs[msg[0]]); 1176 printk("%s ", one_byte_msgs[msg[0]]);
1176 else 1177 else
1177 printk("reserved (%02x) ", msg[0]); 1178 printk("reserved (%02x) ", msg[0]);
1178 len = 1; 1179 } else if (msg[0] == 0x55) {
1180 printk("QAS Request ");
1179 /* Two byte */ 1181 /* Two byte */
1180 } else if (msg[0] <= 0x2f) { 1182 } else if (msg[0] <= 0x2f) {
1181 if ((msg[0] - 0x20) < ARRAY_SIZE(two_byte_msgs)) 1183 if ((msg[0] - 0x20) < ARRAY_SIZE(two_byte_msgs))
@@ -1195,7 +1197,7 @@ EXPORT_SYMBOL(spi_print_msg);
1195 1197
1196int spi_print_msg(const unsigned char *msg) 1198int spi_print_msg(const unsigned char *msg)
1197{ 1199{
1198 int len = 0, i; 1200 int len = 1, i;
1199 1201
1200 if (msg[0] == EXTENDED_MESSAGE) { 1202 if (msg[0] == EXTENDED_MESSAGE) {
1201 len = 2 + msg[1]; 1203 len = 2 + msg[1];
@@ -1206,11 +1208,9 @@ int spi_print_msg(const unsigned char *msg)
1206 /* Identify */ 1208 /* Identify */
1207 } else if (msg[0] & 0x80) { 1209 } else if (msg[0] & 0x80) {
1208 printk("%02x ", msg[0]); 1210 printk("%02x ", msg[0]);
1209 len = 1;
1210 /* Normal One byte */ 1211 /* Normal One byte */
1211 } else if (msg[0] < 0x1f) { 1212 } else if ((msg[0] < 0x1f) || (msg == 0x55)) {
1212 printk("%02x ", msg[0]); 1213 printk("%02x ", msg[0]);
1213 len = 1;
1214 /* Two byte */ 1214 /* Two byte */
1215 } else if (msg[0] <= 0x2f) { 1215 } else if (msg[0] <= 0x2f) {
1216 printk("%02x %02x", msg[0], msg[1]); 1216 printk("%02x %02x", msg[0], msg[1]);