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
Line 
1/** @file
2 * USBLIB - USB Support Library.
3 * This module implements the basic low-level OS interfaces.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
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
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.
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.
29 */
30
31#ifndef ___VBox_usblib_h
32#define ___VBox_usblib_h
33
34#include <VBox/cdefs.h>
35#include <VBox/types.h>
36#include <VBox/usb.h>
37
38#ifdef RT_OS_WINDOWS
39# include <VBox/usblib-win.h>
40#endif
41#ifdef RT_OS_SOLARIS
42# include <VBox/usblib-solaris.h>
43#endif
44#ifdef RT_OS_DARWIN
45# include <VBox/usblib-darwin.h>
46#endif
47/** @todo merge the usblib-win.h interface into the darwin and linux ports where suitable. */
48
49__BEGIN_DECLS
50/** @defgroup grp_USBLib USBLib - USB Support Library
51 * This module implements the basic low-level OS interfaces and common USB code.
52 * @{
53 */
54
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 */
70USBLIB_DECL(int) USBLibInit(void);
71
72/**
73 * Terminates the USBLib component.
74 *
75 * Must match successfull USBLibInit calls.
76 *
77 * @returns VBox status code.
78 */
79USBLIB_DECL(int) USBLibTerm(void);
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 */
98USBLIB_DECL(void *) USBLibAddFilter(PCUSBFILTER pFilter);
99
100/**
101 * Removes a filter.
102 *
103 * @param pvId The ID returned by USBLibAddFilter.
104 */
105USBLIB_DECL(void) USBLibRemoveFilter(void *pvId);
106
107#endif /* IN_RING3 */
108#endif /* !RT_OS_WINDOWS */
109
110/** @} */
111__END_DECLS
112
113#endif
114
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use