Lines Matching +full:rom +full:- +full:15 +full:h
1 // SPDX-License-Identifier: GPL-2.0
2 /* -*-linux-c-*-
4 * vendor-specific code for SCSI CD-ROM's goes here.
7 * the like) are too new to be included into the SCSI-II standard (to
10 * Aug 1997: Ha! Got a SCSI-3 cdrom spec across my fingers. SCSI-3 does
13 * Rearranged stuff here: SCSI-3 is included allways, support
16 * Gerd Knorr <kraxel@cs.tu-berlin.de>
18 * --------------------------------------------------------------------------
20 * support for XA/multisession-CD's
22 * - NEC: Detection and support of multisession CD's.
24 * - TOSHIBA: Detection and support of multisession CD's.
25 * Some XA-Sector tweaking, required for older drives.
27 * - SONY: Detection and support of multisession CD's.
30 * - PIONEER, HITACHI, PLEXTOR, MATSHITA, TEAC, PHILIPS: known to
33 * - HP: Much like SONY, but a little different... (Thomas)
34 * HP-Writers only ??? Maybe other CD-Writers work with this too ?
38 #include <linux/cdrom.h>
39 #include <linux/errno.h>
40 #include <linux/string.h>
41 #include <linux/bcd.h>
42 #include <linux/blkdev.h>
43 #include <linux/slab.h>
45 #include <scsi/scsi.h>
46 #include <scsi/scsi_cmnd.h>
47 #include <scsi/scsi_device.h>
48 #include <scsi/scsi_host.h>
49 #include <scsi/scsi_ioctl.h>
51 #include "sr.h"
59 #define VENDOR_SCSI3 1 /* default: scsi-3 mmc */
63 #define VENDOR_WRITER 4 /* pre-scsi3 writers */
64 #define VENDOR_CYGNAL_85ED 5 /* CD-on-a-chip */
70 const char *vendor = cd->device->vendor; in sr_vendor_init()
71 const char *model = cd->device->model; in sr_vendor_init()
74 cd->vendor = VENDOR_SCSI3; in sr_vendor_init()
75 if (cd->readcd_known) in sr_vendor_init()
76 /* this is true for scsi3/mmc drives - no more checks */ in sr_vendor_init()
79 if (cd->device->type == TYPE_WORM) { in sr_vendor_init()
80 cd->vendor = VENDOR_WRITER; in sr_vendor_init()
83 cd->vendor = VENDOR_NEC; in sr_vendor_init()
84 if (!strncmp(model, "CD-ROM DRIVE:25", 15) || in sr_vendor_init()
85 !strncmp(model, "CD-ROM DRIVE:36", 15) || in sr_vendor_init()
86 !strncmp(model, "CD-ROM DRIVE:83", 15) || in sr_vendor_init()
87 !strncmp(model, "CD-ROM DRIVE:84 ", 16) in sr_vendor_init()
89 /* my NEC 3x returns the read-raw data if a read-raw in sr_vendor_init()
90 is followed by a read for the same sector - aeb */ in sr_vendor_init()
91 || !strncmp(model, "CD-ROM DRIVE:500", 16) in sr_vendor_init()
95 cd->cdi.mask |= CDC_MULTI_SESSION; in sr_vendor_init()
98 cd->vendor = VENDOR_TOSHIBA; in sr_vendor_init()
102 /* The Beurer GL50 evo uses a Cygnal-manufactured CD-on-a-chip in sr_vendor_init()
104 not-implemented commands are fine to fail, but a few, in sr_vendor_init()
109 cd->vendor = VENDOR_CYGNAL_85ED; in sr_vendor_init()
110 cd->cdi.mask |= ( in sr_vendor_init()
131 if (cd->vendor == VENDOR_TOSHIBA) in sr_set_blocklength()
136 return -ENOMEM; in sr_set_blocklength()
147 modesel->block_desc_length = 0x08; in sr_set_blocklength()
148 modesel->density = density; in sr_set_blocklength()
149 modesel->block_length_med = (blocklength >> 8) & 0xff; in sr_set_blocklength()
150 modesel->block_length_lo = blocklength & 0xff; in sr_set_blocklength()
156 cd->device->sector_size = blocklength; in sr_set_blocklength()
173 Scsi_CD *cd = cdi->handle; in sr_cd_check()
179 if (cd->cdi.mask & CDC_MULTI_SESSION) in sr_cd_check()
184 return -ENOMEM; in sr_cd_check()
192 switch (cd->vendor) { in sr_cd_check()
240 min = bcd2bin(buffer[15]); in sr_cd_check()
250 /* we request some disc information (is it a XA-CD ?, in sr_cd_check()
260 if (rc == -EINVAL) { in sr_cd_check()
273 sector -= CD_MSF_OFFSET; in sr_cd_check()
317 cd->vendor); in sr_cd_check()
322 cd->ms_offset = sector; in sr_cd_check()
323 cd->xa_flag = 0; in sr_cd_check()
325 cd->xa_flag = 1; in sr_cd_check()
327 if (2048 != cd->device->sector_size) { in sr_cd_check()
331 cdi->mask |= CDC_MULTI_SESSION; in sr_cd_check()