Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > main-src > by-pkgid > 276c4c69ed5efcebe43ee6121194cf59 > files > 60

kernel22-2.2.20-9mdk.src.rpm

diff -urN linux/drivers/scsi/constants.c linux-GFS/drivers/scsi/constants.c
--- linux/drivers/scsi/constants.c	Fri Jun 16 18:38:10 2000
+++ linux-GFS/drivers/scsi/constants.c	Fri Jun 16 18:49:35 2000
@@ -74,6 +74,14 @@
 };
 
 
+static const char *group_4_commands[] = {
+/* 80-87 */ unknown, unknown, unknown, "Dlock", unknown, unknown, unknown, unknown,
+/* 88-8F */ unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown,
+/* 90-97 */ unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown,
+/* 98-9F */ unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown,
+};
+
+
 /* The following are 12 byte commands in group 5 */
 static const char *group_5_commands[] = {
 /* a0-a5 */ unknown, unknown, unknown, unknown, unknown,
@@ -97,7 +104,7 @@
 
 static const char **commands[] = {
     group_0_commands, group_1_commands, group_2_commands, 
-    (const char **) RESERVED_GROUP, (const char **) RESERVED_GROUP, 
+    (const char **) RESERVED_GROUP, group_4_commands, 
     group_5_commands, (const char **) VENDOR_GROUP, 
     (const char **) VENDOR_GROUP
 };
diff -urN linux/drivers/scsi/scsi.c linux-GFS/drivers/scsi/scsi.c
--- linux/drivers/scsi/scsi.c	Fri Jun 16 18:38:42 2000
+++ linux-GFS/drivers/scsi/scsi.c	Fri Jun 16 18:49:35 2000
@@ -120,9 +120,9 @@
  */
 unsigned long             scsi_pid = 0;
 Scsi_Cmnd               * last_cmnd = NULL;
-/* Command groups 3 and 4 are reserved and should never be used.  */
+/* Command group 3 is reserved and should never be used.  */
 const unsigned char       scsi_command_size[8] = { 6, 10, 10, 12, 
-                                                   12, 12, 10, 10 };
+                                                   16, 12, 10, 10 };
 static unsigned long      serial_number = 0;
 static Scsi_Cmnd        * scsi_bh_queue_head = NULL;
 static Scsi_Cmnd	* scsi_bh_queue_tail = NULL;
@@ -1477,12 +1477,13 @@
     {
 	int i;
 	int target = SCpnt->target;
+        int size = COMMAND_SIZE(((const unsigned char *)cmnd)[0]);
 	printk ("scsi_do_cmd (host = %d, channel = %d target = %d, "
 		"buffer =%p, bufflen = %d, done = %p, timeout = %d, "
 		"retries = %d)\n"
 		"command : " , host->host_no, SCpnt->channel, target, buffer,
 		bufflen, done, timeout, retries);
-	for (i = 0; i < 10; ++i)
+	for (i = 0; i < size; ++i)
 	    printk ("%02x  ", ((unsigned char *) cmnd)[i]);
 	printk("\n");
     });
@@ -1525,7 +1526,10 @@
      * the completion function for the high level driver.
      */
 
-    memcpy ((void *) SCpnt->data_cmnd , (const void *) cmnd, 12);
+    if (SCpnt->cmd_len == 0)
+	SCpnt->cmd_len = COMMAND_SIZE(((const unsigned char *)cmnd)[0]);
+
+    memcpy ((void *) SCpnt->data_cmnd , (const void *) cmnd, SCpnt->cmd_len);
     SCpnt->reset_chain = NULL;
     SCpnt->serial_number = 0;
     SCpnt->serial_number_at_timeout = 0;
@@ -1537,7 +1541,7 @@
     SCpnt->done = done;
     SCpnt->timeout_per_command = timeout;
 
-    memcpy ((void *) SCpnt->cmnd , (const void *) cmnd, 12);
+    memcpy ((void *) SCpnt->cmnd , (const void *) cmnd, SCpnt->cmd_len);
     /* Zero the sense buffer.  Some host adapters automatically request
      * sense on error.  0 is not a valid sense code.
      */
@@ -1545,8 +1549,6 @@
     SCpnt->request_buffer = buffer;
     SCpnt->request_bufflen = bufflen;
     SCpnt->old_use_sg = SCpnt->use_sg;
-    if (SCpnt->cmd_len == 0)
-	SCpnt->cmd_len = COMMAND_SIZE(SCpnt->cmnd[0]);
     SCpnt->old_cmd_len = SCpnt->cmd_len;
 
     /* Start the timer ticking.  */
diff -urN linux/drivers/scsi/scsi.h linux-GFS/drivers/scsi/scsi.h
--- linux/drivers/scsi/scsi.h	Fri Jun 16 18:38:26 2000
+++ linux-GFS/drivers/scsi/scsi.h	Fri Jun 16 18:49:35 2000
@@ -287,7 +287,7 @@
 #define DRIVER_MASK         0x0f
 #define SUGGEST_MASK        0xf0
 
-#define MAX_COMMAND_SIZE    12
+#define MAX_COMMAND_SIZE    16
 
 /*
  *  SCSI command sets
@@ -548,14 +548,14 @@
     unsigned char      old_cmd_len;
 
     /* These elements define the operation we are about to perform */
-    unsigned char      cmnd[12];
+    unsigned char      cmnd[MAX_COMMAND_SIZE];
     unsigned           request_bufflen;	/* Actual request size */
     
     struct timer_list  eh_timeout;         /* Used to time out the command. */
     void             * request_buffer;	/* Actual requested buffer */
     
     /* These elements define the operation we ultimately want to perform */
-    unsigned char      data_cmnd[12];
+    unsigned char      data_cmnd[MAX_COMMAND_SIZE];
     unsigned short     old_use_sg;	/* We save  use_sg here when requesting
                                          * sense info */
     unsigned short     use_sg;          /* Number of pieces of scatter-gather */