ATA: remove "actual" from ata read/write as it's not needed there

This commit is contained in:
Matt Harlum 2024-08-30 03:58:01 +00:00
parent 6fc2e7d8d4
commit fd4045635b
3 changed files with 10 additions and 14 deletions

8
ata.c
View File

@ -432,15 +432,13 @@ bool ata_set_multiple(struct IDEUnit *unit, BYTE multiple) {
* @param buffer destination buffer * @param buffer destination buffer
* @param lba LBA Address * @param lba LBA Address
* @param count Number of blocks to transfer * @param count Number of blocks to transfer
* @param actual Pointer to the io requests io_Actual
* @param unit Pointer to the unit structure * @param unit Pointer to the unit structure
* @returns error * @returns error
*/ */
BYTE ata_read(void *buffer, ULONG lba, ULONG count, ULONG *actual, struct IDEUnit *unit) { BYTE ata_read(void *buffer, ULONG lba, ULONG count, struct IDEUnit *unit) {
Trace("ata_read enter\n"); Trace("ata_read enter\n");
Trace("ATA: Request sector count: %ld\n",count); Trace("ATA: Request sector count: %ld\n",count);
*actual = 0;
UBYTE error = 0; UBYTE error = 0;
ULONG txn_count; // Amount of sectors to transfer in the current READ/WRITE command ULONG txn_count; // Amount of sectors to transfer in the current READ/WRITE command
@ -520,15 +518,13 @@ BYTE ata_read(void *buffer, ULONG lba, ULONG count, ULONG *actual, struct IDEUni
* @param buffer source buffer * @param buffer source buffer
* @param lba LBA Address * @param lba LBA Address
* @param count Number of blocks to transfer * @param count Number of blocks to transfer
* @param actual Pointer to the io requests io_Actual
* @param unit Pointer to the unit structure * @param unit Pointer to the unit structure
* @returns error * @returns error
*/ */
BYTE ata_write(void *buffer, ULONG lba, ULONG count, ULONG *actual, struct IDEUnit *unit) { BYTE ata_write(void *buffer, ULONG lba, ULONG count, struct IDEUnit *unit) {
Trace("ata_write enter\n"); Trace("ata_write enter\n");
Trace("ATA: Request sector count: %ld\n",count); Trace("ATA: Request sector count: %ld\n",count);
*actual = 0;
UBYTE error = 0; UBYTE error = 0;
ULONG txn_count; // Amount of sectors to transfer in the current READ/WRITE command ULONG txn_count; // Amount of sectors to transfer in the current READ/WRITE command

4
ata.h
View File

@ -95,8 +95,8 @@ bool ata_identify(struct IDEUnit *, UWORD *);
bool ata_set_multiple(struct IDEUnit *unit, BYTE multiple); bool ata_set_multiple(struct IDEUnit *unit, BYTE multiple);
void ata_set_xfer(struct IDEUnit *unit, enum xfer method); void ata_set_xfer(struct IDEUnit *unit, enum xfer method);
BYTE ata_read(void *buffer, ULONG lba, ULONG count, ULONG *actual, struct IDEUnit *unit); BYTE ata_read(void *buffer, ULONG lba, ULONG count, struct IDEUnit *unit);
BYTE ata_write(void *buffer, ULONG lba, ULONG count, ULONG *actual, struct IDEUnit *unit); BYTE ata_write(void *buffer, ULONG lba, ULONG count, struct IDEUnit *unit);
BYTE ata_set_pio(struct IDEUnit *unit, UBYTE pio); BYTE ata_set_pio(struct IDEUnit *unit, UBYTE pio);
BYTE scsi_ata_passthrough( struct IDEUnit *unit, struct SCSICmd *cmd); BYTE scsi_ata_passthrough( struct IDEUnit *unit, struct SCSICmd *cmd);

View File

@ -235,9 +235,9 @@ static BYTE handle_scsi_command(struct IOStdReq *ioreq) {
direction = (scsi_command->scsi_Flags & SCSIF_READ) ? READ : WRITE; direction = (scsi_command->scsi_Flags & SCSIF_READ) ? READ : WRITE;
if (direction == READ) { if (direction == READ) {
error = ata_read(data,lba,count,&scsi_command->scsi_Actual,unit); error = ata_read(data,lba,count,unit);
} else { } else {
error = ata_write(data,lba,count,&scsi_command->scsi_Actual,unit); error = ata_write(data,lba,count,unit);
} }
if (error == 0) { if (error == 0) {
scsi_command->scsi_Actual = scsi_command->scsi_Length; scsi_command->scsi_Actual = scsi_command->scsi_Length;
@ -479,7 +479,7 @@ static BYTE init_units(struct IDETask *itask) {
unit->changeInts.mlh_Head = (struct MinNode *)&unit->changeInts.mlh_Tail; unit->changeInts.mlh_Head = (struct MinNode *)&unit->changeInts.mlh_Tail;
unit->changeInts.mlh_TailPred = (struct MinNode *)&unit->changeInts; unit->changeInts.mlh_TailPred = (struct MinNode *)&unit->changeInts;
Warn("testing unit %08lx\n",i); Warn("testing unit %ld\n",unit->unitNum);
if (ata_init_unit(unit)) { if (ata_init_unit(unit)) {
num_units++; num_units++;
@ -692,11 +692,11 @@ transfer:
error = atapi_translate(ioreq->io_Data, lba, count, &ioreq->io_Actual, unit, direction); error = atapi_translate(ioreq->io_Data, lba, count, &ioreq->io_Actual, unit, direction);
} else { } else {
if (direction == READ) { if (direction == READ) {
error = ata_read(ioreq->io_Data, lba, count, &ioreq->io_Actual, unit); error = ata_read(ioreq->io_Data, lba, count, unit);
} else { } else {
error = ata_write(ioreq->io_Data, lba, count, &ioreq->io_Actual, unit); error = ata_write(ioreq->io_Data, lba, count, unit);
} }
if (error == 0) ioreq->io_Actual = ioreq->io_Length; ioreq->io_Actual = ioreq->io_Length;
} }
break; break;