ips - Mode Sense ( Caching Page ) fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux