FreeBSD kernel netgraph code
ng_hci_evnt.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_evnt.c:

Go to the source code of this file.

Functions

static int inquiry_result (ng_hci_unit_p, struct mbuf *)
 
static int con_compl (ng_hci_unit_p, struct mbuf *)
 
static int con_req (ng_hci_unit_p, struct mbuf *)
 
static int discon_compl (ng_hci_unit_p, struct mbuf *)
 
static int encryption_change (ng_hci_unit_p, struct mbuf *)
 
static int read_remote_features_compl (ng_hci_unit_p, struct mbuf *)
 
static int qos_setup_compl (ng_hci_unit_p, struct mbuf *)
 
static int hardware_error (ng_hci_unit_p, struct mbuf *)
 
static int role_change (ng_hci_unit_p, struct mbuf *)
 
static int num_compl_pkts (ng_hci_unit_p, struct mbuf *)
 
static int mode_change (ng_hci_unit_p, struct mbuf *)
 
static int data_buffer_overflow (ng_hci_unit_p, struct mbuf *)
 
static int read_clock_offset_compl (ng_hci_unit_p, struct mbuf *)
 
static int qos_violation (ng_hci_unit_p, struct mbuf *)
 
static int page_scan_mode_change (ng_hci_unit_p, struct mbuf *)
 
static int page_scan_rep_mode_change (ng_hci_unit_p, struct mbuf *)
 
static int sync_con_queue (ng_hci_unit_p, ng_hci_unit_con_p, int)
 
static int send_data_packets (ng_hci_unit_p, int, int)
 
static int le_event (ng_hci_unit_p, struct mbuf *)
 
int ng_hci_process_event (ng_hci_unit_p unit, struct mbuf *event)
 
void ng_hci_send_data (ng_hci_unit_p unit)
 
static int le_advertizing_report (ng_hci_unit_p unit, struct mbuf *event)
 
static int le_connection_complete (ng_hci_unit_p unit, struct mbuf *event)
 
static int le_connection_update (ng_hci_unit_p unit, struct mbuf *event)
 

Function Documentation

◆ con_compl()

◆ con_req()

static int con_req ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

◆ data_buffer_overflow()

static int data_buffer_overflow ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

Definition at line 1221 of file ng_hci_evnt.c.

References event, NG_FREE_M, NG_HCI_ALERT, NG_HCI_LINK_ACL, NG_NODE_NAME, and ng_hci_unit::node.

Referenced by ng_hci_process_event().

Here is the caller graph for this function:

◆ discon_compl()

static int discon_compl ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

Definition at line 884 of file ng_hci_evnt.c.

References event, ng_hci_unit_con::flags, NG_FREE_M, NG_HCI_ALERT, ng_hci_con_by_handle(), NG_HCI_CON_HANDLE, NG_HCI_CON_TIMEOUT_PENDING, ng_hci_con_untimeout(), ng_hci_free_con(), ng_hci_lp_discon_ind(), NG_HCI_M_PULLUP, NG_NODE_NAME, and ng_hci_unit::node.

Referenced by ng_hci_process_event().

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

◆ encryption_change()

static int encryption_change ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

◆ hardware_error()

static int hardware_error ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

Definition at line 1072 of file ng_hci_evnt.c.

References event, NG_FREE_M, NG_HCI_ALERT, NG_NODE_NAME, and ng_hci_unit::node.

Referenced by ng_hci_process_event().

Here is the caller graph for this function:

◆ inquiry_result()

static int inquiry_result ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

◆ le_advertizing_report()

static int le_advertizing_report ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

◆ le_connection_complete()

◆ le_connection_update()

static int le_connection_update ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

Definition at line 567 of file ng_hci_evnt.c.

References event, and NG_FREE_M.

Referenced by le_event().

Here is the caller graph for this function:

◆ le_event()

static int le_event ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

◆ mode_change()

static int mode_change ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

Definition at line 1180 of file ng_hci_evnt.c.

References event, ng_hci_unit_con::link_type, ng_hci_unit_con::mode, NG_FREE_M, NG_HCI_ALERT, ng_hci_con_by_handle(), NG_HCI_CON_HANDLE, NG_HCI_ERR, NG_HCI_LINK_ACL, NG_HCI_M_PULLUP, NG_NODE_NAME, and ng_hci_unit::node.

Referenced by ng_hci_process_event().

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

◆ ng_hci_process_event()

int ng_hci_process_event ( ng_hci_unit_p  unit,
struct mbuf *  event 
)

Definition at line 88 of file ng_hci_evnt.c.

References con_compl(), con_req(), data_buffer_overflow(), discon_compl(), encryption_change(), event, hardware_error(), inquiry_result(), le_event(), mode_change(), NG_FREE_M, NG_HCI_EVENT_AUTH_COMPL, NG_HCI_EVENT_BT_LOGO, NG_HCI_EVENT_CHANGE_CON_LINK_KEY_COMPL, NG_HCI_EVENT_COMMAND_COMPL, NG_HCI_EVENT_COMMAND_STATUS, NG_HCI_EVENT_CON_COMPL, NG_HCI_EVENT_CON_PKT_TYPE_CHANGED, NG_HCI_EVENT_CON_REQ, NG_HCI_EVENT_DATA_BUFFER_OVERFLOW, NG_HCI_EVENT_DISCON_COMPL, NG_HCI_EVENT_ENCRYPTION_CHANGE, NG_HCI_EVENT_FLUSH_OCCUR, NG_HCI_EVENT_HARDWARE_ERROR, NG_HCI_EVENT_INQUIRY_COMPL, NG_HCI_EVENT_INQUIRY_RESULT, NG_HCI_EVENT_LE, NG_HCI_EVENT_LINK_KEY_NOTIFICATION, NG_HCI_EVENT_LINK_KEY_REQ, NG_HCI_EVENT_LOOPBACK_COMMAND, NG_HCI_EVENT_MASTER_LINK_KEY_COMPL, NG_HCI_EVENT_MAX_SLOT_CHANGE, NG_HCI_EVENT_MODE_CHANGE, NG_HCI_EVENT_NUM_COMPL_PKTS, NG_HCI_EVENT_PAGE_SCAN_MODE_CHANGE, NG_HCI_EVENT_PAGE_SCAN_REP_MODE_CHANGE, NG_HCI_EVENT_PIN_CODE_REQ, NG_HCI_EVENT_QOS_SETUP_COMPL, NG_HCI_EVENT_QOS_VIOLATION, NG_HCI_EVENT_READ_CLOCK_OFFSET_COMPL, NG_HCI_EVENT_READ_REMOTE_FEATURES_COMPL, NG_HCI_EVENT_READ_REMOTE_VER_INFO_COMPL, NG_HCI_EVENT_REMOTE_NAME_REQ_COMPL, NG_HCI_EVENT_RETURN_LINK_KEYS, NG_HCI_EVENT_ROLE_CHANGE, NG_HCI_EVENT_VENDOR, NG_HCI_INFO, NG_HCI_M_PULLUP, ng_hci_process_command_complete(), ng_hci_process_command_status(), NG_NODE_NAME, ng_hci_unit::node, num_compl_pkts(), page_scan_mode_change(), page_scan_rep_mode_change(), qos_setup_compl(), qos_violation(), read_clock_offset_compl(), read_remote_features_compl(), and role_change().

Referenced by ng_hci_drv_rcvdata().

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

◆ ng_hci_send_data()

◆ num_compl_pkts()

static int num_compl_pkts ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

◆ page_scan_mode_change()

static int page_scan_mode_change ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

Definition at line 1328 of file ng_hci_evnt.c.

References ng_hci_neighbor::addrtype, ng_hci_unit::bdaddr, ng_hci_neighbor::bdaddr, event, NG_FREE_M, ng_hci_get_neighbor(), NG_HCI_LINK_ACL, NG_HCI_M_PULLUP, ng_hci_new_neighbor(), ng_hci_neighbor::page_scan_mode, and ng_hci_neighbor::updated.

Referenced by ng_hci_process_event().

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

◆ page_scan_rep_mode_change()

static int page_scan_rep_mode_change ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

Definition at line 1363 of file ng_hci_evnt.c.

References ng_hci_neighbor::addrtype, ng_hci_unit::bdaddr, ng_hci_neighbor::bdaddr, event, NG_FREE_M, ng_hci_get_neighbor(), NG_HCI_LINK_ACL, NG_HCI_M_PULLUP, ng_hci_new_neighbor(), ng_hci_neighbor::page_scan_rep_mode, and ng_hci_neighbor::updated.

Referenced by ng_hci_process_event().

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

◆ qos_setup_compl()

static int qos_setup_compl ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

Definition at line 1030 of file ng_hci_evnt.c.

References event, ng_hci_unit_con::link_type, NG_FREE_M, NG_HCI_ALERT, ng_hci_con_by_handle(), NG_HCI_CON_HANDLE, NG_HCI_CON_OPEN, NG_HCI_LINK_ACL, ng_hci_lp_qos_cfm(), NG_HCI_M_PULLUP, NG_NODE_NAME, ng_hci_unit::node, and ng_hci_unit_con::state.

Referenced by ng_hci_process_event().

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

◆ qos_violation()

static int qos_violation ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

Definition at line 1287 of file ng_hci_evnt.c.

References event, ng_hci_unit_con::link_type, NG_FREE_M, NG_HCI_ALERT, ng_hci_con_by_handle(), NG_HCI_CON_HANDLE, NG_HCI_CON_OPEN, NG_HCI_LINK_ACL, ng_hci_lp_qos_ind(), NG_HCI_M_PULLUP, NG_NODE_NAME, ng_hci_unit::node, and ng_hci_unit_con::state.

Referenced by ng_hci_process_event().

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

◆ read_clock_offset_compl()

static int read_clock_offset_compl ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

◆ read_remote_features_compl()

static int read_remote_features_compl ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

◆ role_change()

static int role_change ( ng_hci_unit_p  unit,
struct mbuf *  event 
)
static

Definition at line 1085 of file ng_hci_evnt.c.

References ng_hci_unit::bdaddr, event, NG_FREE_M, NG_HCI_ALERT, ng_hci_con_by_bdaddr(), NG_HCI_ERR, NG_HCI_LINK_ACL, NG_HCI_M_PULLUP, NG_NODE_NAME, ng_hci_unit::node, and ng_hci_unit_con::role.

Referenced by ng_hci_process_event().

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

◆ send_data_packets()

◆ sync_con_queue()

static int sync_con_queue ( ng_hci_unit_p  unit,
ng_hci_unit_con_p  con,
int  completed 
)
static