FreeBSD kernel netgraph code
ng_bluetooth.c File Reference
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/errno.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/sysctl.h>
#include <netgraph/bluetooth/include/ng_bluetooth.h>
Include dependency graph for ng_bluetooth.c:

Go to the source code of this file.

Functions

 SYSCTL_NODE (_net, OID_AUTO, bluetooth, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "Bluetooth family")
 
 SYSCTL_INT (_net_bluetooth, OID_AUTO, version, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, NG_BLUETOOTH_VERSION, "Version of the stack")
 
 SYSCTL_NODE (_net_bluetooth, OID_AUTO, hci, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "Bluetooth HCI family")
 
static int bluetooth_set_hci_command_timeout_value (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_net_bluetooth_hci, OID_AUTO, command_timeout, CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_NEEDGIANT, &bluetooth_hci_command_timeout_value, 5, bluetooth_set_hci_command_timeout_value, "I", "HCI command timeout (sec)")
 
static int bluetooth_set_hci_connect_timeout_value (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_net_bluetooth_hci, OID_AUTO, connection_timeout, CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_NEEDGIANT, &bluetooth_hci_connect_timeout_value, 60, bluetooth_set_hci_connect_timeout_value, "I", "HCI connect timeout (sec)")
 
 SYSCTL_UINT (_net_bluetooth_hci, OID_AUTO, max_neighbor_age, CTLFLAG_RW, &bluetooth_hci_max_neighbor_age_value, 600, "Maximal HCI neighbor cache entry age (sec)")
 
 SYSCTL_NODE (_net_bluetooth, OID_AUTO, l2cap, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "Bluetooth L2CAP family")
 
static int bluetooth_set_l2cap_rtx_timeout_value (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_net_bluetooth_l2cap, OID_AUTO, rtx_timeout, CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_NEEDGIANT, &bluetooth_l2cap_rtx_timeout_value, 60, bluetooth_set_l2cap_rtx_timeout_value, "I", "L2CAP RTX timeout (sec)")
 
static int bluetooth_set_l2cap_ertx_timeout_value (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_net_bluetooth_l2cap, OID_AUTO, ertx_timeout, CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_NEEDGIANT, &bluetooth_l2cap_ertx_timeout_value, 300, bluetooth_set_l2cap_ertx_timeout_value, "I", "L2CAP ERTX timeout (sec)")
 
u_int32_t bluetooth_hci_command_timeout (void)
 
u_int32_t bluetooth_hci_connect_timeout (void)
 
u_int32_t bluetooth_hci_max_neighbor_age (void)
 
u_int32_t bluetooth_l2cap_rtx_timeout (void)
 
u_int32_t bluetooth_l2cap_ertx_timeout (void)
 
u_int32_t bluetooth_sco_rtx_timeout (void)
 
 SYSCTL_NODE (_net_bluetooth, OID_AUTO, rfcomm, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "Bluetooth RFCOMM family")
 
 SYSCTL_NODE (_net_bluetooth, OID_AUTO, sco, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "Bluetooth SCO family")
 
static int bluetooth_set_sco_rtx_timeout_value (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_net_bluetooth_sco, OID_AUTO, rtx_timeout, CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_NEEDGIANT, &bluetooth_sco_rtx_timeout_value, 60, bluetooth_set_sco_rtx_timeout_value, "I", "SCO RTX timeout (sec)")
 
static int bluetooth_modevent (module_t mod, int event, void *data)
 
 DECLARE_MODULE (ng_bluetooth, bluetooth_mod, SI_SUB_PSEUDO, SI_ORDER_ANY)
 
 MODULE_VERSION (ng_bluetooth, NG_BLUETOOTH_VERSION)
 

Variables

static u_int32_t bluetooth_hci_command_timeout_value = 5
 
static u_int32_t bluetooth_hci_connect_timeout_value = 60
 
static u_int32_t bluetooth_hci_max_neighbor_age_value = 600
 
static u_int32_t bluetooth_l2cap_rtx_timeout_value = 60
 
static u_int32_t bluetooth_l2cap_ertx_timeout_value = 300
 
static u_int32_t bluetooth_sco_rtx_timeout_value = 60
 
static moduledata_t bluetooth_mod
 

Function Documentation

◆ bluetooth_hci_command_timeout()

u_int32_t bluetooth_hci_command_timeout ( void  )

Definition at line 185 of file ng_bluetooth.c.

References bluetooth_hci_command_timeout_value.

Referenced by ng_hci_command_timeout().

Here is the caller graph for this function:

◆ bluetooth_hci_connect_timeout()

u_int32_t bluetooth_hci_connect_timeout ( void  )

Definition at line 191 of file ng_bluetooth.c.

References bluetooth_hci_connect_timeout_value.

Referenced by ng_hci_con_timeout(), and ng_l2cap_lp_timeout().

Here is the caller graph for this function:

◆ bluetooth_hci_max_neighbor_age()

u_int32_t bluetooth_hci_max_neighbor_age ( void  )

Definition at line 197 of file ng_bluetooth.c.

References bluetooth_hci_max_neighbor_age_value.

Referenced by ng_hci_neighbor_stale().

Here is the caller graph for this function:

◆ bluetooth_l2cap_ertx_timeout()

u_int32_t bluetooth_l2cap_ertx_timeout ( void  )

Definition at line 209 of file ng_bluetooth.c.

References bluetooth_l2cap_ertx_timeout_value.

Referenced by ng_btsocket_l2cap_timeout(), and ng_l2cap_process_con_rsp().

Here is the caller graph for this function:

◆ bluetooth_l2cap_rtx_timeout()

u_int32_t bluetooth_l2cap_rtx_timeout ( void  )

Definition at line 203 of file ng_bluetooth.c.

References bluetooth_l2cap_rtx_timeout_value.

Referenced by ng_btsocket_l2cap_raw_control(), ng_l2cap_con_wakeup(), and ng_l2cap_process_cfg_rsp().

Here is the caller graph for this function:

◆ bluetooth_modevent()

static int bluetooth_modevent ( module_t  mod,
int  event,
void *  data 
)
static

Definition at line 263 of file ng_bluetooth.c.

References event.

◆ bluetooth_sco_rtx_timeout()

u_int32_t bluetooth_sco_rtx_timeout ( void  )

Definition at line 215 of file ng_bluetooth.c.

References bluetooth_sco_rtx_timeout_value.

Referenced by ng_btsocket_sco_timeout().

Here is the caller graph for this function:

◆ bluetooth_set_hci_command_timeout_value()

static int bluetooth_set_hci_command_timeout_value ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 73 of file ng_bluetooth.c.

References bluetooth_hci_command_timeout_value.

◆ bluetooth_set_hci_connect_timeout_value()

static int bluetooth_set_hci_connect_timeout_value ( SYSCTL_HANDLER_ARGS  )
static

◆ bluetooth_set_l2cap_ertx_timeout_value()

static int bluetooth_set_l2cap_ertx_timeout_value ( SYSCTL_HANDLER_ARGS  )
static

◆ bluetooth_set_l2cap_rtx_timeout_value()

static int bluetooth_set_l2cap_rtx_timeout_value ( SYSCTL_HANDLER_ARGS  )
static

◆ bluetooth_set_sco_rtx_timeout_value()

static int bluetooth_set_sco_rtx_timeout_value ( SYSCTL_HANDLER_ARGS  )
static

◆ DECLARE_MODULE()

DECLARE_MODULE ( ng_bluetooth  ,
bluetooth_mod  ,
SI_SUB_PSEUDO  ,
SI_ORDER_ANY   
)

◆ MODULE_VERSION()

MODULE_VERSION ( ng_bluetooth  ,
NG_BLUETOOTH_VERSION   
)

◆ SYSCTL_INT()

SYSCTL_INT ( _net_bluetooth  ,
OID_AUTO  ,
version  ,
CTLFLAG_RD  ,
SYSCTL_NULL_INT_PTR  ,
NG_BLUETOOTH_VERSION  ,
"Version of the stack"   
)

◆ SYSCTL_NODE() [1/5]

SYSCTL_NODE ( _net  ,
OID_AUTO  ,
bluetooth  ,
CTLFLAG_RW|  CTLFLAG_MPSAFE,
,
"Bluetooth family"   
)

◆ SYSCTL_NODE() [2/5]

SYSCTL_NODE ( _net_bluetooth  ,
OID_AUTO  ,
hci  ,
CTLFLAG_RW|  CTLFLAG_MPSAFE,
,
"Bluetooth HCI family"   
)

◆ SYSCTL_NODE() [3/5]

SYSCTL_NODE ( _net_bluetooth  ,
OID_AUTO  ,
l2cap  ,
CTLFLAG_RW|  CTLFLAG_MPSAFE,
,
"Bluetooth L2CAP family"   
)

◆ SYSCTL_NODE() [4/5]

SYSCTL_NODE ( _net_bluetooth  ,
OID_AUTO  ,
rfcomm  ,
CTLFLAG_RW|  CTLFLAG_MPSAFE,
,
"Bluetooth RFCOMM family"   
)

◆ SYSCTL_NODE() [5/5]

SYSCTL_NODE ( _net_bluetooth  ,
OID_AUTO  ,
sco  ,
CTLFLAG_RW|  CTLFLAG_MPSAFE,
,
"Bluetooth SCO family"   
)

◆ SYSCTL_PROC() [1/5]

SYSCTL_PROC ( _net_bluetooth_hci  ,
OID_AUTO  ,
command_timeout  ,
CTLTYPE_INT|CTLFLAG_RW|  CTLFLAG_NEEDGIANT,
bluetooth_hci_command_timeout_value,
,
bluetooth_set_hci_command_timeout_value  ,
"I"  ,
"HCI command timeout (sec)"   
)

◆ SYSCTL_PROC() [2/5]

SYSCTL_PROC ( _net_bluetooth_hci  ,
OID_AUTO  ,
connection_timeout  ,
CTLTYPE_INT|CTLFLAG_RW|  CTLFLAG_NEEDGIANT,
bluetooth_hci_connect_timeout_value,
60  ,
bluetooth_set_hci_connect_timeout_value  ,
"I"  ,
"HCI connect timeout (sec)"   
)

◆ SYSCTL_PROC() [3/5]

SYSCTL_PROC ( _net_bluetooth_l2cap  ,
OID_AUTO  ,
ertx_timeout  ,
CTLTYPE_INT|CTLFLAG_RW|  CTLFLAG_NEEDGIANT,
bluetooth_l2cap_ertx_timeout_value,
300  ,
bluetooth_set_l2cap_ertx_timeout_value  ,
"I"  ,
"L2CAP ERTX timeout (sec)"   
)

◆ SYSCTL_PROC() [4/5]

SYSCTL_PROC ( _net_bluetooth_l2cap  ,
OID_AUTO  ,
rtx_timeout  ,
CTLTYPE_INT|CTLFLAG_RW|  CTLFLAG_NEEDGIANT,
bluetooth_l2cap_rtx_timeout_value,
60  ,
bluetooth_set_l2cap_rtx_timeout_value  ,
"I"  ,
"L2CAP RTX timeout (sec)"   
)

◆ SYSCTL_PROC() [5/5]

SYSCTL_PROC ( _net_bluetooth_sco  ,
OID_AUTO  ,
rtx_timeout  ,
CTLTYPE_INT|CTLFLAG_RW|  CTLFLAG_NEEDGIANT,
bluetooth_sco_rtx_timeout_value,
60  ,
bluetooth_set_sco_rtx_timeout_value  ,
"I"  ,
"SCO RTX timeout (sec)"   
)

◆ SYSCTL_UINT()

SYSCTL_UINT ( _net_bluetooth_hci  ,
OID_AUTO  ,
max_neighbor_age  ,
CTLFLAG_RW  ,
bluetooth_hci_max_neighbor_age_value,
600  ,
"Maximal HCI neighbor cache entry age (sec)"   
)

Variable Documentation

◆ bluetooth_hci_command_timeout_value

u_int32_t bluetooth_hci_command_timeout_value = 5
static

◆ bluetooth_hci_connect_timeout_value

u_int32_t bluetooth_hci_connect_timeout_value = 60
static

◆ bluetooth_hci_max_neighbor_age_value

u_int32_t bluetooth_hci_max_neighbor_age_value = 600
static

Definition at line 51 of file ng_bluetooth.c.

Referenced by bluetooth_hci_max_neighbor_age().

◆ bluetooth_l2cap_ertx_timeout_value

u_int32_t bluetooth_l2cap_ertx_timeout_value = 300
static

◆ bluetooth_l2cap_rtx_timeout_value

u_int32_t bluetooth_l2cap_rtx_timeout_value = 60
static

◆ bluetooth_mod

moduledata_t bluetooth_mod
static
Initial value:
= {
"ng_bluetooth",
NULL
}
static int bluetooth_modevent(module_t mod, int event, void *data)
Definition: ng_bluetooth.c:263

Definition at line 286 of file ng_bluetooth.c.

◆ bluetooth_sco_rtx_timeout_value

u_int32_t bluetooth_sco_rtx_timeout_value = 60
static