VBoxUSB-solaris.c revision bb062ceb196ff212a08004775c0ed1a62f2ee664
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * VirtualBox USB Client Driver, Solaris Hosts.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Copyright (C) 2008-2014 Oracle Corporation
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * available from http://www.virtualbox.org. This file is free software;
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * you can redistribute it and/or modify it under the terms of the GNU
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * General Public License (GPL) as published by the Free Software
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * The contents of this file may alternatively be used under the terms
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * of the Common Development and Distribution License Version 1.0
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * VirtualBox OSE distribution, in which case the provisions of the
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * CDDL are applicable instead of those of the GPL.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * You may elect to license modified versions of this file under the
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * terms and conditions of either the GPL or the CDDL or both.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/*******************************************************************************
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync* Header Files *
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync*******************************************************************************/
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** @todo review the locking here, verify assumptions about code executed
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * without the vboxusb_state_t::Mtx mutex */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/*******************************************************************************
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync* Defined Constants And Macros *
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync*******************************************************************************/
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** The module name. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** The module description as seen in 'modinfo'. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** Endpoint states */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** Polling states */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** -=-=-=-=-=-=- Standard Specifics -=-=-=-=-=-=- */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** Max. supported endpoints */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** Size of USB Ctrl Xfer Header */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * USB2.0 (Sec. 9-13) Bits 10..0 is the max packet size; for high speed Isoc/Intr, bits 12..11 is
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * number of additional transaction opportunities per microframe.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define VBOXUSB_PKT_SIZE(pkt) (pkt & 0x07FF) * (1 + ((pkt >> 11) & 3))
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** Endpoint Xfer Type */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define VBOXUSB_XFER_TYPE(endp) ((endp)->EpDesc.bmAttributes & USB_EP_ATTR_MASK)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** Endpoint Xfer Direction */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define VBOXUSB_XFER_DIR(endp) ((endp)->EpDesc.bEndpointAddress & USB_EP_DIR_IN)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** -=-=-=-=-=-=- Tunable Parameters -=-=-=-=-=-=- */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** Time to wait while draining inflight UBRs on suspend, in seconds. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** Ctrl Xfer timeout in seconds. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** Bulk Xfer timeout in seconds. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** Intr Xfer timeout in seconds. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** Maximum URB queue length. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** Maximum asynchronous requests per pipe */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** For enabling global symbols while debugging **/
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync# define LOCAL static
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/*******************************************************************************
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync* Kernel Entry Hooks *
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync*******************************************************************************/
int VBoxUSBSolarisPoll(dev_t Dev, short fEvents, int fAnyYet, short *pReqEvents, struct pollhead **ppPollHead);
NULL,
typedef struct vboxusb_ep_t
} vboxusb_ep_t;
typedef struct vboxusb_isoc_req_t
typedef enum VBOXUSB_URB_STATE
typedef struct vboxusb_urb_t
typedef struct vboxusb_power_t
typedef struct vboxusb_state_t
LOCAL int vboxUSBSolarisInitEndPoint(vboxusb_state_t *pState, usb_ep_data_t *pEpData, uchar_t uCfgValue,
LOCAL int vboxUSBSolarisInitEndPointsForInterfaceAlt(vboxusb_state_t *pState, uint8_t uInterface, uint8_t uAlt);
LOCAL vboxusb_urb_t *vboxUSBSolarisQueueURB(vboxusb_state_t *pState, PVBOXUSBREQ_URB pUrbReq, mblk_t *pMsg);
LOCAL int vboxUSBSolarisProcessIOCtl(int iFunction, void *pvState, int Mode, PVBOXUSBREQ pUSBReq, void *pvBuf,
static void *g_pVBoxUSBSolarisState;
int _init(void)
if (pModCtl)
if (!rc)
if (!rc)
return rc;
RTR0Term();
int _fini(void)
int rc;
if (!rc)
RTR0Term();
return rc;
int rc;
switch (enmCmd)
case DDI_ATTACH:
#ifdef DEBUG_ramshankar
return DDI_SUCCESS;
instance));
rc));
return DDI_FAILURE;
case DDI_RESUME:
return DDI_FAILURE;
return DDI_SUCCESS;
return DDI_FAILURE;
return DDI_FAILURE;
switch (enmCmd)
case DDI_DETACH:
return DDI_SUCCESS;
case DDI_SUSPEND:
return DDI_SUCCESS;
return DDI_FAILURE;
return DDI_FAILURE;
switch (enmCmd)
case DDI_INFO_DEVT2DEVINFO:
if (pState)
return DDI_SUCCESS;
return DDI_FAILURE;
case DDI_INFO_DEVT2INSTANCE:
return DDI_SUCCESS;
return DDI_FAILURE;
LogFunc((DEVICE_NAME ":vboxUSBSolarisSetConsumerCredentials Process=%u Instance=%d\n", Process, Instance));
if (!pState)
LogRel((DEVICE_NAME ":vboxUSBSolarisSetConsumerCredentials failed to get device state for instance %d\n", Instance));
return VERR_INVALID_STATE;
LogRel((DEVICE_NAME ":vboxUSBSolarisSetConsumerCredentials failed! Process %u already has client open.\n",
return rc;
LogFunc((DEVICE_NAME ":VBoxUSBSolarisOpen pDev=%p fFlag=%d fType=%d pCred=%p\n", pDev, fFlag, fType, pCred));
return EINVAL;
if (!pState)
return ENXIO;
LogRel((DEVICE_NAME ":VBoxUSBSolarisOpen Process %u is already using this device instance.\n", pState->Process));
return EPERM;
LogFunc((DEVICE_NAME ":VBoxUSBSolarisClose Dev=%d fFlag=%d fType=%d pCred=%p\n", Dev, fFlag, fType, pCred));
LogRel((DEVICE_NAME ":VBoxUSBSolarisClose failed to get device state for instance %d\n", instance));
return ENXIO;
return ENOTSUP;
return ENOTSUP;
int VBoxUSBSolarisPoll(dev_t Dev, short fEvents, int fAnyYet, short *pReqEvents, struct pollhead **ppPollHead)
LogFunc((DEVICE_NAME ":VBoxUSBSolarisPoll Dev=%d fEvents=%d fAnyYet=%d pReqEvents=%p\n", Dev, fEvents, fAnyYet, pReqEvents));
return ENXIO;
fEvents = 0;
if ( !fEvents
&& !fAnyYet)
LogFunc((DEVICE_NAME ":VBoxUSBSolarisPower pDip=%p Component=%d Level=%d\n", pDip, Component, Level));
return DDI_FAILURE;
return DDI_SUCCESS;
switch (Level)
case USB_DEV_OS_PWR_OFF:
case USB_DEV_OS_FULL_PWR:
#ifndef IOCPARM_LEN
/* LogFunc((DEVICE_NAME ":VBoxUSBSolarisIOCtl Dev=%d Cmd=%d pArg=%p Mode=%d\n", Dev, Cmd, pArg)); */
return EINVAL;
LogRel((DEVICE_NAME ": VBoxUSBSolarisIOCtl: bad request %#x size=%d expected=%d\n", Cmd, IOCPARM_LEN(Cmd),
sizeof(ReqWrap)));
return ENOTTY;
LogRel((DEVICE_NAME ": VBoxUSBSolarisIOCtl: ddi_copyin failed to read header pArg=%p Cmd=%d. rc=%d.\n", pArg, Cmd, rc));
return EINVAL;
LogRel((DEVICE_NAME ": VBoxUSBSolarisIOCtl: bad magic %#x; pArg=%p Cmd=%d.\n", ReqWrap.u32Magic, pArg, Cmd));
return EINVAL;
LogRel((DEVICE_NAME ": VBoxUSBSolarisIOCtl: bad size %#x; pArg=%p Cmd=%d.\n", ReqWrap.cbData, pArg, Cmd));
return EINVAL;
LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: RTMemTmpAlloc failed to alloc %d bytes.\n", ReqWrap.cbData));
return ENOMEM;
LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: ddi_copyin failed; pvBuf=%p pArg=%p Cmd=%d. rc=%d\n", pvBuf, pArg, Cmd, rc));
return EFAULT;
LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: invalid request pvBuf=%p cbData=%d\n", pvBuf, ReqWrap.cbData));
return EINVAL;
rc = 0;
LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: too much output data %d expected %d Truncating!\n", cbDataOut,
if (cbDataOut > 0)
LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: ddi_copyout failed; pvBuf=%p pArg=%p Cmd=%d. rc=%d\n", pvBuf, pArg,
LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: ddi_copyout(1)failed; pReqWrap=%p pArg=%p Cmd=%d. rc=%d\n", &ReqWrap, pArg,
return rc;
LOCAL int vboxUSBSolarisProcessIOCtl(int iFunction, void *pvState, int Mode, PVBOXUSBREQ pUSBReq, void *pvBuf, size_t *pcbDataOut)
// LogFunc((DEVICE_NAME ":vboxUSBSolarisProcessIOCtl iFunction=%d pvState=%p pUSBReq=%p\n", iFunction, pvState, pUSBReq));
int rc;
LogRel((DEVICE_NAME ":vboxUSBSolarisProcessIOCtl: " mnemonic ": cbData=%#zx (%zu) min is %#zx (%zu)\n", \
return VERR_BUFFER_OVERFLOW; \
return VERR_INVALID_PARAMETER; \
switch (iFunction)
case VBOXUSB_IOCTL_SEND_URB:
*pcbDataOut = 0;
case VBOXUSB_IOCTL_REAP_URB:
case VBOXUSB_IOCTL_CLEAR_EP:
*pcbDataOut = 0;
case VBOXUSB_IOCTL_SET_CONFIG:
*pcbDataOut = 0;
rc = vboxUSBSolarisSetInterface(pState, pSetInterfaceReq->bInterface, pSetInterfaceReq->bAlternate);
*pcbDataOut = 0;
*pcbDataOut = 0;
case VBOXUSB_IOCTL_ABORT_PIPE:
*pcbDataOut = 0;
case VBOXUSB_IOCTL_GET_CONFIG:
*pcbDataOut = 0;
return rc;
return VINF_SUCCESS;
return rc;
switch (Status)
default: return VUSBSTATUS_INVALID;
switch (UsbRc)
default: return VERR_GENERAL_FAILURE;
switch (uDeviceState)
case USB_DEV_DISCONNECTED:
default: return VERR_GENERAL_FAILURE;
* Check device for "usb" compatible property, root hubs->device would likely mean parent has no "usb" property.
rc = ddi_prop_lookup_string_array(DDI_DEV_T_ANY, pDip, DDI_PROP_DONTPASS, "compatible", &ppszCompatible, &cCompatible);
while (cCompatible--)
Log((DEVICE_NAME ":vboxUSBSolarisIsUSBDevice compatible[%d]=%s\n", cCompatible, ppszCompatible[cCompatible]));
if (pParentDip)
rc = ddi_prop_lookup_string_array(DDI_DEV_T_ANY, pParentDip, DDI_PROP_DONTPASS, "compatible", &ppszCompatible,
&cCompatible);
while (cCompatible--)
Log((DEVICE_NAME ":vboxUSBSolarisIsUSBDevice failed to obtain parent device for property lookup.\n"));
/* LogFunc((DEVICE_NAME ":vboxUSBSolarisSendUrb pState=%p pUrbReq=%p bEndpoint=%#x[%d] enmDir=%#x enmType=%#x cbData=%d pvData=%p\n",
pState, pUrbReq, pUrbReq->bEndpoint, EndPtIndex, pUrbReq->enmDir, pUrbReq->enmType, pUrbReq->cbData, pUrbReq->pvData)); */
return VERR_INVALID_POINTER;
return VERR_NO_MEMORY;
return VERR_NO_MEMORY;
if (pState->fClosed) /* Required for Isoc. IN Xfers which don't Xfer through the pipe after polling starts */
LogRel((DEVICE_NAME ":vboxUSBSolarisSendUrb OpenPipe failed. pState=%p pUrbReq=%p bEndpoint=%#x enmDir=%#x "
return VERR_BAD_PIPE;
case VUSBXFERTYPE_MSG:
case VUSBXFERTYPE_BULK:
case VUSBXFERTYPE_INTR:
case VUSBXFERTYPE_ISOC:
&& pUrb)
return rc;
if (pUrb)
&& cbData))
while (pMsg)
if (cbMsg > 0)
if (pUrb)
return rc;
Log((DEVICE_NAME ":vboxUSBSolarisClearEndPoint bEndpoint=%#x[%d] returns %d\n", bEndpoint, EndPtIndex, rc));
Log((DEVICE_NAME ":vboxUSBSolarisClearEndPoint not opened to be cleared. Faking success. bEndpoint=%#x.\n",
bEndpoint));
LogRel((DEVICE_NAME ":vboxUSBSolarisClearEndPoint Endpoint missing!! bEndpoint=%#x EndPtIndex=%d.\n", bEndpoint,
EndPtIndex));
return rc;
if (iCfgIndex >= 0)
rc = usb_set_cfg(pState->pDip, (uint_t)iCfgIndex, USB_FLAGS_SLEEP, NULL /* callback */, NULL /* callback data */);
LogRel((DEVICE_NAME ":vboxUSBSolarisSetConfig usb_set_cfg failed for iCfgIndex=%#x bCfgValue=%#x rc=%d\n",
LogRel((DEVICE_NAME ":vboxUSBSolarisSetConfig invalid iCfgIndex=%d bCfgValue=%#x\n", iCfgIndex, bCfgValue));
return rc;
if (pCurrCfg)
return VINF_SUCCESS;
return rc;
LogFunc((DEVICE_NAME ":vboxUSBSolarisSetInterface pState=%p uInterface=%#x uAlt=%#x\n", pState, uInterface, uAlt));
rc = usb_set_alt_if(pState->pDip, uInterface, uAlt, USB_FLAGS_SLEEP, NULL /* callback */, NULL /* callback data */);
LogRel((DEVICE_NAME ":vboxUSBSolarisSetInterface usb_set_alt_if failed for uInterface=%#x bAlt=%#x rc=%d\n",
return rc;
switch (enmReset)
case VBOXUSB_RESET_LEVEL_SOFT:
return rc;
return VERR_NOT_SUPPORTED;
LogRel((DEVICE_NAME ":vboxUSBSolarisAbortPipe invalid pipe index %d bEndpoint=%#x\n", EndPtIndex, bEndpoint));
return rc;
LOCAL int vboxUSBSolarisInitEndPoint(vboxusb_state_t *pState, usb_ep_data_t *pEpData, uchar_t uCfgValue,
LogFunc((DEVICE_NAME ":vboxUSBSolarisInitEndPoint pState=%p pEpData=%p CfgVal=%d Iface=%d Alt=%d", pState,
int EpIndex = 0;
if (!pEpData)
EpIndex = 0;
list_create(&pEp->hIsocInLandedReqs, sizeof(vboxusb_isoc_req_t), offsetof(vboxusb_isoc_req_t, hListLink));
Log((DEVICE_NAME ":vboxUSBSolarisInitEndPoint done. %s:[%d] bEndpoint=%#x\n", !pEpData ? "Default " : "Endpoint",
return VINF_SUCCESS;
int rc = vboxUSBSolarisInitEndPoint(pState, NULL /* pEp */, 0 /* uCfgValue */, 0 /* uInterface */, 0 /* uAlt */);
LogRel((DEVICE_NAME ":vboxUSBSolarisInitAllEndPoints: vboxUSBSolarisInitEndPoints uCfgIndex=%d failed. rc=%d\n",
return rc;
return rc;
LogFunc((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForConfig pState=%p uCfgIndex=%d\n", pState, uCfgIndex));
LogRel((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForConfig: vboxUSBSolarisInitEndPoint failed! pEp=%p "
return rc;
return VINF_SUCCESS;
LOCAL int vboxUSBSolarisInitEndPointsForInterfaceAlt(vboxusb_state_t *pState, uint8_t uInterface, uint8_t uAlt)
LogFunc((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForInterfaceAlt pState=%p uInterface=%d uAlt=%d\n", pState, uInterface,
uAlt));
LogRel((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForInterfaceAlt invalid current config index %d\n", uCfgIndex));
return VERR_GENERAL_FAILURE;
LogRel((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForInterfaceAlt: vboxUSBSolarisInitEndPoint failed! pEp=%p "
return rc;
return rc;
for (unsigned i = 0; i < VBOXUSB_MAX_ENDPOINTS; i++)
if (pEp)
while (pUrb)
while (pIsocReq)
if ( pEp
if (fDefault)
if ( pEp
return VINF_SUCCESS;
return VINF_SUCCESS;
int rc = usb_pipe_open(pState->pDip, &pEp->EpDesc, &pEp->PipePolicy, USB_FLAGS_NOSLEEP, &pEp->pPipe);
return rc;
usb_pipe_drain_reqs(pState->pDip, pEp->pPipe, 0, USB_FLAGS_SLEEP, NULL /* callback */, NULL /* callback arg. */);
Log((DEVICE_NAME ":vboxUSBSolarisClosePipe pipe bmAttributes=%#x bEndpointAddress=%#x\n", pEp->EpDesc.bmAttributes,
usb_pipe_close(pState->pDip, pEp->pPipe, USB_FLAGS_SLEEP, NULL /* callback */, NULL /* callback arg. */);
return CfgIndex;
LogRel((DEVICE_NAME ":vboxUSBSolarisGetIsocInURB failed to alloc %d bytes.\n", sizeof(vboxusb_urb_t)));
return pUrb;
LOCAL vboxusb_urb_t *vboxUSBSolarisQueueURB(vboxusb_state_t *pState, PVBOXUSBREQ_URB pUrbReq, mblk_t *pMsg)
if ( !pUrb
|| ( pUrb
return NULL;
return pUrb;
LogFunc((DEVICE_NAME ":vboxUSBSolarisCtrlXfer pState=%p pEp=%p pUrb=%p enmDir=%d cbData=%d\n", pState, pEp, pUrb,
size_t cbData = pUrb->cbDataR3 > VBOXUSB_CTRL_XFER_SIZE ? pUrb->cbDataR3 - VBOXUSB_CTRL_XFER_SIZE : 0;
&& cbData)
LogFunc((DEVICE_NAME ":vboxUSBSolarisCtrlXfer ctrl_wLength=%#RX16 cbData=%#zx fShortOk=%RTbool\n", pReq->ctrl_wLength,
return VINF_SUCCESS;
return rc;
* Completion/Exception callback for Control Xfers.
#ifdef DEBUG_ramshankar
LogRel((DEVICE_NAME ":vboxUSBSolarisCtrlXferCompleted failed to alloc %d bytes for Setup Header.\n",
sizeof(VUSBSETUP)));
LogFunc((DEVICE_NAME ":vboxUSBSolarisBulkXfer pState=%p pEp=%p pUrb=%p enmDir=%d cbData=%d\n", pState, pEp, pUrb,
usb_bulk_req_t *pReq = usb_alloc_bulk_req(pState->pDip, pUrb->enmDir == VUSBDIRECTION_IN ? pUrb->cbDataR3 : 0,
LogRel((DEVICE_NAME ":vboxUSBSolarisBulkXfer requesting %d bytes when only %d bytes supported by device\n",
return VINF_SUCCESS;
LogRel((DEVICE_NAME ":vboxUSBSolarisBulkXfer usb_pipe_bulk_xfer enmDir=%#x Ep=%#x failed! rc=%d\n", pUrb->enmDir,
return rc;
* Completion/Exception callback for Bulk Xfers.
LogRel((DEVICE_NAME ":vboxUSBSolarisBulkXferCompleted Extreme error! private request data missing.\n"));
LogFunc((DEVICE_NAME ":vboxUSBSolarisIntrXfer pState=%p pEp=%p pUrb=%p enmDir=%d cbData=%d\n", pState, pEp, pUrb,
pReq->intr_attributes = USB_ATTRS_AUTOCLEARING | USB_ATTRS_ONE_XFER | (pUrb->fShortOk ? USB_ATTRS_SHORT_XFER_OK : 0);
return VINF_SUCCESS;
return rc;
* Completion/Exception callback for Intr Xfers.
Log((DEVICE_NAME ":vboxUSBSolarisIntrXferCompleted rc=%d pMsg=%p enmDir=%#x\n", pReq->intr_completion_reason,
LogRel((DEVICE_NAME ":vboxUSBSolarisIntrXferCompleted Extreme error! private request data missing.\n"));
size_t cbData = (pUrb->enmDir == VUSBDIRECTION_IN ? pUrb->cIsocPkts * pUrb->aIsocPkts[0].cbPkt : 0);
return VERR_TOO_MUCH_DATA;
return VINF_SUCCESS;
usb_isoc_req_t *pReq = usb_alloc_isoc_req(pState->pDip, pUrb->cIsocPkts, cbData, USB_FLAGS_NOSLEEP);
Log((DEVICE_NAME ":vboxUSBSolarisIsocXfer enmDir=%#x cIsocPkts=%d aIsocPkts[0]=%d cbDataR3=%d\n", pUrb->enmDir,
pReq->isoc_attributes = USB_ATTRS_AUTOCLEARING | USB_ATTRS_ISOC_XFER_ASAP | USB_ATTRS_SHORT_XFER_OK;
return VINF_SUCCESS;
if (pIsocFailedUrb)
LogRel((DEVICE_NAME ":vboxUSBSolarisIsocXfer failed to alloc isoc req for %d packets\n", pUrb->cIsocPkts));
return rc;
* Completion/Exception callback for Isoc IN Xfers.
if ( pEp
Log((DEVICE_NAME ":vboxUSBSolarisIsocInXferCompleted cIsocInUrbs=%d cbIsocInLandedReqs=%d\n", pEp->cIsocInUrbs,
/* Huh!? cIsocInUrbs is wrong then! Should never happen unless we decide to decrement cIsocInUrbs in
pIsocReq->aIsocPkts[i].enmStatus = vboxUSBSolarisGetUrbStatus(pReq->isoc_pkt_descr[i].isoc_pkt_status);
bcopy(pReq->isoc_pkt_descr, pIsocReq->aIsocPkts, pReq->isoc_pkts_count * sizeof(VUSBISOC_PKT_DESC));
LogRel((DEVICE_NAME ":vboxUSBSolarisIsocInXferCompleted failed to alloc %d bytes for Isoc. queueing\n",
sizeof(vboxusb_isoc_req_t)));
if (!pBuffReq)
case USB_CR_NO_RESOURCES:
Log((DEVICE_NAME ":vboxUSBSolarisIsocInXferError resubmitted Isoc. IN request due to immediately unavailable "
case USB_CR_PIPE_CLOSING:
case USB_CR_STOPPED_POLLING:
case USB_CR_PIPE_RESET:
if (pUrb)
* Completion/Exception callback for Isoc OUT Xfers.
Log((DEVICE_NAME ":vboxUSBSolarisIsocOutXferCompleted cIsocPkts=%d cbData=%d cbActPkt=%d\n", pUrb->cIsocPkts,
Log((DEVICE_NAME ":vboxUSBSolarisIsocOutXferCompleted missing private data!?! Dropping OUT pUrb.\n"));
return USB_SUCCESS;
return USB_FAILURE;
return USB_SUCCESS;
return USB_FAILURE;
* Check if the same device is resumed/reconnected.
case USB_DEV_SUSPENDED:
case USB_DEV_ONLINE:
case USB_DEV_DISCONNECTED:
case USB_DEV_PWRED_DOWN:
for (int i = 0; i < VBOXUSB_DRAIN_TIME; i++)
return VERR_RESOURCE_BUSY;
return VINF_SUCCESS;
return rc;