VirtualBox

source: vbox/trunk/include/VBox/usblib.h@ 8251

Last change on this file since 8251 was 8251, checked in by vboxsync, 16 years ago

USBLib goes into VBoxDDU.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
RevLine 
[1]1/** @file
[5563]2 * USBLIB - USB Support Library.
3 * This module implements the basic low-level OS interfaces.
[1]4 */
5
6/*
[8155]7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
[1]8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
[5999]12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
[8155]25 *
26 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
27 * Clara, CA 95054 USA or visit http://www.sun.com if you need
28 * additional information or have any questions.
[1]29 */
30
[3632]31#ifndef ___VBox_usblib_h
32#define ___VBox_usblib_h
[1]33
34#include <VBox/cdefs.h>
35#include <VBox/types.h>
36#include <VBox/usb.h>
37
[3758]38#ifdef RT_OS_WINDOWS
[5563]39# include <VBox/usblib-win.h>
[1]40#endif
[8145]41#ifdef RT_OS_SOLARIS
42# include <VBox/usblib-solaris.h>
43#endif
[8014]44#ifdef RT_OS_DARWIN
45# include <VBox/usblib-darwin.h>
46#endif
[5563]47/** @todo merge the usblib-win.h interface into the darwin and linux ports where suitable. */
[1]48
[8251]49__BEGIN_DECLS
[5563]50/** @defgroup grp_USBLib USBLib - USB Support Library
51 * This module implements the basic low-level OS interfaces and common USB code.
[1]52 * @{
53 */
54
[8014]55#ifndef RT_OS_WINDOWS
56#ifdef IN_RING3
57/**
58 * Initializes the USBLib component.
59 *
60 * The USBLib keeps a per process connection to the kernel driver
61 * and all USBLib users within a process will share the same
62 * connection. USBLib does reference counting to make sure that
63 * the connection remains open until all users has called USBLibTerm().
64 *
65 * @returns VBox status code.
66 *
67 * @remark The users within the process are responsible for not calling
68 * this function at the same time (because I'm lazy).
69 */
[8251]70USBLIB_DECL(int) USBLibInit(void);
[8014]71
72/**
73 * Terminates the USBLib component.
74 *
75 * Must match successfull USBLibInit calls.
76 *
77 * @returns VBox status code.
78 */
[8251]79USBLIB_DECL(int) USBLibTerm(void);
[8014]80
81/**
82 * Adds a filter.
83 *
84 * This function will validate and transfer the specified filter
85 * to the kernel driver and make it start using it. The kernel
86 * driver will return a filter id that this function passes on
87 * to its caller.
88 *
89 * The kernel driver will associate the added filter with the
90 * calling process and automatically remove all filters when
91 * the process terminates the connection to it or dies.
92 *
93 * @returns Filter id for passing to USBLibRemoveFilter on success.
94 * @returns NULL on failure.
95 *
96 * @param pFilter The filter to add.
97 */
[8251]98USBLIB_DECL(void *) USBLibAddFilter(PCUSBFILTER pFilter);
[8014]99
100/**
101 * Removes a filter.
102 *
103 * @param pvId The ID returned by USBLibAddFilter.
104 */
[8251]105USBLIB_DECL(void) USBLibRemoveFilter(void *pvId);
[8014]106
107#endif /* IN_RING3 */
108#endif /* !RT_OS_WINDOWS */
109
[1]110/** @} */
[8251]111__END_DECLS
112
[1]113#endif
114
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use