38#include <sys/kernel.h>
39#include <sys/malloc.h>
63#ifdef NG_SEPARATE_MALLOC
65 "Netgraph Bluetooth L2CAP node");
67#define M_NETGRAPH_L2CAP M_NETGRAPH
124 LIST_INIT(&l2cap->con_list);
125 LIST_INIT(&l2cap->chan_list);
149 bzero(l2cap,
sizeof(*l2cap));
198 if (hook == l2cap->
hci)
201 if (hook == l2cap->
l2c || hook == l2cap->
ctl) {
229 if (hook == l2cap->
hci) {
233 if (hook == l2cap->
l2c) {
237 if (hook == l2cap->
ctl)
276"%s: %s - HCI node is up, bdaddr: %x:%x:%x:%x:%x:%x, " \
290 l2cap->
l2c, NULL, 0);
292 l2cap->
ctl, NULL, 0);
310"%s: %s - sync HCI connection queue, con_handle=%d, pending=%d, completed=%d\n",
318"%s: %s - pending packet counter is out of sync! " \
319"con_handle=%d, pending=%d, completed=%d\n", __func__,
477 struct ng_mesg *msg = NULL, *rsp = NULL;
492 "bdaddr %x:%x:%x:%x:%x:%x, " \
500 (l2cap->
hci != NULL)?
502 (l2cap->
l2c != NULL)?
504 (l2cap->
ctl != NULL)?
558 LIST_FOREACH(con, &l2cap->con_list, next)
565 sizeof(*e1) + n *
sizeof(*e2), M_NOWAIT);
576 LIST_FOREACH(con, &l2cap->con_list, next) {
605 LIST_FOREACH(ch, &l2cap->chan_list, next)
624 LIST_FOREACH(ch, &l2cap->chan_list, next) {
708 struct mbuf *m = NULL;
715 if (hook == l2cap->
hci)
717 else if (hook == l2cap->
l2c)
737 while (!LIST_EMPTY(&l2cap->con_list)) {
738 con = LIST_FIRST(&l2cap->con_list);
757 while (!LIST_EMPTY(&l2cap->chan_list))
int ng_connect_t(hook_p hook)
#define NG_HOOK_NODE(hook)
int ng_rcvmsg_t(node_p node, item_p item, hook_p lasthook)
int ng_disconnect_t(hook_p hook)
#define NG_NODE_SET_PRIVATE(node, val)
#define NG_RESPOND_MSG(error, here, item, resp)
#define NG_NODE_IS_VALID(node)
#define NG_NODE_FORCE_WRITER(node)
#define NG_HOOK_SET_RCVMSG(hook, val)
#define NG_NODE_UNREF(node)
#define NG_NODE_NAME(node)
int ng_rmnode_self(node_p here)
int ng_rcvdata_t(hook_p hook, item_p item)
int ng_shutdown_t(node_p node)
#define NG_FREE_ITEM(item)
int ng_constructor_t(node_p node)
int ng_send_fn(node_p node, hook_p hook, ng_item_fn *fn, void *arg1, int arg2)
#define NG_NODE_NUMHOOKS(node)
#define NGI_GET_MSG(i, m)
#define NG_NODE_PRIVATE(node)
int ng_newhook_t(node_p node, hook_p hook, const char *name)
#define NG_BLUETOOTH_VERSION
MALLOC_DEFINE(M_NG_CCATM, "ng_ccatm", "netgraph uni api node")
#define NGM_HCI_LP_QOS_IND
#define NGM_HCI_LP_CON_IND
#define NGM_HCI_SYNC_CON_QUEUE
#define NGM_HCI_LP_CON_CFM
#define NGM_HCI_LP_ENC_CHG
#define NGM_HCI_LP_DISCON_IND
#define NGM_HCI_LP_QOS_CFM
#define NGM_L2CAP_L2CA_DISCON
#define NGM_L2CAP_L2CA_GRP_CLOSE
#define NG_L2CAP_CON_LP_TIMO
#define NGM_L2CAP_L2CA_ENABLE_CLT
#define NGM_L2CAP_L2CA_CFG_RSP
#define NGM_L2CAP_NODE_GET_CHAN_LIST
u_int16_t ng_l2cap_node_auto_discon_ep
#define NGM_L2CAP_NODE_GET_AUTO_DISCON_TIMO
u_int16_t ng_l2cap_node_flags_ep
#define NGM_L2CAP_NODE_SET_DEBUG
#define NGM_L2CAP_L2CA_PING
#define NGM_L2CAP_L2CA_GRP_CREATE
u_int16_t ng_l2cap_node_debug_ep
#define NG_L2CAP_CON_AUTO_DISCON_TIMO
#define NGM_L2CAP_L2CA_CFG
#define NGM_L2CAP_L2CA_GRP_MEMBERSHIP
#define NGM_L2CAP_NODE_GET_CON_LIST
#define NGM_L2CAP_NODE_GET_FLAGS
#define NGM_L2CAP_NODE_GET_DEBUG
#define NG_L2CAP_NODE_TYPE
#define NGM_L2CAP_L2CA_GET_INFO
#define NG_L2CAP_HOOK_HCI
#define NG_L2CAP_MAX_CON_NUM
#define NGM_L2CAP_L2CA_CON_RSP
#define NG_L2CAP_WARN_LEVEL
#define NGM_L2CAP_L2CA_GRP_ADD_MEMBER
#define NGM_L2CAP_NODE_SET_AUTO_DISCON_TIMO
#define NGM_L2CAP_L2CA_CON
#define NG_L2CAP_MAX_CHAN_NUM
#define NG_L2CAP_HOOK_CTL
#define NGM_L2CAP_L2CA_GRP_REM_MEMBER
#define NG_L2CAP_HOOK_L2C
void ng_l2cap_con_fail(ng_l2cap_con_p con, u_int16_t result)
int ng_l2cap_lp_qos_ind(ng_l2cap_p l2cap, struct ng_mesg *msg)
int ng_l2cap_lp_enc_change(ng_l2cap_p l2cap, struct ng_mesg *msg)
void ng_l2cap_lp_deliver(ng_l2cap_con_p con)
int ng_l2cap_lp_receive(ng_l2cap_p l2cap, struct mbuf *m)
int ng_l2cap_lp_discon_ind(ng_l2cap_p l2cap, struct ng_mesg *msg)
int ng_l2cap_lp_qos_cfm(ng_l2cap_p l2cap, struct ng_mesg *msg)
int ng_l2cap_lp_con_cfm(ng_l2cap_p l2cap, struct ng_mesg *msg)
int ng_l2cap_lp_con_ind(ng_l2cap_p l2cap, struct ng_mesg *msg)
static ng_rcvmsg_t ng_l2cap_lower_rcvmsg
static ng_shutdown_t ng_l2cap_shutdown
static ng_constructor_t ng_l2cap_constructor
MODULE_DEPEND(ng_l2cap, ng_bluetooth, NG_BLUETOOTH_VERSION, NG_BLUETOOTH_VERSION, NG_BLUETOOTH_VERSION)
MODULE_VERSION(ng_l2cap, NG_BLUETOOTH_VERSION)
static ng_rcvmsg_t ng_l2cap_default_rcvmsg
static struct ng_type typestruct
static void ng_l2cap_destroy_channels(ng_l2cap_p)
static void ng_l2cap_cleanup(ng_l2cap_p)
static ng_newhook_t ng_l2cap_newhook
static ng_disconnect_t ng_l2cap_disconnect
static ng_rcvmsg_t ng_l2cap_upper_rcvmsg
static ng_rcvdata_t ng_l2cap_rcvdata
NETGRAPH_INIT(l2cap, &typestruct)
static ng_connect_t ng_l2cap_connect
void ng_l2cap_free_chan(ng_l2cap_chan_p ch)
ng_l2cap_con_p ng_l2cap_con_by_handle(ng_l2cap_p l2cap, u_int16_t con_handle)
void ng_l2cap_send_hook_info(node_p node, hook_p hook, void *arg1, int arg2)
int ng_l2cap_discon_untimeout(ng_l2cap_con_p con)
int ng_l2cap_lp_untimeout(ng_l2cap_con_p con)
static const struct ng_cmdlist ng_l2cap_cmdlist[]
int ng_l2cap_l2ca_ping_req(ng_l2cap_p l2cap, struct ng_mesg *msg)
int ng_l2cap_l2ca_grp_add_member_req(ng_l2cap_p l2cap, struct ng_mesg *msg)
int ng_l2cap_l2ca_cfg_req(ng_l2cap_p l2cap, struct ng_mesg *msg)
int ng_l2cap_l2ca_enable_clt(ng_l2cap_p l2cap, struct ng_mesg *msg)
int ng_l2cap_l2ca_cfg_rsp_req(ng_l2cap_p l2cap, struct ng_mesg *msg)
int ng_l2cap_l2ca_con_req(ng_l2cap_p l2cap, struct ng_mesg *msg)
int ng_l2cap_l2ca_get_info_req(ng_l2cap_p l2cap, struct ng_mesg *msg)
int ng_l2cap_l2ca_write_req(ng_l2cap_p l2cap, struct mbuf *m)
int ng_l2cap_l2ca_grp_rem_member(ng_l2cap_p l2cap, struct ng_mesg *msg)
int ng_l2cap_l2ca_con_rsp_req(ng_l2cap_p l2cap, struct ng_mesg *msg)
int ng_l2cap_l2ca_grp_close(ng_l2cap_p l2cap, struct ng_mesg *msg)
int ng_l2cap_l2ca_discon_req(ng_l2cap_p l2cap, struct ng_mesg *msg)
int ng_l2cap_l2ca_grp_get_members(ng_l2cap_p l2cap, struct ng_mesg *msg)
int ng_l2cap_l2ca_grp_create(ng_l2cap_p l2cap, struct ng_mesg *msg)
#define NG_MKRESPONSE(rsp, msg, len, how)
#define NGM_GENERIC_COOKIE
u_int32_t num_connections
ng_l2cap_node_debug_ep debug
ng_l2cap_node_flags_ep flags
ng_l2cap_node_auto_discon_ep discon_timo
struct ng_mesg::ng_msghdr header