VirtualBox

Changeset 52948 in vbox


Ignore:
Timestamp:
Oct 5, 2014 8:53:13 PM (10 years ago)
Author:
vboxsync
Message:

USBProxyDevice-linux: various fixes for the split URB code paths used on older Linux kernels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/linux/USBProxyDevice-linux.cpp

    r52946 r52948  
    281281static void usbProxyLinuxUrbLinkInFlight(PUSBPROXYDEVLNX pDevLnx, PUSBPROXYURBLNX pUrbLnx)
    282282{
     283    LogFlowFunc(("pDevLnx=%p pUrbLnx=%p\n", pDevLnx, pUrbLnx));
    283284    Assert(RTCritSectIsOwner(&pDevLnx->CritSect));
    284     Assert(!pUrbLnx->pSplitHead);
     285    Assert(!pUrbLnx->pSplitHead || pUrbLnx->pSplitHead == pUrbLnx);
    285286    RTListAppend(&pDevLnx->ListInFlight, &pUrbLnx->NodeList);
    286287}
     
    294295static void usbProxyLinuxUrbUnlinkInFlight(PUSBPROXYDEVLNX pDevLnx, PUSBPROXYURBLNX pUrbLnx)
    295296{
     297    LogFlowFunc(("pDevLnx=%p pUrbLnx=%p\n", pDevLnx, pUrbLnx));
    296298    RTCritSectEnter(&pDevLnx->CritSect);
    297299
     
    302304
    303305    RTListNodeRemove(&pUrbLnx->NodeList);
    304     pUrbLnx->pSplitHead = pUrbLnx->pSplitNext = NULL;
    305306
    306307    RTCritSectLeave(&pDevLnx->CritSect);
     
    319320    PUSBPROXYURBLNX pUrbLnx;
    320321
     322    LogFlowFunc(("pProxyDev=%p pSplitHead=%p\n", pProxyDev, pSplitHead));
     323
    321324    RTCritSectEnter(&pDevLnx->CritSect);
    322325
     
    342345    pUrbLnx->fCanceledBySubmit = false;
    343346    pUrbLnx->fSplitElementReaped = false;
     347    LogFlowFunc(("returns pUrbLnx=%p\n", pUrbLnx));
    344348    return pUrbLnx;
    345349}
     
    356360    PUSBPROXYDEVLNX pDevLnx = USBPROXYDEV_2_DATA(pProxyDev, PUSBPROXYDEVLNX);
    357361
     362    LogFlowFunc(("pProxyDev=%p pUrbLnx=%p\n", pProxyDev, pUrbLnx));
     363
     364    /*
     365     * Link it into the free list.
     366     */
    358367    RTCritSectEnter(&pDevLnx->CritSect);
    359 
    360     /*
    361      * Link it into the free list.
    362      */
    363368    RTListAppend(&pDevLnx->ListFree, &pUrbLnx->NodeList);
    364 
    365369    RTCritSectLeave(&pDevLnx->CritSect);
    366370}
     
    376380{
    377381    PUSBPROXYDEVLNX pDevLnx = USBPROXYDEV_2_DATA(pProxyDev, PUSBPROXYDEVLNX);
     382
     383    LogFlowFunc(("pProxyDev=%p pUrbLnx=%p\n", pProxyDev, pUrbLnx));
    378384
    379385    RTCritSectEnter(&pDevLnx->CritSect);
     
    13061312    uint8_t             *pb = (uint8_t *)pCur->KUrb.buffer;
    13071313
     1314    LogFlowFunc(("pProxyDev=%p pHead=%p pCur=%p\n", pProxyDev, pHead, pCur));
     1315
    13081316    Assert(cbLeft != 0);
    13091317    pNew = pCur->pSplitNext = usbProxyLinuxUrbAlloc(pProxyDev, pHead);
     
    13241332    Assert(cbLeft < INT32_MAX);
    13251333    pNew->cbSplitRemaining = cbLeft;
     1334    LogFlowFunc(("returns pNew=%p\n", pNew));
    13261335    return pNew;
    13271336}
     
    15231532        if (errno == ENODEV)
    15241533        {
     1534            rc = RTErrConvertFromErrno(errno);
    15251535            Log(("usbProxyLinuxUrbQueue: ENODEV -> unplugged. pProxyDev=%s\n", usbProxyGetName(pProxyDev)));
    15261536            if (pUrb->enmType == VUSBXFERTYPE_MSG)
     
    15301540            usbProxyLinuxUrbFree(pProxyDev, pUrbLnx);
    15311541            usbProxLinuxUrbUnplugged(pProxyDev);
    1532             return RTErrConvertFromErrno(errno);
     1542            return rc;
    15331543        }
    15341544
     
    17921802            }
    17931803            pUrb->cbData = pbEnd - &pUrb->abData[0];
     1804            usbProxyLinuxUrbUnlinkInFlight(pDevLnx, pUrbLnx);
    17941805            usbProxyLinuxUrbFreeSplitList(pProxyDev, pUrbLnx);
    17951806        }
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