Various SCSI devices register state items by their disk ID, which are not unique across device types. This introduces a device-type offset for CD-ROMs so their registrations don't clash with harddisks.

This commit is contained in:
R. Belmont 2008-03-31 03:04:34 +00:00
parent cb87356d5c
commit 2a869f8673
2 changed files with 8 additions and 3 deletions

View File

@ -735,14 +735,14 @@ static int scsicd_dispatch(int operation, void *file, INT64 intparm, void *ptrpa
case SCSIOP_READ_DATA:
scsicd_read_data( file, ptrparm, intparm );
return 0;
case SCSIOP_WRITE_DATA:
scsicd_write_data( file, ptrparm, intparm );
return 0;
case SCSIOP_ALLOC_INSTANCE:
SCSIBase( &SCSIClassCDROM, operation, file, intparm, ptrparm );
scsicd_alloc_instance( *((SCSIInstance **) ptrparm), intparm );
SCSIBase( &SCSIClassCDROM, operation, file, intparm + SCSI_DEVICE_CDROM_STATE_BASE, ptrparm );
scsicd_alloc_instance( *((SCSIInstance **) ptrparm), intparm + SCSI_DEVICE_CDROM_STATE_BASE );
return 0;
case SCSIOP_DELETE_INSTANCE:

View File

@ -13,5 +13,10 @@
extern const SCSIClass SCSIClassCDROM;
#define SCSI_DEVICE_CDROM &SCSIClassCDROM
// we pass in the disk ID for each SCSI device, but that's not unique across device types.
// to avoid collisions, each non-HDD SCSI device type should have it's own BASE to prevent
// this problem.
#define SCSI_DEVICE_CDROM_STATE_BASE (32)
#endif