Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22537
b: refs/heads/master
c: fc25307
h: refs/heads/master
i:
  22535: 9607ffa
v: v3
  • Loading branch information
Matthew Wilcox authored and James Bottomley committed Feb 28, 2006
1 parent 9cb9673 commit 36f7fe5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1bfc5d9d5eb8e1a2efacc306bc55c248ed259a8e
refs/heads/master: fc25307d06f524d6c04b371b236dc9e62186058c
24 changes: 19 additions & 5 deletions trunk/drivers/scsi/scsi_transport_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ static const char * const two_byte_msgs[] = {
static const char * const extended_msgs[] = {
/* 0x00 */ "Modify Data Pointer", "Synchronous Data Transfer Request",
/* 0x02 */ "SCSI-I Extended Identify", "Wide Data Transfer Request",
/* 0x04 */ "Parallel Protocol Request"
/* 0x04 */ "Parallel Protocol Request", "Modify Bidirectional Data Pointer"
};

static void print_nego(const unsigned char *msg, int per, int off, int width)
Expand All @@ -1122,20 +1122,28 @@ static void print_nego(const unsigned char *msg, int per, int off, int width)
printk("width = %d ", 8 << msg[width]);
}

static void print_ptr(const unsigned char *msg, int msb, const char *desc)
{
int ptr = (msg[msb] << 24) | (msg[msb+1] << 16) | (msg[msb+2] << 8) |
msg[msb+3];
printk("%s = %d ", desc, ptr);
}

int spi_print_msg(const unsigned char *msg)
{
int len = 0, i;
if (msg[0] == EXTENDED_MESSAGE) {
len = 3 + msg[1];
len = 2 + msg[1];
if (len == 2)
len += 256;
if (msg[2] < ARRAY_SIZE(extended_msgs))
printk ("%s ", extended_msgs[msg[2]]);
else
printk ("Extended Message, reserved code (0x%02x) ",
(int) msg[2]);
switch (msg[2]) {
case EXTENDED_MODIFY_DATA_POINTER:
printk("pointer = %d ", (msg[3] << 24) |
(msg[4] << 16) | (msg[5] << 8) | msg[6]);
print_ptr(msg, 3, "pointer");
break;
case EXTENDED_SDTR:
print_nego(msg, 3, 4, 0);
Expand All @@ -1146,6 +1154,10 @@ int spi_print_msg(const unsigned char *msg)
case EXTENDED_PPR:
print_nego(msg, 3, 5, 6);
break;
case EXTENDED_MODIFY_BIDI_DATA_PTR:
print_ptr(msg, 3, "out");
print_ptr(msg, 7, "in");
break;
default:
for (i = 2; i < len; ++i)
printk("%02x ", msg[i]);
Expand Down Expand Up @@ -1186,7 +1198,9 @@ int spi_print_msg(const unsigned char *msg)
int len = 0, i;

if (msg[0] == EXTENDED_MESSAGE) {
len = 3 + msg[1];
len = 2 + msg[1];
if (len == 2)
len += 256;
for (i = 0; i < len; ++i)
printk("%02x ", msg[i]);
/* Identify */
Expand Down

0 comments on commit 36f7fe5

Please sign in to comment.