FreeBSD kernel netgraph code
ng_hci_cmds.c File Reference
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/endian.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/queue.h>
#include <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
#include <netgraph/bluetooth/include/ng_bluetooth.h>
#include <netgraph/bluetooth/include/ng_hci.h>
#include <netgraph/bluetooth/hci/ng_hci_var.h>
#include <netgraph/bluetooth/hci/ng_hci_cmds.h>
#include <netgraph/bluetooth/hci/ng_hci_evnt.h>
#include <netgraph/bluetooth/hci/ng_hci_ulpi.h>
#include <netgraph/bluetooth/hci/ng_hci_misc.h>
Include dependency graph for ng_hci_cmds.c:

Go to the source code of this file.

Macros

#define min(a, b)   ((a) < (b))? (a) : (b)
 

Functions

static int complete_command (ng_hci_unit_p, int, struct mbuf **)
 
static int process_link_control_params (ng_hci_unit_p, u_int16_t, struct mbuf *, struct mbuf *)
 
static int process_link_policy_params (ng_hci_unit_p, u_int16_t, struct mbuf *, struct mbuf *)
 
static int process_hc_baseband_params (ng_hci_unit_p, u_int16_t, struct mbuf *, struct mbuf *)
 
static int process_info_params (ng_hci_unit_p, u_int16_t, struct mbuf *, struct mbuf *)
 
static int process_status_params (ng_hci_unit_p, u_int16_t, struct mbuf *, struct mbuf *)
 
static int process_testing_params (ng_hci_unit_p, u_int16_t, struct mbuf *, struct mbuf *)
 
static int process_le_params (ng_hci_unit_p, u_int16_t, struct mbuf *, struct mbuf *)
 
static int process_link_control_status (ng_hci_unit_p, ng_hci_command_status_ep *, struct mbuf *)
 
static int process_link_policy_status (ng_hci_unit_p, ng_hci_command_status_ep *, struct mbuf *)
 
static int process_le_status (ng_hci_unit_p, ng_hci_command_status_ep *, struct mbuf *)
 
int ng_hci_send_command (ng_hci_unit_p unit)
 
int ng_hci_process_command_complete (ng_hci_unit_p unit, struct mbuf *e)
 
int ng_hci_process_command_status (ng_hci_unit_p unit, struct mbuf *e)
 
void ng_hci_process_command_timeout (node_p node, hook_p hook, void *arg1, int arg2)
 

Macro Definition Documentation

◆ min

#define min (   a,
 
)    ((a) < (b))? (a) : (b)

Definition at line 60 of file ng_hci_cmds.c.

Function Documentation

◆ complete_command()

static int complete_command ( ng_hci_unit_p  unit,
int  opcode,
struct mbuf **  cp 
)
static

Definition at line 335 of file ng_hci_cmds.c.

References ng_hci_unit::cmdq, NG_BT_MBUFQ_DEQUEUE, NG_BT_MBUFQ_FIRST, NG_HCI_ALERT, ng_hci_command_untimeout(), NG_HCI_UNIT_COMMAND_PENDING, NG_NODE_NAME, ng_hci_unit::node, opcode, and ng_hci_unit::state.

Referenced by ng_hci_process_command_complete(), and ng_hci_process_command_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ng_hci_process_command_complete()

◆ ng_hci_process_command_status()

◆ ng_hci_process_command_timeout()

void ng_hci_process_command_timeout ( node_p  node,
hook_p  hook,
void *  arg1,
int  arg2 
)

◆ ng_hci_send_command()

◆ process_hc_baseband_params()

int process_hc_baseband_params ( ng_hci_unit_p  unit,
u_int16_t  ocf,
struct mbuf *  mcp,
struct mbuf *  mrp 
)
static

Definition at line 562 of file ng_hci_cmds.c.

References ng_hci_unit::buffer, ng_hci_unit_con::flags, NG_FREE_M, NG_HCI_BUFF_ACL_FREE, NG_HCI_BUFF_ACL_TOTAL, NG_HCI_BUFF_SCO_FREE, NG_HCI_BUFF_SCO_TOTAL, NG_HCI_CON_TIMEOUT_PENDING, ng_hci_con_untimeout(), ng_hci_free_con(), ng_hci_lp_discon_ind(), NG_HCI_OCF_CHANGE_LOCAL_NAME, NG_HCI_OCF_CREATE_NEW_UNIT_KEY, NG_HCI_OCF_DELETE_STORED_LINK_KEY, NG_HCI_OCF_FLUSH, NG_HCI_OCF_H2HC_FLOW_CONTROL, NG_HCI_OCF_HOST_BUFFER_SIZE, NG_HCI_OCF_HOST_NUM_COMPL_PKTS, NG_HCI_OCF_READ_AUTH_ENABLE, NG_HCI_OCF_READ_AUTO_FLUSH_TIMO, NG_HCI_OCF_READ_CON_ACCEPT_TIMO, NG_HCI_OCF_READ_ENCRYPTION_MODE, NG_HCI_OCF_READ_HOLD_MODE_ACTIVITY, NG_HCI_OCF_READ_IAC_LAP, NG_HCI_OCF_READ_INQUIRY_SCAN_ACTIVITY, NG_HCI_OCF_READ_LE_HOST_SUPPORTED, NG_HCI_OCF_READ_LINK_SUPERVISION_TIMO, NG_HCI_OCF_READ_LOCAL_NAME, NG_HCI_OCF_READ_NUM_BROADCAST_RETRANS, NG_HCI_OCF_READ_PAGE_SCAN, NG_HCI_OCF_READ_PAGE_SCAN_ACTIVITY, NG_HCI_OCF_READ_PAGE_SCAN_PERIOD, NG_HCI_OCF_READ_PAGE_TIMO, NG_HCI_OCF_READ_PIN_TYPE, NG_HCI_OCF_READ_SCAN_ENABLE, NG_HCI_OCF_READ_SCO_FLOW_CONTROL, NG_HCI_OCF_READ_STORED_LINK_KEY, NG_HCI_OCF_READ_SUPPORTED_IAC_NUM, NG_HCI_OCF_READ_UNIT_CLASS, NG_HCI_OCF_READ_VOICE_SETTINGS, NG_HCI_OCF_READ_XMIT_LEVEL, NG_HCI_OCF_RESET, NG_HCI_OCF_SET_EVENT_FILTER, NG_HCI_OCF_SET_EVENT_MASK, NG_HCI_OCF_WRITE_AUTH_ENABLE, NG_HCI_OCF_WRITE_AUTO_FLUSH_TIMO, NG_HCI_OCF_WRITE_CON_ACCEPT_TIMO, NG_HCI_OCF_WRITE_ENCRYPTION_MODE, NG_HCI_OCF_WRITE_HOLD_MODE_ACTIVITY, NG_HCI_OCF_WRITE_IAC_LAP, NG_HCI_OCF_WRITE_INQUIRY_SCAN_ACTIVITY, NG_HCI_OCF_WRITE_LE_HOST_SUPPORTED, NG_HCI_OCF_WRITE_LINK_SUPERVISION_TIMO, NG_HCI_OCF_WRITE_NUM_BROADCAST_RETRANS, NG_HCI_OCF_WRITE_PAGE_SCAN, NG_HCI_OCF_WRITE_PAGE_SCAN_ACTIVITY, NG_HCI_OCF_WRITE_PAGE_SCAN_PERIOD, NG_HCI_OCF_WRITE_PAGE_TIMO, NG_HCI_OCF_WRITE_PIN_TYPE, NG_HCI_OCF_WRITE_SCAN_ENABLE, NG_HCI_OCF_WRITE_SCO_FLOW_CONTROL, NG_HCI_OCF_WRITE_STORED_LINK_KEY, NG_HCI_OCF_WRITE_UNIT_CLASS, NG_HCI_OCF_WRITE_VOICE_SETTINGS, and ng_hci_unit::state.

Referenced by ng_hci_process_command_complete().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_info_params()

static int process_info_params ( ng_hci_unit_p  unit,
u_int16_t  ocf,
struct mbuf *  mcp,
struct mbuf *  mrp 
)
static

◆ process_le_params()

◆ process_le_status()

◆ process_link_control_params()

◆ process_link_control_status()

◆ process_link_policy_params()

◆ process_link_policy_status()

static int process_link_policy_status ( ng_hci_unit_p  unit,
ng_hci_command_status_ep *  ep,
struct mbuf *  mcp 
)
static

◆ process_status_params()

static int process_status_params ( ng_hci_unit_p  unit,
u_int16_t  ocf,
struct mbuf *  mcp,
struct mbuf *  mrp 
)
static

◆ process_testing_params()

int process_testing_params ( ng_hci_unit_p  unit,
u_int16_t  ocf,
struct mbuf *  mcp,
struct mbuf *  mrp 
)
static

Definition at line 782 of file ng_hci_cmds.c.

References NG_FREE_M, NG_HCI_OCF_ENABLE_UNIT_UNDER_TEST, NG_HCI_OCF_READ_LOOPBACK_MODE, and NG_HCI_OCF_WRITE_LOOPBACK_MODE.

Referenced by ng_hci_process_command_complete().

Here is the caller graph for this function: