VirtualBox

Ignore:
Timestamp:
Jul 31, 2013 4:43:28 PM (11 years ago)
Author:
vboxsync
Message:

Solaris/USB: Fix short-transfers-okay flag.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c

    r43816 r47497  
    55
    66/*
    7  * Copyright (C) 2008-2012 Oracle Corporation
     7 * Copyright (C) 2008-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    9696/** -=-=-=-=-=-=- Tunable Parameters -=-=-=-=-=-=- */
    9797/** Time to wait while draining inflight UBRs on suspend, in seconds. */
    98 #define VBOXUSB_DRAIN_TIME                              30
     98#define VBOXUSB_DRAIN_TIME                              20
    9999/** Ctrl Xfer timeout in seconds. */
    100100#define VBOXUSB_CTRL_XFER_TIMEOUT                       10
     
    18681868                     * Paranoia: we should have a single message block almost always.
    18691869                     */
    1870                     if (RT_LIKELY(!pUrb->pMsg->b_cont && cbData > 0))
     1870                    if (RT_LIKELY(   !pUrb->pMsg->b_cont
     1871                                  && cbData))
    18711872                    {
    18721873                        rc = ddi_copyout(pUrb->pMsg->b_rptr, (void *)pUrbReq->pvData, cbData, Mode);
    1873                         if (RT_UNLIKELY(rc != 0))
     1874                        if (RT_UNLIKELY(rc))
    18741875                        {
    18751876                            LogRel((DEVICE_NAME ":vboxUSBSolarisReapUrb ddi_copyout failed! rc=%d\n", rc));
     
    19441945                AssertCompile(sizeof(pUrbReq->aIsocPkts) == sizeof(pUrb->aIsocPkts));
    19451946                pUrbReq->cIsocPkts = pUrb->cIsocPkts;
    1946 #if 0
     1947
    19471948                for (unsigned i = 0; i < pUrb->cIsocPkts; i++)
    19481949                {
    1949                     pUrbReq->aIsocPkts[i].cbPkt = pUrb->aIsocPkts[i].cbPkt;
    1950                     pUrbReq->aIsocPkts[i].cbActPkt = pUrb->aIsocPkts[i].cbActPkt;
     1950                    pUrbReq->aIsocPkts[i].cbPkt     = pUrb->aIsocPkts[i].cbPkt;
     1951                    pUrbReq->aIsocPkts[i].cbActPkt  = pUrb->aIsocPkts[i].cbActPkt;
    19511952                    pUrbReq->aIsocPkts[i].enmStatus = pUrb->aIsocPkts[i].enmStatus;
    19521953                }
    1953 #else
    1954                 bcopy(pUrb->aIsocPkts, pUrbReq->aIsocPkts, pUrb->cIsocPkts * sizeof(VUSBISOC_PKT_DESC));
    1955 #endif
    19561954
    19571955                if (pUrb->enmDir == VUSBDIRECTION_IN)
     
    19811979        mutex_exit(&pState->Mtx);
    19821980
    1983     Log((DEVICE_NAME ":vboxUSBSolarisReapUrb returns %d\n", rc));
    19841981    return rc;
    19851982}
     
    22342231    int rc = vboxUSBSolarisDeviceState(pState->DevState);
    22352232
    2236     if (enmReset == VBOXUSB_RESET_LEVEL_NONE)
     2233    if (enmReset == VBOXUSB_RESET_LEVEL_CLOSE)
    22372234    {
    22382235        vboxUSBSolarisCloseAllPipes(pState, true /* ControlPipe */);
     
    26632660LOCAL int vboxUSBSolarisOpenPipe(vboxusb_state_t *pState, vboxusb_ep_t *pEp)
    26642661{
    2665 //    LogFunc((DEVICE_NAME ":vboxUSBSolarisOpenPipe pState=%p pEp=%p\n", pState, pEp));
    2666 
    26672662    Assert(mutex_owned(&pState->Mtx));
    26682663
     
    26722667    if (pEp->pPipe)
    26732668        return VINF_SUCCESS;
     2669
    26742670
    26752671    /*
     
    26922688    if (rc == USB_SUCCESS)
    26932689    {
     2690        LogFunc((DEVICE_NAME ":vboxUSBSolarisOpenPipe: Opened pipe. pState=%p pEp=%p\n", pState, pEp));
    26942691        usb_pipe_set_private(pEp->pPipe, (usb_opaque_t)pEp);
    26952692
     
    29272924    if (RT_LIKELY(pUrbReq))
    29282925    {
    2929         pUrb->pvUrbR3 = pUrbReq->pvUrbR3;
     2926        pUrb->pvUrbR3   = pUrbReq->pvUrbR3;
    29302927        pUrb->bEndpoint = pUrbReq->bEndpoint;
    2931         pUrb->enmType = pUrbReq->enmType;
    2932         pUrb->enmDir = pUrbReq->enmDir;
     2928        pUrb->enmType   = pUrbReq->enmType;
     2929        pUrb->enmDir    = pUrbReq->enmDir;
    29332930        pUrb->enmStatus = pUrbReq->enmStatus;
    2934         pUrb->cbDataR3 = pUrbReq->cbData;
    2935         pUrb->pvDataR3 = (RTR3PTR)pUrbReq->pvData;
     2931        pUrb->fShortOk  = pUrbReq->fShortOk;
     2932        pUrb->pvDataR3  = (RTR3PTR)pUrbReq->pvData;
     2933        pUrb->cbDataR3  = pUrbReq->cbData;
    29362934        pUrb->cIsocPkts = pUrbReq->cIsocPkts;
     2935
    29372936        if (pUrbReq->enmType == VUSBXFERTYPE_ISOC)
    29382937        {
     
    30693068    AssertPtrReturn(pUrb->pMsg, VERR_INVALID_PARAMETER);
    30703069    uchar_t *pSetupData = pUrb->pMsg->b_rptr;
    3071     size_t cbData = pUrb->cbDataR3 - VBOXUSB_CTRL_XFER_SIZE;
    3072 
    3073     /*
    3074      * Solaris USBA gives us garbage and incorrect message lengths making it impossible to use
    3075      * pre-allocated control messages. The allocation of "ctrl_data" is not documented well.
    3076      */
     3070    size_t cbData = pUrb->cbDataR3 > VBOXUSB_CTRL_XFER_SIZE ? pUrb->cbDataR3 - VBOXUSB_CTRL_XFER_SIZE : 0;
    30773071
    30783072    /*
     
    30933087
    30943088        if (   pUrb->enmDir == VUSBDIRECTION_OUT
    3095             && cbData > 0)
     3089            && cbData)
    30963090        {
    30973091            pUrb->pMsg->b_rptr += VBOXUSB_CTRL_XFER_SIZE;
     
    31193113        pReq->ctrl_client_private = (usb_opaque_t)pUrb;
    31203114
     3115        LogFunc((DEVICE_NAME ":vboxUSBSolarisCtrlXfer ctrl_wLength=%#RX16 cbData=%#zx fShortOk=%RTbool\n", pReq->ctrl_wLength,
     3116                 cbData, !!(fAttributes & USB_ATTRS_SHORT_XFER_OK)));
    31213117        Log((DEVICE_NAME ":vboxUSBSolarisCtrlXfer %.*Rhxd\n", VBOXUSB_CTRL_XFER_SIZE, pSetupData));
    31223118
     
    31853181            vboxUSBSolarisConcatMsg(pUrb);
    31863182
    3187 #if defined(DEBUG_ramshankar)
     3183#ifdef DEBUG_ramshankar
    31883184            if (   pUrb->pMsg
    31893185                && pUrb->pMsg->b_cont == NULL)  /* Concat succeeded */
     
    31993195             */
    32003196            vboxUSBSolarisDeQueueURB(pUrb, pReq->ctrl_completion_reason);
    3201             usb_free_ctrl_req(pReq);
    3202             return;
    32033197        }
    32043198        else
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