VirtualBox

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

Last change on this file since 8299 was 8262, checked in by vboxsync, 17 years ago

bad idea

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 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#include <VBox/usbfilter.h>
38
39#ifdef RT_OS_WINDOWS
40# include <VBox/usblib-win.h>
41#endif
42#ifdef RT_OS_SOLARIS
43# include <VBox/usblib-solaris.h>
44#endif
45#ifdef RT_OS_DARWIN
46# include <VBox/usblib-darwin.h>
47#endif
48/** @todo merge the usblib-win.h interface into the darwin and linux ports where suitable. */
49
50__BEGIN_DECLS
51/** @defgroup grp_USBLib USBLib - USB Support Library
52 * This module implements the basic low-level OS interfaces and common USB code.
53 * @{
54 */
55
56#ifndef RT_OS_WINDOWS
57#ifdef IN_RING3
58/**
59 * Initializes the USBLib component.
60 *
61 * The USBLib keeps a per process connection to the kernel driver
62 * and all USBLib users within a process will share the same
63 * connection. USBLib does reference counting to make sure that
64 * the connection remains open until all users has called USBLibTerm().
65 *
66 * @returns VBox status code.
67 *
68 * @remark The users within the process are responsible for not calling
69 * this function at the same time (because I'm lazy).
70 */
71USBLIB_DECL(int) USBLibInit(void);
72
73/**
74 * Terminates the USBLib component.
75 *
76 * Must match successfull USBLibInit calls.
77 *
78 * @returns VBox status code.
79 */
80USBLIB_DECL(int) USBLibTerm(void);
81
82/**
83 * Adds a filter.
84 *
85 * This function will validate and transfer the specified filter
86 * to the kernel driver and make it start using it. The kernel
87 * driver will return a filter id that this function passes on
88 * to its caller.
89 *
90 * The kernel driver will associate the added filter with the
91 * calling process and automatically remove all filters when
92 * the process terminates the connection to it or dies.
93 *
94 * @returns Filter id for passing to USBLibRemoveFilter on success.
95 * @returns NULL on failure.
96 *
97 * @param pFilter The filter to add.
98 */
99USBLIB_DECL(void *) USBLibAddFilter(PCUSBFILTER pFilter);
100
101/**
102 * Removes a filter.
103 *
104 * @param pvId The ID returned by USBLibAddFilter.
105 */
106USBLIB_DECL(void) USBLibRemoveFilter(void *pvId);
107
108#endif /* IN_RING3 */
109#endif /* !RT_OS_WINDOWS */
110
111/** @} */
112__END_DECLS
113
114#endif
115
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette