third_party/virtualbox/src/VBox/Devices/USB/VUSBUrb.cpp
/**
 * Complete a STATUS stage URB.
 *
 * This is used both for dev2host and host2dev kind of transfers.
 * It is used by both the sync and async control paths.
 */
Complete a STATUS stage URB.
This is used both for dev2host and host2dev kind of transfers.
It is used by both the sync and async control paths.
Complete a STATUS stage URB . This is used both for dev2host and host2dev kind of transfers . It is used by both the sync and async control paths .
static void vusbMsgStatusCompletion(PVUSBURB pUrb)
{
    PVUSBDEV        pDev = pUrb->pVUsb->pDev;
    PVUSBPIPE       pPipe = &pDev->aPipes[pUrb->EndPt];
    PVUSBCTRLEXTRA  pExtra = pPipe->pCtrl;
    if (pExtra->fOk)
    {
        if (pDev->u8NewAddress != VUSB_INVALID_ADDRESS)
        {
            vusbDevSetAddress(pDev, pDev->u8NewAddress);
            pDev->u8NewAddress = VUSB_INVALID_ADDRESS;
        }
        LogFlow(("%s: vusbMsgStatusCompletion: pDev=%p[%s] pPipe=%p err=OK stage %s->SETUP\n",
                 pUrb->pszDesc, pDev, pDev->pUsbIns->pszName, pPipe, g_apszCtlStates[pExtra->enmStage]));
        pUrb->enmStatus = VUSBSTATUS_OK;
    }
    else
    {
        LogFlow(("%s: vusbMsgStatusCompletion: pDev=%p[%s] pPipe=%p err=STALL stage %s->SETUP\n",
                 pUrb->pszDesc, pDev, pDev->pUsbIns->pszName, pPipe, g_apszCtlStates[pExtra->enmStage]));
        pUrb->enmStatus = VUSBSTATUS_STALL;
    }
    pExtra->pbCur    = NULL;
    pExtra->enmStage = CTLSTAGE_SETUP;
}
static void vusbMsgStatusCompletion ( PVUSBURB pUrb ) { PVUSBDEV pDev = pUrb -> pVUsb -> pDev ; PVUSBPIPE pPipe = & pDev -> aPipes [ pUrb -> EndPt ] ; PVUSBCTRLEXTRA pExtra = pPipe -> pCtrl ; if ( pExtra -> fOk ) { if ( pDev -> u8NewAddress != VUSB_INVALID_ADDRESS ) { vusbDevSetAddress ( pDev , pDev -> u8NewAddress ) ; pDev -> u8NewAddress = VUSB_INVALID_ADDRESS ; } LogFlow ( ( " \n " , pUrb -> pszDesc , pDev , pDev -> pUsbIns -> pszName , pPipe , g_apszCtlStates [ pExtra -> enmStage ] ) ) ; pUrb -> enmStatus = VUSBSTATUS_OK ; } else { LogFlow ( ( " \n " , pUrb -> pszDesc , pDev , pDev -> pUsbIns -> pszName , pPipe , g_apszCtlStates [ pExtra -> enmStage ] ) ) ; pUrb -> enmStatus = VUSBSTATUS_STALL ; } pExtra -> pbCur = NULL ; pExtra -> enmStage = CTLSTAGE_SETUP ; }
Complete a STATUS stage URB.
Complete a STATUS stage URB .
/*
         * vusbDevStdReqSetAddress requests are deferred.
         */ /*
     * Done with this message sequence.
     */