Changeset 30687 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jul 7, 2010 7:21:20 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevBusLogic.cpp
r30597 r30687 840 840 841 841 /* Reset registers to default value. */ 842 pBusLogic->regStatus = BUSLOGIC_REGISTER_STATUS_HOST_ADAPTER_READY ;842 pBusLogic->regStatus = BUSLOGIC_REGISTER_STATUS_HOST_ADAPTER_READY | BUSLOGIC_REGISTER_STATUS_INITIALIZATION_REQUIRED; 843 843 pBusLogic->regInterrupt = 0; 844 844 pBusLogic->regGeometry = BUSLOGIC_REGISTER_GEOMETRY_EXTENTED_TRANSLATION_ENABLED; … … 1301 1301 case BUSLOGICCOMMAND_INQUIRE_BOARD_ID: 1302 1302 { 1303 pBusLogic->aReplyBuffer[0] = ' 0'; /* @todo figure out what to write here.*/1304 pBusLogic->aReplyBuffer[1] = ' 1'; /* @todo figure out what to write here - can't be '0' or 'B'. */1303 pBusLogic->aReplyBuffer[0] = 'A'; /* Firmware option bytes */ 1304 pBusLogic->aReplyBuffer[1] = 'A'; 1305 1305 1306 1306 /* We report version 5.07B. This reply will provide the first two digits. */ … … 1326 1326 /* The reply length is set by the guest and is found in the first byte of the command buffer. */ 1327 1327 pBusLogic->cbReplyParametersLeft = pBusLogic->aCommandBuffer[0]; 1328 memset(pBusLogic->aReplyBuffer, 0, pBusLogic->cbReplyParametersLeft);1328 memset(pBusLogic->aReplyBuffer, ' ', pBusLogic->cbReplyParametersLeft); 1329 1329 const char aModelName[] = "958"; 1330 int cCharsToTransfer = (pBusLogic->cbReplyParametersLeft <= sizeof(aModelName))1330 int cCharsToTransfer = (pBusLogic->cbReplyParametersLeft <= (sizeof(aModelName) - 1)) 1331 1331 ? pBusLogic->cbReplyParametersLeft 1332 : sizeof(aModelName) ;1332 : sizeof(aModelName) - 1; 1333 1333 1334 1334 for (int i = 0; i < cCharsToTransfer; i++) … … 1398 1398 Log(("cMailboxes=%u\n", pBusLogic->cMailbox)); 1399 1399 1400 pBusLogic->regStatus &= ~BUSLOGIC_REGISTER_STATUS_INITIALIZATION_REQUIRED; 1400 1401 pBusLogic->cbReplyParametersLeft = 0; 1401 1402 break; … … 1463 1464 break; 1464 1465 } 1466 case BUSLOGICCOMMAND_SET_PREEMPT_TIME_ON_BUS: 1467 { 1468 pBusLogic->cbReplyParametersLeft = 0; 1469 pBusLogic->LocalRam.structured.autoSCSIData.uBusOnDelay = pBusLogic->aCommandBuffer[0]; 1470 Log(("Bus-on time: %d\n", pBusLogic->aCommandBuffer[0])); 1471 break; 1472 } 1473 case BUSLOGICCOMMAND_SET_TIME_OFF_BUS: 1474 { 1475 pBusLogic->cbReplyParametersLeft = 0; 1476 pBusLogic->LocalRam.structured.autoSCSIData.uBusOffDelay = pBusLogic->aCommandBuffer[0]; 1477 Log(("Bus-off time: %d\n", pBusLogic->aCommandBuffer[0])); 1478 break; 1479 } 1465 1480 case BUSLOGICCOMMAND_EXECUTE_MAILBOX_COMMAND: /* Should be handled already. */ 1466 1481 default: … … 1468 1483 } 1469 1484 1470 Log((" cbReplyParametersLeft=%d\n", pBusLogic->cbReplyParametersLeft));1485 Log(("uOperationCode=%#x, cbReplyParametersLeft=%d\n", pBusLogic->uOperationCode, pBusLogic->cbReplyParametersLeft)); 1471 1486 1472 1487 /* Set the data in ready bit in the status register in case the command has a reply. */ … … 1641 1656 case BUSLOGICCOMMAND_DISABLE_HOST_ADAPTER_INTERRUPT: 1642 1657 case BUSLOGICCOMMAND_ECHO_COMMAND_DATA: 1658 case BUSLOGICCOMMAND_SET_PREEMPT_TIME_ON_BUS: 1659 case BUSLOGICCOMMAND_SET_TIME_OFF_BUS: 1643 1660 pBusLogic->cbCommandParametersLeft = 1; 1644 1661 break;
Note:
See TracChangeset
for help on using the changeset viewer.