Skip to contentSkip to conversation

ips - Mode Sense ( Caching Page ) fix

PATCH Jack Hammer 1 participant 1 message Jan 13, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore 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.

drivers/scsi/ips.c +1 -0
@@ -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;