summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/bluetooth/common/ng_bluetooth.c
diff options
context:
space:
mode:
authoremax <emax@FreeBSD.org>2008-07-10 00:15:29 +0000
committeremax <emax@FreeBSD.org>2008-07-10 00:15:29 +0000
commitb07b40d7feb6ae8e188fa82622c29d6a0daeb94e (patch)
treec9a252ce0ab32de4ddfe23980c92a68052f6f4c0 /sys/netgraph/bluetooth/common/ng_bluetooth.c
parentf158d7c96d50027875a88283d7830455c9ebaa7e (diff)
downloadFreeBSD-src-b07b40d7feb6ae8e188fa82622c29d6a0daeb94e.zip
FreeBSD-src-b07b40d7feb6ae8e188fa82622c29d6a0daeb94e.tar.gz
Get in some basic infrastructure for Bluetooth SCO support.
MFC after: 3 months
Diffstat (limited to 'sys/netgraph/bluetooth/common/ng_bluetooth.c')
-rw-r--r--sys/netgraph/bluetooth/common/ng_bluetooth.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/sys/netgraph/bluetooth/common/ng_bluetooth.c b/sys/netgraph/bluetooth/common/ng_bluetooth.c
index 6f6a46e..1cf17d7 100644
--- a/sys/netgraph/bluetooth/common/ng_bluetooth.c
+++ b/sys/netgraph/bluetooth/common/ng_bluetooth.c
@@ -49,6 +49,7 @@ static u_int32_t bluetooth_hci_connect_timeout_value = 60; /* sec */
static u_int32_t bluetooth_hci_max_neighbor_age_value = 600; /* sec */
static u_int32_t bluetooth_l2cap_rtx_timeout_value = 60; /* sec */
static u_int32_t bluetooth_l2cap_ertx_timeout_value = 300; /* sec */
+static u_int32_t bluetooth_sco_rtx_timeout_value = 60; /* sec */
/*
* Define sysctl tree that shared by other parts of Bluetooth stack
@@ -207,6 +208,12 @@ bluetooth_l2cap_ertx_timeout(void)
return (bluetooth_l2cap_ertx_timeout_value * hz);
} /* bluetooth_l2cap_ertx_timeout */
+u_int32_t
+bluetooth_sco_rtx_timeout(void)
+{
+ return (bluetooth_sco_rtx_timeout_value * hz);
+} /* bluetooth_sco_rtx_timeout */
+
/*
* RFCOMM
*/
@@ -214,6 +221,37 @@ bluetooth_l2cap_ertx_timeout(void)
SYSCTL_NODE(_net_bluetooth, OID_AUTO, rfcomm, CTLFLAG_RW,
0, "Bluetooth RFCOMM family");
+/*
+ * SCO
+ */
+
+SYSCTL_NODE(_net_bluetooth, OID_AUTO, sco, CTLFLAG_RW,
+ 0, "Bluetooth SCO family");
+
+static int
+bluetooth_set_sco_rtx_timeout_value(SYSCTL_HANDLER_ARGS)
+{
+ u_int32_t value;
+ int error;
+
+ value = bluetooth_sco_rtx_timeout_value;
+ error = sysctl_handle_int(oidp, &value, 0, req);
+ if (error == 0 && req->newptr != NULL) {
+ if (bluetooth_hci_connect_timeout_value <= value)
+ bluetooth_sco_rtx_timeout_value = value;
+ else
+ error = EINVAL;
+ }
+
+ return (error);
+} /* bluetooth_set_sco_rtx_timeout_value */
+
+SYSCTL_PROC(_net_bluetooth_sco, OID_AUTO, rtx_timeout,
+ CTLTYPE_INT | CTLFLAG_RW,
+ &bluetooth_sco_rtx_timeout_value, 60,
+ bluetooth_set_sco_rtx_timeout_value,
+ "I", "SCO RTX timeout (sec)");
+
/*
* Handle loading and unloading for this code.
*/
OpenPOWER on IntegriCloud