VirtualBox

Changeset 55188 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Apr 10, 2015 4:08:36 PM (10 years ago)
Author:
vboxsync
Message:

BIOS: Better error checking in SCSI driver.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/BIOS/scsi.c

    r55138 r55188  
    109109    while (status & VBSCSI_BUSY);
    110110
     111    /* If any error occurred, inform the caller and don't bother reading the data. */
     112    if (status & VBSCSI_ERROR) {
     113        outb(io_base + VBSCSI_REGISTER_RESET, 0);
     114
     115        status = inb(io_base + VBSCSI_REGISTER_DEVSTAT);
     116        DBG_SCSI("%s: read failed, device status %02X\n", __func__, status);
     117        return 4;   /* Sector not found */
     118    }
     119
    111120    /* Read in the data. The transfer length may be exactly 64K or more,
    112121     * which needs a bit of care when we're using 16-bit 'rep ins'.
     
    163172        status = inb(io_base + VBSCSI_REGISTER_STATUS);
    164173    while (status & VBSCSI_BUSY);
     174
     175    /* If any error occurred, inform the caller. */
     176    if (status & VBSCSI_ERROR) {
     177        outb(io_base + VBSCSI_REGISTER_RESET, 0);
     178
     179        status = inb(io_base + VBSCSI_REGISTER_DEVSTAT);
     180        DBG_SCSI("%s: write failed, device status %02X\n", __func__, status);
     181        return 4;   /* Sector not found */
     182    }
    165183
    166184    return 0;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette