Changeset 39354 in vbox for trunk/src/VBox
- Timestamp:
- Nov 17, 2011 5:03:18 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c
r38895 r39354 298 298 LOCAL void vboxUSBSolarisDestroyEndPoint(vboxusb_state_t *pState, vboxusb_ep_t *pEp); 299 299 LOCAL void vboxUSBSolarisCloseAllPipes(vboxusb_state_t *pState, bool fControlPipe); 300 LOCAL void vboxUSBSolarisCloseInterface(vboxusb_state_t *pState, uint8_t bInterface);301 300 LOCAL int vboxUSBSolarisOpenPipe(vboxusb_state_t *pState, vboxusb_ep_t *pEp); 302 301 LOCAL void vboxUSBSolarisClosePipe(vboxusb_state_t *pState, vboxusb_ep_t *pEp); … … 328 327 LOCAL int vboxUSBSolarisCloseDevice(vboxusb_state_t *pState, VBOXUSB_RESET_LEVEL enmReset); 329 328 LOCAL int vboxUSBSolarisAbortPipe(vboxusb_state_t *pState, uint8_t bEndpoint); 330 LOCAL bool vboxUSBSolarisIsAnyPipeOpen(vboxusb_state_t *pState);331 329 LOCAL int vboxUSBSolarisGetConfigIndex(vboxusb_state_t *pState, uint_t uCfgValue); 332 330 … … 703 701 */ 704 702 vboxUSBSolarisCloseAllPipes(pState, true /* ControlPipe */); 703 pState->fClosed = true; 705 704 706 705 /* … … 1723 1722 if (RT_FAILURE(rc)) 1724 1723 { 1725 freemsg(pUrb->pMsg); 1724 mutex_enter(&pState->Mtx); 1725 if (pUrb->pMsg) 1726 { 1727 freemsg(pUrb->pMsg); 1728 pUrb->pMsg = NULL; 1729 } 1726 1730 1727 1731 if ( pUrb->enmType == VUSBXFERTYPE_ISOC … … 1736 1740 pUrb->enmState = VBOXUSB_URB_STATE_FREE; 1737 1741 } 1742 mutex_exit(&pState->Mtx); 1738 1743 } 1739 1744 } … … 2591 2596 2592 2597 /** 2593 * Closes all pipes for a given interface.2594 *2595 * @param pState The USB device instance.2596 * @param bInterface The Interface.2597 */2598 LOCAL void vboxUSBSolarisCloseInterface(vboxusb_state_t *pState, uint8_t bInterface)2599 {2600 LogFunc((DEVICE_NAME ":vboxUSBSolarisCloseInterface pState=%p bInterface=%#x\n", pState, bInterface));2601 2602 for (int i = 1; i < VBOXUSB_MAX_ENDPOINTS; i++)2603 {2604 vboxusb_ep_t *pEp = &pState->aEps[i];2605 if ( pEp2606 && pEp->pPipe2607 && pEp->uInterface == bInterface)2608 {2609 Log((DEVICE_NAME ":vboxUSBSolarisCloseInterface closing[%d]\n", i));2610 vboxUSBSolarisClosePipe(pState, pEp);2611 }2612 }2613 }2614 2615 2616 /**2617 2598 * Open the pipe for an Endpoint. 2618 2599 * … … 2747 2728 2748 2729 Assert(pEp->pPipe == NULL); 2749 }2750 2751 2752 /**2753 * Check if any non-default Endpoints are open.2754 *2755 * @param pState The USB device instance.2756 *2757 * @returns Returns true if any non-default Endpoint is open, otherwise false.2758 */2759 LOCAL bool vboxUSBSolarisIsAnyPipeOpen(vboxusb_state_t *pState)2760 {2761 LogFunc((DEVICE_NAME ":vboxUSBSolarisIsAnyPipeOpen pState=%p\n", pState));2762 2763 for (int i = 1; i < VBOXUSB_MAX_ENDPOINTS; i++)2764 {2765 vboxusb_ep_t *pEp = &pState->aEps[i];2766 if (pEp->pPipe)2767 {2768 Log((DEVICE_NAME ":vboxUSBSolarisIsAnyPipeOpen pState=%p pEp=%p returns true.\n", pState, pEp));2769 return true;2770 }2771 }2772 2773 Log((DEVICE_NAME ":vboxUSBSolarisIsAnyPipeOpen pState=%p returns false.\n", pState));2774 return false;2775 2730 } 2776 2731 … … 2879 2834 && pUrb->enmState != VBOXUSB_URB_STATE_FREE)) 2880 2835 { 2881 mutex_exit(&pState->Mtx);2882 2836 pUrb = RTMemAllocZ(sizeof(vboxusb_urb_t)); 2883 2837 if (RT_UNLIKELY(!pUrb)) 2884 2838 { 2839 mutex_exit(&pState->Mtx); 2885 2840 LogRel((DEVICE_NAME ":vboxUSBSolarisQueueURB failed to alloc %d bytes.\n", sizeof(vboxusb_urb_t))); 2886 2841 return NULL; 2887 2842 } 2888 mutex_enter(&pState->Mtx);2889 2843 } 2890 2844 else … … 2901 2855 2902 2856 pUrb->enmState = VBOXUSB_URB_STATE_INFLIGHT; 2903 2904 mutex_exit(&pState->Mtx);2905 2857 2906 2858 Assert(pUrb->pMsg == NULL); … … 2926 2878 pUrb->pMsg = pMsg; 2927 2879 } 2880 2881 mutex_exit(&pState->Mtx); 2928 2882 2929 2883 return pUrb;
Note:
See TracChangeset
for help on using the changeset viewer.