9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync * USBLib - Library for wrapping up the VBoxUSB functionality, Solaris flavor.
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync * (DEV,HDrv,Main)
7e5ac7913370b687d1b62e233ce54247d9db0f4fvboxsync * Copyright (C) 2008-2013 Oracle Corporation
3f1f30f349c6d9ef74ba8d16ff0c5b0ac47def6cvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
3f1f30f349c6d9ef74ba8d16ff0c5b0ac47def6cvboxsync * available from http://www.virtualbox.org. This file is free software;
3f1f30f349c6d9ef74ba8d16ff0c5b0ac47def6cvboxsync * you can redistribute it and/or modify it under the terms of the GNU
3f1f30f349c6d9ef74ba8d16ff0c5b0ac47def6cvboxsync * General Public License (GPL) as published by the Free Software
3f1f30f349c6d9ef74ba8d16ff0c5b0ac47def6cvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
3f1f30f349c6d9ef74ba8d16ff0c5b0ac47def6cvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
3f1f30f349c6d9ef74ba8d16ff0c5b0ac47def6cvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
3f1f30f349c6d9ef74ba8d16ff0c5b0ac47def6cvboxsync * The contents of this file may alternatively be used under the terms
3f1f30f349c6d9ef74ba8d16ff0c5b0ac47def6cvboxsync * of the Common Development and Distribution License Version 1.0
3f1f30f349c6d9ef74ba8d16ff0c5b0ac47def6cvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
3f1f30f349c6d9ef74ba8d16ff0c5b0ac47def6cvboxsync * VirtualBox OSE distribution, in which case the provisions of the
3f1f30f349c6d9ef74ba8d16ff0c5b0ac47def6cvboxsync * CDDL are applicable instead of those of the GPL.
3f1f30f349c6d9ef74ba8d16ff0c5b0ac47def6cvboxsync * You may elect to license modified versions of this file under the
3f1f30f349c6d9ef74ba8d16ff0c5b0ac47def6cvboxsync * terms and conditions of either the GPL or the CDDL or both.
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/** @defgroup grp_USBLib_solaris Solaris Specifics
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync * @addtogroup grp_USBLib
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/** @name VBoxUSB specific IOCtls.
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync * VBoxUSB uses them for resetting USB devices requests from userland.
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync * USBProxyService/Device makes use of them to communicate with VBoxUSB.
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/** Ring-3 request wrapper for big requests.
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync * This is necessary because the ioctl number scheme on many Unixy OSes (esp. Solaris)
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync * only allows a relatively small size to be encoded into the request. So, for big
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync * request this generic form is used instead. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /** Magic value (VBOXUSB(MON)_MAGIC). */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /** The size of the data buffer (In & Out). */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /** Result code of the request filled by driver. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /** The user address of the data buffer. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/** Pointer to a request wrapper for solaris. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/** Pointer to a const request wrapper for solaris. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef struct
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /* Pointer to the Filter. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /* Where to store the added Filter (Id). */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef struct
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /* Pointer to Filter (Id) to be removed. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef struct
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /** Whether to re-attach the driver. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /* Physical path of the USB device. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef struct
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /* Where to store the instance. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /* Physical path of the USB device. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef struct
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /** Where to store the instance. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /* Where to store the client path. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /** Device identifier (VendorId:ProductId:Release:StaticPath) */
27a89c2c0495676503f99e4a63586e3073530d46vboxsync /** Callback from monitor specifying client consumer (VM) credentials */
27a89c2c0495676503f99e4a63586e3073530d46vboxsync DECLR0CALLBACKMEMBER(int, pfnSetConsumerCredentials,(RTPROCESS Process, int Instance, void *pvReserved));
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef PVBOXUSBREQ_CLIENT_INFO PVBOXUSB_CLIENT_INFO;
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/** Isoc packet descriptor (Must mirror exactly Solaris USBA's usb_isoc_pkt_descr_t) */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef struct
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync ushort_t cbActPkt; /* Size of the packet actually transferred */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync VUSBSTATUS enmStatus; /* Per frame transfer status */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/** VBoxUSB IOCtls */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef struct
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync void *pvUrbR3; /* Pointer to userland URB (untouched by kernel driver) */
a93df3b074afab82b9f5fa0d5dde963d22857521vboxsync bool fShortOk; /* Whether receiving less data than requested is acceptable. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync VUSBISOC_PKT_DESC aIsocPkts[8]; /* Array of Isoc packet descriptors */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef struct
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef struct
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef VBOXUSBREQ_SET_CONFIG VBOXUSBREQ_GET_CONFIG;
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef PVBOXUSBREQ_SET_CONFIG PVBOXUSBREQ_GET_CONFIG;
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef struct
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync} VBOXUSBREQ_SET_INTERFACE, *PVBOXUSBREQ_SET_INTERFACE;
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef enum
7e5ac7913370b687d1b62e233ce54247d9db0f4fvboxsync /** Close device not a reset. */
7e5ac7913370b687d1b62e233ce54247d9db0f4fvboxsync /** Hard reset resulting in device replug behaviour. */
7e5ac7913370b687d1b62e233ce54247d9db0f4fvboxsync /** Device-level reset. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef struct
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync VBOXUSB_RESET_LEVEL ResetLevel; /* Reset level after closing */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync} VBOXUSBREQ_CLOSE_DEVICE, *PVBOXUSBREQ_CLOSE_DEVICE;
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef struct
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef struct
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/** The VBOXUSBREQ::u32Magic value for VBoxUSBMon. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/** The VBOXUSBREQ::u32Magic value for VBoxUSB.*/
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/** The USBLib entry point for userland. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/** The USBMonitor Major version. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/** The USBMonitor Minor version. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/** The USB Major version. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/** The USB Minor version. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/** USB driver name*/
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/* No automatic buffering, size limited to 255 bytes => use VBOXUSBREQ for everything. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSB_IOCTL_CODE(Function, Size) _IOWRN('V', (Function) | VBOXUSB_IOCTL_FLAG, sizeof(VBOXUSBREQ))
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSB_IOCTL_CODE_FAST(Function) _IO( 'V', (Function) | VBOXUSB_IOCTL_FLAG)
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSBMON_IOCTL_ADD_FILTER VBOXUSB_IOCTL_CODE(1, (sizeof(VBoxUSBAddFilterReq)))
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSBMON_IOCTL_REMOVE_FILTER VBOXUSB_IOCTL_CODE(2, (sizeof(VBoxUSBRemoveFilterReq)))
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSBMON_IOCTL_RESET_DEVICE VBOXUSB_IOCTL_CODE(3, (sizeof(VBOXUSBREQ_RESET_DEVICE)))
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSBMON_IOCTL_DEVICE_INSTANCE VBOXUSB_IOCTL_CODE(4, (sizeof(VBOXUSBREQ_DEVICE_INSTANCE)))
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSBMON_IOCTL_CLIENT_INFO VBOXUSB_IOCTL_CODE(5, (sizeof(VBOXUSBREQ_CLIENT_PATH)))
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSBMON_IOCTL_GET_VERSION VBOXUSB_IOCTL_CODE(6, (sizeof(VBOXUSBREQ_GET_VERSION)))
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/* VBoxUSB ioctls */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSB_IOCTL_SEND_URB VBOXUSB_IOCTL_CODE(20, (sizeof(VBOXUSBREQ_URB))) /* 1072146796 */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSB_IOCTL_REAP_URB VBOXUSB_IOCTL_CODE(21, (sizeof(VBOXUSBREQ_URB))) /* 1072146795 */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSB_IOCTL_CLEAR_EP VBOXUSB_IOCTL_CODE(22, (sizeof(VBOXUSBREQ_CLEAR_EP))) /* 1072146794 */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSB_IOCTL_SET_CONFIG VBOXUSB_IOCTL_CODE(23, (sizeof(VBOXUSBREQ_SET_CONFIG))) /* 1072146793 */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSB_IOCTL_SET_INTERFACE VBOXUSB_IOCTL_CODE(24, (sizeof(VBOXUSBREQ_SET_INTERFACE))) /* 1072146792 */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSB_IOCTL_CLOSE_DEVICE VBOXUSB_IOCTL_CODE(25, (sizeof(VBOXUSBREQ_CLOSE_DEVICE))) /* 1072146791 0xc0185699 */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSB_IOCTL_ABORT_PIPE VBOXUSB_IOCTL_CODE(26, (sizeof(VBOXUSBREQ_ABORT_PIPE))) /* 1072146790 */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSB_IOCTL_GET_CONFIG VBOXUSB_IOCTL_CODE(27, (sizeof(VBOXUSBREQ_GET_CONFIG))) /* 1072146789 */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync#define VBOXUSB_IOCTL_GET_VERSION VBOXUSB_IOCTL_CODE(28, (sizeof(VBOXUSBREQ_GET_VERSION))) /* 1072146788 */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/* USBLibHelper data for resetting the device. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /** Path of the USB device. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /** Re-enumerate or not. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef VBOXUSBHELPERDATA_RESET *PVBOXUSBHELPERDATA_RESET;
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef const VBOXUSBHELPERDATA_RESET *PCVBOXUSBHELPERDATA_RESET;
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/* USBLibHelper data for device hijacking. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /** Vendor ID. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /** Product ID. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /** Revision, integer part. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync /** Path of the USB device. */
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef VBOXUSBHELPERDATA_ALIAS *PVBOXUSBHELPERDATA_ALIAS;
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsynctypedef const VBOXUSBHELPERDATA_ALIAS *PCVBOXUSBHELPERDATA_ALIAS;
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsyncUSBLIB_DECL(int) USBLibResetDevice(char *pszDevicePath, bool fReattach);
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsyncUSBLIB_DECL(int) USBLibDeviceInstance(char *pszDevicePath, int *pInstance);
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsyncUSBLIB_DECL(int) USBLibGetClientInfo(char *pszDeviceIdent, char **ppszClientPath, int *pInstance);
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsyncUSBLIB_DECL(int) USBLibAddDeviceAlias(PUSBDEVICE pDevice);
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsyncUSBLIB_DECL(int) USBLibRemoveDeviceAlias(PUSBDEVICE pDevice);
9de2fa82343af2df7df171b18afbe32b6f37ed84vboxsync/*USBLIB_DECL(int) USBLibConfigureDevice(PUSBDEVICE pDevice);*/