VirtualBox

Changeset 33919 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Nov 9, 2010 5:27:26 PM (14 years ago)
Author:
vboxsync
Message:

LSILogic: allow multiple SCSI controllers

File:
1 edited

Legend:

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

    r33540 r33919  
    49394939    int rc = VINF_SUCCESS;
    49404940    char *pszCtrlType = NULL;
     4941    char  szDevTag[20], szTaggedText[64];
    49414942    PDMDEV_CHECK_VERSIONS_RETURN(pDevIns);
    49424943
     
    49874988                                N_("LsiLogic configuration error: failed to read ControllerType as string"));
    49884989    Log(("%s: ControllerType=%s\n", __FUNCTION__, pszCtrlType));
    4989 
     4990   
    49904991    rc = lsilogicGetCtrlTypeFromString(pThis, pszCtrlType);
    49914992    MMR3HeapFree(pszCtrlType);
     4993
     4994    RTStrPrintf(szDevTag, sizeof(szDevTag), "LSILOGIC%s-%d",
     4995                pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI ? "SPI" : "SAS",
     4996                iInstance);
     4997
    49924998
    49934999    if (RT_FAILURE(rc))
     
    50875093
    50885094    /* Initialize task queue. (Need two items to handle SMP guest concurrency.) */
     5095    RTStrPrintf(szTaggedText, sizeof(szTaggedText), "%s-Task", szDevTag);
    50895096    rc = PDMDevHlpQueueCreate(pDevIns, sizeof(PDMQUEUEITEMCORE), 2, 0,
    50905097                              lsilogicNotifyQueueConsumer, true,
    5091                               pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI
    5092                               ? "LsiLogic-Task"
    5093                               : "LsiLogicSAS-Task",
     5098                              szTaggedText,
    50945099                              &pThis->pNotificationQueueR3);
    50955100    if (RT_FAILURE(rc))
     
    51145119     * Create critical sections protecting the reply post and free queues.
    51155120     */
     5121    RTStrPrintf(szTaggedText, sizeof(szTaggedText), "%sRFQ", szDevTag);   
    51165122    rc = PDMDevHlpCritSectInit(pDevIns, &pThis->ReplyFreeQueueCritSect, RT_SRC_POS,
    5117                                pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI
    5118                                ? "LsiLogicRFQ"
    5119                                : "LsiLogicSasRFQ");
     5123                               szTaggedText);
    51205124    if (RT_FAILURE(rc))
    51215125        return PDMDEV_SET_ERROR(pDevIns, rc,
    51225126                                N_("LsiLogic: cannot create critical section for reply free queue"));
    51235127
     5128    RTStrPrintf(szTaggedText, sizeof(szTaggedText), "%sRPQ", szDevTag);       
    51245129    rc = PDMDevHlpCritSectInit(pDevIns, &pThis->ReplyPostQueueCritSect, RT_SRC_POS,
    5125                                pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI
    5126                                ? "LsiLogicRPQ"
    5127                                : "LsiLogicSasRPQ");
     5130                               szTaggedText);
    51285131    if (RT_FAILURE(rc))
    51295132        return PDMDEV_SET_ERROR(pDevIns, rc,
     
    52075210    AssertRC(rc);
    52085211
    5209     /* Register I/O port space in ISA region for BIOS access. */
    5210     if (pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI)
    5211         rc = PDMDevHlpIOPortRegister(pDevIns, LSILOGIC_ISA_IO_PORT, 3, NULL,
    5212                                      lsilogicIsaIOPortWrite, lsilogicIsaIOPortRead,
    5213                                      lsilogicIsaIOPortWriteStr, lsilogicIsaIOPortReadStr,
    5214                                      "LsiLogic BIOS");
    5215     else if (pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SAS)
    5216         rc = PDMDevHlpIOPortRegister(pDevIns, LSILOGIC_SAS_ISA_IO_PORT, 3, NULL,
    5217                                      lsilogicIsaIOPortWrite, lsilogicIsaIOPortRead,
    5218                                      lsilogicIsaIOPortWriteStr, lsilogicIsaIOPortReadStr,
    5219                                      "LsiLogic SAS BIOS");
    5220     else
    5221         AssertMsgFailed(("Invalid controller type %d\n", pThis->enmCtrlType));
    5222 
    5223     if (RT_FAILURE(rc))
    5224         return PDMDEV_SET_ERROR(pDevIns, rc, N_("LsiLogic cannot register legacy I/O handlers"));
     5212    /* Register I/O port space in ISA region for BIOS access, only for first controller. */
     5213    if (iInstance == 0)
     5214    {
     5215        if (pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI)
     5216            rc = PDMDevHlpIOPortRegister(pDevIns, LSILOGIC_ISA_IO_PORT, 3, NULL,
     5217                                         lsilogicIsaIOPortWrite, lsilogicIsaIOPortRead,
     5218                                         lsilogicIsaIOPortWriteStr, lsilogicIsaIOPortReadStr,
     5219                                         "LsiLogic BIOS");
     5220        else if (pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SAS)
     5221            rc = PDMDevHlpIOPortRegister(pDevIns, LSILOGIC_SAS_ISA_IO_PORT, 3, NULL,
     5222                                         lsilogicIsaIOPortWrite, lsilogicIsaIOPortRead,
     5223                                         lsilogicIsaIOPortWriteStr, lsilogicIsaIOPortReadStr,
     5224                                         "LsiLogic SAS BIOS");
     5225        else
     5226            AssertMsgFailed(("Invalid controller type %d\n", pThis->enmCtrlType));
     5227
     5228        if (RT_FAILURE(rc))
     5229            return PDMDEV_SET_ERROR(pDevIns, rc, N_("LsiLogic cannot register legacy I/O handlers"));
     5230    }       
    52255231
    52265232    /* Register save state handlers. */
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