patch-2.0.13 linux/drivers/scsi/sr.c

Next file: linux/drivers/scsi/st.c
Previous file: linux/drivers/scsi/scsi_ioctl.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.12/linux/drivers/scsi/sr.c linux/drivers/scsi/sr.c
@@ -427,8 +427,8 @@
 	printk(KERN_DEBUG "sr_photocd: use NEC code\n");
 #endif
 	memset(buf,0,40);
-	*((unsigned long*)buf)   = 0x0;   /* we send nothing...     */
-	*((unsigned long*)buf+1) = 0x16;  /* and receive 0x16 bytes */
+	*((unsigned int*)buf)   = 0x0;   /* we send nothing...     */
+	*((unsigned int*)buf+1) = 0x16;  /* and receive 0x16 bytes */
 	cmd[0] = 0xde;
 	cmd[1] = 0x03;
 	cmd[2] = 0xb0;
@@ -464,10 +464,10 @@
 	/* we request some disc information (is it a XA-CD ?,
 	 * where starts the last session ?) */
 	memset(buf,0,40);
-	*((unsigned long*)buf)   = 0;
-	*((unsigned long*)buf+1) = 4;  /* we receive 4 bytes from the drive */
-	cmd[0] = 0xc7;
-	cmd[1] = 3;
+	*((unsigned int*)buf)   = (unsigned int) 0;
+	*((unsigned int*)buf+1) = (unsigned int) 4;  /* receive 4 bytes */
+	cmd[0]                  = (unsigned char) 0x00c7;
+	cmd[1]                  = (unsigned char) 3;
 	rc = kernel_scsi_ioctl(scsi_CDs[MINOR(inode->i_rdev)].device,
 			       SCSI_IOCTL_SEND_COMMAND, buf);
 	if (rc != 0) {
@@ -499,11 +499,11 @@
 	
 	/* now we do a get_density... */
 	memset(buf,0,40);
-	*((unsigned long*)buf)   = 0;
-	*((unsigned long*)buf+1) = 12;
-	cmd[0] = MODE_SENSE;
-	cmd[2] = 1;
-	cmd[4] = 12;
+	*((unsigned int*)buf)   = (unsigned int) 0;
+	*((unsigned int*)buf+1) = (unsigned int) 12;
+	cmd[0]                  = (unsigned char) MODE_SENSE;
+	cmd[2]                  = (unsigned char) 1;
+	cmd[4]                  = (unsigned char) 12;
 	rc = kernel_scsi_ioctl(scsi_CDs[MINOR(inode->i_rdev)].device,
 			       SCSI_IOCTL_SEND_COMMAND, buf);
 	if (rc != 0) {
@@ -520,15 +520,17 @@
 	    printk(KERN_DEBUG "sr_photocd: doing set_density\n");
 #endif
 	    memset(buf,0,40);
-	    *((unsigned long*)buf)   = 12;  /* sending 12 bytes... */
-	    *((unsigned long*)buf+1) = 0;
-	    cmd[0] = MODE_SELECT;
-	    cmd[1] = (1 << 4);
-	    cmd[4] = 12;
-	    send = &cmd[6];                 /* this is a 6-Byte command    */
-	    send[ 3] = 0x08;                /* the data for the command    */
-	    send[ 4] = (is_xa) ? 0x81 : 0;  /* density 0x81 for XA, 0 else */
-	    send[10] = 0x08;
+	    *((unsigned int*)buf)   = (unsigned int) 12;  /* send 12 bytes */
+	    *((unsigned int*)buf+1) = (unsigned int) 0;
+	    cmd[0]                  = (unsigned char) MODE_SELECT;
+	    cmd[1]                  = (unsigned char) (1 << 4);
+	    cmd[4]                  = (unsigned char) 12;
+            send = &cmd[6]; 		/* this is a 6-Byte command    */
+            send[ 3]                = (unsigned char) 0x08; /* data for cmd */
+            /* density 0x81 for XA, 0 else */
+            send[ 4]                = (is_xa) ? 
+                                    (unsigned char) 0x81 : (unsigned char) 0;  
+            send[10]                = (unsigned char) 0x08;
 	    rc = kernel_scsi_ioctl(scsi_CDs[MINOR(inode->i_rdev)].device,
 				   SCSI_IOCTL_SEND_COMMAND, buf);
 	    if (rc != 0) {
@@ -547,8 +549,8 @@
 #endif
 	get_sectorsize(MINOR(inode->i_rdev));	/* spinup (avoid timeout) */
 	memset(buf,0,40);
-	*((unsigned long*)buf)   = 0x0;   /* we send nothing...     */
-	*((unsigned long*)buf+1) = 0x0c;  /* and receive 0x0c bytes */
+	*((unsigned int*)buf)   = 0x0;   /* we send nothing...     */
+	*((unsigned int*)buf+1) = 0x0c;  /* and receive 0x0c bytes */
 	cmd[0] = READ_TOC;
 	cmd[8] = 0x0c;
 	cmd[9] = 0x40;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov