Deleted Added
full compact
ng_hci.4 (212463) ng_hci.4 (231564)
1.\" Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 9 unchanged lines hidden (view full) ---

18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $Id: ng_hci.4,v 1.3 2003/05/21 19:37:35 max Exp $
1.\" Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 9 unchanged lines hidden (view full) ---

18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $Id: ng_hci.4,v 1.3 2003/05/21 19:37:35 max Exp $
26.\" $FreeBSD: head/share/man/man4/ng_hci.4 212463 2010-09-11 10:49:56Z brucec $
26.\" $FreeBSD: head/share/man/man4/ng_hci.4 231564 2012-02-12 18:29:56Z ed $
27.\"
28.Dd June 25, 2002
29.Dt NG_HCI 4
30.Os
31.Sh NAME
32.Nm ng_hci
33.Nd Netgraph node type that is also a Bluetooth Host Controller Interface
34(HCI) layer

--- 93 unchanged lines hidden (view full) ---

128When the Host discovers that an
129event has occurred it will then parse the received event packet to determine
130which event occurred.
131The next sections specify the HCI packet formats.
132.Ss HCI Command Packet
133.Bd -literal -offset indent
134#define NG_HCI_CMD_PKT 0x01
135typedef struct {
27.\"
28.Dd June 25, 2002
29.Dt NG_HCI 4
30.Os
31.Sh NAME
32.Nm ng_hci
33.Nd Netgraph node type that is also a Bluetooth Host Controller Interface
34(HCI) layer

--- 93 unchanged lines hidden (view full) ---

128When the Host discovers that an
129event has occurred it will then parse the received event packet to determine
130which event occurred.
131The next sections specify the HCI packet formats.
132.Ss HCI Command Packet
133.Bd -literal -offset indent
134#define NG_HCI_CMD_PKT 0x01
135typedef struct {
136 u_int8_t type; /* MUST be 0x1 */
137 u_int16_t opcode; /* OpCode */
138 u_int8_t length; /* parameter(s) length in bytes */
136 uint8_t type; /* MUST be 0x1 */
137 uint16_t opcode; /* OpCode */
138 uint8_t length; /* parameter(s) length in bytes */
139} __attribute__ ((packed)) ng_hci_cmd_pkt_t;
140.Ed
141.Pp
142The HCI command packet is used to send commands to the Host Controller
143from the Host.
144When the Host Controller completes most of the commands,
145a Command Complete event is sent to the Host.
146Some commands do not receive

--- 4 unchanged lines hidden (view full) ---

151command.
152Later on, when the actions associated with the command have finished,
153an event that is associated with the sent command will be sent by the Host
154Controller to the Host.
155.Ss HCI Event Packet
156.Bd -literal -offset indent
157#define NG_HCI_EVENT_PKT 0x04
158typedef struct {
139} __attribute__ ((packed)) ng_hci_cmd_pkt_t;
140.Ed
141.Pp
142The HCI command packet is used to send commands to the Host Controller
143from the Host.
144When the Host Controller completes most of the commands,
145a Command Complete event is sent to the Host.
146Some commands do not receive

--- 4 unchanged lines hidden (view full) ---

151command.
152Later on, when the actions associated with the command have finished,
153an event that is associated with the sent command will be sent by the Host
154Controller to the Host.
155.Ss HCI Event Packet
156.Bd -literal -offset indent
157#define NG_HCI_EVENT_PKT 0x04
158typedef struct {
159 u_int8_t type; /* MUST be 0x4 */
160 u_int8_t event; /* event */
161 u_int8_t length; /* parameter(s) length in bytes */
159 uint8_t type; /* MUST be 0x4 */
160 uint8_t event; /* event */
161 uint8_t length; /* parameter(s) length in bytes */
162} __attribute__ ((packed)) ng_hci_event_pkt_t;
163.Ed
164.Pp
165The HCI event packet is used by the Host Controller to notify the Host
166when events occur.
167.Ss HCI ACL Data Packet
168.Bd -literal -offset indent
169#define NG_HCI_ACL_DATA_PKT 0x02
170typedef struct {
162} __attribute__ ((packed)) ng_hci_event_pkt_t;
163.Ed
164.Pp
165The HCI event packet is used by the Host Controller to notify the Host
166when events occur.
167.Ss HCI ACL Data Packet
168.Bd -literal -offset indent
169#define NG_HCI_ACL_DATA_PKT 0x02
170typedef struct {
171 u_int8_t type; /* MUST be 0x2 */
172 u_int16_t con_handle; /* connection handle + PB + BC flags */
173 u_int16_t length; /* payload length in bytes */
171 uint8_t type; /* MUST be 0x2 */
172 uint16_t con_handle; /* connection handle + PB + BC flags */
173 uint16_t length; /* payload length in bytes */
174} __attribute__ ((packed)) ng_hci_acldata_pkt_t;
175.Ed
176.Pp
177HCI ACL data packets are used to exchange ACL data between the Host and
178Host Controller.
179.Ss HCI SCO Data Packet
180.Bd -literal -offset indent
181#define NG_HCI_SCO_DATA_PKT 0x03
182typedef struct {
174} __attribute__ ((packed)) ng_hci_acldata_pkt_t;
175.Ed
176.Pp
177HCI ACL data packets are used to exchange ACL data between the Host and
178Host Controller.
179.Ss HCI SCO Data Packet
180.Bd -literal -offset indent
181#define NG_HCI_SCO_DATA_PKT 0x03
182typedef struct {
183 u_int8_t type; /* MUST be 0x3 */
184 u_int16_t con_handle; /* connection handle + reserved bits */
185 u_int8_t length; /* payload length in bytes */
183 uint8_t type; /* MUST be 0x3 */
184 uint16_t con_handle; /* connection handle + reserved bits */
185 uint8_t length; /* payload length in bytes */
186} __attribute__ ((packed)) ng_hci_scodata_pkt_t;
187.Ed
188.Pp
189HCI SCO data packets are used to exchange SCO data between the Host and
190Host Controller.
191.Sh HCI INITIALIZATION
192On initialization, HCI control application must issue the following HCI
193commands (in any order).

--- 17 unchanged lines hidden (view full) ---

211bit for the node.
212Once HCI node has been initialized all upstream hooks
213will receive a
214.Dv NGM_HCI_NODE_UP
215Netgraph message defined as follows.
216.Bd -literal -offset indent
217#define NGM_HCI_NODE_UP 112 /* HCI -> Upper */
218typedef struct {
186} __attribute__ ((packed)) ng_hci_scodata_pkt_t;
187.Ed
188.Pp
189HCI SCO data packets are used to exchange SCO data between the Host and
190Host Controller.
191.Sh HCI INITIALIZATION
192On initialization, HCI control application must issue the following HCI
193commands (in any order).

--- 17 unchanged lines hidden (view full) ---

211bit for the node.
212Once HCI node has been initialized all upstream hooks
213will receive a
214.Dv NGM_HCI_NODE_UP
215Netgraph message defined as follows.
216.Bd -literal -offset indent
217#define NGM_HCI_NODE_UP 112 /* HCI -> Upper */
218typedef struct {
219 u_int16_t pkt_size; /* max. ACL/SCO packet size (w/o hdr) */
220 u_int16_t num_pkts; /* ACL/SCO packet queue size */
221 u_int16_t reserved; /* place holder */
219 uint16_t pkt_size; /* max. ACL/SCO packet size (w/o hdr) */
220 uint16_t num_pkts; /* ACL/SCO packet queue size */
221 uint16_t reserved; /* place holder */
222 bdaddr_t bdaddr; /* bdaddr */
223} ng_hci_node_up_ep;
224.Ed
225.Sh HCI FLOW CONTROL
226HCI layer performs flow control on baseband connection basis (i.e., ACL and
227SCO link).
228Each baseband connection has
229.Dq "connection handle"

--- 9 unchanged lines hidden (view full) ---

239Netgraph messages to inform upper layers about current queue state for each
240connection handle.
241The
242.Dv NGM_HCI_SYNC_CON_QUEUE
243Netgraph message is defined as follows.
244.Bd -literal -offset indent
245#define NGM_HCI_SYNC_CON_QUEUE 113 /* HCI -> Upper */
246typedef struct {
222 bdaddr_t bdaddr; /* bdaddr */
223} ng_hci_node_up_ep;
224.Ed
225.Sh HCI FLOW CONTROL
226HCI layer performs flow control on baseband connection basis (i.e., ACL and
227SCO link).
228Each baseband connection has
229.Dq "connection handle"

--- 9 unchanged lines hidden (view full) ---

239Netgraph messages to inform upper layers about current queue state for each
240connection handle.
241The
242.Dv NGM_HCI_SYNC_CON_QUEUE
243Netgraph message is defined as follows.
244.Bd -literal -offset indent
245#define NGM_HCI_SYNC_CON_QUEUE 113 /* HCI -> Upper */
246typedef struct {
247 u_int16_t con_handle; /* connection handle */
248 u_int16_t completed; /* number of completed packets */
247 uint16_t con_handle; /* connection handle */
248 uint16_t completed; /* number of completed packets */
249} ng_hci_sync_con_queue_ep;
250.Ed
251.Sh HOOKS
252This node type supports the following hooks:
253.Bl -tag -width indent
254.It Dv drv
255Bluetooth Host Controller Transport Layer hook.
256Single HCI packet contained in single

--- 131 unchanged lines hidden ---
249} ng_hci_sync_con_queue_ep;
250.Ed
251.Sh HOOKS
252This node type supports the following hooks:
253.Bl -tag -width indent
254.It Dv drv
255Bluetooth Host Controller Transport Layer hook.
256Single HCI packet contained in single

--- 131 unchanged lines hidden ---