mirror of
https://github.com/LIV2/lide.device.git
synced 2025-12-06 00:32:45 +00:00
Compact Unit struct some more
This commit is contained in:
parent
6696cadfd2
commit
244e137d68
70
ata.c
70
ata.c
@ -160,7 +160,7 @@ bool ata_select(struct IDEUnit *unit, UBYTE select, bool wait)
|
||||
bool changed = false;
|
||||
volatile UBYTE *shadowDevHead = unit->shadowDevHead;
|
||||
|
||||
if (!unit->lba) select &= ~(0x40);
|
||||
if (!unit->flags.lba) select &= ~(0x40);
|
||||
|
||||
if (*shadowDevHead == select) {
|
||||
return false;
|
||||
@ -193,7 +193,7 @@ bool ata_select(struct IDEUnit *unit, UBYTE select, bool wait)
|
||||
*/
|
||||
bool ata_identify(struct IDEUnit *unit, UWORD *buffer)
|
||||
{
|
||||
UBYTE drvSel = (unit->primary) ? 0xE0 : 0xF0; // Select drive
|
||||
UBYTE drvSel = (unit->flags.primary) ? 0xE0 : 0xF0; // Select drive
|
||||
|
||||
ata_select(unit,drvSel,false);
|
||||
|
||||
@ -348,12 +348,12 @@ void ata_set_xfer(struct IDEUnit *unit, enum xfer method) {
|
||||
bool ata_init_unit(struct IDEUnit *unit, void *base) {
|
||||
struct ExecBase *SysBase = unit->SysBase;
|
||||
|
||||
unit->cylinders = 0;
|
||||
unit->heads = 0;
|
||||
unit->sectorsPerTrack = 0;
|
||||
unit->blockSize = 0;
|
||||
unit->present = false;
|
||||
unit->mediumPresent = false;
|
||||
unit->cylinders = 0;
|
||||
unit->heads = 0;
|
||||
unit->sectorsPerTrack = 0;
|
||||
unit->blockSize = 0;
|
||||
unit->flags.present = false;
|
||||
unit->flags.mediumPresent = false;
|
||||
|
||||
UWORD *buf;
|
||||
bool dev_found = false;
|
||||
@ -367,7 +367,7 @@ bool ata_init_unit(struct IDEUnit *unit, void *base) {
|
||||
unit->drive.devHead = (UBYTE*) (base + ata_reg_devHead);
|
||||
unit->drive.status_command = (UBYTE*) (base + ata_reg_status);
|
||||
|
||||
*unit->shadowDevHead = *unit->drive.devHead = (unit->primary) ? 0xE0 : 0xF0; // Select drive
|
||||
*unit->shadowDevHead = *unit->drive.devHead = (unit->flags.primary) ? 0xE0 : 0xF0; // Select drive
|
||||
|
||||
enum xfer method = ata_autoselect_xfer(unit);
|
||||
ata_set_xfer(unit,method);
|
||||
@ -393,20 +393,20 @@ bool ata_init_unit(struct IDEUnit *unit, void *base) {
|
||||
if (ata_identify(unit,buf) == true) {
|
||||
Info("INIT: ATA Drive found!\n");
|
||||
|
||||
unit->lba = (buf[ata_identify_capabilities] & ata_capability_lba) != 0;
|
||||
unit->cylinders = buf[ata_identify_cylinders];
|
||||
unit->heads = buf[ata_identify_heads];
|
||||
unit->sectorsPerTrack = buf[ata_identify_sectors];
|
||||
unit->blockSize = 512;
|
||||
unit->logicalSectors = buf[ata_identify_logical_sectors+1] << 16 | buf[ata_identify_logical_sectors];
|
||||
unit->blockShift = 0;
|
||||
unit->mediumPresent = true;
|
||||
unit->multipleCount = buf[ata_identify_multiple] & 0xFF;
|
||||
unit->flags.lba = (buf[ata_identify_capabilities] & ata_capability_lba) != 0;
|
||||
unit->cylinders = buf[ata_identify_cylinders];
|
||||
unit->heads = buf[ata_identify_heads];
|
||||
unit->sectorsPerTrack = buf[ata_identify_sectors];
|
||||
unit->blockSize = 512;
|
||||
unit->logicalSectors = buf[ata_identify_logical_sectors+1] << 16 | buf[ata_identify_logical_sectors];
|
||||
unit->blockShift = 0;
|
||||
unit->flags.mediumPresent = true;
|
||||
unit->multipleCount = buf[ata_identify_multiple] & 0xFF;
|
||||
|
||||
if (unit->multipleCount > 0 && (ata_set_multiple(unit,unit->multipleCount) == 0)) {
|
||||
unit->xferMultiple = true;
|
||||
unit->flags.xferMultiple = true;
|
||||
} else {
|
||||
unit->xferMultiple = false;
|
||||
unit->flags.xferMultiple = false;
|
||||
unit->multipleCount = 1;
|
||||
}
|
||||
|
||||
@ -418,13 +418,13 @@ bool ata_init_unit(struct IDEUnit *unit, void *base) {
|
||||
goto ident_failed;
|
||||
}
|
||||
|
||||
unit->lba48 = true;
|
||||
unit->flags.lba48 = true;
|
||||
Info("INIT: Drive supports LBA48 mode \n");
|
||||
unit->logicalSectors = (buf[ata_identify_lba48_sectors + 1] << 16 |
|
||||
buf[ata_identify_lba48_sectors]);
|
||||
unit->write_taskfile = &write_taskfile_lba48;
|
||||
|
||||
} else if (unit->lba == true) {
|
||||
} else if (unit->flags.lba == true) {
|
||||
// LBA-28 up to 127GB
|
||||
unit->write_taskfile = &write_taskfile_lba;
|
||||
|
||||
@ -462,7 +462,7 @@ bool ata_init_unit(struct IDEUnit *unit, void *base) {
|
||||
Info("INIT: ATAPI Drive found!\n");
|
||||
|
||||
unit->deviceType = (buf[0] >> 8) & 0x1F;
|
||||
unit->atapi = true;
|
||||
unit->flags.atapi = true;
|
||||
|
||||
atapi_test_unit_ready(unit,true); // Clear the Unit attention check condition
|
||||
} else {
|
||||
@ -474,14 +474,14 @@ ident_failed:
|
||||
}
|
||||
}
|
||||
|
||||
if (unit->atapi == false && unit->blockSize == 0) {
|
||||
if (unit->flags.atapi == false && unit->blockSize == 0) {
|
||||
Warn("INIT: Error! blockSize is 0\n");
|
||||
if (buf) FreeMem(buf,512);
|
||||
return false;
|
||||
}
|
||||
|
||||
Info("INIT: Blockshift: %ld\n",unit->blockShift);
|
||||
unit->present = true;
|
||||
unit->flags.present = true;
|
||||
|
||||
Info("INIT: LBAs %ld Blocksize: %ld\n",unit->logicalSectors,unit->blockSize);
|
||||
|
||||
@ -498,7 +498,7 @@ ident_failed:
|
||||
* @return non-zero on error
|
||||
*/
|
||||
bool ata_set_multiple(struct IDEUnit *unit, BYTE multiple) {
|
||||
UBYTE drvSel = (unit->primary) ? 0xE0 : 0xF0; // Select drive
|
||||
UBYTE drvSel = (unit->flags.primary) ? 0xE0 : 0xF0; // Select drive
|
||||
|
||||
ata_select(unit,drvSel,true);
|
||||
|
||||
@ -550,10 +550,10 @@ BYTE ata_read(void *buffer, ULONG lba, ULONG count, struct IDEUnit *unit) {
|
||||
UBYTE multipleCount = unit->multipleCount;
|
||||
volatile void *dataRegister = unit->drive.data;
|
||||
|
||||
if (unit->lba48) {
|
||||
if (unit->flags.lba48) {
|
||||
command = ATA_CMD_READ_MULTIPLE_EXT;
|
||||
} else {
|
||||
command = (unit->xferMultiple) ? ATA_CMD_READ_MULTIPLE : ATA_CMD_READ;
|
||||
command = (unit->flags.xferMultiple) ? ATA_CMD_READ_MULTIPLE : ATA_CMD_READ;
|
||||
}
|
||||
|
||||
ata_xfer_func ata_xfer;
|
||||
@ -565,7 +565,7 @@ BYTE ata_read(void *buffer, ULONG lba, ULONG count, struct IDEUnit *unit) {
|
||||
ata_xfer = unit->read_fast;
|
||||
}
|
||||
|
||||
UBYTE drvSel = (unit->primary) ? 0xE0 : 0xF0;
|
||||
UBYTE drvSel = (unit->flags.primary) ? 0xE0 : 0xF0;
|
||||
|
||||
ata_select(unit,drvSel,true);
|
||||
|
||||
@ -639,10 +639,10 @@ BYTE ata_write(void *buffer, ULONG lba, ULONG count, struct IDEUnit *unit) {
|
||||
UBYTE multipleCount = unit->multipleCount;
|
||||
volatile void *dataRegister = unit->drive.data;
|
||||
|
||||
if (unit->lba48) {
|
||||
if (unit->flags.lba48) {
|
||||
command = ATA_CMD_WRITE_MULTIPLE_EXT;
|
||||
} else {
|
||||
command = (unit->xferMultiple) ? ATA_CMD_WRITE_MULTIPLE : ATA_CMD_WRITE;
|
||||
command = (unit->flags.xferMultiple) ? ATA_CMD_WRITE_MULTIPLE : ATA_CMD_WRITE;
|
||||
}
|
||||
|
||||
ata_xfer_func ata_xfer;
|
||||
@ -654,7 +654,7 @@ BYTE ata_write(void *buffer, ULONG lba, ULONG count, struct IDEUnit *unit) {
|
||||
ata_xfer = unit->write_fast;
|
||||
}
|
||||
|
||||
UBYTE drvSel = (unit->primary) ? 0xE0 : 0xF0;
|
||||
UBYTE drvSel = (unit->flags.primary) ? 0xE0 : 0xF0;
|
||||
|
||||
ata_select(unit,drvSel,true);
|
||||
|
||||
@ -758,7 +758,7 @@ static BYTE write_taskfile_chs(struct IDEUnit *unit, UBYTE command, ULONG lba, U
|
||||
if (!ata_wait_ready(unit,ATA_RDY_WAIT_COUNT))
|
||||
return HFERR_SelTimeout;
|
||||
|
||||
devHead = ((unit->primary) ? 0xA0 : 0xB0) | (head & 0x0F);
|
||||
devHead = ((unit->flags.primary) ? 0xA0 : 0xB0) | (head & 0x0F);
|
||||
|
||||
*unit->shadowDevHead = devHead;
|
||||
*unit->drive.devHead = devHead;
|
||||
@ -784,7 +784,7 @@ static BYTE write_taskfile_lba(struct IDEUnit *unit, UBYTE command, ULONG lba, U
|
||||
if (!ata_wait_ready(unit,ATA_RDY_WAIT_COUNT))
|
||||
return HFERR_SelTimeout;
|
||||
|
||||
devHead = ((unit->primary) ? 0xE0 : 0xF0) | ((lba >> 24) & 0x0F);
|
||||
devHead = ((unit->flags.primary) ? 0xE0 : 0xF0) | ((lba >> 24) & 0x0F);
|
||||
|
||||
*unit->shadowDevHead = devHead;
|
||||
*unit->drive.devHead = devHead;
|
||||
@ -918,7 +918,7 @@ BYTE scsi_ata_passthrough(struct IDEUnit *unit, struct SCSICmd *cmd) {
|
||||
|
||||
count += (count & 1); // Ensure byte count is even
|
||||
|
||||
UBYTE drvSel = (unit->primary) ? 0xE0 : 0xF0;
|
||||
UBYTE drvSel = (unit->flags.primary) ? 0xE0 : 0xF0;
|
||||
|
||||
ata_select(unit,drvSel,true);
|
||||
|
||||
|
||||
12
atapi.c
12
atapi.c
@ -206,7 +206,7 @@ bool atapi_check_signature(struct IDEUnit *unit) {
|
||||
*/
|
||||
bool atapi_identify(struct IDEUnit *unit, UWORD *buffer) {
|
||||
|
||||
UBYTE drvSel = (unit->primary) ? 0xE0 : 0xF0; // Select drive
|
||||
UBYTE drvSel = (unit->flags.primary) ? 0xE0 : 0xF0; // Select drive
|
||||
|
||||
// Only update the devHead register if absolutely necessary to save time
|
||||
ata_select(unit,drvSel,false);
|
||||
@ -410,7 +410,7 @@ BYTE atapi_packet(struct SCSICmd *cmd, struct IDEUnit *unit) {
|
||||
|
||||
cmd->scsi_Actual = 0;
|
||||
|
||||
UBYTE drvSelHead = ((unit->primary) ? 0xE0 : 0xF0);
|
||||
UBYTE drvSelHead = ((unit->flags.primary) ? 0xE0 : 0xF0);
|
||||
|
||||
// Only update the devHead register if absolutely necessary to save time
|
||||
ata_select(unit,drvSelHead,true);
|
||||
@ -1119,14 +1119,14 @@ BYTE atapi_check_wp(struct IDEUnit *unit) {
|
||||
*/
|
||||
bool atapi_update_presence(struct IDEUnit *unit, bool present) {
|
||||
bool ret = false;
|
||||
if (present && unit->mediumPresent == false) {
|
||||
if (present && unit->flags.mediumPresent == false) {
|
||||
unit->changeCount++;
|
||||
unit->mediumPresent = true;
|
||||
unit->flags.mediumPresent = true;
|
||||
atapi_get_capacity(unit);
|
||||
ret = true;
|
||||
} else if (!present && unit->mediumPresent == true) {
|
||||
} else if (!present && unit->flags.mediumPresent == true) {
|
||||
unit->changeCount++;
|
||||
unit->mediumPresent = false;
|
||||
unit->flags.mediumPresent = false;
|
||||
unit->logicalSectors = 0;
|
||||
unit->blockShift = 0;
|
||||
unit->blockSize = 0;
|
||||
|
||||
6
device.c
6
device.c
@ -549,7 +549,7 @@ static void open(struct DeviceBase *dev asm("a6"), struct IORequest *ioreq asm("
|
||||
|
||||
ReleaseSemaphore(&dev->ulSem);
|
||||
|
||||
if (found == false || unit->present == false) {
|
||||
if (found == false || unit->flags.present == false) {
|
||||
error = TDERR_BadUnitNum;
|
||||
goto exit;
|
||||
}
|
||||
@ -608,7 +608,7 @@ static void td_get_geometry(struct IOStdReq *ioreq) {
|
||||
geometry->dg_TrackSectors = unit->sectorsPerTrack;
|
||||
geometry->dg_BufMemType = MEMF_PUBLIC;
|
||||
geometry->dg_DeviceType = unit->deviceType;
|
||||
geometry->dg_Flags = (unit->atapi) ? DGF_REMOVABLE : 0;
|
||||
geometry->dg_Flags = (unit->flags.atapi) ? DGF_REMOVABLE : 0;
|
||||
|
||||
ioreq->io_Actual = sizeof(struct DriveGeometry);
|
||||
}
|
||||
@ -791,7 +791,7 @@ static void begin_io(struct DeviceBase *dev asm("a6"), struct IOStdReq *ioreq as
|
||||
case CMD_START:
|
||||
case CMD_STOP:
|
||||
// Don't pass it to the task if it's not an atapi device
|
||||
if (!unit->atapi) {
|
||||
if (!unit->flags.atapi) {
|
||||
error = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
18
device.h
18
device.h
@ -58,14 +58,6 @@ struct IDEUnit {
|
||||
UBYTE unitNum;
|
||||
UBYTE deviceType;
|
||||
UBYTE last_error[6];
|
||||
bool primary;
|
||||
bool present;
|
||||
bool atapi;
|
||||
bool mediumPresent;
|
||||
bool mediumPresentPrev;
|
||||
bool xferMultiple;
|
||||
bool lba;
|
||||
bool lba48;
|
||||
UWORD openCount;
|
||||
UWORD changeCount;
|
||||
UWORD heads;
|
||||
@ -76,6 +68,16 @@ struct IDEUnit {
|
||||
ULONG logicalSectors;
|
||||
struct MinList changeInts;
|
||||
UBYTE multipleCount;
|
||||
struct {
|
||||
unsigned char primary : 1;
|
||||
unsigned char present : 1;
|
||||
unsigned char atapi : 1;
|
||||
unsigned char mediumPresent : 1;
|
||||
unsigned char mediumPresentPrev : 1;
|
||||
unsigned char xferMultiple : 1;
|
||||
unsigned char lba : 1;
|
||||
unsigned char lba48 : 1;
|
||||
} flags;
|
||||
};
|
||||
|
||||
struct DeviceBase {
|
||||
|
||||
56
idetask.c
56
idetask.c
@ -267,7 +267,7 @@ static BYTE handle_scsi_command(struct IOStdReq *ioreq) {
|
||||
|
||||
Trace("SCSI: Command %lx\n",*scsi_command->scsi_Command);
|
||||
|
||||
if (unit->atapi == false)
|
||||
if (unit->flags.atapi == false)
|
||||
{
|
||||
// Non-ATAPI drives - Translate SCSI CMD to ATA
|
||||
switch (scsi_command->scsi_Command[0]) {
|
||||
@ -425,21 +425,21 @@ static BYTE init_units(struct IDETask *itask) {
|
||||
|
||||
if (unit != NULL) {
|
||||
// Setup each unit structure
|
||||
unit->itask = itask;
|
||||
unit->unitNum = ((itask->boardNum * 4) + (itask->channel << 1) + i);
|
||||
unit->SysBase = SysBase;
|
||||
unit->primary = ((i%2) == 1) ? false : true;
|
||||
unit->openCount = 0;
|
||||
unit->changeCount = 1;
|
||||
unit->deviceType = DG_DIRECT_ACCESS;
|
||||
unit->mediumPresent = false;
|
||||
unit->mediumPresentPrev = false;
|
||||
unit->present = false;
|
||||
unit->atapi = false;
|
||||
unit->xferMultiple = false;
|
||||
unit->multipleCount = 0;
|
||||
unit->shadowDevHead = &itask->shadowDevHead;
|
||||
*unit->shadowDevHead = 0;
|
||||
unit->itask = itask;
|
||||
unit->unitNum = ((itask->boardNum * 4) + (itask->channel << 1) + i);
|
||||
unit->SysBase = SysBase;
|
||||
unit->flags.primary = ((i%2) == 1) ? false : true;
|
||||
unit->openCount = 0;
|
||||
unit->changeCount = 1;
|
||||
unit->deviceType = DG_DIRECT_ACCESS;
|
||||
unit->flags.mediumPresent = false;
|
||||
unit->flags.mediumPresentPrev = false;
|
||||
unit->flags.present = false;
|
||||
unit->flags.atapi = false;
|
||||
unit->flags.xferMultiple = false;
|
||||
unit->multipleCount = 0;
|
||||
unit->shadowDevHead = &itask->shadowDevHead;
|
||||
*unit->shadowDevHead = 0;
|
||||
|
||||
// Initialize the change int list
|
||||
unit->changeInts.mlh_Tail = NULL;
|
||||
@ -452,7 +452,7 @@ static BYTE init_units(struct IDETask *itask) {
|
||||
base += (itask->channel == 0) ? CHANNEL_0 : CHANNEL_1;
|
||||
|
||||
if (ata_init_unit(unit,base)) {
|
||||
if (unit->atapi) itask->hasRemovables = true;
|
||||
if (unit->flags.atapi) itask->hasRemovables = true;
|
||||
num_units++;
|
||||
itask->dev->numUnits++;
|
||||
dev->highestUnit = unit->unitNum;
|
||||
@ -526,11 +526,11 @@ static void diskchange_check(struct IDETask *itask) {
|
||||
unit->mn_Node.mln_Succ != NULL;
|
||||
unit = (struct IDEUnit *)unit->mn_Node.mln_Succ)
|
||||
{
|
||||
if (unit->present && unit->atapi) {
|
||||
if (unit->flags.present && unit->flags.atapi) {
|
||||
|
||||
present = (atapi_test_unit_ready(unit,true) == 0) ? true : false;
|
||||
|
||||
if (present != unit->mediumPresentPrev) {
|
||||
if (present != unit->flags.mediumPresentPrev) {
|
||||
|
||||
Forbid();
|
||||
if (unit->changeInt != NULL)
|
||||
@ -547,7 +547,7 @@ static void diskchange_check(struct IDETask *itask) {
|
||||
Permit();
|
||||
}
|
||||
|
||||
unit->mediumPresentPrev = present;
|
||||
unit->flags.mediumPresentPrev = present;
|
||||
|
||||
|
||||
}
|
||||
@ -587,23 +587,23 @@ static void process_ioreq(struct IDETask *itask, struct IOStdReq *ioreq) {
|
||||
return;
|
||||
|
||||
case CMD_START:
|
||||
if (unit->atapi) {
|
||||
if (unit->flags.atapi) {
|
||||
error = atapi_start_stop_unit(unit,true,false,false);
|
||||
}
|
||||
break;
|
||||
|
||||
case CMD_STOP:
|
||||
if (unit->atapi) {
|
||||
if (unit->flags.atapi) {
|
||||
error = atapi_start_stop_unit(unit,false,false,false);
|
||||
}
|
||||
break;
|
||||
|
||||
case TD_EJECT:
|
||||
if (!unit->atapi) {
|
||||
if (!unit->flags.atapi) {
|
||||
error = IOERR_NOCMD;
|
||||
break;
|
||||
}
|
||||
ioreq->io_Actual = (unit->mediumPresent) ? 0 : 1; // io_Actual reflects the previous state
|
||||
ioreq->io_Actual = (unit->flags.mediumPresent) ? 0 : 1; // io_Actual reflects the previous state
|
||||
|
||||
bool insert = (ioreq->io_Length == 0) ? true : false;
|
||||
|
||||
@ -613,7 +613,7 @@ static void process_ioreq(struct IDETask *itask, struct IOStdReq *ioreq) {
|
||||
case TD_CHANGESTATE:
|
||||
error = 0;
|
||||
ioreq->io_Actual = 0;
|
||||
if (unit->atapi) {
|
||||
if (unit->flags.atapi) {
|
||||
ioreq->io_Actual = (atapi_test_unit_ready(unit,false) != 0);
|
||||
break;
|
||||
}
|
||||
@ -621,7 +621,7 @@ static void process_ioreq(struct IDETask *itask, struct IOStdReq *ioreq) {
|
||||
|
||||
case TD_PROTSTATUS:
|
||||
error = 0;
|
||||
if (unit->atapi) {
|
||||
if (unit->flags.atapi) {
|
||||
if ((error = atapi_check_wp(unit)) == TDERR_WriteProt) {
|
||||
error = 0;
|
||||
ioreq->io_Actual = 1;
|
||||
@ -662,7 +662,7 @@ validate_etd:
|
||||
case NSCMD_TD_FORMAT64:
|
||||
direction = WRITE;
|
||||
transfer:
|
||||
if (unit->atapi == true && unit->mediumPresent == false) {
|
||||
if (unit->flags.atapi == true && unit->flags.mediumPresent == false) {
|
||||
Trace("Access attempt without media\n");
|
||||
error = TDERR_DiskChanged;
|
||||
break;
|
||||
@ -683,7 +683,7 @@ transfer:
|
||||
break;
|
||||
}
|
||||
|
||||
if (unit->atapi == true) {
|
||||
if (unit->flags.atapi == true) {
|
||||
error = atapi_translate(ioreq->io_Data, lba, count, &ioreq->io_Actual, unit, direction);
|
||||
} else {
|
||||
if (direction == READ) {
|
||||
|
||||
@ -161,14 +161,14 @@ static void DumpUnit(struct IOStdReq *req) {
|
||||
|
||||
printf("Device Type: %d\n", unit->deviceType);
|
||||
printf("Transfer method: %d\n", unit->xferMethod);
|
||||
printf("Primary: %s\n", (unit->primary) ? "Yes" : "No");
|
||||
printf("ATAPI: %s\n", (unit->atapi) ? "Yes" : "No");
|
||||
printf("Medium Present: %s\n", (unit->mediumPresent) ? "Yes" : "No");
|
||||
printf("Supports LBA: %s\n", (unit->lba) ? "Yes" : "No");
|
||||
printf("Supports LBA48: %s\n", (unit->lba48) ? "Yes" : "No");
|
||||
printf("Primary: %s\n", (unit->flags.primary) ? "Yes" : "No");
|
||||
printf("ATAPI: %s\n", (unit->flags.atapi) ? "Yes" : "No");
|
||||
printf("Medium Present: %s\n", (unit->flags.mediumPresent) ? "Yes" : "No");
|
||||
printf("Supports LBA: %s\n", (unit->flags.lba) ? "Yes" : "No");
|
||||
printf("Supports LBA48: %s\n", (unit->flags.lba48) ? "Yes" : "No");
|
||||
printf("C/H/S: %d/%d/%d\n", unit->cylinders, unit->heads, unit->sectorsPerTrack);
|
||||
printf("Logical Sectors: %ld\n", (long int)unit->logicalSectors);
|
||||
printf("READ/WRITE Multiple: %s\n", (unit->xferMultiple) ? "Yes" : "No");
|
||||
printf("READ/WRITE Multiple: %s\n", (unit->flags.xferMultiple) ? "Yes" : "No");
|
||||
printf("Multiple count: %d\n", unit->multipleCount);
|
||||
printf("Last Error: ");
|
||||
for (int i=0; i<6; i++) {
|
||||
@ -298,12 +298,12 @@ static void setMultiple(struct IOStdReq *req, int multiple) {
|
||||
struct IDEUnit *unit = (struct IDEUnit *)req->io_Unit;
|
||||
|
||||
if (multiple > 0) {
|
||||
unit->xferMultiple = true;
|
||||
unit->flags.xferMultiple = true;
|
||||
unit->multipleCount = multiple;
|
||||
printf("set multiple transfer: %d\n",multiple);
|
||||
} else {
|
||||
printf("Transfer multiple disabled.\n");
|
||||
unit->xferMultiple = false;
|
||||
unit->flags.xferMultiple = false;
|
||||
unit->multipleCount = 1;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user