Source
x
// SPDX-License-Identifier: GPL-2.0
/* -*-linux-c-*-
* vendor-specific code for SCSI CD-ROM's goes here.
*
* This is needed becauce most of the new features (multisession and
* the like) are too new to be included into the SCSI-II standard (to
* be exact: there is'nt anything in my draft copy).
*
* Aug 1997: Ha! Got a SCSI-3 cdrom spec across my fingers. SCSI-3 does
* multisession using the READ TOC command (like SONY).
*
* Rearranged stuff here: SCSI-3 is included allways, support
* for NEC/TOSHIBA/HP commands is optional.
*
* Gerd Knorr <kraxel@cs.tu-berlin.de>
*
* --------------------------------------------------------------------------
*
* support for XA/multisession-CD's
*
* - NEC: Detection and support of multisession CD's.
*
* - TOSHIBA: Detection and support of multisession CD's.
* Some XA-Sector tweaking, required for older drives.
*
* - SONY: Detection and support of multisession CD's.
* added by Thomas Quinot <thomas@cuivre.freenix.fr>
*
* - PIONEER, HITACHI, PLEXTOR, MATSHITA, TEAC, PHILIPS: known to
* work with SONY (SCSI3 now) code.
*
* - HP: Much like SONY, but a little different... (Thomas)
* HP-Writers only ??? Maybe other CD-Writers work with this too ?
* HP 6020 writers now supported.
*/
/* here are some constants to sort the vendors into groups */
/* default: scsi-3 mmc */
/* pre-scsi3 writers */
void sr_vendor_init(Scsi_CD *cd)
{
cd->vendor = VENDOR_SCSI3;
const char *vendor = cd->device->vendor;
const char *model = cd->device->model;
/* default */
cd->vendor = VENDOR_SCSI3;
if (cd->readcd_known)
/* this is true for scsi3/mmc drives - no more checks */
return;
if (cd->device->type == TYPE_WORM) {
cd->vendor = VENDOR_WRITER;
} else if (!strncmp(vendor, "NEC", 3)) {
cd->vendor = VENDOR_NEC;
if (!strncmp(model, "CD-ROM DRIVE:25", 15) ||
!strncmp(model, "CD-ROM DRIVE:36", 15) ||
!strncmp(model, "CD-ROM DRIVE:83", 15) ||
!strncmp(model, "CD-ROM DRIVE:84 ", 16)
/* my NEC 3x returns the read-raw data if a read-raw
is followed by a read for the same sector - aeb */