linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ips - Mode Sense (Caching Page ) fix
@ 2006-01-13 15:06 Jack Hammer
  0 siblings, 0 replies; 3+ messages in thread
From: Jack Hammer @ 2006-01-13 15:06 UTC (permalink / raw)
  To: linux-scsi

Much better ...  To avoid the "sda: got wrong page" message,
the ServeRAID driver should be setting flags indicating
that the Mode Sense commands are not supported.

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	Fri Jan 13 09:44:02 2006
@@ -1319,6 +1319,9 @@
 			min = ha->max_cmds - 1;
 		scsi_adjust_queue_depth(SDptr, MSG_ORDERED_TAG, min);
 	}
+
+	SDptr->skip_ms_page_8 = 1;
+	SDptr->skip_ms_page_3f = 1;
 	return 0;
 }
 #endif

^ permalink raw reply	[flat|nested] 3+ messages in thread
* RE: ips - Mode Sense ( Caching Page ) fix
@ 2006-01-13 13:49 Hammer, Jack
  0 siblings, 0 replies; 3+ messages in thread
From: Hammer, Jack @ 2006-01-13 13:49 UTC (permalink / raw)
  To: linux-scsi


Mark Salyzyn has pointed out to me that a better way to handle this is
with the skip_ms_page_8
flag in the scsi_device structure.

I agree.

I will cancel this request and create ( a much simpler fix ) using
skip_ms_page_8.

Thanks, Mark.

Jack

 

-----Original Message-----
From: linux-scsi-owner@vger.kernel.org
[mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of Hammer, Jack
Sent: Friday, January 13, 2006 8:31 AM
To: linux-scsi@vger.kernel.org
Subject: ips - Mode Sense ( Caching Page ) fix

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;
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org More majordomo info
at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 3+ messages in thread
* ips - Mode Sense ( Caching Page ) fix
@ 2006-01-13 13:30 Jack Hammer
  0 siblings, 0 replies; 3+ messages in thread
From: Jack Hammer @ 2006-01-13 13:30 UTC (permalink / raw)
  To: linux-scsi

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;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-01-13 15:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-13 15:06 ips - Mode Sense (Caching Page ) fix Jack Hammer
  -- strict thread matches above, loose matches on Subject: below --
2006-01-13 13:49 ips - Mode Sense ( Caching " Hammer, Jack
2006-01-13 13:30 Jack Hammer

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).