Changeset 29326 in vbox
- Timestamp:
- May 11, 2010 10:08:13 AM (14 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 6 edited
-
Devices/Builtins.cpp (modified) (1 diff)
-
Devices/Builtins.h (modified) (1 diff)
-
Devices/PC/BIOS/scsi.c (modified) (5 diffs)
-
Devices/Storage/DevLsiLogicSCSI.cpp (modified) (17 diffs)
-
Devices/Storage/DevLsiLogicSCSI.h (modified) (1 diff)
-
Main/ConsoleImpl.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Builtins.cpp
r28800 r29326 178 178 if (RT_FAILURE(rc)) 179 179 return rc; 180 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceLsiLogicSAS); 181 if (RT_FAILURE(rc)) 182 return rc; 180 183 #endif 181 184 -
trunk/src/VBox/Devices/Builtins.h
r28800 r29326 78 78 #ifdef VBOX_WITH_LSILOGIC 79 79 extern const PDMDEVREG g_DeviceLsiLogicSCSI; 80 extern const PDMDEVREG g_DeviceLsiLogicSAS; 80 81 #endif 81 82 #ifdef VBOX_WITH_SMC -
trunk/src/VBox/Devices/PC/BIOS/scsi.c
r28800 r29326 20 20 /* The I/O port of the LsiLogic SCSI adapter. */ 21 21 #define LSILOGIC_ISA_IO_PORT 0x340 22 /* The I/O port of the LsiLogic SAS adapter. */ 23 #define LSILOGIC_SAS_ISA_IO_PORT 0x350 22 24 23 25 #define VBOXSCSI_REGISTER_STATUS 0 … … 284 286 285 287 ebda_seg = read_word(0x0040, 0x000E); 286 287 write_byte(ebda_seg, &EbdaData->scsi.hdcount, 0);288 288 289 289 /* Go through target devices. */ … … 366 366 cylinders = (uint32_t)(sectors / (heads * sectors_per_track)); 367 367 } 368 else if (io_base == LSILOGIC_ISA_IO_PORT )368 else if (io_base == LSILOGIC_ISA_IO_PORT || io_base == LSILOGIC_SAS_ISA_IO_PORT) 369 369 { 370 370 /* This is from the BusLogic driver in the Linux kernel. */ … … 442 442 { 443 443 Bit8u identifier; 444 Bit16u ebda_seg; 445 446 447 ebda_seg = read_word(0x0040, 0x000E); 448 write_byte(ebda_seg, &EbdaData->scsi.hdcount, 0); 444 449 445 450 identifier = 0; … … 476 481 VBOXSCSI_DEBUG("scsi_init: LsiLogic SCSI adapter not detected\n"); 477 482 } 483 484 /* Detect LsiLogic SAS adapter. */ 485 outb(LSILOGIC_SAS_ISA_IO_PORT+VBOXSCSI_REGISTER_IDENTIFY, 0x55); 486 identifier = inb(LSILOGIC_SAS_ISA_IO_PORT+VBOXSCSI_REGISTER_IDENTIFY); 487 488 if (identifier == 0x55) 489 { 490 /* Detected - Enumerate attached devices. */ 491 VBOXSCSI_DEBUG("scsi_init: LsiLogic SAS adapter detected\n"); 492 outb(LSILOGIC_SAS_ISA_IO_PORT+VBOXSCSI_REGISTER_RESET, 0); 493 scsi_enumerate_attached_devices(LSILOGIC_SAS_ISA_IO_PORT); 494 } 495 else 496 { 497 VBOXSCSI_DEBUG("scsi_init: LsiLogic SAS adapter not detected\n"); 498 } 478 499 } 479 500 -
trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
r29242 r29326 3502 3502 { 3503 3503 int rc; 3504 PLSILOGICSCSI p LsiLogic= PDMINS_2_DATA(pDevIns, PLSILOGICSCSI);3504 PLSILOGICSCSI pThis = PDMINS_2_DATA(pDevIns, PLSILOGICSCSI); 3505 3505 3506 3506 Assert(cb == 1); 3507 3507 3508 rc = vboxscsiReadRegister(&pLsiLogic->VBoxSCSI, (Port - LSILOGIC_ISA_IO_PORT), pu32); 3508 uint8_t iRegister = pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI 3509 ? Port - LSILOGIC_ISA_IO_PORT 3510 : Port - LSILOGIC_SAS_ISA_IO_PORT; 3511 rc = vboxscsiReadRegister(&pThis->VBoxSCSI, iRegister, pu32); 3509 3512 3510 3513 Log2(("%s: pu32=%p:{%.*Rhxs} iRegister=%d rc=%Rrc\n", 3511 __FUNCTION__, pu32, 1, pu32, (Port - LSILOGIC_ISA_IO_PORT), rc));3514 __FUNCTION__, pu32, 1, pu32, iRegister, rc)); 3512 3515 3513 3516 return rc; … … 3585 3588 { 3586 3589 int rc; 3587 PLSILOGICSCSI p LsiLogic= PDMINS_2_DATA(pDevIns, PLSILOGICSCSI);3590 PLSILOGICSCSI pThis = PDMINS_2_DATA(pDevIns, PLSILOGICSCSI); 3588 3591 3589 3592 Log2(("#%d %s: pvUser=%#p cb=%d u32=%#x Port=%#x\n", … … 3592 3595 Assert(cb == 1); 3593 3596 3594 rc = vboxscsiWriteRegister(&pLsiLogic->VBoxSCSI, (Port - LSILOGIC_ISA_IO_PORT), (uint8_t)u32); 3597 uint8_t iRegister = pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI 3598 ? Port - LSILOGIC_ISA_IO_PORT 3599 : Port - LSILOGIC_SAS_ISA_IO_PORT; 3600 rc = vboxscsiWriteRegister(&pThis->VBoxSCSI, iRegister, (uint8_t)u32); 3595 3601 if (rc == VERR_MORE_DATA) 3596 3602 { 3597 rc = lsilogicPrepareBIOSSCSIRequest(p LsiLogic);3603 rc = lsilogicPrepareBIOSSCSIRequest(pThis); 3598 3604 AssertRC(rc); 3599 3605 } … … 3610 3616 static DECLCALLBACK(int) lsilogicIsaIOPortWriteStr(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, RTGCPTR *pGCPtrSrc, PRTGCUINTREG pcTransfer, unsigned cb) 3611 3617 { 3612 PLSILOGICSCSI p LsiLogic= PDMINS_2_DATA(pDevIns, PLSILOGICSCSI);3618 PLSILOGICSCSI pThis = PDMINS_2_DATA(pDevIns, PLSILOGICSCSI); 3613 3619 int rc; 3614 3620 … … 3616 3622 pDevIns->iInstance, __FUNCTION__, pvUser, cb, Port)); 3617 3623 3618 rc = vboxscsiWriteString(pDevIns, &pLsiLogic->VBoxSCSI, (Port - LSILOGIC_ISA_IO_PORT), 3624 uint8_t iRegister = pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI 3625 ? Port - LSILOGIC_ISA_IO_PORT 3626 : Port - LSILOGIC_SAS_ISA_IO_PORT; 3627 rc = vboxscsiWriteString(pDevIns, &pThis->VBoxSCSI, iRegister, 3619 3628 pGCPtrSrc, pcTransfer, cb); 3620 3629 if (rc == VERR_MORE_DATA) 3621 3630 { 3622 rc = lsilogicPrepareBIOSSCSIRequest(p LsiLogic);3631 rc = lsilogicPrepareBIOSSCSIRequest(pThis); 3623 3632 AssertRC(rc); 3624 3633 } … … 3635 3644 static DECLCALLBACK(int) lsilogicIsaIOPortReadStr(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, RTGCPTR *pGCPtrDst, PRTGCUINTREG pcTransfer, unsigned cb) 3636 3645 { 3637 PLSILOGICSCSI p LsiLogic= PDMINS_2_DATA(pDevIns, PLSILOGICSCSI);3646 PLSILOGICSCSI pThis = PDMINS_2_DATA(pDevIns, PLSILOGICSCSI); 3638 3647 3639 3648 LogFlowFunc(("#%d %s: pvUser=%#p cb=%d Port=%#x\n", 3640 3649 pDevIns->iInstance, __FUNCTION__, pvUser, cb, Port)); 3641 3650 3642 return vboxscsiReadString(pDevIns, &pLsiLogic->VBoxSCSI, (Port - LSILOGIC_ISA_IO_PORT), 3651 uint8_t iRegister = pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI 3652 ? Port - LSILOGIC_ISA_IO_PORT 3653 : Port - LSILOGIC_SAS_ISA_IO_PORT; 3654 return vboxscsiReadString(pDevIns, &pThis->VBoxSCSI, iRegister, 3643 3655 pGCPtrDst, pcTransfer, cb); 3644 3656 } … … 3651 3663 PLSILOGICSCSI pThis = PDMINS_2_DATA(pDevIns, PLSILOGICSCSI); 3652 3664 int rc = VINF_SUCCESS; 3665 const char *pcszCtrl = pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI 3666 ? "LsiLogic" 3667 : "LsiLogicSas"; 3668 const char *pcszDiag = pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI 3669 ? "LsiLogicDiag" 3670 : "LsiLogicSasDiag"; 3653 3671 3654 3672 Log2(("%s: registering area at GCPhysAddr=%RGp cb=%u\n", __FUNCTION__, GCPhysAddress, cb)); … … 3662 3680 /* We use the assigned size here, because we currently only support page aligned MMIO ranges. */ 3663 3681 rc = PDMDevHlpMMIORegister(pDevIns, GCPhysAddress, cb, NULL, 3664 lsilogicMMIOWrite, lsilogicMMIORead, NULL, "LsiLogic");3682 lsilogicMMIOWrite, lsilogicMMIORead, NULL, pcszCtrl); 3665 3683 if (RT_FAILURE(rc)) 3666 3684 return rc; … … 3688 3706 /* We use the assigned size here, because we currently only support page aligned MMIO ranges. */ 3689 3707 rc = PDMDevHlpMMIORegister(pDevIns, GCPhysAddress, cb, NULL, 3690 lsilogicDiagnosticWrite, lsilogicDiagnosticRead, NULL, "LsiLogicDiag");3708 lsilogicDiagnosticWrite, lsilogicDiagnosticRead, NULL, pcszDiag); 3691 3709 if (RT_FAILURE(rc)) 3692 3710 return rc; … … 3711 3729 { 3712 3730 rc = PDMDevHlpIOPortRegister(pDevIns, (RTIOPORT)GCPhysAddress, LSILOGIC_PCI_SPACE_IO_SIZE, 3713 NULL, lsilogicIOPortWrite, lsilogicIOPortRead, NULL, NULL, "LsiLogic");3731 NULL, lsilogicIOPortWrite, lsilogicIOPortRead, NULL, NULL, pcszCtrl); 3714 3732 if (RT_FAILURE(rc)) 3715 3733 return rc; … … 3718 3736 { 3719 3737 rc = PDMDevHlpIOPortRegisterR0(pDevIns, (RTIOPORT)GCPhysAddress, LSILOGIC_PCI_SPACE_IO_SIZE, 3720 0, "lsilogicIOPortWrite", "lsilogicIOPortRead", NULL, NULL, "LsiLogic");3738 0, "lsilogicIOPortWrite", "lsilogicIOPortRead", NULL, NULL, pcszCtrl); 3721 3739 if (RT_FAILURE(rc)) 3722 3740 return rc; … … 3726 3744 { 3727 3745 rc = PDMDevHlpIOPortRegisterRC(pDevIns, (RTIOPORT)GCPhysAddress, LSILOGIC_PCI_SPACE_IO_SIZE, 3728 0, "lsilogicIOPortWrite", "lsilogicIOPortRead", NULL, NULL, "LsiLogic");3746 0, "lsilogicIOPortWrite", "lsilogicIOPortRead", NULL, NULL, pcszCtrl); 3729 3747 if (RT_FAILURE(rc)) 3730 3748 return rc; … … 4512 4530 /* Intialize task queue. */ 4513 4531 rc = PDMDevHlpQueueCreate(pDevIns, sizeof(PDMQUEUEITEMCORE), 2, 0, 4514 lsilogicNotifyQueueConsumer, true, "LsiLogic-Task", &pThis->pNotificationQueueR3); 4532 lsilogicNotifyQueueConsumer, true, 4533 pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI 4534 ? "LsiLogic-Task" 4535 : "LsiLogicSAS-Task", 4536 &pThis->pNotificationQueueR3); 4515 4537 if (RT_FAILURE(rc)) 4516 4538 return rc; … … 4549 4571 * Create critical sections protecting the reply post and free queues. 4550 4572 */ 4551 rc = PDMDevHlpCritSectInit(pDevIns, &pThis->ReplyFreeQueueCritSect, RT_SRC_POS, "LsiLogicRFQ"); 4573 rc = PDMDevHlpCritSectInit(pDevIns, &pThis->ReplyFreeQueueCritSect, RT_SRC_POS, 4574 pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI 4575 ? "LsiLogicRFQ" 4576 : "LsiLogicSasRFQ"); 4552 4577 if (RT_FAILURE(rc)) 4553 4578 return PDMDEV_SET_ERROR(pDevIns, rc, 4554 4579 N_("LsiLogic: cannot create critical section for reply free queue")); 4555 4580 4556 rc = PDMDevHlpCritSectInit(pDevIns, &pThis->ReplyPostQueueCritSect, RT_SRC_POS, "LsiLogicRPQ"); 4581 rc = PDMDevHlpCritSectInit(pDevIns, &pThis->ReplyPostQueueCritSect, RT_SRC_POS, 4582 pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI 4583 ? "LsiLogicRPQ" 4584 : "LsiLogicSasRPQ"); 4557 4585 if (RT_FAILURE(rc)) 4558 4586 return PDMDEV_SET_ERROR(pDevIns, rc, … … 4637 4665 4638 4666 /* Register I/O port space in ISA region for BIOS access. */ 4639 rc = PDMDevHlpIOPortRegister(pDevIns, LSILOGIC_ISA_IO_PORT, 3, NULL, 4640 lsilogicIsaIOPortWrite, lsilogicIsaIOPortRead, 4641 lsilogicIsaIOPortWriteStr, lsilogicIsaIOPortReadStr, 4642 "LsiLogic BIOS"); 4667 if (pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI) 4668 rc = PDMDevHlpIOPortRegister(pDevIns, LSILOGIC_ISA_IO_PORT, 3, NULL, 4669 lsilogicIsaIOPortWrite, lsilogicIsaIOPortRead, 4670 lsilogicIsaIOPortWriteStr, lsilogicIsaIOPortReadStr, 4671 "LsiLogic BIOS"); 4672 else if (pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SAS) 4673 rc = PDMDevHlpIOPortRegister(pDevIns, LSILOGIC_SAS_ISA_IO_PORT, 3, NULL, 4674 lsilogicIsaIOPortWrite, lsilogicIsaIOPortRead, 4675 lsilogicIsaIOPortWriteStr, lsilogicIsaIOPortReadStr, 4676 "LsiLogic SAS BIOS"); 4677 else 4678 AssertMsgFailed(("Invalid controller type %d\n", pThis->enmCtrlType)); 4679 4643 4680 if (RT_FAILURE(rc)) 4644 4681 return PDMDEV_SET_ERROR(pDevIns, rc, N_("LsiLogic cannot register legacy I/O handlers")); … … 4660 4697 4661 4698 /** 4662 * The device registration structure .4699 * The device registration structure - SPI SCSI controller. 4663 4700 */ 4664 4701 const PDMDEVREG g_DeviceLsiLogicSCSI = … … 4714 4751 }; 4715 4752 4753 /** 4754 * The device registration structure - SAS controller. 4755 */ 4756 const PDMDEVREG g_DeviceLsiLogicSAS = 4757 { 4758 /* u32Version */ 4759 PDM_DEVREG_VERSION, 4760 /* szName */ 4761 "lsilogicsas", 4762 /* szRCMod */ 4763 "VBoxDDGC.gc", 4764 /* szR0Mod */ 4765 "VBoxDDR0.r0", 4766 /* pszDescription */ 4767 "LSI Logic SAS1068 controller.\n", 4768 /* fFlags */ 4769 PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0, 4770 /* fClass */ 4771 PDM_DEVREG_CLASS_STORAGE, 4772 /* cMaxInstances */ 4773 ~0, 4774 /* cbInstance */ 4775 sizeof(LSILOGICSCSI), 4776 /* pfnConstruct */ 4777 lsilogicConstruct, 4778 /* pfnDestruct */ 4779 lsilogicDestruct, 4780 /* pfnRelocate */ 4781 lsilogicRelocate, 4782 /* pfnIOCtl */ 4783 NULL, 4784 /* pfnPowerOn */ 4785 NULL, 4786 /* pfnReset */ 4787 lsilogicReset, 4788 /* pfnSuspend */ 4789 NULL, 4790 /* pfnResume */ 4791 NULL, 4792 /* pfnAttach */ 4793 lsilogicAttach, 4794 /* pfnDetach */ 4795 lsilogicDetach, 4796 /* pfnQueryInterface. */ 4797 NULL, 4798 /* pfnInitComplete */ 4799 NULL, 4800 /* pfnPowerOff */ 4801 NULL, 4802 /* pfnSoftReset */ 4803 NULL, 4804 /* u32VersionEnd */ 4805 PDM_DEVREG_VERSION 4806 }; 4807 4716 4808 #endif /* IN_RING3 */ 4717 4809 #endif /* !VBOX_DEVICE_STRUCT_TESTCASE */ -
trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.h
r28800 r29326 25 25 */ 26 26 #define LSILOGIC_ISA_IO_PORT 0x340 27 #define LSILOGIC_SAS_ISA_IO_PORT 0x350 27 28 28 29 #define LSILOGICSCSI_REQUEST_QUEUE_DEPTH_DEFAULT 1024 -
trunk/src/VBox/Main/ConsoleImpl.cpp
r29292 r29326 3106 3106 { 3107 3107 case StorageControllerType_LsiLogic: 3108 case StorageControllerType_LsiLogicSas:3109 3108 return "lsilogicscsi"; 3110 3109 case StorageControllerType_BusLogic: 3111 3110 return "buslogic"; 3111 case StorageControllerType_LsiLogicSas: 3112 return "lsilogicsas"; 3112 3113 case StorageControllerType_IntelAhci: 3113 3114 return "ahci";
Note:
See TracChangeset
for help on using the changeset viewer.

