ng_ubt.h revision 107120
1107120Sjulian/*
2107120Sjulian * ng_ubt.h
3107120Sjulian *
4107120Sjulian * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
5107120Sjulian * All rights reserved.
6107120Sjulian *
7107120Sjulian * Redistribution and use in source and binary forms, with or without
8107120Sjulian * modification, are permitted provided that the following conditions
9107120Sjulian * are met:
10107120Sjulian * 1. Redistributions of source code must retain the above copyright
11107120Sjulian *    notice, this list of conditions and the following disclaimer.
12107120Sjulian * 2. Redistributions in binary form must reproduce the above copyright
13107120Sjulian *    notice, this list of conditions and the following disclaimer in the
14107120Sjulian *    documentation and/or other materials provided with the distribution.
15107120Sjulian *
16107120Sjulian * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17107120Sjulian * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18107120Sjulian * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19107120Sjulian * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20107120Sjulian * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21107120Sjulian * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22107120Sjulian * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23107120Sjulian * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24107120Sjulian * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25107120Sjulian * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26107120Sjulian * SUCH DAMAGE.
27107120Sjulian *
28107120Sjulian * $Id: ng_ubt.h,v 1.1 2002/11/09 19:09:02 max Exp $
29107120Sjulian * $FreeBSD: head/sys/netgraph/bluetooth/include/ng_ubt.h 107120 2002-11-20 23:01:59Z julian $
30107120Sjulian */
31107120Sjulian
32107120Sjulian#ifndef _NG_UBT_H_
33107120Sjulian#define _NG_UBT_H_
34107120Sjulian
35107120Sjulian/* XXX FIXME Does not belong here. Move to usbdevs.h later */
36107120Sjulian#define USB_VENDOR_MSI			0x0db0 /* MSI www.msi.com.tw */
37107120Sjulian#define USB_VENDOR_EPOX			0x0a12 /* EPoX www.epox.com */
38107120Sjulian
39107120Sjulian#define USB_PRODUCT_3COM_3CREB96	0x00a0 /* 3Com Bluetooth USB dongle */
40107120Sjulian#define USB_PRODUCT_MITSUMI_BT_DONGLE	0x641f /* Mitsumi Bluetooth USB dongle*/
41107120Sjulian#define USB_PRODUCT_TDK_BT_DONGLE	0x0309 /* TDK Bluetooth USB dongle */
42107120Sjulian#define USB_PRODUCT_MSI_BT_DONGLE	0x1967 /* MSI Bluetooth USB dongle */
43107120Sjulian#define USB_PRODUCT_DBW_120M_BT_DONGLE	0x2033 /* D-Link DBW-120M */
44107120Sjulian#define USB_PRODUCT_BT_DG02_DONGLE	0x0001 /* EPoX BT-DG02 USB dongle */
45107120Sjulian
46107120Sjulian/* XXX FIXME Does not belong here. Move to usb.h later */
47107120Sjulian#define UICLASS_WIRELESS_CONTROLLER	0xe0	/* Wireless Controller */
48107120Sjulian#define UISUBCLASS_RF_CONTROLLER	0x01	/* RF Controller */
49107120Sjulian#define UIPROTO_BLUETOOTH		0x01	/* Bluetooth programming */
50107120Sjulian
51107120Sjulian/**************************************************************************
52107120Sjulian **************************************************************************
53107120Sjulian **     Netgraph node hook name, type name and type cookie and commands
54107120Sjulian **************************************************************************
55107120Sjulian **************************************************************************/
56107120Sjulian
57107120Sjulian#define NG_UBT_NODE_TYPE	"ubt"
58107120Sjulian#define NG_UBT_HOOK		"hook"
59107120Sjulian
60107120Sjulian#define NGM_UBT_COOKIE		1021837971
61107120Sjulian
62107120Sjulian/* Debug levels */
63107120Sjulian#define NG_UBT_ALERT_LEVEL	1
64107120Sjulian#define NG_UBT_ERR_LEVEL	2
65107120Sjulian#define NG_UBT_WARN_LEVEL	3
66107120Sjulian#define NG_UBT_INFO_LEVEL	4
67107120Sjulian
68107120Sjulian/**************************************************************************
69107120Sjulian **************************************************************************
70107120Sjulian **                    UBT node command/event parameters
71107120Sjulian **************************************************************************
72107120Sjulian **************************************************************************/
73107120Sjulian
74107120Sjulian#define NGM_UBT_NODE_SET_DEBUG	1		/* set debug level */
75107120Sjulian#define NGM_UBT_NODE_GET_DEBUG	2		/* get debug level */
76107120Sjuliantypedef u_int16_t		ng_ubt_node_debug_ep;
77107120Sjulian
78107120Sjulian#define NGM_UBT_NODE_SET_QLEN	3		/* set queue length */
79107120Sjulian#define NGM_UBT_NODE_GET_QLEN	4		/* get queue length */
80107120Sjuliantypedef struct {
81107120Sjulian	int32_t		queue;			/* queue index */
82107120Sjulian#define	NGM_UBT_NODE_QUEUE_IN	1		/* incoming queue */
83107120Sjulian#define	NGM_UBT_NODE_QUEUE_CMD	2		/* commands */
84107120Sjulian#define	NGM_UBT_NODE_QUEUE_ACL	3		/* ACL data */
85107120Sjulian#define	NGM_UBT_NODE_QUEUE_SCO	4		/* SCO data */
86107120Sjulian
87107120Sjulian	int32_t		qlen;			/* queue length */
88107120Sjulian} ng_ubt_node_qlen_ep;
89107120Sjulian
90107120Sjulian#define NGM_UBT_NODE_GET_STAT	5		/* get statistic */
91107120Sjuliantypedef struct {
92107120Sjulian	u_int32_t	pckts_recv;		/* # of packets received */
93107120Sjulian	u_int32_t	bytes_recv;		/* # of bytes received */
94107120Sjulian	u_int32_t	pckts_sent;		/* # of packets sent */
95107120Sjulian	u_int32_t	bytes_sent;		/* # of bytes sent */
96107120Sjulian	u_int32_t	oerrors;		/* # of output errors */
97107120Sjulian	u_int32_t	ierrors;		/* # of input errors */
98107120Sjulian} ng_ubt_node_stat_ep;
99107120Sjulian
100107120Sjulian#define NGM_UBT_NODE_RESET_STAT	6		/* reset statistic */
101107120Sjulian
102107120Sjulian#endif /* ndef _NG_UBT_H_ */
103107120Sjulian
104