fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / scsi / sr_vendor.c
index 2f7894e..4eb3da9 100644 (file)
  *              HP 6020 writers now supported.
  */
 
-#include <linux/config.h>
+#include <linux/cdrom.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/bcd.h>
-
 #include <linux/blkdev.h>
-#include "scsi.h"
-#include "hosts.h"
+
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_host.h>
 #include <scsi/scsi_ioctl.h>
 
-#include <linux/cdrom.h>
 #include "sr.h"
 
 #if 0
@@ -66,8 +67,8 @@ void sr_vendor_init(Scsi_CD *cd)
 #ifndef CONFIG_BLK_DEV_SR_VENDOR
        cd->vendor = VENDOR_SCSI3;
 #else
-       char *vendor = cd->device->vendor;
-       char *model = cd->device->model;
+       const char *vendor = cd->device->vendor;
+       const char *model = cd->device->model;
        
        /* default */
        cd->vendor = VENDOR_SCSI3;
@@ -116,7 +117,7 @@ int sr_set_blocklength(Scsi_CD *cd, int blocklength)
                density = (blocklength > 2048) ? 0x81 : 0x83;
 #endif
 
-       buffer = (unsigned char *) kmalloc(512, GFP_KERNEL | GFP_DMA);
+       buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
        if (!buffer)
                return -ENOMEM;
 
@@ -135,7 +136,7 @@ int sr_set_blocklength(Scsi_CD *cd, int blocklength)
        modesel->block_length_lo = blocklength & 0xff;
        cgc.buffer = buffer;
        cgc.buflen = sizeof(*modesel);
-       cgc.data_direction = SCSI_DATA_WRITE;
+       cgc.data_direction = DMA_TO_DEVICE;
        cgc.timeout = VENDOR_TIMEOUT;
        if (0 == (rc = sr_do_ioctl(cd, &cgc))) {
                cd->device->sector_size = blocklength;
@@ -163,7 +164,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)
        if (cd->cdi.mask & CDC_MULTI_SESSION)
                return 0;
 
-       buffer = (unsigned char *) kmalloc(512, GFP_KERNEL | GFP_DMA);
+       buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
        if (!buffer)
                return -ENOMEM;
 
@@ -182,7 +183,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)
                cgc.buffer = buffer;
                cgc.buflen = 12;
                cgc.quiet = 1;
-               cgc.data_direction = SCSI_DATA_READ;
+               cgc.data_direction = DMA_FROM_DEVICE;
                cgc.timeout = VENDOR_TIMEOUT;
                rc = sr_do_ioctl(cd, &cgc);
                if (rc != 0)
@@ -210,7 +211,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)
                        cgc.buffer = buffer;
                        cgc.buflen = 0x16;
                        cgc.quiet = 1;
-                       cgc.data_direction = SCSI_DATA_READ;
+                       cgc.data_direction = DMA_FROM_DEVICE;
                        cgc.timeout = VENDOR_TIMEOUT;
                        rc = sr_do_ioctl(cd, &cgc);
                        if (rc != 0)
@@ -239,7 +240,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)
                        cgc.buffer = buffer;
                        cgc.buflen = 4;
                        cgc.quiet = 1;
-                       cgc.data_direction = SCSI_DATA_READ;
+                       cgc.data_direction = DMA_FROM_DEVICE;
                        cgc.timeout = VENDOR_TIMEOUT;
                        rc = sr_do_ioctl(cd, &cgc);
                        if (rc == -EINVAL) {
@@ -268,7 +269,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)
                cgc.buffer = buffer;
                cgc.buflen = 0x04;
                cgc.quiet = 1;
-               cgc.data_direction = SCSI_DATA_READ;
+               cgc.data_direction = DMA_FROM_DEVICE;
                cgc.timeout = VENDOR_TIMEOUT;
                rc = sr_do_ioctl(cd, &cgc);
                if (rc != 0) {
@@ -286,7 +287,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)
                cgc.buffer = buffer;
                cgc.buflen = 12;
                cgc.quiet = 1;
-               cgc.data_direction = SCSI_DATA_READ;
+               cgc.data_direction = DMA_FROM_DEVICE;
                cgc.timeout = VENDOR_TIMEOUT;
                rc = sr_do_ioctl(cd, &cgc);
                if (rc != 0) {