mirror of
https://github.com/LIV2/lide.device.git
synced 2025-12-06 00:32:45 +00:00
ATA: Implement PMI for SCSI READ CAPACITY
Implementing PMI for READ CAPACITY gets rid of the "cannot find track size, assuming 68" error in HDToolbox
This commit is contained in:
parent
5212f4c30d
commit
58d8e9a524
13
idetask.c
13
idetask.c
@ -76,9 +76,20 @@ static BYTE scsi_read_capaity_ata(struct IDEUnit *unit, struct SCSICmd *scsi_com
|
||||
return error;
|
||||
}
|
||||
|
||||
data->lba = (unit->logicalSectors) - 1;
|
||||
struct SCSI_READ_CAPACITY_10 *cdb = (struct SCSI_READ_CAPACITY_10 *)scsi_command->scsi_Command;
|
||||
|
||||
data->block_size = unit->blockSize;
|
||||
|
||||
if (cdb->flags & 0x01) {
|
||||
// Partial Medium Indicator - Return end of cylinder
|
||||
// Implement this so HDToolbox stops moaning about track size
|
||||
ULONG spc = unit->cylinders * unit->heads;
|
||||
data->lba = (((cdb->lba / spc) + 1) * spc) - 1;
|
||||
} else {
|
||||
data->lba = (unit->logicalSectors) - 1;
|
||||
}
|
||||
|
||||
|
||||
scsi_command->scsi_Actual = 8;
|
||||
|
||||
return 0;
|
||||
|
||||
9
scsi.h
9
scsi.h
@ -47,6 +47,15 @@ struct __attribute__((packed)) SCSI_CDB_10 {
|
||||
UBYTE control;
|
||||
};
|
||||
|
||||
struct __attribute__((packed)) SCSI_READ_CAPACITY_10 {
|
||||
UBYTE operation;
|
||||
UBYTE reserved1;
|
||||
ULONG lba;
|
||||
UWORD reserved2;
|
||||
UBYTE flags;
|
||||
UBYTE control;
|
||||
};
|
||||
|
||||
struct __attribute__((packed)) SCSI_CAPACITY_10 {
|
||||
ULONG lba;
|
||||
ULONG block_size;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user