Fixed the third batch of problems.

This commit is contained in:
OBattler
2020-01-15 04:58:28 +01:00
parent af023ff5dd
commit 932ad5595a
39 changed files with 127 additions and 80 deletions

View File

@@ -729,7 +729,8 @@ aha_setnvr(x54x_t *dev)
f = nvr_fopen(dev->nvr_path, L"rb");
if (f) {
fread(dev->nvr, 1, NVR_SIZE, f);
if (fread(dev->nvr, 1, NVR_SIZE, f) != NVR_SIZE)
fatal("aha_setnvr(): Error reading data\n");
fclose(f);
f = NULL;
} else

View File

@@ -410,7 +410,8 @@ BuslogicInitializeAutoSCSIRam(x54x_t *dev)
f = nvr_fopen(BuslogicGetNVRFileName(bl), L"rb");
if (f)
{
fread(&(bl->LocalRAM.structured.autoSCSIData), 1, 64, f);
if (fread(&(bl->LocalRAM.structured.autoSCSIData), 1, 64, f) != 64)
fatal("BuslogicInitializeAutoSCSIRam(): Error reading data\n");
fclose(f);
f = NULL;
if (bl->chip == CHIP_BUSLOGIC_PCI) {
@@ -1229,6 +1230,7 @@ BuslogicPCIWrite(int func, int addr, uint8_t val, void *p)
case 0x10:
val &= 0xe0;
val |= 1;
/*FALLTHROUGH*/
case 0x11: case 0x12: case 0x13:
/* I/O Base set. */

View File

@@ -155,7 +155,8 @@ scsi_disk_mode_sense_load(scsi_disk_t *dev)
swprintf(file_name, 512, L"scsi_disk_%02i_mode_sense.bin", dev->id);
f = plat_fopen(nvr_path(file_name), L"rb");
if (f) {
fread(dev->ms_pages_saved.pages[0x30], 1, 0x18, f);
if (fread(dev->ms_pages_saved.pages[0x30], 1, 0x18, f) != 0x18)
fatal("scsi_disk_mode_sense_load(): Error reading data\n");
fclose(f);
}
}

View File

@@ -1096,14 +1096,6 @@ x54x_req_setup(x54x_t *dev, uint32_t CCBPointer, Mailbox32_t *Mailbox32)
return;
}
if (req->CmdBlock.common.ControlByte > 0x03) {
x54x_log("Invalid control byte: %02X\n",
req->CmdBlock.common.ControlByte);
x54x_mbi_setup(dev, CCBPointer, &req->CmdBlock, CCB_INVALID_DIRECTION, SCSI_STATUS_OK, MBI_ERROR);
dev->callback_sub_phase = 4;
return;
}
dev->callback_sub_phase = 1;
}
}