]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/man/man4/ng_h4.4
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / man / man4 / ng_h4.4
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 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
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_h4.4,v 1.2 2003/05/21 19:37:35 max Exp $
26 .\" $FreeBSD$
27 .\"
28 .Dd June 14, 2002
29 .Dt NG_H4 4
30 .Os
31 .Sh NAME
32 .Nm ng_h4
33 .Nd Netgraph node type that is also an H4 line discipline
34 .Sh SYNOPSIS
35 .In sys/types.h
36 .In netgraph/bluetooth/include/ng_h4.h
37 .Sh DESCRIPTION
38 The
39 .Nm h4
40 node type is both a persistent Netgraph node type and a H4 line
41 discipline.
42 It implements a Bluetooth HCI UART transport layer as
43 per chapter H4 of the Bluetooth Specification Book v1.1.
44 A new node is created when the corresponding line discipline,
45 .Dv H4DISC ,
46 is registered on a tty device (see
47 .Xr tty 4 ) .
48 .Pp
49 The node has a single hook called
50 .Dv hook .
51 Incoming bytes received on the tty device are re-assembled into
52 HCI frames (according to the length).
53 Full HCI frames are sent out on the hook.
54 HCI frames received on
55 .Dv hook
56 are transmitted out on the tty device.
57 No modification to the data is performed in either direction.
58 While the line discipline is installed on a tty, the normal
59 read and write operations are unavailable, returning
60 .Er EIO .
61 .Pp
62 Information about the node is available via the netgraph
63 .Xr ioctl 2
64 command
65 .Dv NGIOCGINFO .
66 This command returns a
67 .Vt "struct nodeinfo"
68 similar to the
69 .Dv NGM_NODEINFO
70 .Xr netgraph 4
71 control message.
72 .Sh HOOKS
73 This node type supports the following hooks:
74 .Bl -tag -width ".Va hook"
75 .It Va hook
76 single HCI frame contained in single
77 .Vt mbuf
78 structure.
79 .El
80 .Sh CONTROL MESSAGES
81 This node type supports the generic control messages, plus the following:
82 .Bl -tag -width foo
83 .It Dv NGM_H4_NODE_RESET
84 Reset the node.
85 .It Dv NGM_H4_NODE_GET_STATE
86 Returns current receiving state for the node.
87 .It Dv NGM_H4_NODE_GET_DEBUG
88 Returns an integer containing the current debug level for the node.
89 .It Dv NGM_H4_NODE_SET_DEBUG
90 This command takes an integer argument and sets current debug level
91 for the node.
92 .It Dv NGM_H4_NODE_GET_QLEN
93 Returns current length of outgoing queue for the node.
94 .It Dv NGM_H4_NODE_SET_QLEN
95 This command takes an integer argument and sets maximum length of
96 outgoing queue for the node.
97 .It Dv NGM_H4_NODE_GET_STAT
98 Returns various statistic information for the node, such as: number of
99 bytes (frames) sent, number of bytes (frames) received and number of
100 input (output) errors.
101 .It Dv NGM_H4_NODE_RESET_STAT
102 Reset all statistic counters to zero.
103 .El
104 .Sh SHUTDOWN
105 This node shuts down when the corresponding device is closed
106 (or the line discipline is uninstalled on the device).
107 .Sh SEE ALSO
108 .Xr ioctl 2 ,
109 .Xr netgraph 4 ,
110 .Xr tty 4 ,
111 .Xr ngctl 8
112 .Sh HISTORY
113 The
114 .Nm h4
115 node type was implemented in
116 .Fx 5.0 .
117 .Sh AUTHORS
118 .An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
119 .Sh BUGS
120 This node still uses
121 .Xr spltty 9
122 to lock tty layer.
123 This is wrong.