1*b06ebda0SMatthew Dillon /*
2*b06ebda0SMatthew Dillon  * ng_hci.h
3*b06ebda0SMatthew Dillon  */
4*b06ebda0SMatthew Dillon 
5*b06ebda0SMatthew Dillon /*-
6*b06ebda0SMatthew Dillon  * Copyright (c) 2001 Maksim Yevmenkin <m_evmenkin@yahoo.com>
7*b06ebda0SMatthew Dillon  * All rights reserved.
8*b06ebda0SMatthew Dillon  *
9*b06ebda0SMatthew Dillon  * Redistribution and use in source and binary forms, with or without
10*b06ebda0SMatthew Dillon  * modification, are permitted provided that the following conditions
11*b06ebda0SMatthew Dillon  * are met:
12*b06ebda0SMatthew Dillon  * 1. Redistributions of source code must retain the above copyright
13*b06ebda0SMatthew Dillon  *    notice, this list of conditions and the following disclaimer.
14*b06ebda0SMatthew Dillon  * 2. Redistributions in binary form must reproduce the above copyright
15*b06ebda0SMatthew Dillon  *    notice, this list of conditions and the following disclaimer in the
16*b06ebda0SMatthew Dillon  *    documentation and/or other materials provided with the distribution.
17*b06ebda0SMatthew Dillon  *
18*b06ebda0SMatthew Dillon  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19*b06ebda0SMatthew Dillon  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20*b06ebda0SMatthew Dillon  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21*b06ebda0SMatthew Dillon  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22*b06ebda0SMatthew Dillon  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23*b06ebda0SMatthew Dillon  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24*b06ebda0SMatthew Dillon  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25*b06ebda0SMatthew Dillon  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26*b06ebda0SMatthew Dillon  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27*b06ebda0SMatthew Dillon  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28*b06ebda0SMatthew Dillon  * SUCH DAMAGE.
29*b06ebda0SMatthew Dillon  *
30*b06ebda0SMatthew Dillon  * $Id: ng_hci.h,v 1.2 2003/03/18 00:09:37 max Exp $
31*b06ebda0SMatthew Dillon  * $FreeBSD: src/sys/netgraph/bluetooth/include/ng_hci.h,v 1.7 2006/05/17 00:13:06 emax Exp $
32*b06ebda0SMatthew Dillon  */
33*b06ebda0SMatthew Dillon 
34*b06ebda0SMatthew Dillon /*
35*b06ebda0SMatthew Dillon  * This file contains everything that application needs to know about
36*b06ebda0SMatthew Dillon  * Host Controller Interface (HCI). All information was obtained from
37*b06ebda0SMatthew Dillon  * Bluetooth Specification Book v1.1.
38*b06ebda0SMatthew Dillon  *
39*b06ebda0SMatthew Dillon  * This file can be included by both kernel and userland applications.
40*b06ebda0SMatthew Dillon  *
41*b06ebda0SMatthew Dillon  * NOTE: Here and after Bluetooth device is called a "unit". Bluetooth
42*b06ebda0SMatthew Dillon  *       specification refers to both devices and units. They are the
43*b06ebda0SMatthew Dillon  *       same thing (i think), so to be consistent word "unit" will be
44*b06ebda0SMatthew Dillon  *       used.
45*b06ebda0SMatthew Dillon  */
46*b06ebda0SMatthew Dillon 
47*b06ebda0SMatthew Dillon #ifndef _NETGRAPH_HCI_H_
48*b06ebda0SMatthew Dillon #define _NETGRAPH_HCI_H_
49*b06ebda0SMatthew Dillon 
50*b06ebda0SMatthew Dillon /**************************************************************************
51*b06ebda0SMatthew Dillon  **************************************************************************
52*b06ebda0SMatthew Dillon  **     Netgraph node hook name, type name and type cookie and commands
53*b06ebda0SMatthew Dillon  **************************************************************************
54*b06ebda0SMatthew Dillon  **************************************************************************/
55*b06ebda0SMatthew Dillon 
56*b06ebda0SMatthew Dillon /* Node type name and type cookie */
57*b06ebda0SMatthew Dillon #define NG_HCI_NODE_TYPE			"hci"
58*b06ebda0SMatthew Dillon #define NGM_HCI_COOKIE				1000774184
59*b06ebda0SMatthew Dillon 
60*b06ebda0SMatthew Dillon /* Netgraph node hook names */
61*b06ebda0SMatthew Dillon #define NG_HCI_HOOK_DRV				"drv" /* Driver <-> HCI */
62*b06ebda0SMatthew Dillon #define NG_HCI_HOOK_ACL				"acl" /* HCI <-> Upper */
63*b06ebda0SMatthew Dillon #define NG_HCI_HOOK_SCO				"sco" /* HCI <-> Upper */
64*b06ebda0SMatthew Dillon #define NG_HCI_HOOK_RAW				"raw" /* HCI <-> Upper */
65*b06ebda0SMatthew Dillon 
66*b06ebda0SMatthew Dillon /**************************************************************************
67*b06ebda0SMatthew Dillon  **************************************************************************
68*b06ebda0SMatthew Dillon  **                   Common defines and types (HCI)
69*b06ebda0SMatthew Dillon  **************************************************************************
70*b06ebda0SMatthew Dillon  **************************************************************************/
71*b06ebda0SMatthew Dillon 
72*b06ebda0SMatthew Dillon /* All sizes are in bytes */
73*b06ebda0SMatthew Dillon #define NG_HCI_BDADDR_SIZE			6   /* unit address */
74*b06ebda0SMatthew Dillon #define NG_HCI_LAP_SIZE				3   /* unit LAP */
75*b06ebda0SMatthew Dillon #define NG_HCI_KEY_SIZE				16  /* link key */
76*b06ebda0SMatthew Dillon #define NG_HCI_PIN_SIZE				16  /* link PIN */
77*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_MASK_SIZE			8   /* event mask */
78*b06ebda0SMatthew Dillon #define NG_HCI_CLASS_SIZE			3   /* unit class */
79*b06ebda0SMatthew Dillon #define NG_HCI_FEATURES_SIZE			8   /* LMP features */
80*b06ebda0SMatthew Dillon #define NG_HCI_UNIT_NAME_SIZE			248 /* unit name size */
81*b06ebda0SMatthew Dillon 
82*b06ebda0SMatthew Dillon /* HCI specification */
83*b06ebda0SMatthew Dillon #define NG_HCI_SPEC_V10				0x00 /* v1.0 */
84*b06ebda0SMatthew Dillon #define NG_HCI_SPEC_V11				0x01 /* v1.1 */
85*b06ebda0SMatthew Dillon /* 0x02 - 0xFF - reserved for future use */
86*b06ebda0SMatthew Dillon 
87*b06ebda0SMatthew Dillon /* LMP features */
88*b06ebda0SMatthew Dillon /* ------------------- byte 0 --------------------*/
89*b06ebda0SMatthew Dillon #define NG_HCI_LMP_3SLOT			0x01
90*b06ebda0SMatthew Dillon #define NG_HCI_LMP_5SLOT			0x02
91*b06ebda0SMatthew Dillon #define NG_HCI_LMP_ENCRYPTION			0x04
92*b06ebda0SMatthew Dillon #define NG_HCI_LMP_SLOT_OFFSET			0x08
93*b06ebda0SMatthew Dillon #define NG_HCI_LMP_TIMING_ACCURACY		0x10
94*b06ebda0SMatthew Dillon #define NG_HCI_LMP_SWITCH			0x20
95*b06ebda0SMatthew Dillon #define NG_HCI_LMP_HOLD_MODE			0x40
96*b06ebda0SMatthew Dillon #define NG_HCI_LMP_SNIFF_MODE			0x80
97*b06ebda0SMatthew Dillon /* ------------------- byte 1 --------------------*/
98*b06ebda0SMatthew Dillon #define NG_HCI_LMP_PARK_MODE			0x01
99*b06ebda0SMatthew Dillon #define NG_HCI_LMP_RSSI				0x02
100*b06ebda0SMatthew Dillon #define NG_HCI_LMP_CHANNEL_QUALITY		0x04
101*b06ebda0SMatthew Dillon #define NG_HCI_LMP_SCO_LINK			0x08
102*b06ebda0SMatthew Dillon #define NG_HCI_LMP_HV2_PKT			0x10
103*b06ebda0SMatthew Dillon #define NG_HCI_LMP_HV3_PKT			0x20
104*b06ebda0SMatthew Dillon #define NG_HCI_LMP_ULAW_LOG			0x40
105*b06ebda0SMatthew Dillon #define NG_HCI_LMP_ALAW_LOG			0x80
106*b06ebda0SMatthew Dillon /* ------------------- byte 2 --------------------*/
107*b06ebda0SMatthew Dillon #define NG_HCI_LMP_CVSD				0x01
108*b06ebda0SMatthew Dillon #define NG_HCI_LMP_PAGING_SCHEME		0x02
109*b06ebda0SMatthew Dillon #define NG_HCI_LMP_POWER_CONTROL		0x04
110*b06ebda0SMatthew Dillon #define NG_HCI_LMP_TRANSPARENT_SCO		0x08
111*b06ebda0SMatthew Dillon #define NG_HCI_LMP_FLOW_CONTROL_LAG0		0x10
112*b06ebda0SMatthew Dillon #define NG_HCI_LMP_FLOW_CONTROL_LAG1		0x20
113*b06ebda0SMatthew Dillon #define NG_HCI_LMP_FLOW_CONTROL_LAG2		0x40
114*b06ebda0SMatthew Dillon 
115*b06ebda0SMatthew Dillon /* Link types */
116*b06ebda0SMatthew Dillon #define NG_HCI_LINK_SCO				0x00 /* Voice */
117*b06ebda0SMatthew Dillon #define NG_HCI_LINK_ACL				0x01 /* Data */
118*b06ebda0SMatthew Dillon /* 0x02 - 0xFF - reserved for future use */
119*b06ebda0SMatthew Dillon 
120*b06ebda0SMatthew Dillon /* Packet types */
121*b06ebda0SMatthew Dillon 				/* 0x0001 - 0x0004 - reserved for future use */
122*b06ebda0SMatthew Dillon #define NG_HCI_PKT_DM1				0x0008 /* ACL link */
123*b06ebda0SMatthew Dillon #define NG_HCI_PKT_DH1				0x0010 /* ACL link */
124*b06ebda0SMatthew Dillon #define NG_HCI_PKT_HV1				0x0020 /* SCO link */
125*b06ebda0SMatthew Dillon #define NG_HCI_PKT_HV2				0x0040 /* SCO link */
126*b06ebda0SMatthew Dillon #define NG_HCI_PKT_HV3				0x0080 /* SCO link */
127*b06ebda0SMatthew Dillon 				/* 0x0100 - 0x0200 - reserved for future use */
128*b06ebda0SMatthew Dillon #define NG_HCI_PKT_DM3				0x0400 /* ACL link */
129*b06ebda0SMatthew Dillon #define NG_HCI_PKT_DH3				0x0800 /* ACL link */
130*b06ebda0SMatthew Dillon 				/* 0x1000 - 0x2000 - reserved for future use */
131*b06ebda0SMatthew Dillon #define NG_HCI_PKT_DM5				0x4000 /* ACL link */
132*b06ebda0SMatthew Dillon #define NG_HCI_PKT_DH5				0x8000 /* ACL link */
133*b06ebda0SMatthew Dillon 
134*b06ebda0SMatthew Dillon /*
135*b06ebda0SMatthew Dillon  * Connection modes/Unit modes
136*b06ebda0SMatthew Dillon  *
137*b06ebda0SMatthew Dillon  * This is confusing. It means that one of the units change its mode
138*b06ebda0SMatthew Dillon  * for the specific connection. For example one connection was put on
139*b06ebda0SMatthew Dillon  * hold (but i could be wrong :)
140*b06ebda0SMatthew Dillon  */
141*b06ebda0SMatthew Dillon 
142*b06ebda0SMatthew Dillon #define NG_HCI_UNIT_MODE_ACTIVE			0x00
143*b06ebda0SMatthew Dillon #define NG_HCI_UNIT_MODE_HOLD			0x01
144*b06ebda0SMatthew Dillon #define NG_HCI_UNIT_MODE_SNIFF			0x02
145*b06ebda0SMatthew Dillon #define NG_HCI_UNIT_MODE_PARK			0x03
146*b06ebda0SMatthew Dillon /* 0x04 - 0xFF - reserved for future use */
147*b06ebda0SMatthew Dillon 
148*b06ebda0SMatthew Dillon /* Page scan modes */
149*b06ebda0SMatthew Dillon #define NG_HCI_MANDATORY_PAGE_SCAN_MODE		0x00
150*b06ebda0SMatthew Dillon #define NG_HCI_OPTIONAL_PAGE_SCAN_MODE1		0x01
151*b06ebda0SMatthew Dillon #define NG_HCI_OPTIONAL_PAGE_SCAN_MODE2		0x02
152*b06ebda0SMatthew Dillon #define NG_HCI_OPTIONAL_PAGE_SCAN_MODE3		0x03
153*b06ebda0SMatthew Dillon /* 0x04 - 0xFF - reserved for future use */
154*b06ebda0SMatthew Dillon 
155*b06ebda0SMatthew Dillon /* Page scan repetition modes */
156*b06ebda0SMatthew Dillon #define NG_HCI_SCAN_REP_MODE0			0x00
157*b06ebda0SMatthew Dillon #define NG_HCI_SCAN_REP_MODE1			0x01
158*b06ebda0SMatthew Dillon #define NG_HCI_SCAN_REP_MODE2			0x02
159*b06ebda0SMatthew Dillon /* 0x03 - 0xFF - reserved for future use */
160*b06ebda0SMatthew Dillon 
161*b06ebda0SMatthew Dillon /* Page scan period modes */
162*b06ebda0SMatthew Dillon #define NG_HCI_PAGE_SCAN_PERIOD_MODE0		0x00
163*b06ebda0SMatthew Dillon #define NG_HCI_PAGE_SCAN_PERIOD_MODE1		0x01
164*b06ebda0SMatthew Dillon #define NG_HCI_PAGE_SCAN_PERIOD_MODE2		0x02
165*b06ebda0SMatthew Dillon /* 0x03 - 0xFF - reserved for future use */
166*b06ebda0SMatthew Dillon 
167*b06ebda0SMatthew Dillon /* Scan enable */
168*b06ebda0SMatthew Dillon #define NG_HCI_NO_SCAN_ENABLE			0x00
169*b06ebda0SMatthew Dillon #define NG_HCI_INQUIRY_ENABLE_PAGE_DISABLE	0x01
170*b06ebda0SMatthew Dillon #define NG_HCI_INQUIRY_DISABLE_PAGE_ENABLE	0x02
171*b06ebda0SMatthew Dillon #define NG_HCI_INQUIRY_ENABLE_PAGE_ENABLE	0x03
172*b06ebda0SMatthew Dillon /* 0x04 - 0xFF - reserved for future use */
173*b06ebda0SMatthew Dillon 
174*b06ebda0SMatthew Dillon /* Hold mode activities */
175*b06ebda0SMatthew Dillon #define NG_HCI_HOLD_MODE_NO_CHANGE		0x00
176*b06ebda0SMatthew Dillon #define NG_HCI_HOLD_MODE_SUSPEND_PAGE_SCAN	0x01
177*b06ebda0SMatthew Dillon #define NG_HCI_HOLD_MODE_SUSPEND_INQUIRY_SCAN	0x02
178*b06ebda0SMatthew Dillon #define NG_HCI_HOLD_MODE_SUSPEND_PERIOD_INQUIRY	0x04
179*b06ebda0SMatthew Dillon /* 0x08 - 0x80 - reserved for future use */
180*b06ebda0SMatthew Dillon 
181*b06ebda0SMatthew Dillon /* Connection roles */
182*b06ebda0SMatthew Dillon #define NG_HCI_ROLE_MASTER			0x00
183*b06ebda0SMatthew Dillon #define NG_HCI_ROLE_SLAVE			0x01
184*b06ebda0SMatthew Dillon /* 0x02 - 0xFF - reserved for future use */
185*b06ebda0SMatthew Dillon 
186*b06ebda0SMatthew Dillon /* Key flags */
187*b06ebda0SMatthew Dillon #define NG_HCI_USE_SEMI_PERMANENT_LINK_KEYS	0x00
188*b06ebda0SMatthew Dillon #define NG_HCI_USE_TEMPORARY_LINK_KEY		0x01
189*b06ebda0SMatthew Dillon /* 0x02 - 0xFF - reserved for future use */
190*b06ebda0SMatthew Dillon 
191*b06ebda0SMatthew Dillon /* Pin types */
192*b06ebda0SMatthew Dillon #define NG_HCI_PIN_TYPE_VARIABLE		0x00
193*b06ebda0SMatthew Dillon #define NG_HCI_PIN_TYPE_FIXED			0x01
194*b06ebda0SMatthew Dillon 
195*b06ebda0SMatthew Dillon /* Link key types */
196*b06ebda0SMatthew Dillon #define NG_HCI_LINK_KEY_TYPE_COMBINATION_KEY	0x00
197*b06ebda0SMatthew Dillon #define NG_HCI_LINK_KEY_TYPE_LOCAL_UNIT_KEY	0x01
198*b06ebda0SMatthew Dillon #define NG_HCI_LINK_KEY_TYPE_REMOTE_UNIT_KEY	0x02
199*b06ebda0SMatthew Dillon /* 0x03 - 0xFF - reserved for future use */
200*b06ebda0SMatthew Dillon 
201*b06ebda0SMatthew Dillon /* Encryption modes */
202*b06ebda0SMatthew Dillon #define NG_HCI_ENCRYPTION_MODE_NONE		0x00
203*b06ebda0SMatthew Dillon #define NG_HCI_ENCRYPTION_MODE_P2P		0x01
204*b06ebda0SMatthew Dillon #define NG_HCI_ENCRYPTION_MODE_ALL		0x02
205*b06ebda0SMatthew Dillon /* 0x03 - 0xFF - reserved for future use */
206*b06ebda0SMatthew Dillon 
207*b06ebda0SMatthew Dillon /* Quality of service types */
208*b06ebda0SMatthew Dillon #define NG_HCI_SERVICE_TYPE_NO_TRAFFIC		0x00
209*b06ebda0SMatthew Dillon #define NG_HCI_SERVICE_TYPE_BEST_EFFORT		0x01
210*b06ebda0SMatthew Dillon #define NG_HCI_SERVICE_TYPE_GUARANTEED		0x02
211*b06ebda0SMatthew Dillon /* 0x03 - 0xFF - reserved for future use */
212*b06ebda0SMatthew Dillon 
213*b06ebda0SMatthew Dillon /* Link policy settings */
214*b06ebda0SMatthew Dillon #define NG_HCI_LINK_POLICY_DISABLE_ALL_LM_MODES	0x0000
215*b06ebda0SMatthew Dillon #define NG_HCI_LINK_POLICY_ENABLE_ROLE_SWITCH	0x0001 /* Master/Slave switch */
216*b06ebda0SMatthew Dillon #define NG_HCI_LINK_POLICY_ENABLE_HOLD_MODE	0x0002
217*b06ebda0SMatthew Dillon #define NG_HCI_LINK_POLICY_ENABLE_SNIFF_MODE	0x0004
218*b06ebda0SMatthew Dillon #define NG_HCI_LINK_POLICY_ENABLE_PARK_MODE	0x0008
219*b06ebda0SMatthew Dillon /* 0x0010 - 0x8000 - reserved for future use */
220*b06ebda0SMatthew Dillon 
221*b06ebda0SMatthew Dillon /* Event masks */
222*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_ALL			0x00000000ffffffff
223*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_NONE			0x0000000000000000
224*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_INQUIRY_COMPL		0x0000000000000001
225*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_INQUIRY_RESULT		0x0000000000000002
226*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_CON_COMPL			0x0000000000000004
227*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_CON_REQ			0x0000000000000008
228*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_DISCON_COMPL		0x0000000000000010
229*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_AUTH_COMPL			0x0000000000000020
230*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_REMOTE_NAME_REQ_COMPL	0x0000000000000040
231*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_ENCRYPTION_CHANGE		0x0000000000000080
232*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_CHANGE_CON_LINK_KEY_COMPL	0x0000000000000100
233*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_MASTER_LINK_KEY_COMPL	0x0000000000000200
234*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_READ_REMOTE_FEATURES_COMPL	0x0000000000000400
235*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_READ_REMOTE_VER_INFO_COMPL	0x0000000000000800
236*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_QOS_SETUP_COMPL		0x0000000000001000
237*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_COMMAND_COMPL		0x0000000000002000
238*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_COMMAND_STATUS		0x0000000000004000
239*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_HARDWARE_ERROR		0x0000000000008000
240*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_FLUSH_OCCUR		0x0000000000010000
241*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_ROLE_CHANGE		0x0000000000020000
242*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_NUM_COMPL_PKTS		0x0000000000040000
243*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_MODE_CHANGE		0x0000000000080000
244*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_RETURN_LINK_KEYS		0x0000000000100000
245*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_PIN_CODE_REQ		0x0000000000200000
246*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_LINK_KEY_REQ		0x0000000000400000
247*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_LINK_KEY_NOTIFICATION	0x0000000000800000
248*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_LOOPBACK_COMMAND		0x0000000001000000
249*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_DATA_BUFFER_OVERFLOW	0x0000000002000000
250*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_MAX_SLOT_CHANGE		0x0000000004000000
251*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_READ_CLOCK_OFFSET_COMLETE	0x0000000008000000
252*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_CON_PKT_TYPE_CHANGED	0x0000000010000000
253*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_QOS_VIOLATION		0x0000000020000000
254*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_PAGE_SCAN_MODE_CHANGE	0x0000000040000000
255*b06ebda0SMatthew Dillon #define NG_HCI_EVMSK_PAGE_SCAN_REP_MODE_CHANGE	0x0000000080000000
256*b06ebda0SMatthew Dillon /* 0x0000000100000000 - 0x8000000000000000 - reserved for future use */
257*b06ebda0SMatthew Dillon 
258*b06ebda0SMatthew Dillon /* Filter types */
259*b06ebda0SMatthew Dillon #define NG_HCI_FILTER_TYPE_NONE			0x00
260*b06ebda0SMatthew Dillon #define NG_HCI_FILTER_TYPE_INQUIRY_RESULT	0x01
261*b06ebda0SMatthew Dillon #define NG_HCI_FILTER_TYPE_CON_SETUP		0x02
262*b06ebda0SMatthew Dillon /* 0x03 - 0xFF - reserved for future use */
263*b06ebda0SMatthew Dillon 
264*b06ebda0SMatthew Dillon /* Filter condition types for NG_HCI_FILTER_TYPE_INQUIRY_RESULT */
265*b06ebda0SMatthew Dillon #define NG_HCI_FILTER_COND_INQUIRY_NEW_UNIT	0x00
266*b06ebda0SMatthew Dillon #define NG_HCI_FILTER_COND_INQUIRY_UNIT_CLASS	0x01
267*b06ebda0SMatthew Dillon #define NG_HCI_FILTER_COND_INQUIRY_BDADDR	0x02
268*b06ebda0SMatthew Dillon /* 0x03 - 0xFF - reserved for future use */
269*b06ebda0SMatthew Dillon 
270*b06ebda0SMatthew Dillon /* Filter condition types for NG_HCI_FILTER_TYPE_CON_SETUP */
271*b06ebda0SMatthew Dillon #define NG_HCI_FILTER_COND_CON_ANY_UNIT		0x00
272*b06ebda0SMatthew Dillon #define NG_HCI_FILTER_COND_CON_UNIT_CLASS	0x01
273*b06ebda0SMatthew Dillon #define NG_HCI_FILTER_COND_CON_BDADDR		0x02
274*b06ebda0SMatthew Dillon /* 0x03 - 0xFF - reserved for future use */
275*b06ebda0SMatthew Dillon 
276*b06ebda0SMatthew Dillon /* Xmit level types */
277*b06ebda0SMatthew Dillon #define NG_HCI_XMIT_LEVEL_CURRENT		0x00
278*b06ebda0SMatthew Dillon #define NG_HCI_XMIT_LEVEL_MAXIMUM		0x01
279*b06ebda0SMatthew Dillon /* 0x02 - 0xFF - reserved for future use */
280*b06ebda0SMatthew Dillon 
281*b06ebda0SMatthew Dillon /* Host to Host Controller flow control */
282*b06ebda0SMatthew Dillon #define NG_HCI_H2HC_FLOW_CONTROL_NONE		0x00
283*b06ebda0SMatthew Dillon #define NG_HCI_H2HC_FLOW_CONTROL_ACL		0x01
284*b06ebda0SMatthew Dillon #define NG_HCI_H2HC_FLOW_CONTROL_SCO		0x02
285*b06ebda0SMatthew Dillon #define NG_HCI_H2HC_FLOW_CONTROL_BOTH		0x03	/* ACL and SCO */
286*b06ebda0SMatthew Dillon /* 0x04 - 0xFF - reserved future use */
287*b06ebda0SMatthew Dillon 
288*b06ebda0SMatthew Dillon /* Country codes */
289*b06ebda0SMatthew Dillon #define NG_HCI_COUNTRY_CODE_NAM_EUR_JP		0x00
290*b06ebda0SMatthew Dillon #define NG_HCI_COUNTRY_CODE_FRANCE		0x01
291*b06ebda0SMatthew Dillon /* 0x02 - 0xFF - reserved future use */
292*b06ebda0SMatthew Dillon 
293*b06ebda0SMatthew Dillon /* Loopback modes */
294*b06ebda0SMatthew Dillon #define NG_HCI_LOOPBACK_NONE			0x00
295*b06ebda0SMatthew Dillon #define NG_HCI_LOOPBACK_LOCAL			0x01
296*b06ebda0SMatthew Dillon #define NG_HCI_LOOPBACK_REMOTE			0x02
297*b06ebda0SMatthew Dillon /* 0x03 - 0xFF - reserved future use */
298*b06ebda0SMatthew Dillon 
299*b06ebda0SMatthew Dillon /**************************************************************************
300*b06ebda0SMatthew Dillon  **************************************************************************
301*b06ebda0SMatthew Dillon  **                 Link level defines, headers and types
302*b06ebda0SMatthew Dillon  **************************************************************************
303*b06ebda0SMatthew Dillon  **************************************************************************/
304*b06ebda0SMatthew Dillon 
305*b06ebda0SMatthew Dillon /*
306*b06ebda0SMatthew Dillon  * Macro(s) to combine OpCode and extract OGF (OpCode Group Field)
307*b06ebda0SMatthew Dillon  * and OCF (OpCode Command Field) from OpCode.
308*b06ebda0SMatthew Dillon  */
309*b06ebda0SMatthew Dillon 
310*b06ebda0SMatthew Dillon #define NG_HCI_OPCODE(gf,cf)		((((gf) & 0x3f) << 10) | ((cf) & 0x3ff))
311*b06ebda0SMatthew Dillon #define NG_HCI_OCF(op)			((op) & 0x3ff)
312*b06ebda0SMatthew Dillon #define NG_HCI_OGF(op)			(((op) >> 10) & 0x3f)
313*b06ebda0SMatthew Dillon 
314*b06ebda0SMatthew Dillon /*
315*b06ebda0SMatthew Dillon  * Marco(s) to extract/combine connection handle, BC (Broadcast) and
316*b06ebda0SMatthew Dillon  * PB (Packet boundary) flags.
317*b06ebda0SMatthew Dillon  */
318*b06ebda0SMatthew Dillon 
319*b06ebda0SMatthew Dillon #define NG_HCI_CON_HANDLE(h)		((h) & 0x0fff)
320*b06ebda0SMatthew Dillon #define NG_HCI_PB_FLAG(h)		(((h) & 0x3000) >> 12)
321*b06ebda0SMatthew Dillon #define NG_HCI_BC_FLAG(h)		(((h) & 0xc000) >> 14)
322*b06ebda0SMatthew Dillon #define NG_HCI_MK_CON_HANDLE(h, pb, bc) \
323*b06ebda0SMatthew Dillon 	(((h) & 0x0fff) | (((pb) & 3) << 12) | (((bc) & 3) << 14))
324*b06ebda0SMatthew Dillon 
325*b06ebda0SMatthew Dillon /* PB flag values */
326*b06ebda0SMatthew Dillon 					/* 00 - reserved for future use */
327*b06ebda0SMatthew Dillon #define	NG_HCI_PACKET_FRAGMENT		0x1
328*b06ebda0SMatthew Dillon #define	NG_HCI_PACKET_START		0x2
329*b06ebda0SMatthew Dillon 					/* 11 - reserved for future use */
330*b06ebda0SMatthew Dillon 
331*b06ebda0SMatthew Dillon /* BC flag values */
332*b06ebda0SMatthew Dillon #define NG_HCI_POINT2POINT		0x0 /* only Host controller to Host */
333*b06ebda0SMatthew Dillon #define NG_HCI_BROADCAST_ACTIVE		0x1 /* both directions */
334*b06ebda0SMatthew Dillon #define NG_HCI_BROADCAST_PICONET	0x2 /* both directions */
335*b06ebda0SMatthew Dillon 					/* 11 - reserved for future use */
336*b06ebda0SMatthew Dillon 
337*b06ebda0SMatthew Dillon /* HCI command packet header */
338*b06ebda0SMatthew Dillon #define NG_HCI_CMD_PKT			0x01
339*b06ebda0SMatthew Dillon #define NG_HCI_CMD_PKT_SIZE		0xff /* without header */
340*b06ebda0SMatthew Dillon typedef struct {
341*b06ebda0SMatthew Dillon 	u_int8_t	type;   /* MUST be 0x1 */
342*b06ebda0SMatthew Dillon 	u_int16_t	opcode; /* OpCode */
343*b06ebda0SMatthew Dillon 	u_int8_t	length; /* parameter(s) length in bytes */
344*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_cmd_pkt_t;
345*b06ebda0SMatthew Dillon 
346*b06ebda0SMatthew Dillon /* ACL data packet header */
347*b06ebda0SMatthew Dillon #define NG_HCI_ACL_DATA_PKT		0x02
348*b06ebda0SMatthew Dillon #define NG_HCI_ACL_PKT_SIZE		0xffff /* without header */
349*b06ebda0SMatthew Dillon typedef struct {
350*b06ebda0SMatthew Dillon 	u_int8_t	type;        /* MUST be 0x2 */
351*b06ebda0SMatthew Dillon 	u_int16_t	con_handle;  /* connection handle + PB + BC flags */
352*b06ebda0SMatthew Dillon 	u_int16_t	length;      /* payload length in bytes */
353*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_acldata_pkt_t;
354*b06ebda0SMatthew Dillon 
355*b06ebda0SMatthew Dillon /* SCO data packet header */
356*b06ebda0SMatthew Dillon #define NG_HCI_SCO_DATA_PKT		0x03
357*b06ebda0SMatthew Dillon #define NG_HCI_SCO_PKT_SIZE		0xff /* without header */
358*b06ebda0SMatthew Dillon typedef struct {
359*b06ebda0SMatthew Dillon 	u_int8_t	type;       /* MUST be 0x3 */
360*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle + reserved bits */
361*b06ebda0SMatthew Dillon 	u_int8_t	length;     /* payload length in bytes */
362*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_scodata_pkt_t;
363*b06ebda0SMatthew Dillon 
364*b06ebda0SMatthew Dillon /* HCI event packet header */
365*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_PKT		0x04
366*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_PKT_SIZE		0xff /* without header */
367*b06ebda0SMatthew Dillon typedef struct {
368*b06ebda0SMatthew Dillon 	u_int8_t	type;   /* MUST be 0x4 */
369*b06ebda0SMatthew Dillon 	u_int8_t	event;  /* event */
370*b06ebda0SMatthew Dillon 	u_int8_t	length; /* parameter(s) length in bytes */
371*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_event_pkt_t;
372*b06ebda0SMatthew Dillon 
373*b06ebda0SMatthew Dillon /* Bluetooth unit address */
374*b06ebda0SMatthew Dillon typedef struct {
375*b06ebda0SMatthew Dillon 	u_int8_t	b[NG_HCI_BDADDR_SIZE];
376*b06ebda0SMatthew Dillon } __attribute__ ((packed)) bdaddr_t;
377*b06ebda0SMatthew Dillon typedef bdaddr_t *	bdaddr_p;
378*b06ebda0SMatthew Dillon 
379*b06ebda0SMatthew Dillon /* Any BD_ADDR. Note: This is actually 7 bytes (count '\0' terminator) */
380*b06ebda0SMatthew Dillon #define NG_HCI_BDADDR_ANY	((bdaddr_p) "\000\000\000\000\000\000")
381*b06ebda0SMatthew Dillon 
382*b06ebda0SMatthew Dillon /* HCI status return parameter */
383*b06ebda0SMatthew Dillon typedef struct {
384*b06ebda0SMatthew Dillon 	u_int8_t	status; /* 0x00 - success */
385*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_status_rp;
386*b06ebda0SMatthew Dillon 
387*b06ebda0SMatthew Dillon /**************************************************************************
388*b06ebda0SMatthew Dillon  **************************************************************************
389*b06ebda0SMatthew Dillon  **        Upper layer protocol interface. LP_xxx event parameters
390*b06ebda0SMatthew Dillon  **************************************************************************
391*b06ebda0SMatthew Dillon  **************************************************************************/
392*b06ebda0SMatthew Dillon 
393*b06ebda0SMatthew Dillon /* Connection Request Event */
394*b06ebda0SMatthew Dillon #define NGM_HCI_LP_CON_REQ			1  /* Upper -> HCI */
395*b06ebda0SMatthew Dillon typedef struct {
396*b06ebda0SMatthew Dillon 	u_int16_t	link_type; /* type of connection */
397*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;    /* remote unit address */
398*b06ebda0SMatthew Dillon } ng_hci_lp_con_req_ep;
399*b06ebda0SMatthew Dillon 
400*b06ebda0SMatthew Dillon /*
401*b06ebda0SMatthew Dillon  * XXX XXX XXX
402*b06ebda0SMatthew Dillon  *
403*b06ebda0SMatthew Dillon  * NOTE: This request is not defined by Bluetooth specification,
404*b06ebda0SMatthew Dillon  * but i find it useful :)
405*b06ebda0SMatthew Dillon  */
406*b06ebda0SMatthew Dillon #define NGM_HCI_LP_DISCON_REQ			2 /* Upper -> HCI */
407*b06ebda0SMatthew Dillon typedef struct {
408*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
409*b06ebda0SMatthew Dillon 	u_int16_t	reason;	    /* reason to disconnect (only low byte) */
410*b06ebda0SMatthew Dillon } ng_hci_lp_discon_req_ep;
411*b06ebda0SMatthew Dillon 
412*b06ebda0SMatthew Dillon /* Connection Confirmation Event */
413*b06ebda0SMatthew Dillon #define NGM_HCI_LP_CON_CFM			3  /* HCI -> Upper */
414*b06ebda0SMatthew Dillon typedef struct {
415*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
416*b06ebda0SMatthew Dillon 	u_int8_t	link_type;  /* link type */
417*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* con_handle */
418*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;     /* remote unit address */
419*b06ebda0SMatthew Dillon } ng_hci_lp_con_cfm_ep;
420*b06ebda0SMatthew Dillon 
421*b06ebda0SMatthew Dillon /* Connection Indication Event */
422*b06ebda0SMatthew Dillon #define NGM_HCI_LP_CON_IND			4  /* HCI -> Upper */
423*b06ebda0SMatthew Dillon typedef struct {
424*b06ebda0SMatthew Dillon 	u_int8_t	link_type;                 /* link type */
425*b06ebda0SMatthew Dillon 	u_int8_t	uclass[NG_HCI_CLASS_SIZE]; /* unit class */
426*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;                    /* remote unit address */
427*b06ebda0SMatthew Dillon } ng_hci_lp_con_ind_ep;
428*b06ebda0SMatthew Dillon 
429*b06ebda0SMatthew Dillon /* Connection Response Event */
430*b06ebda0SMatthew Dillon #define NGM_HCI_LP_CON_RSP			5  /* Upper -> HCI */
431*b06ebda0SMatthew Dillon typedef struct {
432*b06ebda0SMatthew Dillon 	u_int8_t	status;    /* 0x00 - accept connection */
433*b06ebda0SMatthew Dillon 	u_int8_t	link_type; /* link type */
434*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;    /* remote unit address */
435*b06ebda0SMatthew Dillon } ng_hci_lp_con_rsp_ep;
436*b06ebda0SMatthew Dillon 
437*b06ebda0SMatthew Dillon /* Disconnection Indication Event */
438*b06ebda0SMatthew Dillon #define NGM_HCI_LP_DISCON_IND			6  /* HCI -> Upper */
439*b06ebda0SMatthew Dillon typedef struct {
440*b06ebda0SMatthew Dillon 	u_int8_t	reason;     /* reason to disconnect (only low byte) */
441*b06ebda0SMatthew Dillon 	u_int8_t	link_type;  /* link type */
442*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
443*b06ebda0SMatthew Dillon } ng_hci_lp_discon_ind_ep;
444*b06ebda0SMatthew Dillon 
445*b06ebda0SMatthew Dillon /* QoS Setup Request Event */
446*b06ebda0SMatthew Dillon #define NGM_HCI_LP_QOS_REQ			7  /* Upper -> HCI */
447*b06ebda0SMatthew Dillon typedef struct {
448*b06ebda0SMatthew Dillon 	u_int16_t	con_handle;      /* connection handle */
449*b06ebda0SMatthew Dillon 	u_int8_t	flags;           /* reserved */
450*b06ebda0SMatthew Dillon 	u_int8_t	service_type;    /* service type */
451*b06ebda0SMatthew Dillon 	u_int32_t	token_rate;      /* bytes/sec */
452*b06ebda0SMatthew Dillon 	u_int32_t	peak_bandwidth;  /* bytes/sec */
453*b06ebda0SMatthew Dillon 	u_int32_t	latency;         /* msec */
454*b06ebda0SMatthew Dillon 	u_int32_t	delay_variation; /* msec */
455*b06ebda0SMatthew Dillon } ng_hci_lp_qos_req_ep;
456*b06ebda0SMatthew Dillon 
457*b06ebda0SMatthew Dillon /* QoS Conformition Event */
458*b06ebda0SMatthew Dillon #define NGM_HCI_LP_QOS_CFM			8  /* HCI -> Upper */
459*b06ebda0SMatthew Dillon typedef struct {
460*b06ebda0SMatthew Dillon 	u_int16_t	status;          /* 0x00 - success  (only low byte) */
461*b06ebda0SMatthew Dillon 	u_int16_t	con_handle;      /* connection handle */
462*b06ebda0SMatthew Dillon } ng_hci_lp_qos_cfm_ep;
463*b06ebda0SMatthew Dillon 
464*b06ebda0SMatthew Dillon /* QoS Violation Indication Event */
465*b06ebda0SMatthew Dillon #define NGM_HCI_LP_QOS_IND			9  /* HCI -> Upper */
466*b06ebda0SMatthew Dillon typedef struct {
467*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
468*b06ebda0SMatthew Dillon } ng_hci_lp_qos_ind_ep;
469*b06ebda0SMatthew Dillon 
470*b06ebda0SMatthew Dillon /**************************************************************************
471*b06ebda0SMatthew Dillon  **************************************************************************
472*b06ebda0SMatthew Dillon  **                    HCI node command/event parameters
473*b06ebda0SMatthew Dillon  **************************************************************************
474*b06ebda0SMatthew Dillon  **************************************************************************/
475*b06ebda0SMatthew Dillon 
476*b06ebda0SMatthew Dillon /* Debug levels */
477*b06ebda0SMatthew Dillon #define NG_HCI_ALERT_LEVEL		1
478*b06ebda0SMatthew Dillon #define NG_HCI_ERR_LEVEL		2
479*b06ebda0SMatthew Dillon #define NG_HCI_WARN_LEVEL		3
480*b06ebda0SMatthew Dillon #define NG_HCI_INFO_LEVEL		4
481*b06ebda0SMatthew Dillon 
482*b06ebda0SMatthew Dillon /* Unit states */
483*b06ebda0SMatthew Dillon #define NG_HCI_UNIT_CONNECTED		(1 << 0)
484*b06ebda0SMatthew Dillon #define NG_HCI_UNIT_INITED		(1 << 1)
485*b06ebda0SMatthew Dillon #define NG_HCI_UNIT_READY	(NG_HCI_UNIT_CONNECTED|NG_HCI_UNIT_INITED)
486*b06ebda0SMatthew Dillon #define NG_HCI_UNIT_COMMAND_PENDING	(1 << 2)
487*b06ebda0SMatthew Dillon 
488*b06ebda0SMatthew Dillon /* Connection state */
489*b06ebda0SMatthew Dillon #define NG_HCI_CON_CLOSED		0 /* connection closed */
490*b06ebda0SMatthew Dillon #define NG_HCI_CON_W4_LP_CON_RSP	1 /* wait for LP_ConnectRsp */
491*b06ebda0SMatthew Dillon #define NG_HCI_CON_W4_CONN_COMPLETE	2 /* wait for Connection_Complete evt */
492*b06ebda0SMatthew Dillon #define NG_HCI_CON_OPEN			3 /* connection open */
493*b06ebda0SMatthew Dillon 
494*b06ebda0SMatthew Dillon /* Get HCI node (unit) state (see states above) */
495*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_GET_STATE			100  /* HCI -> User */
496*b06ebda0SMatthew Dillon typedef u_int16_t	ng_hci_node_state_ep;
497*b06ebda0SMatthew Dillon 
498*b06ebda0SMatthew Dillon /* Turn on "inited" bit */
499*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_INIT			101 /* User -> HCI */
500*b06ebda0SMatthew Dillon /* No parameters */
501*b06ebda0SMatthew Dillon 
502*b06ebda0SMatthew Dillon /* Get/Set node debug level (see debug levels above) */
503*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_GET_DEBUG			102 /* HCI -> User */
504*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_SET_DEBUG			103 /* User -> HCI */
505*b06ebda0SMatthew Dillon typedef u_int16_t	ng_hci_node_debug_ep;
506*b06ebda0SMatthew Dillon 
507*b06ebda0SMatthew Dillon /* Get node buffer info */
508*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_GET_BUFFER			104 /* HCI -> User */
509*b06ebda0SMatthew Dillon typedef struct {
510*b06ebda0SMatthew Dillon 	u_int8_t	cmd_free; /* number of free command packets */
511*b06ebda0SMatthew Dillon 	u_int8_t	sco_size; /* max. size of SCO packet */
512*b06ebda0SMatthew Dillon 	u_int16_t	sco_pkts; /* number of SCO packets */
513*b06ebda0SMatthew Dillon 	u_int16_t	sco_free; /* number of free SCO packets */
514*b06ebda0SMatthew Dillon 	u_int16_t	acl_size; /* max. size of ACL packet */
515*b06ebda0SMatthew Dillon 	u_int16_t	acl_pkts; /* number of ACL packets */
516*b06ebda0SMatthew Dillon 	u_int16_t	acl_free; /* number of free ACL packets */
517*b06ebda0SMatthew Dillon } ng_hci_node_buffer_ep;
518*b06ebda0SMatthew Dillon 
519*b06ebda0SMatthew Dillon /* Get BDADDR */
520*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_GET_BDADDR			105 /* HCI -> User */
521*b06ebda0SMatthew Dillon /* bdaddr_t -- BDADDR */
522*b06ebda0SMatthew Dillon 
523*b06ebda0SMatthew Dillon /* Get features */
524*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_GET_FEATURES		106 /* HCI -> User */
525*b06ebda0SMatthew Dillon /* features[NG_HCI_FEATURES_SIZE] -- features */
526*b06ebda0SMatthew Dillon 
527*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_GET_STAT			107 /* HCI -> User */
528*b06ebda0SMatthew Dillon typedef struct {
529*b06ebda0SMatthew Dillon 	u_int32_t	cmd_sent;   /* number of HCI commands sent */
530*b06ebda0SMatthew Dillon 	u_int32_t	evnt_recv;  /* number of HCI events received */
531*b06ebda0SMatthew Dillon 	u_int32_t	acl_recv;   /* number of ACL packets received */
532*b06ebda0SMatthew Dillon 	u_int32_t	acl_sent;   /* number of ACL packets sent */
533*b06ebda0SMatthew Dillon 	u_int32_t	sco_recv;   /* number of SCO packets received */
534*b06ebda0SMatthew Dillon 	u_int32_t	sco_sent;   /* number of SCO packets sent */
535*b06ebda0SMatthew Dillon 	u_int32_t	bytes_recv; /* total number of bytes received */
536*b06ebda0SMatthew Dillon 	u_int32_t	bytes_sent; /* total number of bytes sent */
537*b06ebda0SMatthew Dillon } ng_hci_node_stat_ep;
538*b06ebda0SMatthew Dillon 
539*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_RESET_STAT			108 /* User -> HCI */
540*b06ebda0SMatthew Dillon /* No parameters */
541*b06ebda0SMatthew Dillon 
542*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_FLUSH_NEIGHBOR_CACHE	109 /* User -> HCI */
543*b06ebda0SMatthew Dillon 
544*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_GET_NEIGHBOR_CACHE		110 /* HCI -> User */
545*b06ebda0SMatthew Dillon typedef struct {
546*b06ebda0SMatthew Dillon 	u_int32_t	num_entries;	/* number of entries */
547*b06ebda0SMatthew Dillon } ng_hci_node_get_neighbor_cache_ep;
548*b06ebda0SMatthew Dillon 
549*b06ebda0SMatthew Dillon typedef struct {
550*b06ebda0SMatthew Dillon 	u_int16_t	page_scan_rep_mode;             /* page rep scan mode */
551*b06ebda0SMatthew Dillon 	u_int16_t	page_scan_mode;                 /* page scan mode */
552*b06ebda0SMatthew Dillon 	u_int16_t	clock_offset;                   /* clock offset */
553*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;                         /* bdaddr */
554*b06ebda0SMatthew Dillon 	u_int8_t	features[NG_HCI_FEATURES_SIZE]; /* features */
555*b06ebda0SMatthew Dillon } ng_hci_node_neighbor_cache_entry_ep;
556*b06ebda0SMatthew Dillon 
557*b06ebda0SMatthew Dillon #define NG_HCI_MAX_NEIGHBOR_NUM \
558*b06ebda0SMatthew Dillon 	((0xffff - sizeof(ng_hci_node_get_neighbor_cache_ep))/sizeof(ng_hci_node_neighbor_cache_entry_ep))
559*b06ebda0SMatthew Dillon 
560*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_GET_CON_LIST		111 /* HCI -> User */
561*b06ebda0SMatthew Dillon typedef struct {
562*b06ebda0SMatthew Dillon 	u_int32_t	num_connections; /* number of connections */
563*b06ebda0SMatthew Dillon } ng_hci_node_con_list_ep;
564*b06ebda0SMatthew Dillon 
565*b06ebda0SMatthew Dillon typedef struct {
566*b06ebda0SMatthew Dillon 	u_int8_t	link_type;       /* ACL or SCO */
567*b06ebda0SMatthew Dillon 	u_int8_t	encryption_mode; /* none, p2p, ... */
568*b06ebda0SMatthew Dillon 	u_int8_t	mode;            /* ACTIVE, HOLD ... */
569*b06ebda0SMatthew Dillon 	u_int8_t	role;            /* MASTER/SLAVE */
570*b06ebda0SMatthew Dillon 	u_int16_t	state;           /* connection state */
571*b06ebda0SMatthew Dillon 	u_int16_t	reserved;        /* place holder */
572*b06ebda0SMatthew Dillon 	u_int16_t	pending;         /* number of pending packets */
573*b06ebda0SMatthew Dillon 	u_int16_t	queue_len;       /* number of packets in queue */
574*b06ebda0SMatthew Dillon 	u_int16_t	con_handle;      /* connection handle */
575*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;          /* remote bdaddr */
576*b06ebda0SMatthew Dillon } ng_hci_node_con_ep;
577*b06ebda0SMatthew Dillon 
578*b06ebda0SMatthew Dillon #define NG_HCI_MAX_CON_NUM \
579*b06ebda0SMatthew Dillon 	((0xffff - sizeof(ng_hci_node_con_list_ep))/sizeof(ng_hci_node_con_ep))
580*b06ebda0SMatthew Dillon 
581*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_UP				112 /* HCI -> Upper */
582*b06ebda0SMatthew Dillon typedef struct {
583*b06ebda0SMatthew Dillon 	u_int16_t	pkt_size; /* max. ACL/SCO packet size (w/out header) */
584*b06ebda0SMatthew Dillon 	u_int16_t	num_pkts; /* ACL/SCO packet queue size */
585*b06ebda0SMatthew Dillon 	u_int16_t	reserved; /* place holder */
586*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;	  /* bdaddr */
587*b06ebda0SMatthew Dillon } ng_hci_node_up_ep;
588*b06ebda0SMatthew Dillon 
589*b06ebda0SMatthew Dillon #define NGM_HCI_SYNC_CON_QUEUE			113 /* HCI -> Upper */
590*b06ebda0SMatthew Dillon typedef struct {
591*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
592*b06ebda0SMatthew Dillon 	u_int16_t	completed;  /* number of completed packets */
593*b06ebda0SMatthew Dillon } ng_hci_sync_con_queue_ep;
594*b06ebda0SMatthew Dillon 
595*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_GET_LINK_POLICY_SETTINGS_MASK	114 /* HCI -> User */
596*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_SET_LINK_POLICY_SETTINGS_MASK	115 /* User -> HCI */
597*b06ebda0SMatthew Dillon typedef u_int16_t	ng_hci_node_link_policy_mask_ep;
598*b06ebda0SMatthew Dillon 
599*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_GET_PACKET_MASK		116 /* HCI -> User */
600*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_SET_PACKET_MASK		117 /* User -> HCI */
601*b06ebda0SMatthew Dillon typedef u_int16_t	ng_hci_node_packet_mask_ep;
602*b06ebda0SMatthew Dillon 
603*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_GET_ROLE_SWITCH		118 /* HCI -> User */
604*b06ebda0SMatthew Dillon #define NGM_HCI_NODE_SET_ROLE_SWITCH		119 /* User -> HCI */
605*b06ebda0SMatthew Dillon typedef u_int16_t	ng_hci_node_role_switch_ep;
606*b06ebda0SMatthew Dillon 
607*b06ebda0SMatthew Dillon #define	NGM_HCI_NODE_LIST_NAMES			200 /* HCI -> User */
608*b06ebda0SMatthew Dillon 
609*b06ebda0SMatthew Dillon /**************************************************************************
610*b06ebda0SMatthew Dillon  **************************************************************************
611*b06ebda0SMatthew Dillon  **             Link control commands and return parameters
612*b06ebda0SMatthew Dillon  **************************************************************************
613*b06ebda0SMatthew Dillon  **************************************************************************/
614*b06ebda0SMatthew Dillon 
615*b06ebda0SMatthew Dillon #define NG_HCI_OGF_LINK_CONTROL			0x01 /* OpCode Group Field */
616*b06ebda0SMatthew Dillon 
617*b06ebda0SMatthew Dillon #define NG_HCI_OCF_INQUIRY			0x0001
618*b06ebda0SMatthew Dillon typedef struct {
619*b06ebda0SMatthew Dillon 	u_int8_t	lap[NG_HCI_LAP_SIZE]; /* LAP */
620*b06ebda0SMatthew Dillon 	u_int8_t	inquiry_length; /* (N x 1.28) sec */
621*b06ebda0SMatthew Dillon 	u_int8_t	num_responses;  /* Max. # of responses before halted */
622*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_inquiry_cp;
623*b06ebda0SMatthew Dillon /* No return parameter(s) */
624*b06ebda0SMatthew Dillon 
625*b06ebda0SMatthew Dillon #define NG_HCI_OCF_INQUIRY_CANCEL		0x0002
626*b06ebda0SMatthew Dillon /* No command parameter(s) */
627*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_inquiry_cancel_rp;
628*b06ebda0SMatthew Dillon 
629*b06ebda0SMatthew Dillon #define NG_HCI_OCF_PERIODIC_INQUIRY		0x0003
630*b06ebda0SMatthew Dillon typedef struct {
631*b06ebda0SMatthew Dillon 	u_int16_t	max_period_length; /* Max. and min. amount of time */
632*b06ebda0SMatthew Dillon 	u_int16_t	min_period_length; /* between consecutive inquiries */
633*b06ebda0SMatthew Dillon 	u_int8_t	lap[NG_HCI_LAP_SIZE]; /* LAP */
634*b06ebda0SMatthew Dillon 	u_int8_t	inquiry_length;    /* (inquiry_length * 1.28) sec */
635*b06ebda0SMatthew Dillon 	u_int8_t	num_responses;     /* Max. # of responses */
636*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_periodic_inquiry_cp;
637*b06ebda0SMatthew Dillon 
638*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_periodic_inquiry_rp;
639*b06ebda0SMatthew Dillon 
640*b06ebda0SMatthew Dillon #define NG_HCI_OCF_EXIT_PERIODIC_INQUIRY	0x0004
641*b06ebda0SMatthew Dillon /* No command parameter(s) */
642*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_exit_periodic_inquiry_rp;
643*b06ebda0SMatthew Dillon 
644*b06ebda0SMatthew Dillon #define NG_HCI_OCF_CREATE_CON			0x0005
645*b06ebda0SMatthew Dillon typedef struct {
646*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;             /* destination address */
647*b06ebda0SMatthew Dillon 	u_int16_t	pkt_type;           /* packet type */
648*b06ebda0SMatthew Dillon 	u_int8_t	page_scan_rep_mode; /* page scan repetition mode */
649*b06ebda0SMatthew Dillon 	u_int8_t	page_scan_mode;     /* page scan mode */
650*b06ebda0SMatthew Dillon 	u_int16_t	clock_offset;       /* clock offset */
651*b06ebda0SMatthew Dillon 	u_int8_t	accept_role_switch; /* accept role switch? 0x00 - no */
652*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_create_con_cp;
653*b06ebda0SMatthew Dillon /* No return parameter(s) */
654*b06ebda0SMatthew Dillon 
655*b06ebda0SMatthew Dillon #define NG_HCI_OCF_DISCON			0x0006
656*b06ebda0SMatthew Dillon typedef struct {
657*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
658*b06ebda0SMatthew Dillon 	u_int8_t	reason;     /* reason to disconnect */
659*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_discon_cp;
660*b06ebda0SMatthew Dillon /* No return parameter(s) */
661*b06ebda0SMatthew Dillon 
662*b06ebda0SMatthew Dillon #define NG_HCI_OCF_ADD_SCO_CON			0x0007
663*b06ebda0SMatthew Dillon typedef struct {
664*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
665*b06ebda0SMatthew Dillon 	u_int16_t	pkt_type;   /* packet type */
666*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_add_sco_con_cp;
667*b06ebda0SMatthew Dillon /* No return parameter(s) */
668*b06ebda0SMatthew Dillon 
669*b06ebda0SMatthew Dillon #define NG_HCI_OCF_ACCEPT_CON			0x0009
670*b06ebda0SMatthew Dillon typedef struct {
671*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr; /* address of unit to be connected */
672*b06ebda0SMatthew Dillon 	u_int8_t	role;   /* connection role */
673*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_accept_con_cp;
674*b06ebda0SMatthew Dillon /* No return parameter(s) */
675*b06ebda0SMatthew Dillon 
676*b06ebda0SMatthew Dillon #define NG_HCI_OCF_REJECT_CON			0x000a
677*b06ebda0SMatthew Dillon typedef struct {
678*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr; /* remote address */
679*b06ebda0SMatthew Dillon 	u_int8_t	reason; /* reason to reject */
680*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_reject_con_cp;
681*b06ebda0SMatthew Dillon /* No return parameter(s) */
682*b06ebda0SMatthew Dillon 
683*b06ebda0SMatthew Dillon #define NG_HCI_OCF_LINK_KEY_REP			0x000b
684*b06ebda0SMatthew Dillon typedef struct {
685*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;               /* remote address */
686*b06ebda0SMatthew Dillon 	u_int8_t	key[NG_HCI_KEY_SIZE]; /* key */
687*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_link_key_rep_cp;
688*b06ebda0SMatthew Dillon 
689*b06ebda0SMatthew Dillon typedef struct {
690*b06ebda0SMatthew Dillon 	u_int8_t	status; /* 0x00 - success */
691*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr; /* unit address */
692*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_link_key_rep_rp;
693*b06ebda0SMatthew Dillon 
694*b06ebda0SMatthew Dillon #define NG_HCI_OCF_LINK_KEY_NEG_REP		0x000c
695*b06ebda0SMatthew Dillon typedef struct {
696*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr; /* remote address */
697*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_link_key_neg_rep_cp;
698*b06ebda0SMatthew Dillon 
699*b06ebda0SMatthew Dillon typedef struct {
700*b06ebda0SMatthew Dillon 	u_int8_t	status; /* 0x00 - success */
701*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr; /* unit address */
702*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_link_key_neg_rep_rp;
703*b06ebda0SMatthew Dillon 
704*b06ebda0SMatthew Dillon #define NG_HCI_OCF_PIN_CODE_REP			0x000d
705*b06ebda0SMatthew Dillon typedef struct {
706*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;               /* remote address */
707*b06ebda0SMatthew Dillon 	u_int8_t	pin_size;             /* pin code length (in bytes) */
708*b06ebda0SMatthew Dillon 	u_int8_t	pin[NG_HCI_PIN_SIZE]; /* pin code */
709*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_pin_code_rep_cp;
710*b06ebda0SMatthew Dillon 
711*b06ebda0SMatthew Dillon typedef struct {
712*b06ebda0SMatthew Dillon 	u_int8_t	status; /* 0x00 - success */
713*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr; /* unit address */
714*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_pin_code_rep_rp;
715*b06ebda0SMatthew Dillon 
716*b06ebda0SMatthew Dillon #define NG_HCI_OCF_PIN_CODE_NEG_REP		0x000e
717*b06ebda0SMatthew Dillon typedef struct {
718*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;  /* remote address */
719*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_pin_code_neg_rep_cp;
720*b06ebda0SMatthew Dillon 
721*b06ebda0SMatthew Dillon typedef struct {
722*b06ebda0SMatthew Dillon 	u_int8_t	status; /* 0x00 - success */
723*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr; /* unit address */
724*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_pin_code_neg_rep_rp;
725*b06ebda0SMatthew Dillon 
726*b06ebda0SMatthew Dillon #define NG_HCI_OCF_CHANGE_CON_PKT_TYPE		0x000f
727*b06ebda0SMatthew Dillon typedef struct {
728*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
729*b06ebda0SMatthew Dillon 	u_int16_t	pkt_type;   /* packet type */
730*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_change_con_pkt_type_cp;
731*b06ebda0SMatthew Dillon /* No return parameter(s) */
732*b06ebda0SMatthew Dillon 
733*b06ebda0SMatthew Dillon #define NG_HCI_OCF_AUTH_REQ			0x0011
734*b06ebda0SMatthew Dillon typedef struct {
735*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
736*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_auth_req_cp;
737*b06ebda0SMatthew Dillon /* No return parameter(s) */
738*b06ebda0SMatthew Dillon 
739*b06ebda0SMatthew Dillon #define NG_HCI_OCF_SET_CON_ENCRYPTION		0x0013
740*b06ebda0SMatthew Dillon typedef struct {
741*b06ebda0SMatthew Dillon 	u_int16_t	con_handle;        /* connection handle */
742*b06ebda0SMatthew Dillon 	u_int8_t	encryption_enable; /* 0x00 - disable, 0x01 - enable */
743*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_set_con_encryption_cp;
744*b06ebda0SMatthew Dillon /* No return parameter(s) */
745*b06ebda0SMatthew Dillon 
746*b06ebda0SMatthew Dillon #define NG_HCI_OCF_CHANGE_CON_LINK_KEY		0x0015
747*b06ebda0SMatthew Dillon typedef struct {
748*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
749*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_change_con_link_key_cp;
750*b06ebda0SMatthew Dillon /* No return parameter(s) */
751*b06ebda0SMatthew Dillon 
752*b06ebda0SMatthew Dillon #define NG_HCI_OCF_MASTER_LINK_KEY		0x0017
753*b06ebda0SMatthew Dillon typedef struct {
754*b06ebda0SMatthew Dillon 	u_int8_t	key_flag; /* key flag */
755*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_master_link_key_cp;
756*b06ebda0SMatthew Dillon /* No return parameter(s) */
757*b06ebda0SMatthew Dillon 
758*b06ebda0SMatthew Dillon #define NG_HCI_OCF_REMOTE_NAME_REQ		0x0019
759*b06ebda0SMatthew Dillon typedef struct {
760*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;             /* remote address */
761*b06ebda0SMatthew Dillon 	u_int8_t	page_scan_rep_mode; /* page scan repetition mode */
762*b06ebda0SMatthew Dillon 	u_int8_t	page_scan_mode;     /* page scan mode */
763*b06ebda0SMatthew Dillon 	u_int16_t	clock_offset;       /* clock offset */
764*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_remote_name_req_cp;
765*b06ebda0SMatthew Dillon /* No return parameter(s) */
766*b06ebda0SMatthew Dillon 
767*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_REMOTE_FEATURES		0x001b
768*b06ebda0SMatthew Dillon typedef struct {
769*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
770*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_remote_features_cp;
771*b06ebda0SMatthew Dillon /* No return parameter(s) */
772*b06ebda0SMatthew Dillon 
773*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_REMOTE_VER_INFO		0x001d
774*b06ebda0SMatthew Dillon typedef struct {
775*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
776*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_remote_ver_info_cp;
777*b06ebda0SMatthew Dillon /* No return parameter(s) */
778*b06ebda0SMatthew Dillon 
779*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_CLOCK_OFFSET		 0x001f
780*b06ebda0SMatthew Dillon typedef struct {
781*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
782*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_clock_offset_cp;
783*b06ebda0SMatthew Dillon /* No return parameter(s) */
784*b06ebda0SMatthew Dillon 
785*b06ebda0SMatthew Dillon /**************************************************************************
786*b06ebda0SMatthew Dillon  **************************************************************************
787*b06ebda0SMatthew Dillon  **        Link policy commands and return parameters
788*b06ebda0SMatthew Dillon  **************************************************************************
789*b06ebda0SMatthew Dillon  **************************************************************************/
790*b06ebda0SMatthew Dillon 
791*b06ebda0SMatthew Dillon #define NG_HCI_OGF_LINK_POLICY			0x02 /* OpCode Group Field */
792*b06ebda0SMatthew Dillon 
793*b06ebda0SMatthew Dillon #define NG_HCI_OCF_HOLD_MODE			0x0001
794*b06ebda0SMatthew Dillon typedef struct {
795*b06ebda0SMatthew Dillon 	u_int16_t	con_handle;   /* connection handle */
796*b06ebda0SMatthew Dillon 	u_int16_t	max_interval; /* (max_interval * 0.625) msec */
797*b06ebda0SMatthew Dillon 	u_int16_t	min_interval; /* (max_interval * 0.625) msec */
798*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_hold_mode_cp;
799*b06ebda0SMatthew Dillon /* No return parameter(s) */
800*b06ebda0SMatthew Dillon 
801*b06ebda0SMatthew Dillon #define NG_HCI_OCF_SNIFF_MODE			0x0003
802*b06ebda0SMatthew Dillon typedef struct {
803*b06ebda0SMatthew Dillon 	u_int16_t	con_handle;   /* connection handle */
804*b06ebda0SMatthew Dillon 	u_int16_t	max_interval; /* (max_interval * 0.625) msec */
805*b06ebda0SMatthew Dillon 	u_int16_t	min_interval; /* (max_interval * 0.625) msec */
806*b06ebda0SMatthew Dillon 	u_int16_t	attempt;      /* (2 * attempt - 1) * 0.625 msec */
807*b06ebda0SMatthew Dillon 	u_int16_t	timeout;      /* (2 * attempt - 1) * 0.625 msec */
808*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_sniff_mode_cp;
809*b06ebda0SMatthew Dillon /* No return parameter(s) */
810*b06ebda0SMatthew Dillon 
811*b06ebda0SMatthew Dillon #define NG_HCI_OCF_EXIT_SNIFF_MODE		0x0004
812*b06ebda0SMatthew Dillon typedef struct {
813*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
814*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_exit_sniff_mode_cp;
815*b06ebda0SMatthew Dillon /* No return parameter(s) */
816*b06ebda0SMatthew Dillon 
817*b06ebda0SMatthew Dillon #define NG_HCI_OCF_PARK_MODE			0x0005
818*b06ebda0SMatthew Dillon typedef struct {
819*b06ebda0SMatthew Dillon 	u_int16_t	con_handle;   /* connection handle */
820*b06ebda0SMatthew Dillon 	u_int16_t	max_interval; /* (max_interval * 0.625) msec */
821*b06ebda0SMatthew Dillon 	u_int16_t	min_interval; /* (max_interval * 0.625) msec */
822*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_park_mode_cp;
823*b06ebda0SMatthew Dillon /* No return parameter(s) */
824*b06ebda0SMatthew Dillon 
825*b06ebda0SMatthew Dillon #define NG_HCI_OCF_EXIT_PARK_MODE		0x0006
826*b06ebda0SMatthew Dillon typedef struct {
827*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
828*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_exit_park_mode_cp;
829*b06ebda0SMatthew Dillon /* No return parameter(s) */
830*b06ebda0SMatthew Dillon 
831*b06ebda0SMatthew Dillon #define NG_HCI_OCF_QOS_SETUP			0x0007
832*b06ebda0SMatthew Dillon typedef struct {
833*b06ebda0SMatthew Dillon 	u_int16_t	con_handle;      /* connection handle */
834*b06ebda0SMatthew Dillon 	u_int8_t	flags;           /* reserved for future use */
835*b06ebda0SMatthew Dillon 	u_int8_t	service_type;    /* service type */
836*b06ebda0SMatthew Dillon 	u_int32_t	token_rate;      /* bytes per second */
837*b06ebda0SMatthew Dillon 	u_int32_t	peak_bandwidth;  /* bytes per second */
838*b06ebda0SMatthew Dillon 	u_int32_t	latency;         /* microseconds */
839*b06ebda0SMatthew Dillon 	u_int32_t	delay_variation; /* microseconds */
840*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_qos_setup_cp;
841*b06ebda0SMatthew Dillon /* No return parameter(s) */
842*b06ebda0SMatthew Dillon 
843*b06ebda0SMatthew Dillon #define NG_HCI_OCF_ROLE_DISCOVERY		0x0009
844*b06ebda0SMatthew Dillon typedef struct {
845*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
846*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_role_discovery_cp;
847*b06ebda0SMatthew Dillon 
848*b06ebda0SMatthew Dillon typedef struct {
849*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
850*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
851*b06ebda0SMatthew Dillon 	u_int8_t	role;       /* role for the connection handle */
852*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_role_discovery_rp;
853*b06ebda0SMatthew Dillon 
854*b06ebda0SMatthew Dillon #define NG_HCI_OCF_SWITCH_ROLE			0x000b
855*b06ebda0SMatthew Dillon typedef struct {
856*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr; /* remote address */
857*b06ebda0SMatthew Dillon 	u_int8_t	role;   /* new local role */
858*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_switch_role_cp;
859*b06ebda0SMatthew Dillon /* No return parameter(s) */
860*b06ebda0SMatthew Dillon 
861*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_LINK_POLICY_SETTINGS	0x000c
862*b06ebda0SMatthew Dillon typedef struct {
863*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
864*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_link_policy_settings_cp;
865*b06ebda0SMatthew Dillon 
866*b06ebda0SMatthew Dillon typedef struct {
867*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
868*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
869*b06ebda0SMatthew Dillon 	u_int16_t	settings;   /* link policy settings */
870*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_link_policy_settings_rp;
871*b06ebda0SMatthew Dillon 
872*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_LINK_POLICY_SETTINGS	0x000d
873*b06ebda0SMatthew Dillon typedef struct {
874*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
875*b06ebda0SMatthew Dillon 	u_int16_t	settings;   /* link policy settings */
876*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_link_policy_settings_cp;
877*b06ebda0SMatthew Dillon 
878*b06ebda0SMatthew Dillon typedef struct {
879*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
880*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
881*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_link_policy_settings_rp;
882*b06ebda0SMatthew Dillon 
883*b06ebda0SMatthew Dillon /**************************************************************************
884*b06ebda0SMatthew Dillon  **************************************************************************
885*b06ebda0SMatthew Dillon  **   Host controller and baseband commands and return parameters
886*b06ebda0SMatthew Dillon  **************************************************************************
887*b06ebda0SMatthew Dillon  **************************************************************************/
888*b06ebda0SMatthew Dillon 
889*b06ebda0SMatthew Dillon #define NG_HCI_OGF_HC_BASEBAND			0x03 /* OpCode Group Field */
890*b06ebda0SMatthew Dillon 
891*b06ebda0SMatthew Dillon #define NG_HCI_OCF_SET_EVENT_MASK		0x0001
892*b06ebda0SMatthew Dillon typedef struct {
893*b06ebda0SMatthew Dillon 	u_int8_t	event_mask[NG_HCI_EVENT_MASK_SIZE]; /* event_mask */
894*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_set_event_mask_cp;
895*b06ebda0SMatthew Dillon 
896*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_set_event_mask_rp;
897*b06ebda0SMatthew Dillon 
898*b06ebda0SMatthew Dillon #define NG_HCI_OCF_RESET			0x0003
899*b06ebda0SMatthew Dillon /* No command parameter(s) */
900*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_reset_rp;
901*b06ebda0SMatthew Dillon 
902*b06ebda0SMatthew Dillon #define NG_HCI_OCF_SET_EVENT_FILTER		0x0005
903*b06ebda0SMatthew Dillon typedef struct {
904*b06ebda0SMatthew Dillon 	u_int8_t	filter_type;           /* filter type */
905*b06ebda0SMatthew Dillon 	u_int8_t	filter_condition_type; /* filter condition type */
906*b06ebda0SMatthew Dillon 	u_int8_t	condition[0];          /* conditions - variable size */
907*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_set_event_filter_cp;
908*b06ebda0SMatthew Dillon 
909*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_set_event_filter_rp;
910*b06ebda0SMatthew Dillon 
911*b06ebda0SMatthew Dillon #define NG_HCI_OCF_FLUSH			0x0008
912*b06ebda0SMatthew Dillon typedef struct {
913*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
914*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_flush_cp;
915*b06ebda0SMatthew Dillon 
916*b06ebda0SMatthew Dillon typedef struct {
917*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
918*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
919*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_flush_rp;
920*b06ebda0SMatthew Dillon 
921*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_PIN_TYPE		0x0009
922*b06ebda0SMatthew Dillon /* No command parameter(s) */
923*b06ebda0SMatthew Dillon typedef struct {
924*b06ebda0SMatthew Dillon 	u_int8_t	status;   /* 0x00 - success */
925*b06ebda0SMatthew Dillon 	u_int8_t	pin_type; /* PIN type */
926*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_pin_type_rp;
927*b06ebda0SMatthew Dillon 
928*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_PIN_TYPE		0x000a
929*b06ebda0SMatthew Dillon typedef struct {
930*b06ebda0SMatthew Dillon 	u_int8_t	pin_type; /* PIN type */
931*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_pin_type_cp;
932*b06ebda0SMatthew Dillon 
933*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_pin_type_rp;
934*b06ebda0SMatthew Dillon 
935*b06ebda0SMatthew Dillon #define NG_HCI_OCF_CREATE_NEW_UNIT_KEY		0x000b
936*b06ebda0SMatthew Dillon /* No command parameter(s) */
937*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_create_new_unit_key_rp;
938*b06ebda0SMatthew Dillon 
939*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_STORED_LINK_KEY		0x000d
940*b06ebda0SMatthew Dillon typedef struct {
941*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;   /* address */
942*b06ebda0SMatthew Dillon 	u_int8_t	read_all; /* read all keys? 0x01 - yes */
943*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_stored_link_key_cp;
944*b06ebda0SMatthew Dillon 
945*b06ebda0SMatthew Dillon typedef struct {
946*b06ebda0SMatthew Dillon 	u_int8_t	status;        /* 0x00 - success */
947*b06ebda0SMatthew Dillon 	u_int16_t	max_num_keys;  /* Max. number of keys */
948*b06ebda0SMatthew Dillon 	u_int16_t	num_keys_read; /* Number of stored keys */
949*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_stored_link_key_rp;
950*b06ebda0SMatthew Dillon 
951*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_STORED_LINK_KEY	0x0011
952*b06ebda0SMatthew Dillon typedef struct {
953*b06ebda0SMatthew Dillon 	u_int8_t	num_keys_write; /* # of keys to write */
954*b06ebda0SMatthew Dillon /* these are repeated "num_keys_write" times
955*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;                --- remote address(es)
956*b06ebda0SMatthew Dillon 	u_int8_t	key[NG_HCI_KEY_SIZE];  --- key(s) */
957*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_stored_link_key_cp;
958*b06ebda0SMatthew Dillon 
959*b06ebda0SMatthew Dillon typedef struct {
960*b06ebda0SMatthew Dillon 	u_int8_t	status;           /* 0x00 - success */
961*b06ebda0SMatthew Dillon 	u_int8_t	num_keys_written; /* # of keys successfully written */
962*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_stored_link_key_rp;
963*b06ebda0SMatthew Dillon 
964*b06ebda0SMatthew Dillon #define NG_HCI_OCF_DELETE_STORED_LINK_KEY	0x0012
965*b06ebda0SMatthew Dillon typedef struct {
966*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;     /* address */
967*b06ebda0SMatthew Dillon 	u_int8_t	delete_all; /* delete all keys? 0x01 - yes */
968*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_delete_stored_link_key_cp;
969*b06ebda0SMatthew Dillon 
970*b06ebda0SMatthew Dillon typedef struct {
971*b06ebda0SMatthew Dillon 	u_int8_t	status;           /* 0x00 - success */
972*b06ebda0SMatthew Dillon 	u_int16_t	num_keys_deleted; /* Number of keys deleted */
973*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_delete_stored_link_key_rp;
974*b06ebda0SMatthew Dillon 
975*b06ebda0SMatthew Dillon #define NG_HCI_OCF_CHANGE_LOCAL_NAME		0x0013
976*b06ebda0SMatthew Dillon typedef struct {
977*b06ebda0SMatthew Dillon 	char		name[NG_HCI_UNIT_NAME_SIZE]; /* new unit name */
978*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_change_local_name_cp;
979*b06ebda0SMatthew Dillon 
980*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_change_local_name_rp;
981*b06ebda0SMatthew Dillon 
982*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_LOCAL_NAME		0x0014
983*b06ebda0SMatthew Dillon /* No command parameter(s) */
984*b06ebda0SMatthew Dillon typedef struct {
985*b06ebda0SMatthew Dillon 	u_int8_t	status;  /* 0x00 - success */
986*b06ebda0SMatthew Dillon 	char		name[NG_HCI_UNIT_NAME_SIZE]; /* unit name */
987*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_local_name_rp;
988*b06ebda0SMatthew Dillon 
989*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_CON_ACCEPT_TIMO		0x0015
990*b06ebda0SMatthew Dillon /* No command parameter(s) */
991*b06ebda0SMatthew Dillon typedef struct {
992*b06ebda0SMatthew Dillon 	u_int8_t	status;  /* 0x00 - success */
993*b06ebda0SMatthew Dillon 	u_int16_t	timeout; /* (timeout * 0.625) msec */
994*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_con_accept_timo_rp;
995*b06ebda0SMatthew Dillon 
996*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_CON_ACCEPT_TIMO	0x0016
997*b06ebda0SMatthew Dillon typedef struct {
998*b06ebda0SMatthew Dillon 	u_int16_t	timeout; /* (timeout * 0.625) msec */
999*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_con_accept_timo_cp;
1000*b06ebda0SMatthew Dillon 
1001*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_con_accept_timo_rp;
1002*b06ebda0SMatthew Dillon 
1003*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_PAGE_TIMO		0x0017
1004*b06ebda0SMatthew Dillon /* No command parameter(s) */
1005*b06ebda0SMatthew Dillon typedef struct {
1006*b06ebda0SMatthew Dillon 	u_int8_t	status;  /* 0x00 - success */
1007*b06ebda0SMatthew Dillon 	u_int16_t	timeout; /* (timeout * 0.625) msec */
1008*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_page_timo_rp;
1009*b06ebda0SMatthew Dillon 
1010*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_PAGE_TIMO		0x0018
1011*b06ebda0SMatthew Dillon typedef struct {
1012*b06ebda0SMatthew Dillon 	u_int16_t	timeout; /* (timeout * 0.625) msec */
1013*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_page_timo_cp;
1014*b06ebda0SMatthew Dillon 
1015*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_page_timo_rp;
1016*b06ebda0SMatthew Dillon 
1017*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_SCAN_ENABLE		0x0019
1018*b06ebda0SMatthew Dillon /* No command parameter(s) */
1019*b06ebda0SMatthew Dillon typedef struct {
1020*b06ebda0SMatthew Dillon 	u_int8_t	status;      /* 0x00 - success */
1021*b06ebda0SMatthew Dillon 	u_int8_t	scan_enable; /* Scan enable */
1022*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_scan_enable_rp;
1023*b06ebda0SMatthew Dillon 
1024*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_SCAN_ENABLE		0x001a
1025*b06ebda0SMatthew Dillon typedef struct {
1026*b06ebda0SMatthew Dillon 	u_int8_t	scan_enable; /* Scan enable */
1027*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_scan_enable_cp;
1028*b06ebda0SMatthew Dillon 
1029*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_scan_enable_rp;
1030*b06ebda0SMatthew Dillon 
1031*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_PAGE_SCAN_ACTIVITY	0x001b
1032*b06ebda0SMatthew Dillon /* No command parameter(s) */
1033*b06ebda0SMatthew Dillon typedef struct {
1034*b06ebda0SMatthew Dillon 	u_int8_t	status;             /* 0x00 - success */
1035*b06ebda0SMatthew Dillon 	u_int16_t	page_scan_interval; /* interval * 0.625 msec */
1036*b06ebda0SMatthew Dillon 	u_int16_t	page_scan_window;   /* window * 0.625 msec */
1037*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_page_scan_activity_rp;
1038*b06ebda0SMatthew Dillon 
1039*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_PAGE_SCAN_ACTIVITY	0x001c
1040*b06ebda0SMatthew Dillon typedef struct {
1041*b06ebda0SMatthew Dillon 	u_int16_t	page_scan_interval; /* interval * 0.625 msec */
1042*b06ebda0SMatthew Dillon 	u_int16_t	page_scan_window;   /* window * 0.625 msec */
1043*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_page_scan_activity_cp;
1044*b06ebda0SMatthew Dillon 
1045*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_page_scan_activity_rp;
1046*b06ebda0SMatthew Dillon 
1047*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_INQUIRY_SCAN_ACTIVITY	0x001d
1048*b06ebda0SMatthew Dillon /* No command parameter(s) */
1049*b06ebda0SMatthew Dillon typedef struct {
1050*b06ebda0SMatthew Dillon 	u_int8_t	status;                /* 0x00 - success */
1051*b06ebda0SMatthew Dillon 	u_int16_t	inquiry_scan_interval; /* interval * 0.625 msec */
1052*b06ebda0SMatthew Dillon 	u_int16_t	inquiry_scan_window;   /* window * 0.625 msec */
1053*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_inquiry_scan_activity_rp;
1054*b06ebda0SMatthew Dillon 
1055*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_INQUIRY_SCAN_ACTIVITY	0x001e
1056*b06ebda0SMatthew Dillon typedef struct {
1057*b06ebda0SMatthew Dillon 	u_int16_t	inquiry_scan_interval; /* interval * 0.625 msec */
1058*b06ebda0SMatthew Dillon 	u_int16_t	inquiry_scan_window;   /* window * 0.625 msec */
1059*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_inquiry_scan_activity_cp;
1060*b06ebda0SMatthew Dillon 
1061*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_inquiry_scan_activity_rp;
1062*b06ebda0SMatthew Dillon 
1063*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_AUTH_ENABLE		0x001f
1064*b06ebda0SMatthew Dillon /* No command parameter(s) */
1065*b06ebda0SMatthew Dillon typedef struct {
1066*b06ebda0SMatthew Dillon 	u_int8_t	status;      /* 0x00 - success */
1067*b06ebda0SMatthew Dillon 	u_int8_t	auth_enable; /* 0x01 - enabled */
1068*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_auth_enable_rp;
1069*b06ebda0SMatthew Dillon 
1070*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_AUTH_ENABLE		0x0020
1071*b06ebda0SMatthew Dillon typedef struct {
1072*b06ebda0SMatthew Dillon 	u_int8_t	auth_enable; /* 0x01 - enabled */
1073*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_auth_enable_cp;
1074*b06ebda0SMatthew Dillon 
1075*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_auth_enable_rp;
1076*b06ebda0SMatthew Dillon 
1077*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_ENCRYPTION_MODE		0x0021
1078*b06ebda0SMatthew Dillon /* No command parameter(s) */
1079*b06ebda0SMatthew Dillon typedef struct {
1080*b06ebda0SMatthew Dillon 	u_int8_t	status;          /* 0x00 - success */
1081*b06ebda0SMatthew Dillon 	u_int8_t	encryption_mode; /* encryption mode */
1082*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_encryption_mode_rp;
1083*b06ebda0SMatthew Dillon 
1084*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_ENCRYPTION_MODE	0x0022
1085*b06ebda0SMatthew Dillon typedef struct {
1086*b06ebda0SMatthew Dillon 	u_int8_t	encryption_mode; /* encryption mode */
1087*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_encryption_mode_cp;
1088*b06ebda0SMatthew Dillon 
1089*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_encryption_mode_rp;
1090*b06ebda0SMatthew Dillon 
1091*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_UNIT_CLASS		0x0023
1092*b06ebda0SMatthew Dillon /* No command parameter(s) */
1093*b06ebda0SMatthew Dillon typedef struct {
1094*b06ebda0SMatthew Dillon 	u_int8_t	status;                    /* 0x00 - success */
1095*b06ebda0SMatthew Dillon 	u_int8_t	uclass[NG_HCI_CLASS_SIZE]; /* unit class */
1096*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_unit_class_rp;
1097*b06ebda0SMatthew Dillon 
1098*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_UNIT_CLASS		0x0024
1099*b06ebda0SMatthew Dillon typedef struct {
1100*b06ebda0SMatthew Dillon 	u_int8_t	uclass[NG_HCI_CLASS_SIZE]; /* unit class */
1101*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_unit_class_cp;
1102*b06ebda0SMatthew Dillon 
1103*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_unit_class_rp;
1104*b06ebda0SMatthew Dillon 
1105*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_VOICE_SETTINGS		0x0025
1106*b06ebda0SMatthew Dillon /* No command parameter(s) */
1107*b06ebda0SMatthew Dillon typedef struct {
1108*b06ebda0SMatthew Dillon 	u_int8_t	status;   /* 0x00 - success */
1109*b06ebda0SMatthew Dillon 	u_int16_t	settings; /* voice settings */
1110*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_voice_settings_rp;
1111*b06ebda0SMatthew Dillon 
1112*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_VOICE_SETTINGS		0x0026
1113*b06ebda0SMatthew Dillon typedef struct {
1114*b06ebda0SMatthew Dillon 	u_int16_t	settings; /* voice settings */
1115*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_voice_settings_cp;
1116*b06ebda0SMatthew Dillon 
1117*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_voice_settings_rp;
1118*b06ebda0SMatthew Dillon 
1119*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_AUTO_FLUSH_TIMO		0x0027
1120*b06ebda0SMatthew Dillon typedef struct {
1121*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1122*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_auto_flush_timo_cp;
1123*b06ebda0SMatthew Dillon 
1124*b06ebda0SMatthew Dillon typedef struct {
1125*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
1126*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1127*b06ebda0SMatthew Dillon 	u_int16_t	timeout;    /* 0x00 - no flush, timeout * 0.625 msec */
1128*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_auto_flush_timo_rp;
1129*b06ebda0SMatthew Dillon 
1130*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_AUTO_FLUSH_TIMO	0x0028
1131*b06ebda0SMatthew Dillon typedef struct {
1132*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1133*b06ebda0SMatthew Dillon 	u_int16_t	timeout;    /* 0x00 - no flush, timeout * 0.625 msec */
1134*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_auto_flush_timo_cp;
1135*b06ebda0SMatthew Dillon 
1136*b06ebda0SMatthew Dillon typedef struct {
1137*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
1138*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1139*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_auto_flush_timo_rp;
1140*b06ebda0SMatthew Dillon 
1141*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_NUM_BROADCAST_RETRANS	0x0029
1142*b06ebda0SMatthew Dillon /* No command parameter(s) */
1143*b06ebda0SMatthew Dillon typedef struct {
1144*b06ebda0SMatthew Dillon 	u_int8_t	status;  /* 0x00 - success */
1145*b06ebda0SMatthew Dillon 	u_int8_t	counter; /* number of broadcast retransmissions */
1146*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_num_broadcast_retrans_rp;
1147*b06ebda0SMatthew Dillon 
1148*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_NUM_BROADCAST_RETRANS	0x002a
1149*b06ebda0SMatthew Dillon typedef struct {
1150*b06ebda0SMatthew Dillon 	u_int8_t	counter; /* number of broadcast retransmissions */
1151*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_num_broadcast_retrans_cp;
1152*b06ebda0SMatthew Dillon 
1153*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_num_broadcast_retrans_rp;
1154*b06ebda0SMatthew Dillon 
1155*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_HOLD_MODE_ACTIVITY	0x002b
1156*b06ebda0SMatthew Dillon /* No command parameter(s) */
1157*b06ebda0SMatthew Dillon typedef struct {
1158*b06ebda0SMatthew Dillon 	u_int8_t	status;             /* 0x00 - success */
1159*b06ebda0SMatthew Dillon 	u_int8_t	hold_mode_activity; /* Hold mode activities */
1160*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_hold_mode_activity_rp;
1161*b06ebda0SMatthew Dillon 
1162*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_HOLD_MODE_ACTIVITY	0x002c
1163*b06ebda0SMatthew Dillon typedef struct {
1164*b06ebda0SMatthew Dillon 	u_int8_t	hold_mode_activity; /* Hold mode activities */
1165*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_hold_mode_activity_cp;
1166*b06ebda0SMatthew Dillon 
1167*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_hold_mode_activity_rp;
1168*b06ebda0SMatthew Dillon 
1169*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_XMIT_LEVEL		0x002d
1170*b06ebda0SMatthew Dillon typedef struct {
1171*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1172*b06ebda0SMatthew Dillon 	u_int8_t	type;       /* Xmit level type */
1173*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_xmit_level_cp;
1174*b06ebda0SMatthew Dillon 
1175*b06ebda0SMatthew Dillon typedef struct {
1176*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
1177*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1178*b06ebda0SMatthew Dillon 	char		level;      /* -30 <= level <= 30 dBm */
1179*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_xmit_level_rp;
1180*b06ebda0SMatthew Dillon 
1181*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_SCO_FLOW_CONTROL	0x002e
1182*b06ebda0SMatthew Dillon /* No command parameter(s) */
1183*b06ebda0SMatthew Dillon typedef struct {
1184*b06ebda0SMatthew Dillon 	u_int8_t	status;       /* 0x00 - success */
1185*b06ebda0SMatthew Dillon 	u_int8_t	flow_control; /* 0x00 - disabled */
1186*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_sco_flow_control_rp;
1187*b06ebda0SMatthew Dillon 
1188*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_SCO_FLOW_CONTROL	0x002f
1189*b06ebda0SMatthew Dillon typedef struct {
1190*b06ebda0SMatthew Dillon 	u_int8_t	flow_control; /* 0x00 - disabled */
1191*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_sco_flow_control_cp;
1192*b06ebda0SMatthew Dillon 
1193*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_sco_flow_control_rp;
1194*b06ebda0SMatthew Dillon 
1195*b06ebda0SMatthew Dillon #define NG_HCI_OCF_H2HC_FLOW_CONTROL		0x0031
1196*b06ebda0SMatthew Dillon typedef struct {
1197*b06ebda0SMatthew Dillon 	u_int8_t	h2hc_flow; /* Host to Host controller flow control */
1198*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_h2hc_flow_control_cp;
1199*b06ebda0SMatthew Dillon 
1200*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_h2hc_flow_control_rp;
1201*b06ebda0SMatthew Dillon 
1202*b06ebda0SMatthew Dillon #define NG_HCI_OCF_HOST_BUFFER_SIZE		0x0033
1203*b06ebda0SMatthew Dillon typedef struct {
1204*b06ebda0SMatthew Dillon 	u_int16_t	max_acl_size; /* Max. size of ACL packet (bytes) */
1205*b06ebda0SMatthew Dillon 	u_int8_t	max_sco_size; /* Max. size of SCO packet (bytes) */
1206*b06ebda0SMatthew Dillon 	u_int16_t	num_acl_pkt;  /* Max. number of ACL packets */
1207*b06ebda0SMatthew Dillon 	u_int16_t	num_sco_pkt;  /* Max. number of SCO packets */
1208*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_host_buffer_size_cp;
1209*b06ebda0SMatthew Dillon 
1210*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_host_buffer_size_rp;
1211*b06ebda0SMatthew Dillon 
1212*b06ebda0SMatthew Dillon #define NG_HCI_OCF_HOST_NUM_COMPL_PKTS		0x0035
1213*b06ebda0SMatthew Dillon typedef struct {
1214*b06ebda0SMatthew Dillon 	u_int8_t	num_con_handles; /* # of connection handles */
1215*b06ebda0SMatthew Dillon /* these are repeated "num_con_handles" times
1216*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; --- connection handle(s)
1217*b06ebda0SMatthew Dillon 	u_int16_t	compl_pkt;  --- # of completed packets */
1218*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_host_num_compl_pkts_cp;
1219*b06ebda0SMatthew Dillon /* No return parameter(s) */
1220*b06ebda0SMatthew Dillon 
1221*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_LINK_SUPERVISION_TIMO	0x0036
1222*b06ebda0SMatthew Dillon typedef struct {
1223*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1224*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_link_supervision_timo_cp;
1225*b06ebda0SMatthew Dillon 
1226*b06ebda0SMatthew Dillon typedef struct {
1227*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
1228*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1229*b06ebda0SMatthew Dillon 	u_int16_t	timeout;    /* Link supervision timeout * 0.625 msec */
1230*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_link_supervision_timo_rp;
1231*b06ebda0SMatthew Dillon 
1232*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_LINK_SUPERVISION_TIMO	0x0037
1233*b06ebda0SMatthew Dillon typedef struct {
1234*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1235*b06ebda0SMatthew Dillon 	u_int16_t	timeout;    /* Link supervision timeout * 0.625 msec */
1236*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_link_supervision_timo_cp;
1237*b06ebda0SMatthew Dillon 
1238*b06ebda0SMatthew Dillon typedef struct {
1239*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
1240*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1241*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_link_supervision_timo_rp;
1242*b06ebda0SMatthew Dillon 
1243*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_SUPPORTED_IAC_NUM	0x0038
1244*b06ebda0SMatthew Dillon /* No command parameter(s) */
1245*b06ebda0SMatthew Dillon typedef struct {
1246*b06ebda0SMatthew Dillon 	u_int8_t	status;  /* 0x00 - success */
1247*b06ebda0SMatthew Dillon 	u_int8_t	num_iac; /* # of supported IAC during scan */
1248*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_supported_iac_num_rp;
1249*b06ebda0SMatthew Dillon 
1250*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_IAC_LAP			0x0039
1251*b06ebda0SMatthew Dillon /* No command parameter(s) */
1252*b06ebda0SMatthew Dillon typedef struct {
1253*b06ebda0SMatthew Dillon 	u_int8_t	status;  /* 0x00 - success */
1254*b06ebda0SMatthew Dillon 	u_int8_t	num_iac; /* # of IAC */
1255*b06ebda0SMatthew Dillon /* these are repeated "num_iac" times
1256*b06ebda0SMatthew Dillon 	u_int8_t	laps[NG_HCI_LAP_SIZE]; --- LAPs */
1257*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_iac_lap_rp;
1258*b06ebda0SMatthew Dillon 
1259*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_IAC_LAP		0x003a
1260*b06ebda0SMatthew Dillon typedef struct {
1261*b06ebda0SMatthew Dillon 	u_int8_t	num_iac; /* # of IAC */
1262*b06ebda0SMatthew Dillon /* these are repeated "num_iac" times
1263*b06ebda0SMatthew Dillon 	u_int8_t	laps[NG_HCI_LAP_SIZE]; --- LAPs */
1264*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_iac_lap_cp;
1265*b06ebda0SMatthew Dillon 
1266*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_iac_lap_rp;
1267*b06ebda0SMatthew Dillon 
1268*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_PAGE_SCAN_PERIOD	0x003b
1269*b06ebda0SMatthew Dillon /* No command parameter(s) */
1270*b06ebda0SMatthew Dillon typedef struct {
1271*b06ebda0SMatthew Dillon 	u_int8_t	status;                /* 0x00 - success */
1272*b06ebda0SMatthew Dillon 	u_int8_t	page_scan_period_mode; /* Page scan period mode */
1273*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_page_scan_period_rp;
1274*b06ebda0SMatthew Dillon 
1275*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_PAGE_SCAN_PERIOD	0x003c
1276*b06ebda0SMatthew Dillon typedef struct {
1277*b06ebda0SMatthew Dillon 	u_int8_t	page_scan_period_mode; /* Page scan period mode */
1278*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_page_scan_period_cp;
1279*b06ebda0SMatthew Dillon 
1280*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_page_scan_period_rp;
1281*b06ebda0SMatthew Dillon 
1282*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_PAGE_SCAN		0x003d
1283*b06ebda0SMatthew Dillon /* No command parameter(s) */
1284*b06ebda0SMatthew Dillon typedef struct {
1285*b06ebda0SMatthew Dillon 	u_int8_t	status;         /* 0x00 - success */
1286*b06ebda0SMatthew Dillon 	u_int8_t	page_scan_mode; /* Page scan mode */
1287*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_page_scan_rp;
1288*b06ebda0SMatthew Dillon 
1289*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_PAGE_SCAN		0x003e
1290*b06ebda0SMatthew Dillon typedef struct {
1291*b06ebda0SMatthew Dillon 	u_int8_t	page_scan_mode; /* Page scan mode */
1292*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_page_scan_cp;
1293*b06ebda0SMatthew Dillon 
1294*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_page_scan_rp;
1295*b06ebda0SMatthew Dillon 
1296*b06ebda0SMatthew Dillon /**************************************************************************
1297*b06ebda0SMatthew Dillon  **************************************************************************
1298*b06ebda0SMatthew Dillon  **           Informational commands and return parameters
1299*b06ebda0SMatthew Dillon  **     All commands in this category do not accept any parameters
1300*b06ebda0SMatthew Dillon  **************************************************************************
1301*b06ebda0SMatthew Dillon  **************************************************************************/
1302*b06ebda0SMatthew Dillon 
1303*b06ebda0SMatthew Dillon #define NG_HCI_OGF_INFO				0x04 /* OpCode Group Field */
1304*b06ebda0SMatthew Dillon 
1305*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_LOCAL_VER		0x0001
1306*b06ebda0SMatthew Dillon typedef struct {
1307*b06ebda0SMatthew Dillon 	u_int8_t	status;         /* 0x00 - success */
1308*b06ebda0SMatthew Dillon 	u_int8_t	hci_version;    /* HCI version */
1309*b06ebda0SMatthew Dillon 	u_int16_t	hci_revision;   /* HCI revision */
1310*b06ebda0SMatthew Dillon 	u_int8_t	lmp_version;    /* LMP version */
1311*b06ebda0SMatthew Dillon 	u_int16_t	manufacturer;   /* Hardware manufacturer name */
1312*b06ebda0SMatthew Dillon 	u_int16_t	lmp_subversion; /* LMP sub-version */
1313*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_local_ver_rp;
1314*b06ebda0SMatthew Dillon 
1315*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_LOCAL_FEATURES		0x0003
1316*b06ebda0SMatthew Dillon typedef struct {
1317*b06ebda0SMatthew Dillon 	u_int8_t	status;                         /* 0x00 - success */
1318*b06ebda0SMatthew Dillon 	u_int8_t	features[NG_HCI_FEATURES_SIZE]; /* LMP features bitmsk*/
1319*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_local_features_rp;
1320*b06ebda0SMatthew Dillon 
1321*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_BUFFER_SIZE		0x0005
1322*b06ebda0SMatthew Dillon typedef struct {
1323*b06ebda0SMatthew Dillon 	u_int8_t	status;       /* 0x00 - success */
1324*b06ebda0SMatthew Dillon 	u_int16_t	max_acl_size; /* Max. size of ACL packet (bytes) */
1325*b06ebda0SMatthew Dillon 	u_int8_t	max_sco_size; /* Max. size of SCO packet (bytes) */
1326*b06ebda0SMatthew Dillon 	u_int16_t	num_acl_pkt;  /* Max. number of ACL packets */
1327*b06ebda0SMatthew Dillon 	u_int16_t	num_sco_pkt;  /* Max. number of SCO packets */
1328*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_buffer_size_rp;
1329*b06ebda0SMatthew Dillon 
1330*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_COUNTRY_CODE		0x0007
1331*b06ebda0SMatthew Dillon typedef struct {
1332*b06ebda0SMatthew Dillon 	u_int8_t	status;       /* 0x00 - success */
1333*b06ebda0SMatthew Dillon 	u_int8_t	country_code; /* 0x00 - NAM, EUR, JP; 0x01 - France */
1334*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_country_code_rp;
1335*b06ebda0SMatthew Dillon 
1336*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_BDADDR			0x0009
1337*b06ebda0SMatthew Dillon typedef struct {
1338*b06ebda0SMatthew Dillon 	u_int8_t	status; /* 0x00 - success */
1339*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr; /* unit address */
1340*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_bdaddr_rp;
1341*b06ebda0SMatthew Dillon 
1342*b06ebda0SMatthew Dillon /**************************************************************************
1343*b06ebda0SMatthew Dillon  **************************************************************************
1344*b06ebda0SMatthew Dillon  **            Status commands and return parameters
1345*b06ebda0SMatthew Dillon  **************************************************************************
1346*b06ebda0SMatthew Dillon  **************************************************************************/
1347*b06ebda0SMatthew Dillon 
1348*b06ebda0SMatthew Dillon #define NG_HCI_OGF_STATUS			0x05 /* OpCode Group Field */
1349*b06ebda0SMatthew Dillon 
1350*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_FAILED_CONTACT_CNTR	0x0001
1351*b06ebda0SMatthew Dillon typedef struct {
1352*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1353*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_failed_contact_cntr_cp;
1354*b06ebda0SMatthew Dillon 
1355*b06ebda0SMatthew Dillon typedef struct {
1356*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
1357*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1358*b06ebda0SMatthew Dillon 	u_int16_t	counter;    /* number of consecutive failed contacts */
1359*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_failed_contact_cntr_rp;
1360*b06ebda0SMatthew Dillon 
1361*b06ebda0SMatthew Dillon #define NG_HCI_OCF_RESET_FAILED_CONTACT_CNTR	0x0002
1362*b06ebda0SMatthew Dillon typedef struct {
1363*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1364*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_reset_failed_contact_cntr_cp;
1365*b06ebda0SMatthew Dillon 
1366*b06ebda0SMatthew Dillon typedef struct {
1367*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
1368*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1369*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_reset_failed_contact_cntr_rp;
1370*b06ebda0SMatthew Dillon 
1371*b06ebda0SMatthew Dillon #define NG_HCI_OCF_GET_LINK_QUALITY		0x0003
1372*b06ebda0SMatthew Dillon typedef struct {
1373*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1374*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_get_link_quality_cp;
1375*b06ebda0SMatthew Dillon 
1376*b06ebda0SMatthew Dillon typedef struct {
1377*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
1378*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1379*b06ebda0SMatthew Dillon 	u_int8_t	quality;    /* higher value means better quality */
1380*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_get_link_quality_rp;
1381*b06ebda0SMatthew Dillon 
1382*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_RSSI			0x0005
1383*b06ebda0SMatthew Dillon typedef struct {
1384*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1385*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_rssi_cp;
1386*b06ebda0SMatthew Dillon 
1387*b06ebda0SMatthew Dillon typedef struct {
1388*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
1389*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1390*b06ebda0SMatthew Dillon 	char		rssi;       /* -127 <= rssi <= 127 dB */
1391*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_rssi_rp;
1392*b06ebda0SMatthew Dillon 
1393*b06ebda0SMatthew Dillon /**************************************************************************
1394*b06ebda0SMatthew Dillon  **************************************************************************
1395*b06ebda0SMatthew Dillon  **             Testing commands and return parameters
1396*b06ebda0SMatthew Dillon  **************************************************************************
1397*b06ebda0SMatthew Dillon  **************************************************************************/
1398*b06ebda0SMatthew Dillon 
1399*b06ebda0SMatthew Dillon #define NG_HCI_OGF_TESTING			0x06 /* OpCode Group Field */
1400*b06ebda0SMatthew Dillon 
1401*b06ebda0SMatthew Dillon #define NG_HCI_OCF_READ_LOOPBACK_MODE		0x0001
1402*b06ebda0SMatthew Dillon /* No command parameter(s) */
1403*b06ebda0SMatthew Dillon typedef struct {
1404*b06ebda0SMatthew Dillon 	u_int8_t	status; /* 0x00 - success */
1405*b06ebda0SMatthew Dillon 	u_int8_t	lbmode; /* loopback mode */
1406*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_loopback_mode_rp;
1407*b06ebda0SMatthew Dillon 
1408*b06ebda0SMatthew Dillon #define NG_HCI_OCF_WRITE_LOOPBACK_MODE		0x0002
1409*b06ebda0SMatthew Dillon typedef struct {
1410*b06ebda0SMatthew Dillon 	u_int8_t	lbmode; /* loopback mode */
1411*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_write_loopback_mode_cp;
1412*b06ebda0SMatthew Dillon 
1413*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_write_loopback_mode_rp;
1414*b06ebda0SMatthew Dillon 
1415*b06ebda0SMatthew Dillon #define NG_HCI_OCF_ENABLE_UNIT_UNDER_TEST	0x0003
1416*b06ebda0SMatthew Dillon /* No command parameter(s) */
1417*b06ebda0SMatthew Dillon typedef ng_hci_status_rp	ng_hci_enable_unit_under_test_rp;
1418*b06ebda0SMatthew Dillon 
1419*b06ebda0SMatthew Dillon /**************************************************************************
1420*b06ebda0SMatthew Dillon  **************************************************************************
1421*b06ebda0SMatthew Dillon  **                Special HCI OpCode group field values
1422*b06ebda0SMatthew Dillon  **************************************************************************
1423*b06ebda0SMatthew Dillon  **************************************************************************/
1424*b06ebda0SMatthew Dillon 
1425*b06ebda0SMatthew Dillon #define NG_HCI_OGF_BT_LOGO			0x3e
1426*b06ebda0SMatthew Dillon 
1427*b06ebda0SMatthew Dillon #define NG_HCI_OGF_VENDOR			0x3f
1428*b06ebda0SMatthew Dillon 
1429*b06ebda0SMatthew Dillon /**************************************************************************
1430*b06ebda0SMatthew Dillon  **************************************************************************
1431*b06ebda0SMatthew Dillon  **                         Events and event parameters
1432*b06ebda0SMatthew Dillon  **************************************************************************
1433*b06ebda0SMatthew Dillon  **************************************************************************/
1434*b06ebda0SMatthew Dillon 
1435*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_INQUIRY_COMPL		0x01
1436*b06ebda0SMatthew Dillon typedef struct {
1437*b06ebda0SMatthew Dillon 	u_int8_t	status; /* 0x00 - success */
1438*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_inquiry_compl_ep;
1439*b06ebda0SMatthew Dillon 
1440*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_INQUIRY_RESULT		0x02
1441*b06ebda0SMatthew Dillon typedef struct {
1442*b06ebda0SMatthew Dillon 	u_int8_t	num_responses;      /* number of responses */
1443*b06ebda0SMatthew Dillon /*	ng_hci_inquiry_response[num_responses]   -- see below */
1444*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_inquiry_result_ep;
1445*b06ebda0SMatthew Dillon 
1446*b06ebda0SMatthew Dillon typedef struct {
1447*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;                   /* unit address */
1448*b06ebda0SMatthew Dillon 	u_int8_t	page_scan_rep_mode;       /* page scan rep. mode */
1449*b06ebda0SMatthew Dillon 	u_int8_t	page_scan_period_mode;    /* page scan period mode */
1450*b06ebda0SMatthew Dillon 	u_int8_t	page_scan_mode;           /* page scan mode */
1451*b06ebda0SMatthew Dillon 	u_int8_t	uclass[NG_HCI_CLASS_SIZE];/* unit class */
1452*b06ebda0SMatthew Dillon 	u_int16_t	clock_offset;             /* clock offset */
1453*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_inquiry_response;
1454*b06ebda0SMatthew Dillon 
1455*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_CON_COMPL			0x03
1456*b06ebda0SMatthew Dillon typedef struct {
1457*b06ebda0SMatthew Dillon 	u_int8_t	status;          /* 0x00 - success */
1458*b06ebda0SMatthew Dillon 	u_int16_t	con_handle;      /* Connection handle */
1459*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;          /* remote unit address */
1460*b06ebda0SMatthew Dillon 	u_int8_t	link_type;       /* Link type */
1461*b06ebda0SMatthew Dillon 	u_int8_t	encryption_mode; /* Encryption mode */
1462*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_con_compl_ep;
1463*b06ebda0SMatthew Dillon 
1464*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_CON_REQ			0x04
1465*b06ebda0SMatthew Dillon typedef struct {
1466*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;                    /* remote unit address */
1467*b06ebda0SMatthew Dillon 	u_int8_t	uclass[NG_HCI_CLASS_SIZE]; /* remote unit class */
1468*b06ebda0SMatthew Dillon 	u_int8_t	link_type;                 /* link type */
1469*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_con_req_ep;
1470*b06ebda0SMatthew Dillon 
1471*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_DISCON_COMPL		0x05
1472*b06ebda0SMatthew Dillon typedef struct {
1473*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
1474*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1475*b06ebda0SMatthew Dillon 	u_int8_t	reason;     /* reason to disconnect */
1476*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_discon_compl_ep;
1477*b06ebda0SMatthew Dillon 
1478*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_AUTH_COMPL			0x06
1479*b06ebda0SMatthew Dillon typedef struct {
1480*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
1481*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1482*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_auth_compl_ep;
1483*b06ebda0SMatthew Dillon 
1484*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_REMOTE_NAME_REQ_COMPL	0x7
1485*b06ebda0SMatthew Dillon typedef struct {
1486*b06ebda0SMatthew Dillon 	u_int8_t	status; /* 0x00 - success */
1487*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr; /* remote unit address */
1488*b06ebda0SMatthew Dillon 	char		name[NG_HCI_UNIT_NAME_SIZE]; /* remote unit name */
1489*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_remote_name_req_compl_ep;
1490*b06ebda0SMatthew Dillon 
1491*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_ENCRYPTION_CHANGE		0x08
1492*b06ebda0SMatthew Dillon typedef struct {
1493*b06ebda0SMatthew Dillon 	u_int8_t	status;            /* 0x00 - success */
1494*b06ebda0SMatthew Dillon 	u_int16_t	con_handle;        /* Connection handle */
1495*b06ebda0SMatthew Dillon 	u_int8_t	encryption_enable; /* 0x00 - disable */
1496*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_encryption_change_ep;
1497*b06ebda0SMatthew Dillon 
1498*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_CHANGE_CON_LINK_KEY_COMPL	0x09
1499*b06ebda0SMatthew Dillon typedef struct {
1500*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
1501*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* Connection handle */
1502*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_change_con_link_key_compl_ep;
1503*b06ebda0SMatthew Dillon 
1504*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_MASTER_LINK_KEY_COMPL	0x0a
1505*b06ebda0SMatthew Dillon typedef struct {
1506*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
1507*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* Connection handle */
1508*b06ebda0SMatthew Dillon 	u_int8_t	key_flag;   /* Key flag */
1509*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_master_link_key_compl_ep;
1510*b06ebda0SMatthew Dillon 
1511*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_READ_REMOTE_FEATURES_COMPL	0x0b
1512*b06ebda0SMatthew Dillon typedef struct {
1513*b06ebda0SMatthew Dillon 	u_int8_t	status;                         /* 0x00 - success */
1514*b06ebda0SMatthew Dillon 	u_int16_t	con_handle;                     /* Connection handle */
1515*b06ebda0SMatthew Dillon 	u_int8_t	features[NG_HCI_FEATURES_SIZE]; /* LMP features bitmsk*/
1516*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_remote_features_compl_ep;
1517*b06ebda0SMatthew Dillon 
1518*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_READ_REMOTE_VER_INFO_COMPL	0x0c
1519*b06ebda0SMatthew Dillon typedef struct {
1520*b06ebda0SMatthew Dillon 	u_int8_t	status;         /* 0x00 - success */
1521*b06ebda0SMatthew Dillon 	u_int16_t	con_handle;     /* Connection handle */
1522*b06ebda0SMatthew Dillon 	u_int8_t	lmp_version;    /* LMP version */
1523*b06ebda0SMatthew Dillon 	u_int16_t	manufacturer;   /* Hardware manufacturer name */
1524*b06ebda0SMatthew Dillon 	u_int16_t	lmp_subversion; /* LMP sub-version */
1525*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_remote_ver_info_compl_ep;
1526*b06ebda0SMatthew Dillon 
1527*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_QOS_SETUP_COMPL		0x0d
1528*b06ebda0SMatthew Dillon typedef struct {
1529*b06ebda0SMatthew Dillon 	u_int8_t	status;          /* 0x00 - success */
1530*b06ebda0SMatthew Dillon 	u_int16_t	con_handle;      /* connection handle */
1531*b06ebda0SMatthew Dillon 	u_int8_t	flags;           /* reserved for future use */
1532*b06ebda0SMatthew Dillon 	u_int8_t	service_type;    /* service type */
1533*b06ebda0SMatthew Dillon 	u_int32_t	token_rate;      /* bytes per second */
1534*b06ebda0SMatthew Dillon 	u_int32_t	peak_bandwidth;  /* bytes per second */
1535*b06ebda0SMatthew Dillon 	u_int32_t	latency;         /* microseconds */
1536*b06ebda0SMatthew Dillon 	u_int32_t	delay_variation; /* microseconds */
1537*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_qos_setup_compl_ep;
1538*b06ebda0SMatthew Dillon 
1539*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_COMMAND_COMPL		0x0e
1540*b06ebda0SMatthew Dillon typedef struct {
1541*b06ebda0SMatthew Dillon 	u_int8_t	num_cmd_pkts; /* # of HCI command packets */
1542*b06ebda0SMatthew Dillon 	u_int16_t	opcode;       /* command OpCode */
1543*b06ebda0SMatthew Dillon 	/* command return parameters (if any) */
1544*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_command_compl_ep;
1545*b06ebda0SMatthew Dillon 
1546*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_COMMAND_STATUS		0x0f
1547*b06ebda0SMatthew Dillon typedef struct {
1548*b06ebda0SMatthew Dillon 	u_int8_t	status;       /* 0x00 - pending */
1549*b06ebda0SMatthew Dillon 	u_int8_t	num_cmd_pkts; /* # of HCI command packets */
1550*b06ebda0SMatthew Dillon 	u_int16_t	opcode;       /* command OpCode */
1551*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_command_status_ep;
1552*b06ebda0SMatthew Dillon 
1553*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_HARDWARE_ERROR		0x10
1554*b06ebda0SMatthew Dillon typedef struct {
1555*b06ebda0SMatthew Dillon 	u_int8_t	hardware_code; /* hardware error code */
1556*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_hardware_error_ep;
1557*b06ebda0SMatthew Dillon 
1558*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_FLUSH_OCCUR		0x11
1559*b06ebda0SMatthew Dillon typedef struct {
1560*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1561*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_flush_occur_ep;
1562*b06ebda0SMatthew Dillon 
1563*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_ROLE_CHANGE		0x12
1564*b06ebda0SMatthew Dillon typedef struct {
1565*b06ebda0SMatthew Dillon 	u_int8_t	status; /* 0x00 - success */
1566*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr; /* address of remote unit */
1567*b06ebda0SMatthew Dillon 	u_int8_t	role;   /* new connection role */
1568*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_role_change_ep;
1569*b06ebda0SMatthew Dillon 
1570*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_NUM_COMPL_PKTS		0x13
1571*b06ebda0SMatthew Dillon typedef struct {
1572*b06ebda0SMatthew Dillon 	u_int8_t	num_con_handles; /* # of connection handles */
1573*b06ebda0SMatthew Dillon /* these are repeated "num_con_handles" times
1574*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; --- connection handle(s)
1575*b06ebda0SMatthew Dillon 	u_int16_t	compl_pkt;  --- # of completed packets */
1576*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_num_compl_pkts_ep;
1577*b06ebda0SMatthew Dillon 
1578*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_MODE_CHANGE		0x14
1579*b06ebda0SMatthew Dillon typedef struct {
1580*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
1581*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1582*b06ebda0SMatthew Dillon 	u_int8_t	unit_mode;  /* remote unit mode */
1583*b06ebda0SMatthew Dillon 	u_int16_t	interval;   /* interval * 0.625 msec */
1584*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_mode_change_ep;
1585*b06ebda0SMatthew Dillon 
1586*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_RETURN_LINK_KEYS		0x15
1587*b06ebda0SMatthew Dillon typedef struct {
1588*b06ebda0SMatthew Dillon 	u_int8_t	num_keys; /* # of keys */
1589*b06ebda0SMatthew Dillon /* these are repeated "num_keys" times
1590*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;               --- remote address(es)
1591*b06ebda0SMatthew Dillon 	u_int8_t	key[NG_HCI_KEY_SIZE]; --- key(s) */
1592*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_return_link_keys_ep;
1593*b06ebda0SMatthew Dillon 
1594*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_PIN_CODE_REQ		0x16
1595*b06ebda0SMatthew Dillon typedef struct {
1596*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr; /* remote unit address */
1597*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_pin_code_req_ep;
1598*b06ebda0SMatthew Dillon 
1599*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_LINK_KEY_REQ		0x17
1600*b06ebda0SMatthew Dillon typedef struct {
1601*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr; /* remote unit address */
1602*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_link_key_req_ep;
1603*b06ebda0SMatthew Dillon 
1604*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_LINK_KEY_NOTIFICATION	0x18
1605*b06ebda0SMatthew Dillon typedef struct {
1606*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;               /* remote unit address */
1607*b06ebda0SMatthew Dillon 	u_int8_t	key[NG_HCI_KEY_SIZE]; /* link key */
1608*b06ebda0SMatthew Dillon 	u_int8_t	key_type;             /* type of the key */
1609*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_link_key_notification_ep;
1610*b06ebda0SMatthew Dillon 
1611*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_LOOPBACK_COMMAND		0x19
1612*b06ebda0SMatthew Dillon typedef struct {
1613*b06ebda0SMatthew Dillon 	u_int8_t	command[0]; /* Command packet */
1614*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_loopback_command_ep;
1615*b06ebda0SMatthew Dillon 
1616*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_DATA_BUFFER_OVERFLOW	0x1a
1617*b06ebda0SMatthew Dillon typedef struct {
1618*b06ebda0SMatthew Dillon 	u_int8_t	link_type; /* Link type */
1619*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_data_buffer_overflow_ep;
1620*b06ebda0SMatthew Dillon 
1621*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_MAX_SLOT_CHANGE		0x1b
1622*b06ebda0SMatthew Dillon typedef struct {
1623*b06ebda0SMatthew Dillon 	u_int16_t	con_handle;    /* connection handle */
1624*b06ebda0SMatthew Dillon 	u_int8_t	lmp_max_slots; /* Max. # of slots allowed */
1625*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_max_slot_change_ep;
1626*b06ebda0SMatthew Dillon 
1627*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_READ_CLOCK_OFFSET_COMPL	0x1c
1628*b06ebda0SMatthew Dillon typedef struct {
1629*b06ebda0SMatthew Dillon 	u_int8_t	status;       /* 0x00 - success */
1630*b06ebda0SMatthew Dillon 	u_int16_t	con_handle;   /* Connection handle */
1631*b06ebda0SMatthew Dillon 	u_int16_t	clock_offset; /* Clock offset */
1632*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_read_clock_offset_compl_ep;
1633*b06ebda0SMatthew Dillon 
1634*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_CON_PKT_TYPE_CHANGED	0x1d
1635*b06ebda0SMatthew Dillon typedef struct {
1636*b06ebda0SMatthew Dillon 	u_int8_t	status;     /* 0x00 - success */
1637*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1638*b06ebda0SMatthew Dillon 	u_int16_t	pkt_type;   /* packet type */
1639*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_con_pkt_type_changed_ep;
1640*b06ebda0SMatthew Dillon 
1641*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_QOS_VIOLATION		0x1e
1642*b06ebda0SMatthew Dillon typedef struct {
1643*b06ebda0SMatthew Dillon 	u_int16_t	con_handle; /* connection handle */
1644*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_qos_violation_ep;
1645*b06ebda0SMatthew Dillon 
1646*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_PAGE_SCAN_MODE_CHANGE	0x1f
1647*b06ebda0SMatthew Dillon typedef struct {
1648*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;         /* destination address */
1649*b06ebda0SMatthew Dillon 	u_int8_t	page_scan_mode; /* page scan mode */
1650*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_page_scan_mode_change_ep;
1651*b06ebda0SMatthew Dillon 
1652*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_PAGE_SCAN_REP_MODE_CHANGE	0x20
1653*b06ebda0SMatthew Dillon typedef struct {
1654*b06ebda0SMatthew Dillon 	bdaddr_t	bdaddr;             /* destination address */
1655*b06ebda0SMatthew Dillon 	u_int8_t	page_scan_rep_mode; /* page scan repetition mode */
1656*b06ebda0SMatthew Dillon } __attribute__ ((packed)) ng_hci_page_scan_rep_mode_change_ep;
1657*b06ebda0SMatthew Dillon 
1658*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_BT_LOGO			0xfe
1659*b06ebda0SMatthew Dillon 
1660*b06ebda0SMatthew Dillon #define NG_HCI_EVENT_VENDOR			0xff
1661*b06ebda0SMatthew Dillon 
1662*b06ebda0SMatthew Dillon #endif /* ndef _NETGRAPH_HCI_H_ */
1663