From: Jack Hammer <jack_hammer@adaptec.com>
To: linux-scsi@vger.kernel.org
Subject: ips - Mode Sense ( Caching Page ) fix
Date: Fri, 13 Jan 2006 08:30:38 -0500 [thread overview]
Message-ID: <43C7AB7E.7050400@adaptec.com> (raw)
The ServeRAID driver ( ips ) does not recognize and respond properly to a
Mode Sense - Caching Page request. This causes sd.c to display the message
"sda: got wrong page"
The following patch for creates a valid response to this request.
Signed-off-by: Jack Hammer <jack_hammer@adaptec.com>
--- a/drivers/scsi/ips.c Mon Jan 2 22:21:10 2006
+++ b/drivers/scsi/ips.c Thu Jan 12 15:45:42 2006
@@ -3745,6 +3745,7 @@
int device_error;
IPS_DCDB_TABLE_TAPE *tapeDCDB;
int TimeOut;
+ uint8_t cachePageResponse[22];
METHOD_TRACE("ips_send_cmd", 1);
@@ -3949,6 +3950,24 @@
break;
case MODE_SENSE:
+ if ((scb->scsi_cmd->cmnd[2] & 0x3F) == 8) // Caching Page Request
+ {
+ memset(cachePageResponse, 0, sizeof (cachePageResponse));
+ // Bytes 0-3 are the Mode Parameter Header
+ cachePageResponse[0] = 0x15; // Mode Data Length
+ cachePageResponse[1] = 0x00; // Medium Type = Default
+ cachePageResponse[2] = 0x00; // Device Specific Parmeters
+ cachePageResponse[3] = 0x00; // No Block Descriptors
+ // Actual Caching Page Data Starts Here
+ cachePageResponse[4] = 0x08; // Page Code 8 ( Caching Page )
+ cachePageResponse[5] = 0x12; // Page Length
+ cachePageResponse[6] = 0x00; // WCE is OFF !
+
+ ips_scmd_buf_write(scb->scsi_cmd, cachePageResponse, sizeof (cachePageResponse));
+ scb->scsi_cmd->result = DID_OK << 16;
+ break;
+ }
+
scb->cmd.basic_io.op_code = IPS_CMD_ENQUIRY;
scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb);
scb->cmd.basic_io.segment_4G = 0;
next reply other threads:[~2006-01-13 13:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-13 13:30 Jack Hammer [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-01-13 13:49 ips - Mode Sense ( Caching Page ) fix Hammer, Jack
2006-01-13 15:06 ips - Mode Sense (Caching " Jack Hammer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43C7AB7E.7050400@adaptec.com \
--to=jack_hammer@adaptec.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).