VirtualBox

Changeset 43660 in vbox


Ignore:
Timestamp:
Oct 16, 2012 4:26:09 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
81426
Message:

BIOS: Added error checking to packet commands.

File:
1 edited

Legend:

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

    r43475 r43660  
    2929#endif
    3030
    31 #define VBSCSI_BUSY (1 << 0)
     31#define VBSCSI_BUSY     (1 << 0)
     32#define VBSCSI_ERROR    (1 << 1)
    3233
    3334/* The I/O port of the BusLogic SCSI adapter. */
     
    4344#define VBSCSI_REGISTER_IDENTIFY 2
    4445#define VBSCSI_REGISTER_RESET    3
     46#define VBSCSI_REGISTER_DEVSTAT  3
    4547
    4648#define VBSCSI_MAX_DEVICES 16 /* Maximum number of devices a SCSI device can have. */
     
    295297        status = inb(io_base + VBSCSI_REGISTER_STATUS);
    296298    while (status & VBSCSI_BUSY);
     299
     300    /* If any error occurred, inform the caller and don't bother reading the data. */
     301    if (status & VBSCSI_ERROR) {
     302        outb(io_base + VBSCSI_REGISTER_RESET, 0);
     303
     304        status = inb(io_base + VBSCSI_REGISTER_DEVSTAT);
     305        DBG_SCSI("%s: read failed, device status %02X\n", __func__, status);
     306        return 3;
     307    }
    297308
    298309    /* Transfer the data read from the device. */
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