This section describes two device-specific driver gestalt status calls, ReturnDeviceID and GetCDDeviceInfo.
A status call with a csCode value of 120 returns the DeviceIdent value for the primary SCSI device being controlled by a driver. SCSI drivers that set the driverGestaltEnable bit must implement this csCode value as described or return statusErr.
A status call with a csCode value of 121 determines the features of a particular CD-ROM drive. Before Apple's CD-ROM driver version 5.0, this was done using the GetDriveType status call, which returned a specific model of CD-ROM drive. This makes client code difficult to maintain since it must be modified each time a new CD-ROM drive is introduced. To alleviate this problem, the features of the device have been encoded in testable bits. An integer containing the sustained transfer rate of the drive relative to an AppleCD 150 is also included. This information is returned in the CDDeviceCharacteristics structure. CD-ROM drivers that set the driverGestaltEnable bit must either implement this csCode value or return statusErr.
struct CDDeviceCharacteristics
{
UInt8 speedMajor; /* high byte of fixed-point number
for drive speed */
UInt8 speedMinor; /* low byte of "" CD 300 == 2.2,
CD_SC == 1.0 etc. */
UInt16 cdFeatures; /* flags for features of drive */
};
enum /* flags for CD features field (cdFeatures) */
{
cdPowerInject = 0, /* supports power inject of media */
cdNotPowerEject = 1, /* no power eject of media */
cdMute = 2, /* audio channels can be muted;
audio play mode = 00xxb or xx00b */
/* bits 3 and 4 are reserved */
cdLeftPlusRight = 5, /* left, right channels can be mixed;
audio play mode = 11xxb or xx11b */
/* bits 6 through 9 are reserved */
cdSCSI2 = 10, /* supports SCSI-2 CD-ROM cmd set */
cdStereoVolume = 11, /* supports independent volume levels
for each audio channel */
cdDisconnect = 12, /* drive supports SCSI disconnect/
reconnect */
cdWriteOnce = 13, /* drive is a write/once (CD-R) type;
bits 14 and 15 are reserved */
cdPowerInjectMask = 1 << cdPowerInject,
cdNotPowerEjectMask = 1 << cdNotPowerEject,
cdMuteMask = 1 << cdMute,
cdLeftPlusRightMask = 1 << cdLeftPlusRight,
cdSCSI2Mask = 1 << cdSCSI_2,
cdStereoVolumeMask = 1 << cdStereoVolume,
cdDisconnectMask = 1 << cdDisconnect,
cdWriteOnceMask = 1 << cdWriteOnce
};