*/
#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 <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
#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;
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;
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)
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)
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) {
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) {
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) {