Changeset 47497 in vbox for trunk/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c
- Timestamp:
- Jul 31, 2013 4:43:28 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c
r43816 r47497 5 5 6 6 /* 7 * Copyright (C) 2008-201 2Oracle Corporation7 * Copyright (C) 2008-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 96 96 /** -=-=-=-=-=-=- Tunable Parameters -=-=-=-=-=-=- */ 97 97 /** Time to wait while draining inflight UBRs on suspend, in seconds. */ 98 #define VBOXUSB_DRAIN_TIME 3098 #define VBOXUSB_DRAIN_TIME 20 99 99 /** Ctrl Xfer timeout in seconds. */ 100 100 #define VBOXUSB_CTRL_XFER_TIMEOUT 10 … … 1868 1868 * Paranoia: we should have a single message block almost always. 1869 1869 */ 1870 if (RT_LIKELY(!pUrb->pMsg->b_cont && cbData > 0)) 1870 if (RT_LIKELY( !pUrb->pMsg->b_cont 1871 && cbData)) 1871 1872 { 1872 1873 rc = ddi_copyout(pUrb->pMsg->b_rptr, (void *)pUrbReq->pvData, cbData, Mode); 1873 if (RT_UNLIKELY(rc != 0))1874 if (RT_UNLIKELY(rc)) 1874 1875 { 1875 1876 LogRel((DEVICE_NAME ":vboxUSBSolarisReapUrb ddi_copyout failed! rc=%d\n", rc)); … … 1944 1945 AssertCompile(sizeof(pUrbReq->aIsocPkts) == sizeof(pUrb->aIsocPkts)); 1945 1946 pUrbReq->cIsocPkts = pUrb->cIsocPkts; 1946 #if 0 1947 1947 1948 for (unsigned i = 0; i < pUrb->cIsocPkts; i++) 1948 1949 { 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; 1951 1952 pUrbReq->aIsocPkts[i].enmStatus = pUrb->aIsocPkts[i].enmStatus; 1952 1953 } 1953 #else1954 bcopy(pUrb->aIsocPkts, pUrbReq->aIsocPkts, pUrb->cIsocPkts * sizeof(VUSBISOC_PKT_DESC));1955 #endif1956 1954 1957 1955 if (pUrb->enmDir == VUSBDIRECTION_IN) … … 1981 1979 mutex_exit(&pState->Mtx); 1982 1980 1983 Log((DEVICE_NAME ":vboxUSBSolarisReapUrb returns %d\n", rc));1984 1981 return rc; 1985 1982 } … … 2234 2231 int rc = vboxUSBSolarisDeviceState(pState->DevState); 2235 2232 2236 if (enmReset == VBOXUSB_RESET_LEVEL_ NONE)2233 if (enmReset == VBOXUSB_RESET_LEVEL_CLOSE) 2237 2234 { 2238 2235 vboxUSBSolarisCloseAllPipes(pState, true /* ControlPipe */); … … 2663 2660 LOCAL int vboxUSBSolarisOpenPipe(vboxusb_state_t *pState, vboxusb_ep_t *pEp) 2664 2661 { 2665 // LogFunc((DEVICE_NAME ":vboxUSBSolarisOpenPipe pState=%p pEp=%p\n", pState, pEp));2666 2667 2662 Assert(mutex_owned(&pState->Mtx)); 2668 2663 … … 2672 2667 if (pEp->pPipe) 2673 2668 return VINF_SUCCESS; 2669 2674 2670 2675 2671 /* … … 2692 2688 if (rc == USB_SUCCESS) 2693 2689 { 2690 LogFunc((DEVICE_NAME ":vboxUSBSolarisOpenPipe: Opened pipe. pState=%p pEp=%p\n", pState, pEp)); 2694 2691 usb_pipe_set_private(pEp->pPipe, (usb_opaque_t)pEp); 2695 2692 … … 2927 2924 if (RT_LIKELY(pUrbReq)) 2928 2925 { 2929 pUrb->pvUrbR3 = pUrbReq->pvUrbR3;2926 pUrb->pvUrbR3 = pUrbReq->pvUrbR3; 2930 2927 pUrb->bEndpoint = pUrbReq->bEndpoint; 2931 pUrb->enmType = pUrbReq->enmType;2932 pUrb->enmDir = pUrbReq->enmDir;2928 pUrb->enmType = pUrbReq->enmType; 2929 pUrb->enmDir = pUrbReq->enmDir; 2933 2930 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; 2936 2934 pUrb->cIsocPkts = pUrbReq->cIsocPkts; 2935 2937 2936 if (pUrbReq->enmType == VUSBXFERTYPE_ISOC) 2938 2937 { … … 3069 3068 AssertPtrReturn(pUrb->pMsg, VERR_INVALID_PARAMETER); 3070 3069 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; 3077 3071 3078 3072 /* … … 3093 3087 3094 3088 if ( pUrb->enmDir == VUSBDIRECTION_OUT 3095 && cbData > 0)3089 && cbData) 3096 3090 { 3097 3091 pUrb->pMsg->b_rptr += VBOXUSB_CTRL_XFER_SIZE; … … 3119 3113 pReq->ctrl_client_private = (usb_opaque_t)pUrb; 3120 3114 3115 LogFunc((DEVICE_NAME ":vboxUSBSolarisCtrlXfer ctrl_wLength=%#RX16 cbData=%#zx fShortOk=%RTbool\n", pReq->ctrl_wLength, 3116 cbData, !!(fAttributes & USB_ATTRS_SHORT_XFER_OK))); 3121 3117 Log((DEVICE_NAME ":vboxUSBSolarisCtrlXfer %.*Rhxd\n", VBOXUSB_CTRL_XFER_SIZE, pSetupData)); 3122 3118 … … 3185 3181 vboxUSBSolarisConcatMsg(pUrb); 3186 3182 3187 #if defined(DEBUG_ramshankar)3183 #ifdef DEBUG_ramshankar 3188 3184 if ( pUrb->pMsg 3189 3185 && pUrb->pMsg->b_cont == NULL) /* Concat succeeded */ … … 3199 3195 */ 3200 3196 vboxUSBSolarisDeQueueURB(pUrb, pReq->ctrl_completion_reason); 3201 usb_free_ctrl_req(pReq);3202 return;3203 3197 } 3204 3198 else
Note:
See TracChangeset
for help on using the changeset viewer.