1 /* $NetBSD: bt_sysctl.c,v 1.1 2006/06/19 15:44:45 gdamore Exp $ */
4 * Copyright (c) 2005 Iain Hibbert.
5 * Copyright (c) 2006 Itronix Inc.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. The name of Itronix Inc. may not be used to endorse
17 * or promote products derived from this software without specific
18 * prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY ITRONIX INC. ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ITRONIX INC. BE LIABLE FOR ANY
24 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 * ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
33 #include <sys/cdefs.h>
34 __KERNEL_RCSID(0, "$NetBSD: bt_sysctl.c,v 1.1 2006/06/19 15:44:45 gdamore Exp $");
36 #include <sys/param.h>
37 #include <sys/kernel.h>
40 #include <sys/sysctl.h>
41 #include <sys/systm.h>
43 #include <netbt/bluetooth.h>
44 #include <netbt/hci.h>
45 #include <netbt/l2cap.h>
46 #include <netbt/rfcomm.h>
47 #include <netbt/sco.h>
49 SYSCTL_SETUP(sysctl_net_bluetooth_setup
, "sysctl net.bluetooth subtree setup")
52 sysctl_createv(clog
, 0, NULL
, NULL
,
54 CTLTYPE_NODE
, "net", NULL
,
59 sysctl_createv(clog
, 0, NULL
, NULL
,
61 CTLTYPE_NODE
, "bluetooth",
62 SYSCTL_DESCR("Bluetooth Protocol Family"),
65 CTL_NET
, PF_BLUETOOTH
, CTL_EOL
);
67 #ifdef BLUETOOTH_DEBUG
68 sysctl_createv(clog
, 0, NULL
, NULL
,
69 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
71 SYSCTL_DESCR("debug level"),
73 &bluetooth_debug
, sizeof(bluetooth_debug
),
74 CTL_NET
, PF_BLUETOOTH
,
78 sysctl_createv(clog
, 0, NULL
, NULL
,
81 SYSCTL_DESCR("Host Controller Interface"),
84 CTL_NET
, PF_BLUETOOTH
, BTPROTO_HCI
, CTL_EOL
);
86 sysctl_createv(clog
, 0, NULL
, NULL
,
87 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
88 CTLTYPE_INT
, "sendspace",
89 SYSCTL_DESCR("Socket Send Buffer Size"),
91 &hci_sendspace
, sizeof(hci_sendspace
),
92 CTL_NET
, PF_BLUETOOTH
, BTPROTO_HCI
,
95 sysctl_createv(clog
, 0, NULL
, NULL
,
96 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
97 CTLTYPE_INT
, "recvspace",
98 SYSCTL_DESCR("Socket Receive Buffer Size"),
100 &hci_recvspace
, sizeof(hci_recvspace
),
101 CTL_NET
, PF_BLUETOOTH
, BTPROTO_HCI
,
102 CTL_CREATE
, CTL_EOL
);
104 sysctl_createv(clog
, 0, NULL
, NULL
,
105 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
106 CTLTYPE_INT
, "acl_expiry",
107 SYSCTL_DESCR("ACL Connection Expiry Time"),
109 &hci_acl_expiry
, sizeof(hci_acl_expiry
),
110 CTL_NET
, PF_BLUETOOTH
, BTPROTO_HCI
,
111 CTL_CREATE
, CTL_EOL
);
113 sysctl_createv(clog
, 0, NULL
, NULL
,
114 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
115 CTLTYPE_INT
, "memo_expiry",
116 SYSCTL_DESCR("Memo Expiry Time"),
118 &hci_memo_expiry
, sizeof(hci_memo_expiry
),
119 CTL_NET
, PF_BLUETOOTH
, BTPROTO_HCI
,
120 CTL_CREATE
, CTL_EOL
);
122 sysctl_createv(clog
, 0, NULL
, NULL
,
123 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
124 CTLTYPE_INT
, "eventq_max",
125 SYSCTL_DESCR("Max Event queue length"),
127 &hci_eventq_max
, sizeof(hci_eventq_max
),
128 CTL_NET
, PF_BLUETOOTH
, BTPROTO_HCI
,
129 CTL_CREATE
, CTL_EOL
);
131 sysctl_createv(clog
, 0, NULL
, NULL
,
132 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
133 CTLTYPE_INT
, "aclrxq_max",
134 SYSCTL_DESCR("Max ACL rx queue length"),
136 &hci_aclrxq_max
, sizeof(hci_aclrxq_max
),
137 CTL_NET
, PF_BLUETOOTH
, BTPROTO_HCI
,
138 CTL_CREATE
, CTL_EOL
);
140 sysctl_createv(clog
, 0, NULL
, NULL
,
141 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
142 CTLTYPE_INT
, "scorxq_max",
143 SYSCTL_DESCR("Max SCO rx queue length"),
145 &hci_scorxq_max
, sizeof(hci_scorxq_max
),
146 CTL_NET
, PF_BLUETOOTH
, BTPROTO_HCI
,
147 CTL_CREATE
, CTL_EOL
);
149 sysctl_createv(clog
, 0, NULL
, NULL
,
151 CTLTYPE_NODE
, "l2cap",
152 SYSCTL_DESCR("Logical Link Control & Adapataion Protocol"),
154 CTL_NET
, PF_BLUETOOTH
, BTPROTO_L2CAP
, CTL_EOL
);
156 sysctl_createv(clog
, 0, NULL
, NULL
,
157 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
158 CTLTYPE_INT
, "sendspace",
159 SYSCTL_DESCR("Socket Send Buffer Size"),
161 &l2cap_sendspace
, sizeof(l2cap_sendspace
),
162 CTL_NET
, PF_BLUETOOTH
, BTPROTO_L2CAP
,
163 CTL_CREATE
, CTL_EOL
);
165 sysctl_createv(clog
, 0, NULL
, NULL
,
166 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
167 CTLTYPE_INT
, "recvspace",
168 SYSCTL_DESCR("Socket Receive Buffer Size"),
170 &l2cap_recvspace
, sizeof(l2cap_recvspace
),
171 CTL_NET
, PF_BLUETOOTH
, BTPROTO_L2CAP
,
172 CTL_CREATE
, CTL_EOL
);
174 sysctl_createv(clog
, 0, NULL
, NULL
,
175 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
177 SYSCTL_DESCR("Response Timeout"),
179 &l2cap_response_timeout
, sizeof(l2cap_response_timeout
),
180 CTL_NET
, PF_BLUETOOTH
, BTPROTO_L2CAP
,
181 CTL_CREATE
, CTL_EOL
);
183 sysctl_createv(clog
, 0, NULL
, NULL
,
184 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
186 SYSCTL_DESCR("Extended Response Timeout"),
188 &l2cap_response_extended_timeout
,
189 sizeof(l2cap_response_extended_timeout
),
190 CTL_NET
, PF_BLUETOOTH
, BTPROTO_L2CAP
,
191 CTL_CREATE
, CTL_EOL
);
193 sysctl_createv(clog
, 0, NULL
, NULL
,
195 CTLTYPE_NODE
, "rfcomm",
196 SYSCTL_DESCR("Serial Cable Emulation"),
198 CTL_NET
, PF_BLUETOOTH
, BTPROTO_RFCOMM
, CTL_EOL
);
200 sysctl_createv(clog
, 0, NULL
, NULL
,
201 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
202 CTLTYPE_INT
, "sendspace",
203 SYSCTL_DESCR("Socket Send Buffer Size"),
205 &rfcomm_sendspace
, sizeof(rfcomm_sendspace
),
206 CTL_NET
, PF_BLUETOOTH
, BTPROTO_RFCOMM
,
207 CTL_CREATE
, CTL_EOL
);
209 sysctl_createv(clog
, 0, NULL
, NULL
,
210 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
211 CTLTYPE_INT
, "recvspace",
212 SYSCTL_DESCR("Socket Receive Buffer Size"),
214 &rfcomm_recvspace
, sizeof(rfcomm_recvspace
),
215 CTL_NET
, PF_BLUETOOTH
, BTPROTO_RFCOMM
,
216 CTL_CREATE
, CTL_EOL
);
218 sysctl_createv(clog
, 0, NULL
, NULL
,
219 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
220 CTLTYPE_INT
, "mtu_default",
221 SYSCTL_DESCR("Default MTU"),
223 &rfcomm_mtu_default
, sizeof(rfcomm_mtu_default
),
224 CTL_NET
, PF_BLUETOOTH
, BTPROTO_RFCOMM
,
225 CTL_CREATE
, CTL_EOL
);
227 sysctl_createv(clog
, 0, NULL
, NULL
,
228 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
229 CTLTYPE_INT
, "ack_timeout",
230 SYSCTL_DESCR("Acknowledgement Timer"),
232 &rfcomm_ack_timeout
, sizeof(rfcomm_ack_timeout
),
233 CTL_NET
, PF_BLUETOOTH
, BTPROTO_RFCOMM
,
234 CTL_CREATE
, CTL_EOL
);
236 sysctl_createv(clog
, 0, NULL
, NULL
,
237 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
238 CTLTYPE_INT
, "mcc_timeout",
239 SYSCTL_DESCR("Response Timeout for Multiplexer Control Channel"),
241 &rfcomm_mcc_timeout
, sizeof(rfcomm_mcc_timeout
),
242 CTL_NET
, PF_BLUETOOTH
, BTPROTO_RFCOMM
,
243 CTL_CREATE
, CTL_EOL
);
245 sysctl_createv(clog
, 0, NULL
, NULL
,
248 SYSCTL_DESCR("SCO data"),
250 CTL_NET
, PF_BLUETOOTH
, BTPROTO_SCO
, CTL_EOL
);
252 sysctl_createv(clog
, 0, NULL
, NULL
,
253 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
254 CTLTYPE_INT
, "sendspace",
255 SYSCTL_DESCR("Socket Send Buffer Size"),
257 &sco_sendspace
, sizeof(sco_sendspace
),
258 CTL_NET
, PF_BLUETOOTH
, BTPROTO_SCO
,
259 CTL_CREATE
, CTL_EOL
);
261 sysctl_createv(clog
, 0, NULL
, NULL
,
262 CTLFLAG_PERMANENT
| CTLFLAG_READWRITE
,
263 CTLTYPE_INT
, "recvspace",
264 SYSCTL_DESCR("Socket Receive Buffer Size"),
266 &sco_recvspace
, sizeof(sco_recvspace
),
267 CTL_NET
, PF_BLUETOOTH
, BTPROTO_SCO
,
268 CTL_CREATE
, CTL_EOL
);