Changeset 67919 in vbox
- Timestamp:
- Jul 12, 2017 9:34:17 AM (7 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Devices/Storage/DevBusLogic.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevBusLogic.cpp
r67917 r67919 383 383 /** Flag whether IRQs are enabled. */ 384 384 bool fIRQEnabled; 385 /** Flag whether the ISA I/O port range is disabled386 * to prevent the BIOS to access the device. */387 bool fISAEnabled; /**< @todo unused, to be removed */388 385 /** Flag whether 24-bit mailboxes are in use (default is 32-bit). */ 389 386 bool fMbxIs24Bit; 390 387 /** ISA I/O port base (encoded in FW-compatible format). */ 391 388 uint8_t uISABaseCode; 389 uint8_t Alignment00; 392 390 393 391 /** ISA I/O port base (disabled if zero). */ … … 1872 1870 { 1873 1871 /* The reply length is set by the guest and is found in the first byte of the command buffer. */ 1872 if (pBusLogic->aCommandBuffer[0] > sizeof(pBusLogic->aReplyBuffer)) 1873 { 1874 Log(("Requested too much adapter model number data (%u)!\n", pBusLogic->aCommandBuffer[0])); 1875 pBusLogic->regStatus |= BL_STAT_CMDINV; 1876 break; 1877 } 1874 1878 pBusLogic->cbReplyParametersLeft = pBusLogic->aCommandBuffer[0]; 1875 memset(pBusLogic->aReplyBuffer, 0, pBusLogic->cbReplyParametersLeft);1879 memset(pBusLogic->aReplyBuffer, 0, sizeof(pBusLogic->aReplyBuffer)); 1876 1880 const char aModelName[] = "958D "; /* Trailing \0 is fine, that's the filler anyway. */ 1877 1881 int cCharsToTransfer = pBusLogic->cbReplyParametersLeft <= sizeof(aModelName) … … 1971 1975 PRequestInitMbx pRequest = (PRequestInitMbx)pBusLogic->aCommandBuffer; 1972 1976 1973 ///@todo: Command should fail if requested no. of mailbox entries is zero 1977 pBusLogic->cbReplyParametersLeft = 0; 1978 if (!pRequest->cMailbox) 1979 { 1980 Log(("cMailboxes=%u (24-bit mode), fail!\n", pBusLogic->cMailbox)); 1981 pBusLogic->regStatus |= BL_STAT_CMDINV; 1982 break; 1983 } 1974 1984 pBusLogic->fMbxIs24Bit = true; 1975 1985 pBusLogic->cMailbox = pRequest->cMailbox; … … 1984 1994 1985 1995 pBusLogic->regStatus &= ~BL_STAT_INREQ; 1996 break; 1997 } 1998 case BUSLOGICCOMMAND_INITIALIZE_EXTENDED_MAILBOX: 1999 { 2000 PRequestInitializeExtendedMailbox pRequest = (PRequestInitializeExtendedMailbox)pBusLogic->aCommandBuffer; 2001 1986 2002 pBusLogic->cbReplyParametersLeft = 0; 1987 break; 1988 } 1989 case BUSLOGICCOMMAND_INITIALIZE_EXTENDED_MAILBOX: 1990 { 1991 PRequestInitializeExtendedMailbox pRequest = (PRequestInitializeExtendedMailbox)pBusLogic->aCommandBuffer; 1992 1993 ///@todo: Command should fail if requested no. of mailbox entries is zero 2003 if (!pRequest->cMailbox) 2004 { 2005 Log(("cMailboxes=%u (32-bit mode), fail!\n", pBusLogic->cMailbox)); 2006 pBusLogic->regStatus |= BL_STAT_CMDINV; 2007 break; 2008 } 1994 2009 pBusLogic->fMbxIs24Bit = false; 1995 2010 pBusLogic->cMailbox = pRequest->cMailbox; … … 2004 2019 2005 2020 pBusLogic->regStatus &= ~BL_STAT_INREQ; 2006 pBusLogic->cbReplyParametersLeft = 0;2007 2021 break; 2008 2022 } … … 2071 2085 case BUSLOGICCOMMAND_INQUIRE_SYNCHRONOUS_PERIOD: 2072 2086 { 2087 if (pBusLogic->aCommandBuffer[0] > sizeof(pBusLogic->aReplyBuffer)) 2088 { 2089 Log(("Requested too much synch period inquiry (%u)!\n", pBusLogic->aCommandBuffer[0])); 2090 pBusLogic->regStatus |= BL_STAT_CMDINV; 2091 break; 2092 } 2073 2093 pBusLogic->cbReplyParametersLeft = pBusLogic->aCommandBuffer[0]; 2074 2075 2094 for (uint8_t i = 0; i < pBusLogic->cbReplyParametersLeft; i++) 2076 2095 pBusLogic->aReplyBuffer[i] = 0; /** @todo Figure if we need something other here. It's not needed for the linux driver */ … … 2080 2099 case BUSLOGICCOMMAND_DISABLE_HOST_ADAPTER_INTERRUPT: 2081 2100 { 2101 pBusLogic->cbReplyParametersLeft = 0; 2082 2102 if (pBusLogic->aCommandBuffer[0] == 0) 2083 2103 pBusLogic->fIRQEnabled = false;
Note:
See TracChangeset
for help on using the changeset viewer.

