VirtualBox

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


Ignore:
Timestamp:
Jan 19, 2011 3:40:11 PM (14 years ago)
Author:
vboxsync
Message:

BusLogic: Properly fail some Adaptec 154xC commands that a guest may send.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevBusLogic.cpp

    r35353 r35631  
    1616 */
    1717
    18 /* Implemented looking at the driver source in the linux kernel (drivers/scsi/BusLogic.[ch]). */
     18/* Implemented looking at the driver source in the linux kernel (drivers/scsi/BusLogic.[ch]).
     19 * See also: http://www.drdobbs.com/184410111
     20 */
    1921
    2022/*******************************************************************************
     
    140142    BUSLOGICCOMMAND_INQUIRE_TARGET_DEVICES = 0x24,
    141143    BUSLOGICCOMMAND_DISABLE_HOST_ADAPTER_INTERRUPT = 0x25,
     144    BUSLOGICCOMMAND_EXT_BIOS_INFO = 0x28,
     145    BUSLOGICCOMMAND_UNLOCK_MAILBOX = 0x29,
    142146    BUSLOGICCOMMAND_INITIALIZE_EXTENDED_MAILBOX = 0x81,
    143147    BUSLOGICCOMMAND_EXECUTE_SCSI_COMMAND = 0x83,
     
    14941498            break;
    14951499        }
     1500        case BUSLOGICCOMMAND_EXT_BIOS_INFO:
     1501        case BUSLOGICCOMMAND_UNLOCK_MAILBOX:
     1502            /* Commands valid for Adaptec 154xC which we don't handle since
     1503             * we pretend being 154xB compatible. Just mark the command as invalid.
     1504             */
     1505            Log(("Command %#x not valid for this adapter\n", pBusLogic->uOperationCode));
     1506            pBusLogic->cbReplyParametersLeft = 0;
     1507            pBusLogic->regStatus |= BUSLOGIC_REGISTER_STATUS_COMMAND_INVALID;
     1508            break;
    14961509        case BUSLOGICCOMMAND_EXECUTE_MAILBOX_COMMAND: /* Should be handled already. */
    14971510        default:
     
    16411654                pBusLogic->iParameter = 0;
    16421655
    1643                 /* Mark host adapter as busy. */
    1644                 pBusLogic->regStatus &= ~BUSLOGIC_REGISTER_STATUS_HOST_ADAPTER_READY;
     1656                /* Mark host adapter as busy and clear the invalid status bit. */
     1657                pBusLogic->regStatus &= ~(BUSLOGIC_REGISTER_STATUS_HOST_ADAPTER_READY | BUSLOGIC_REGISTER_STATUS_COMMAND_INVALID);
    16451658
    16461659                /* Get the number of bytes for parameters from the command code. */
     
    16731686                    case BUSLOGICCOMMAND_INITIALIZE_EXTENDED_MAILBOX:
    16741687                        pBusLogic->cbCommandParametersLeft = sizeof(RequestInitializeExtendedMailbox);
     1688                        break;
     1689                    case BUSLOGICCOMMAND_EXT_BIOS_INFO:
     1690                    case BUSLOGICCOMMAND_UNLOCK_MAILBOX:
     1691                        /* Invalid commands. */
     1692                        pBusLogic->cbCommandParametersLeft = 0;
    16751693                        break;
    16761694                    case BUSLOGICCOMMAND_EXECUTE_MAILBOX_COMMAND: /* Should not come here anymore. */
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