37 #include <linux/cdrom.h>
38 #include <linux/errno.h>
39 #include <linux/string.h>
42 #include <linux/slab.h>
44 #include <scsi/scsi.h>
58 #define VENDOR_SCSI3 1
61 #define VENDOR_TOSHIBA 3
62 #define VENDOR_WRITER 4
64 #define VENDOR_TIMEOUT 30*HZ
68 #ifndef CONFIG_BLK_DEV_SR_VENDOR
83 }
else if (!
strncmp(vendor,
"NEC", 3)) {
85 if (!
strncmp(model,
"CD-ROM DRIVE:25", 15) ||
86 !
strncmp(model,
"CD-ROM DRIVE:36", 15) ||
87 !
strncmp(model,
"CD-ROM DRIVE:83", 15) ||
88 !
strncmp(model,
"CD-ROM DRIVE:84 ", 16)
92 || !
strncmp(model,
"CD-ROM DRIVE:500", 16)
98 }
else if (!
strncmp(vendor,
"TOSHIBA", 7)) {
116 #ifdef CONFIG_BLK_DEV_SR_VENDOR
118 density = (blocklength > 2048) ? 0x81 : 0x83;
126 printk(
"%s: MODE SELECT 0x%x/%d\n", cd->
cdi.name, density, blocklength);
130 cgc.
cmd[1] = (1 << 4);
133 memset(modesel, 0,
sizeof(*modesel));
139 cgc.
buflen =
sizeof(*modesel);
143 cd->
device->sector_size = blocklength;
147 printk(
"%s: switching blocklength to %d bytes failed\n",
148 cd->
cdi.name, blocklength);
192 if ((buffer[0] << 8) + buffer[1] < 0x0a) {
194 "doesn't support multisession CD's\n", cd->
cdi.name);
198 sector = buffer[11] + (buffer[10] << 8) +
199 (buffer[9] << 16) + (buffer[8] << 24);
200 if (buffer[6] <= 1) {
206 #ifdef CONFIG_BLK_DEV_SR_VENDOR
220 if (buffer[14] != 0 && buffer[14] != 0xb0) {
222 "doesn't support multisession CD's\n",
249 "doesn't support multisession CD's\n",
279 if ((rc = buffer[2]) == 0) {
281 "%s: No finished session\n", cd->
cdi.name);
285 cgc.
cmd[6] = rc & 0x7f;
297 sector = buffer[11] + (buffer[10] << 8) +
298 (buffer[9] << 16) + (buffer[8] << 24);
305 "%s: unknown vendor code (%i), not initialized ?\n",
316 if (2048 != cd->
device->sector_size) {
325 cd->
cdi.name, sector);