Changeset 41687 in vbox for trunk/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c
- Timestamp:
- Jun 13, 2012 5:01:16 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c
r40200 r41687 108 108 109 109 /******************************************************************************* 110 * Kernel Entry Hook 110 * Kernel Entry Hooks * 111 111 *******************************************************************************/ 112 112 int VBoxUSBSolarisOpen(dev_t *pDev, int fFlag, int fType, cred_t *pCred); … … 317 317 LOCAL inline void vboxUSBSolarisDeQueueURB(vboxusb_urb_t *pUrb, int URBStatus); 318 318 LOCAL inline void vboxUSBSolarisNotifyComplete(vboxusb_state_t *pState); 319 LOCAL int vboxUSBSolarisProcessIOCtl(int iFunction, void *pvState, int Mode, PVBOXUSBREQ pUSBReq, void *pvBuf, size_t *pcbDataOut); 319 LOCAL int vboxUSBSolarisProcessIOCtl(int iFunction, void *pvState, int Mode, PVBOXUSBREQ pUSBReq, void *pvBuf, 320 size_t *pcbDataOut); 320 321 LOCAL bool vboxUSBSolarisIsUSBDevice(dev_info_t *pDip); 321 322 … … 555 556 char szDevicePath[MAXPATHLEN]; 556 557 ddi_pathname(pState->pDip, szDevicePath); 557 RTStrPrintf(pState->ClientInfo.szClientPath, sizeof(pState->ClientInfo.szClientPath), 558 "/devices%s:%s", 559 szDevicePath, 560 DEVICE_NAME); 558 RTStrPrintf(pState->ClientInfo.szClientPath, 559 sizeof(pState->ClientInfo.szClientPath), 560 "/devices%s:%s", szDevicePath,DEVICE_NAME); 561 561 RTPathStripFilename(szDevicePath); 562 RTStrPrintf(pState->ClientInfo.szDeviceIdent, sizeof(pState->ClientInfo.szDeviceIdent), 562 RTStrPrintf(pState->ClientInfo.szDeviceIdent, 563 sizeof(pState->ClientInfo.szDeviceIdent), 563 564 "%#x:%#x:%d:%s", 564 565 pState->pDevDesc->dev_descr->idVendor, 565 566 pState->pDevDesc->dev_descr->idProduct, 566 pState->pDevDesc->dev_descr->bcdDevice, 567 szDevicePath); 567 pState->pDevDesc->dev_descr->bcdDevice, szDevicePath); 568 568 pState->ClientInfo.Instance = instance; 569 569 pState->ClientInfo.pfnSetConsumerCredentials = &vboxUSBSolarisSetConsumerCredentials; … … 572 572 { 573 573 LogRel((DEVICE_NAME ": Captured %s %#x:%#x:%d:%s\n", 574 pState->pDevDesc->dev_product ? pState->pDevDesc->dev_product : "<Unnamed USB device>", 574 pState->pDevDesc->dev_product ? pState->pDevDesc->dev_product 575 : "<Unnamed USB device>", 575 576 pState->pDevDesc->dev_descr->idVendor, 576 577 pState->pDevDesc->dev_descr->idProduct, … … 582 583 else 583 584 { 584 LogRel((DEVICE_NAME ":VBoxUSBMonSolarisRegisterClient failed! rc=%d path=%s instance=%d\n", 585 rc, pState->ClientInfo.szClientPath, instance)); 585 LogRel((DEVICE_NAME ":VBoxUSBMonSolarisRegisterClient failed! rc=%d " 586 "path=%s instance=%d\n", rc, pState->ClientInfo.szClientPath, 587 instance)); 586 588 } 587 589 … … 589 591 } 590 592 else 591 LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach failed to register hotplug callbacks! rc=%d\n", rc)); 593 LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach failed to register hotplug " 594 "callbacks! rc=%d\n", rc)); 592 595 593 596 ddi_remove_minor_node(pState->pDip, NULL); 594 597 } 595 598 else 596 LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach ddi_create_minor_node failed! rc=%d\n", rc)); 599 { 600 LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach ddi_create_minor_node failed! rc=%d\n", 601 rc)); 602 } 597 603 } 598 604 else 599 LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach failed to initialize power management! rc=%d\n", rc)); 605 { 606 LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach failed to initialize power management! " 607 "rc=%d\n", rc)); 608 } 600 609 } 601 610 else 602 LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach vboxUSBSolarisInitAllEndPoints failed! rc=%d\n")); 611 { 612 LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach vboxUSBSolarisInitAllEndPoints failed! " 613 "rc=%d\n")); 614 } 603 615 } 604 616 else 605 LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach usb_pipe_get_max_bulk_transfer_size failed! rc=%d\n", rc)); 617 { 618 LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach usb_pipe_get_max_bulk_transfer_size failed! " 619 "rc=%d\n", rc)); 620 } 606 621 607 622 usb_fini_serialization(pState->StateMulti); … … 618 633 } 619 634 else 620 Log((DEVICE_NAME ":VBoxUSBSolarisAttach not a USB device.\n")); /* This would appear on every boot if it were Rel */ 635 { 636 /* This would appear on every boot if it were LogRel() */ 637 Log((DEVICE_NAME ":VBoxUSBSolarisAttach not a USB device.\n")); 638 } 621 639 } 622 640 else … … 850 868 else 851 869 { 852 LogRel((DEVICE_NAME ":vboxUSBSolarisSetConsumerCredentials failed! Process %u already has client open.\n", pState->Process)); 870 LogRel((DEVICE_NAME ":vboxUSBSolarisSetConsumerCredentials failed! Process %u already has client open.\n", 871 pState->Process)); 853 872 rc = VERR_RESOURCE_BUSY; 854 873 } … … 891 910 LogRel((DEVICE_NAME ":VBoxUSBSolarisOpen No prior information about authorized process.\n")); 892 911 else 893 LogRel((DEVICE_NAME ":VBoxUSBSolarisOpen Process % dis already using this device instance.\n", pState->Process));912 LogRel((DEVICE_NAME ":VBoxUSBSolarisOpen Process %u is already using this device instance.\n", pState->Process)); 894 913 895 914 mutex_exit(&pState->Mtx); … … 1091 1110 if (IOCPARM_LEN(Cmd) != sizeof(ReqWrap)) 1092 1111 { 1093 LogRel((DEVICE_NAME ": VBoxUSBSolarisIOCtl: bad request %#x size=%d expected=%d\n", Cmd, IOCPARM_LEN(Cmd), sizeof(ReqWrap))); 1112 LogRel((DEVICE_NAME ": VBoxUSBSolarisIOCtl: bad request %#x size=%d expected=%d\n", Cmd, IOCPARM_LEN(Cmd), 1113 sizeof(ReqWrap))); 1094 1114 return ENOTTY; 1095 1115 } … … 1149 1169 if (RT_UNLIKELY(cbDataOut > ReqWrap.cbData)) 1150 1170 { 1151 LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: too much output data %d expected %d Truncating!\n", cbDataOut, ReqWrap.cbData)); 1171 LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: too much output data %d expected %d Truncating!\n", cbDataOut, 1172 ReqWrap.cbData)); 1152 1173 cbDataOut = ReqWrap.cbData; 1153 1174 } … … 1169 1190 if (RT_UNLIKELY(rc)) 1170 1191 { 1171 LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: ddi_copyout failed; pvBuf=%p pArg=%p Cmd=%d. rc=%d\n", pvBuf, pArg, Cmd, rc)); 1192 LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: ddi_copyout failed; pvBuf=%p pArg=%p Cmd=%d. rc=%d\n", pvBuf, pArg, 1193 Cmd, rc)); 1172 1194 rc = EFAULT; 1173 1195 } … … 1176 1198 else 1177 1199 { 1178 LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: ddi_copyout(1)failed; pReqWrap=%p pArg=%p Cmd=%d. rc=%d\n", &ReqWrap, pArg, Cmd, rc)); 1200 LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: ddi_copyout(1)failed; pReqWrap=%p pArg=%p Cmd=%d. rc=%d\n", &ReqWrap, pArg, 1201 Cmd, rc)); 1179 1202 rc = EFAULT; 1180 1203 } … … 1560 1583 if (!strncmp(ppszCompatible[cCompatible], "usb", 3)) 1561 1584 { 1562 Log((DEVICE_NAME ":vboxUSBSolarisIsUSBDevice verified device as USB. pszCompatible=%s\n", ppszCompatible[cCompatible])); 1585 Log((DEVICE_NAME ":vboxUSBSolarisIsUSBDevice verified device as USB. pszCompatible=%s\n", 1586 ppszCompatible[cCompatible])); 1563 1587 ddi_prop_free(ppszCompatible); 1564 1588 return true; … … 1578 1602 if (pParentDip) 1579 1603 { 1580 rc = ddi_prop_lookup_string_array(DDI_DEV_T_ANY, pParentDip, DDI_PROP_DONTPASS, "compatible", &ppszCompatible, &cCompatible); 1604 rc = ddi_prop_lookup_string_array(DDI_DEV_T_ANY, pParentDip, DDI_PROP_DONTPASS, "compatible", &ppszCompatible, 1605 &cCompatible); 1581 1606 if (RT_LIKELY(rc == DDI_PROP_SUCCESS)) 1582 1607 { 1583 1608 while (cCompatible--) 1584 1609 { 1585 Log((DEVICE_NAME ":vboxUSBSolarisIsUSBDevice parent compatible[%d]=%s\n", cCompatible, ppszCompatible[cCompatible])); 1610 Log((DEVICE_NAME ":vboxUSBSolarisIsUSBDevice parent compatible[%d]=%s\n", cCompatible, 1611 ppszCompatible[cCompatible])); 1586 1612 if (!strncmp(ppszCompatible[cCompatible], "usb", 3)) 1587 1613 { … … 1610 1636 * 1611 1637 * @param pState The USB device instance. 1612 * @param pUrb 1638 * @param pUrbReq Pointer to the VBox USB URB. 1613 1639 * @param Mode The IOCtl mode. 1614 1640 * … … 1673 1699 mutex_exit(&pState->Mtx); 1674 1700 freemsg(pMsg); 1675 LogRel((DEVICE_NAME ":vboxUSBSolarisSendUrb OpenPipe failed. pState=%p pUrbReq=%p bEndpoint=%#x enmDir=%#x enmType=%#x cbData=%d pvData=%p rc=%d\n", 1676 pState, pUrbReq, pUrbReq->bEndpoint, pUrbReq->enmDir, pUrbReq->enmType, pUrbReq->cbData, pUrbReq->pvData, rc)); 1701 LogRel((DEVICE_NAME ":vboxUSBSolarisSendUrb OpenPipe failed. pState=%p pUrbReq=%p bEndpoint=%#x enmDir=%#x " 1702 "enmType=%#x cbData=%d pvData=%p rc=%d\n", pState, pUrbReq, pUrbReq->bEndpoint, pUrbReq->enmDir, 1703 pUrbReq->enmType, pUrbReq->cbData, pUrbReq->pvData, rc)); 1677 1704 return VERR_BAD_PIPE; 1678 1705 } … … 1724 1751 if (RT_FAILURE(rc)) 1725 1752 { 1753 /** @todo We share the state mutex for protecting concurrent accesses to both 1754 * the inflight URB list as well as pUrb->pMsg (data). Probably make this 1755 * more fine grained later by having a different mutex for the URB if 1756 * it's really worth the trouble. */ 1726 1757 mutex_enter(&pState->Mtx); 1727 1758 if (pUrb->pMsg) … … 1796 1827 { 1797 1828 vboxusb_urb_t *pUrb = list_remove_head(&pState->hLandedUrbs); 1829 1830 /* 1831 * It is safe to access pUrb->pMsg outside the state mutex because this is from the landed URB list 1832 * and not the inflight URB list. 1833 */ 1798 1834 mutex_exit(&pState->Mtx); 1799 1835 if (pUrb) … … 1856 1892 } 1857 1893 1858 Log((DEVICE_NAME ":vboxUSBSolarisReapUrb pvUrbR3=%p pvDataR3=%p cbData=%d\n", pUrbReq->pvUrbR3, pUrbReq->pvData, pUrbReq->cbData)); 1894 Log((DEVICE_NAME ":vboxUSBSolarisReapUrb pvUrbR3=%p pvDataR3=%p cbData=%d\n", pUrbReq->pvUrbR3, 1895 pUrbReq->pvData, pUrbReq->cbData)); 1859 1896 } 1860 1897 else … … 1993 2030 else 1994 2031 { 1995 Log((DEVICE_NAME ":vboxUSBSolarisClearEndPoint not opened to be cleared. Faking success. bEndpoint=%#x.\n", bEndpoint)); 2032 Log((DEVICE_NAME ":vboxUSBSolarisClearEndPoint not opened to be cleared. Faking success. bEndpoint=%#x.\n", 2033 bEndpoint)); 1996 2034 rc = VINF_SUCCESS; 1997 2035 } … … 1999 2037 else 2000 2038 { 2001 LogRel((DEVICE_NAME ":vboxUSBSolarisClearEndPoint Endpoint missing!! bEndpoint=%#x EndPtIndex=%d.\n", bEndpoint, EndPtIndex)); 2039 LogRel((DEVICE_NAME ":vboxUSBSolarisClearEndPoint Endpoint missing!! bEndpoint=%#x EndPtIndex=%d.\n", bEndpoint, 2040 EndPtIndex)); 2002 2041 rc = VERR_GENERAL_FAILURE; 2003 2042 } … … 2390 2429 if (RT_FAILURE(rc)) 2391 2430 { 2392 LogRel((DEVICE_NAME ":vboxUSBSolarisInitAllEndPoints: vboxUSBSolarisInitEndPoints uCfgIndex=%d failed. rc=%d\n", uCfgIndex, rc)); 2431 LogRel((DEVICE_NAME ":vboxUSBSolarisInitAllEndPoints: vboxUSBSolarisInitEndPoints uCfgIndex=%d failed. rc=%d\n", 2432 uCfgIndex, rc)); 2393 2433 return rc; 2394 2434 } … … 2431 2471 if (RT_FAILURE(rc)) 2432 2472 { 2433 LogRel((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForConfig: vboxUSBSolarisInitEndPoint failed! pEp=%p uCfgValue=%u uCfgIndex=%u uInterface=%u, uAlt=%u\n",2434 2473 LogRel((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForConfig: vboxUSBSolarisInitEndPoint failed! pEp=%p " 2474 "uCfgValue=%u uCfgIndex=%u uInterface=%u, uAlt=%u\n", uCfgValue, uCfgIndex, uInterface, uAlt)); 2435 2475 return rc; 2436 2476 } … … 2453 2493 LOCAL int vboxUSBSolarisInitEndPointsForInterfaceAlt(vboxusb_state_t *pState, uint8_t uInterface, uint8_t uAlt) 2454 2494 { 2455 LogFunc((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForInterfaceAlt pState=%p uInterface=%d uAlt=%d\n", pState, uInterface, uAlt)); 2495 LogFunc((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForInterfaceAlt pState=%p uInterface=%d uAlt=%d\n", pState, uInterface, 2496 uAlt)); 2456 2497 2457 2498 /* Doesn't hurt to be paranoid */ … … 2479 2520 if (RT_FAILURE(rc)) 2480 2521 { 2481 LogRel((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForInterfaceAlt: vboxUSBSolarisInitEndPoint failed! pEp=%p uCfgValue=%u uCfgIndex=%u uInterface=%u, uAlt=%u\n",2482 2522 LogRel((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForInterfaceAlt: vboxUSBSolarisInitEndPoint failed! pEp=%p " 2523 "uCfgValue=%u uCfgIndex=%u uInterface=%u, uAlt=%u\n", uCfgValue, uCfgIndex, uInterface, uAlt)); 2483 2524 return rc; 2484 2525 } … … 2506 2547 * 2507 2548 * @param pState The USB device instance. 2508 * @remarks Requires the state mutex to be held !!2549 * @remarks Requires the state mutex to be held. 2509 2550 * Call only from Detach() or similar as callbacks 2510 2551 */ … … 2512 2553 { 2513 2554 LogFunc((DEVICE_NAME ":vboxUSBSolarisDestroyAllEndPoints pState=%p\n", pState)); 2555 2556 Assert(mutex_owned(&pState->Mtx)); 2514 2557 for (unsigned i = 0; i < VBOXUSB_MAX_ENDPOINTS; i++) 2515 2558 { … … 2529 2572 * @param pState The USB device instance. 2530 2573 * @param pEp The Endpoint. 2574 * @remarks Requires the state mutex to be held. 2531 2575 */ 2532 2576 LOCAL void vboxUSBSolarisDestroyEndPoint(vboxusb_state_t *pState, vboxusb_ep_t *pEp) … … 2534 2578 LogFunc((DEVICE_NAME ":vboxUSBSolarisDestroyEndPoint pState=%p pEp=%p\n", pState, pEp)); 2535 2579 2580 Assert(mutex_owned(&pState->Mtx)); 2536 2581 if (pEp->fInitialized == VBOXUSB_EP_INITIALIZED) 2537 2582 { … … 2602 2647 * @param pState The USB device instance. 2603 2648 * @param pEp The Endpoint. 2649 * @remarks Requires the device state mutex to be held. 2604 2650 * 2605 2651 * @returns VBox status code. … … 2608 2654 { 2609 2655 // LogFunc((DEVICE_NAME ":vboxUSBSolarisOpenPipe pState=%p pEp=%p\n", pState, pEp)); 2656 2657 Assert(mutex_owned(&pState->Mtx)); 2610 2658 2611 2659 /* … … 2629 2677 * Open the non-default pipe for the Endpoint. 2630 2678 */ 2679 mutex_exit(&pState->Mtx); 2631 2680 int rc = usb_pipe_open(pState->pDip, &pEp->EpDesc, &pEp->PipePolicy, USB_FLAGS_NOSLEEP, &pEp->pPipe); 2681 mutex_enter(&pState->Mtx); 2632 2682 if (rc == USB_SUCCESS) 2633 2683 { … … 2715 2765 * Non-default pipe: close it. 2716 2766 */ 2717 Log((DEVICE_NAME ":vboxUSBSolarisClosePipe pipe bmAttributes=%#x bEndpointAddress=%#x\n", pEp->EpDesc.bmAttributes, pEp->EpDesc.bEndpointAddress)); 2767 Log((DEVICE_NAME ":vboxUSBSolarisClosePipe pipe bmAttributes=%#x bEndpointAddress=%#x\n", pEp->EpDesc.bmAttributes, 2768 pEp->EpDesc.bEndpointAddress)); 2718 2769 mutex_exit(&pState->Mtx); 2719 2770 usb_pipe_close(pState->pDip, pEp->pPipe, USB_FLAGS_SLEEP, NULL /* callback */, NULL /* callback arg. */); … … 2806 2857 * @param pMsg Pointer to the allocated request data. 2807 2858 * 2808 * @returns The allocated URB to be used .2859 * @returns The allocated URB to be used, or NULL upon failure. 2809 2860 */ 2810 2861 LOCAL vboxusb_urb_t *vboxUSBSolarisQueueURB(vboxusb_state_t *pState, PVBOXUSBREQ_URB pUrbReq, mblk_t *pMsg) … … 2836 2887 && pUrb->enmState != VBOXUSB_URB_STATE_FREE)) 2837 2888 { 2889 mutex_exit(&pState->Mtx); 2838 2890 pUrb = RTMemAllocZ(sizeof(vboxusb_urb_t)); 2839 2891 if (RT_UNLIKELY(!pUrb)) 2840 2892 { 2841 mutex_exit(&pState->Mtx);2842 2893 LogRel((DEVICE_NAME ":vboxUSBSolarisQueueURB failed to alloc %d bytes.\n", sizeof(vboxusb_urb_t))); 2843 2894 return NULL; 2844 2895 } 2896 mutex_enter(&pState->Mtx); 2845 2897 } 2846 2898 else … … 2850 2902 * up each one free 'head'. 2851 2903 */ 2904 Assert(pUrb && pUrb->enmState == VBOXUSB_URB_STATE_FREE); 2852 2905 list_remove_head(&pState->hUrbs); 2853 2906 } … … 2955 3008 * 2956 3009 * @param pState The USB device instance. 2957 * @remarks Requires the device state mutex to be held !!3010 * @remarks Requires the device state mutex to be held. 2958 3011 */ 2959 3012 LOCAL inline void vboxUSBSolarisNotifyComplete(vboxusb_state_t *pState) … … 3001 3054 LOCAL int vboxUSBSolarisCtrlXfer(vboxusb_state_t *pState, vboxusb_ep_t *pEp, vboxusb_urb_t *pUrb) 3002 3055 { 3003 LogFunc((DEVICE_NAME ":vboxUSBSolarisCtrlXfer pState=%p pEp=%p pUrb=%p enmDir=%d cbData=%d\n", pState, pEp, pUrb, pUrb->enmDir, pUrb->cbDataR3)); 3056 LogFunc((DEVICE_NAME ":vboxUSBSolarisCtrlXfer pState=%p pEp=%p pUrb=%p enmDir=%d cbData=%d\n", pState, pEp, pUrb, 3057 pUrb->enmDir, pUrb->cbDataR3)); 3004 3058 3005 3059 AssertPtrReturn(pUrb->pMsg, VERR_INVALID_PARAMETER); … … 3106 3160 pSetupMsg->b_wptr += sizeof(VUSBSETUP); 3107 3161 3162 /* 3163 * Should be safe to update pMsg here without the state mutex, see vboxUSBSolarisSendURB() 3164 * and vboxUSBSolarisQueueUURB() as the URB state is (still) not VBOXUSB_URB_STATE_FREE. 3165 */ 3108 3166 pUrb->pMsg = pSetupMsg; 3109 3167 pUrb->pMsg->b_cont = pReq->ctrl_data; … … 3115 3173 && pUrb->pMsg->b_cont == NULL) /* Concat succeeded */ 3116 3174 { 3117 Log((DEVICE_NAME ":vboxUSBSolarisCtrlXferCompleted prepended header rc=%d cbData=%d.\n", pReq->ctrl_completion_reason,3118 3175 Log((DEVICE_NAME ":vboxUSBSolarisCtrlXferCompleted prepended header rc=%d cbData=%d.\n", 3176 pReq->ctrl_completion_reason, MBLKL(pUrb->pMsg))); 3119 3177 Log((DEVICE_NAME ":%.*Rhxd\n", MBLKL(pUrb->pMsg), pUrb->pMsg->b_rptr)); 3120 3178 } … … 3129 3187 } 3130 3188 else 3131 LogRel((DEVICE_NAME ":vboxUSBSolarisCtrlXferCompleted failed to alloc %d bytes for Setup Header.\n", sizeof(VUSBSETUP))); 3189 { 3190 LogRel((DEVICE_NAME ":vboxUSBSolarisCtrlXferCompleted failed to alloc %d bytes for Setup Header.\n", 3191 sizeof(VUSBSETUP))); 3192 } 3132 3193 } 3133 3194 else … … 3150 3211 LOCAL int vboxUSBSolarisBulkXfer(vboxusb_state_t *pState, vboxusb_ep_t *pEp, vboxusb_urb_t *pUrb) 3151 3212 { 3152 LogFunc((DEVICE_NAME ":vboxUSBSolarisBulkXfer pState=%p pEp=%p pUrb=%p enmDir=%d cbData=%d\n", pState, pEp, pUrb, pUrb->enmDir, pUrb->cbDataR3)); 3213 LogFunc((DEVICE_NAME ":vboxUSBSolarisBulkXfer pState=%p pEp=%p pUrb=%p enmDir=%d cbData=%d\n", pState, pEp, pUrb, 3214 pUrb->enmDir, pUrb->cbDataR3)); 3153 3215 3154 3216 /* … … 3156 3218 */ 3157 3219 int rc = VINF_SUCCESS; 3158 usb_bulk_req_t *pReq = usb_alloc_bulk_req(pState->pDip, pUrb->enmDir == VUSBDIRECTION_IN ? pUrb->cbDataR3 : 0, USB_FLAGS_NOSLEEP); 3220 usb_bulk_req_t *pReq = usb_alloc_bulk_req(pState->pDip, pUrb->enmDir == VUSBDIRECTION_IN ? pUrb->cbDataR3 : 0, 3221 USB_FLAGS_NOSLEEP); 3159 3222 if (RT_LIKELY(pReq)) 3160 3223 { … … 3188 3251 else 3189 3252 { 3190 LogRel((DEVICE_NAME ":vboxUSBSolarisBulkXfer usb_pipe_bulk_xfer enmDir=%#x Ep=%#x failed! rc=%d\n", pUrb->enmDir, pUrb->bEndpoint, rc)); 3253 LogRel((DEVICE_NAME ":vboxUSBSolarisBulkXfer usb_pipe_bulk_xfer enmDir=%#x Ep=%#x failed! rc=%d\n", pUrb->enmDir, 3254 pUrb->bEndpoint, rc)); 3191 3255 rc = VERR_PIPE_IO_ERROR; 3192 3256 } … … 3268 3332 LOCAL int vboxUSBSolarisIntrXfer(vboxusb_state_t *pState, vboxusb_ep_t *pEp, vboxusb_urb_t *pUrb) 3269 3333 { 3270 LogFunc((DEVICE_NAME ":vboxUSBSolarisIntrXfer pState=%p pEp=%p pUrb=%p enmDir=%d cbData=%d\n", pState, pEp, pUrb, pUrb->enmDir, pUrb->cbDataR3)); 3334 LogFunc((DEVICE_NAME ":vboxUSBSolarisIntrXfer pState=%p pEp=%p pUrb=%p enmDir=%d cbData=%d\n", pState, pEp, pUrb, 3335 pUrb->enmDir, pUrb->cbDataR3)); 3271 3336 3272 3337 int rc = VINF_SUCCESS; … … 3347 3412 } 3348 3413 3349 Log((DEVICE_NAME ":vboxUSBSolarisIntrXferCompleted rc=%d pMsg=%p enmDir=%#x\n", pReq->intr_completion_reason, pUrb->pMsg,3350 3414 Log((DEVICE_NAME ":vboxUSBSolarisIntrXferCompleted rc=%d pMsg=%p enmDir=%#x\n", pReq->intr_completion_reason, 3415 pUrb->pMsg, pUrb->enmDir)); 3351 3416 3352 3417 /* … … 3533 3598 if (RT_LIKELY(pReq->isoc_data)) 3534 3599 { 3535 Log((DEVICE_NAME ":vboxUSBSolarisIsocInXferCompleted cIsocInUrbs=%d cbIsocInLandedReqs=%d\n", pEp->cIsocInUrbs, pEp->cbIsocInLandedReqs)); 3600 Log((DEVICE_NAME ":vboxUSBSolarisIsocInXferCompleted cIsocInUrbs=%d cbIsocInLandedReqs=%d\n", pEp->cIsocInUrbs, 3601 pEp->cbIsocInLandedReqs)); 3536 3602 3537 3603 mutex_enter(&pState->Mtx); … … 3548 3614 --pEp->cIsocInUrbs; 3549 3615 mutex_exit(&pState->Mtx); 3550 #if 0 3616 3551 3617 for (unsigned i = 0; i < pReq->isoc_pkts_count; i++) 3552 3618 { … … 3554 3620 pUrb->aIsocPkts[i].enmStatus = vboxUSBSolarisGetUrbStatus(pReq->isoc_pkt_descr[i].isoc_pkt_status); 3555 3621 } 3556 #else 3557 bcopy(pReq->isoc_pkt_descr, pUrb->aIsocPkts, sizeof(VUSBISOC_PKT_DESC) * pReq->isoc_pkts_count); 3558 #endif 3622 3559 3623 pUrb->pMsg = pReq->isoc_data; 3560 3624 pReq->isoc_data = NULL; … … 3569 3633 else 3570 3634 { 3571 /* Huh!? cIsocInUrbs is wrong then! Should never happen unless we decide to decrement cIsocInUrbs in Reap time */ 3635 /* Huh!? cIsocInUrbs is wrong then! Should never happen unless we decide to decrement cIsocInUrbs in 3636 Reap time */ 3572 3637 pEp->cIsocInUrbs = 0; 3573 3638 LogRel((DEVICE_NAME ":vboxUSBSolarisIsocInXferCompleted Extreme error! Isoc. counter b0rked!\n")); … … 3725 3790 mutex_exit(&pState->Mtx); 3726 3791 usb_pipe_isoc_xfer(pPipe, pReq, USB_FLAGS_NOSLEEP); 3727 Log((DEVICE_NAME ":vboxUSBSolarisIsocInXferError resubmitted Isoc. IN request due to immediately unavailable resources.\n")); 3792 Log((DEVICE_NAME ":vboxUSBSolarisIsocInXferError resubmitted Isoc. IN request due to immediately unavailable " 3793 "resources.\n")); 3728 3794 3729 3795 return; … … 3741 3807 default: 3742 3808 { 3743 Log((DEVICE_NAME ":vboxUSBSolarisIsocInXferError stopping Isoc. In. polling due to rc=%d\n", pReq->isoc_completion_reason)); 3809 Log((DEVICE_NAME ":vboxUSBSolarisIsocInXferError stopping Isoc. In. polling due to rc=%d\n", 3810 pReq->isoc_completion_reason)); 3744 3811 pEp->fIsocPolling = false; 3745 3812 mutex_exit(&pState->Mtx); … … 3793 3860 } 3794 3861 3795 Log((DEVICE_NAME ":vboxUSBSolarisIsocOutXferCompleted cIsocPkts=%d cbData=%d cbActPkt=%d\n", pUrb->cIsocPkts, pUrb->cbDataR3, cbActPkt)); 3862 Log((DEVICE_NAME ":vboxUSBSolarisIsocOutXferCompleted cIsocPkts=%d cbData=%d cbActPkt=%d\n", pUrb->cIsocPkts, 3863 pUrb->cbDataR3, cbActPkt)); 3796 3864 3797 3865 if (pReq->isoc_completion_reason == USB_CR_OK)
Note:
See TracChangeset
for help on using the changeset viewer.