xref: /freebsd/sys/netgraph/bluetooth/include/ng_ubt.h (revision 6780ab54325a71e7e70112b11657973edde8655e)
1 /*
2  * ng_ubt.h
3  *
4  * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  *
28  * $Id: ng_ubt.h,v 1.1 2002/11/09 19:09:02 max Exp $
29  * $FreeBSD$
30  */
31 
32 #ifndef _NG_UBT_H_
33 #define _NG_UBT_H_
34 
35 /* XXX FIXME Does not belong here. Move to usbdevs.h later */
36 #define USB_VENDOR_MSI			0x0db0 /* MSI www.msi.com.tw */
37 #define USB_VENDOR_EPOX			0x0a12 /* EPoX www.epox.com */
38 
39 #define USB_PRODUCT_3COM_3CREB96	0x00a0 /* 3Com Bluetooth USB dongle */
40 #define USB_PRODUCT_MITSUMI_BT_DONGLE	0x641f /* Mitsumi Bluetooth USB dongle*/
41 #define USB_PRODUCT_TDK_BT_DONGLE	0x0309 /* TDK Bluetooth USB dongle */
42 #define USB_PRODUCT_MSI_BT_DONGLE	0x1967 /* MSI Bluetooth USB dongle */
43 #define USB_PRODUCT_DBW_120M_BT_DONGLE	0x2033 /* D-Link DBW-120M */
44 #define USB_PRODUCT_BT_DG02_DONGLE	0x0001 /* EPoX BT-DG02 USB dongle */
45 
46 /* XXX FIXME Does not belong here. Move to usb.h later */
47 #define UICLASS_WIRELESS_CONTROLLER	0xe0	/* Wireless Controller */
48 #define UISUBCLASS_RF_CONTROLLER	0x01	/* RF Controller */
49 #define UIPROTO_BLUETOOTH		0x01	/* Bluetooth programming */
50 
51 /**************************************************************************
52  **************************************************************************
53  **     Netgraph node hook name, type name and type cookie and commands
54  **************************************************************************
55  **************************************************************************/
56 
57 #define NG_UBT_NODE_TYPE	"ubt"
58 #define NG_UBT_HOOK		"hook"
59 
60 #define NGM_UBT_COOKIE		1021837971
61 
62 /* Debug levels */
63 #define NG_UBT_ALERT_LEVEL	1
64 #define NG_UBT_ERR_LEVEL	2
65 #define NG_UBT_WARN_LEVEL	3
66 #define NG_UBT_INFO_LEVEL	4
67 
68 /**************************************************************************
69  **************************************************************************
70  **                    UBT node command/event parameters
71  **************************************************************************
72  **************************************************************************/
73 
74 #define NGM_UBT_NODE_SET_DEBUG	1		/* set debug level */
75 #define NGM_UBT_NODE_GET_DEBUG	2		/* get debug level */
76 typedef u_int16_t		ng_ubt_node_debug_ep;
77 
78 #define NGM_UBT_NODE_SET_QLEN	3		/* set queue length */
79 #define NGM_UBT_NODE_GET_QLEN	4		/* get queue length */
80 typedef struct {
81 	int32_t		queue;			/* queue index */
82 #define	NGM_UBT_NODE_QUEUE_IN	1		/* incoming queue */
83 #define	NGM_UBT_NODE_QUEUE_CMD	2		/* commands */
84 #define	NGM_UBT_NODE_QUEUE_ACL	3		/* ACL data */
85 #define	NGM_UBT_NODE_QUEUE_SCO	4		/* SCO data */
86 
87 	int32_t		qlen;			/* queue length */
88 } ng_ubt_node_qlen_ep;
89 
90 #define NGM_UBT_NODE_GET_STAT	5		/* get statistic */
91 typedef struct {
92 	u_int32_t	pckts_recv;		/* # of packets received */
93 	u_int32_t	bytes_recv;		/* # of bytes received */
94 	u_int32_t	pckts_sent;		/* # of packets sent */
95 	u_int32_t	bytes_sent;		/* # of bytes sent */
96 	u_int32_t	oerrors;		/* # of output errors */
97 	u_int32_t	ierrors;		/* # of input errors */
98 } ng_ubt_node_stat_ep;
99 
100 #define NGM_UBT_NODE_RESET_STAT	6		/* reset statistic */
101 
102 #endif /* ndef _NG_UBT_H_ */
103 
104