FreeBSD kernel netgraph code
|
#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>
Go to the source code of this file.
|
static |
Definition at line 673 of file ng_hci_evnt.c.
References __attribute__, ng_hci_unit_con::bdaddr, ng_hci_unit::cmdq, ng_hci_unit_con::con_handle, ng_hci_unit_con::encryption_mode, event, ng_hci_unit::features, ng_hci_unit::link_policy_mask, ng_hci_unit_con::link_type, NG_BT_MBUFQ_ENQUEUE, NG_FREE_M, NG_HCI_CMD_PKT, NG_HCI_CON_HANDLE, NG_HCI_CON_OPEN, ng_hci_con_untimeout(), NG_HCI_CON_W4_CONN_COMPLETE, ng_hci_free_con(), NG_HCI_LINK_ACL, NG_HCI_LMP_HOLD_MODE, NG_HCI_LMP_PARK_MODE, NG_HCI_LMP_SNIFF_MODE, NG_HCI_LMP_SWITCH, ng_hci_lp_con_cfm(), NG_HCI_M_PULLUP, ng_hci_new_con(), NG_HCI_OCF_WRITE_LINK_POLICY_SETTINGS, NG_HCI_OGF_LINK_POLICY, NG_HCI_OPCODE, ng_hci_send_command(), NG_HCI_UNIT_COMMAND_PENDING, ng_hci_unit::role_switch, ng_hci_unit::state, and ng_hci_unit_con::state.
Referenced by ng_hci_process_event().
|
static |
Definition at line 799 of file ng_hci_evnt.c.
References ng_hci_unit_con::bdaddr, event, ng_hci_unit_con::link_type, NG_FREE_M, ng_hci_con_timeout(), ng_hci_con_untimeout(), NG_HCI_CON_W4_CONN_COMPLETE, NG_HCI_CON_W4_LP_CON_RSP, ng_hci_free_con(), ng_hci_lp_con_ind(), NG_HCI_M_PULLUP, ng_hci_new_con(), and ng_hci_unit_con::state.
Referenced by ng_hci_process_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().
|
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().
|
static |
Definition at line 930 of file ng_hci_evnt.c.
References ng_hci_unit_con::encryption_mode, event, ng_hci_unit_con::link_type, NG_FREE_M, NG_HCI_ALERT, ng_hci_con_by_handle(), NG_HCI_CON_HANDLE, NG_HCI_ENCRYPTION_MODE_NONE, NG_HCI_ENCRYPTION_MODE_P2P, NG_HCI_ERR, NG_HCI_LINK_SCO, ng_hci_lp_enc_change(), NG_HCI_M_PULLUP, NG_NODE_NAME, and ng_hci_unit::node.
Referenced by ng_hci_process_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().
|
static |
Definition at line 612 of file ng_hci_evnt.c.
References ng_hci_neighbor::addrtype, ng_hci_neighbor::bdaddr, ng_hci_neighbor::clock_offset, event, NG_FREE_M, NG_HCI_CLASS_SIZE, ng_hci_get_neighbor(), NG_HCI_LINK_ACL, NG_HCI_M_PULLUP, ng_hci_new_neighbor(), ng_hci_neighbor::page_scan_mode, ng_hci_neighbor::page_scan_rep_mode, and ng_hci_neighbor::updated.
Referenced by ng_hci_process_event().
|
static |
Definition at line 378 of file ng_hci_evnt.c.
References ng_hci_neighbor::addrtype, ng_hci_neighbor::bdaddr, event, ng_hci_neighbor::extinq_data, ng_hci_neighbor::extinq_size, NG_FREE_M, NG_HCI_EXTINQ_MAX, ng_hci_get_neighbor(), NG_HCI_LINK_LE_PUBLIC, NG_HCI_LINK_LE_RANDOM, NG_HCI_M_PULLUP, ng_hci_new_neighbor(), NG_HCI_WARN, ng_hci_neighbor::page_scan_mode, and ng_hci_neighbor::updated.
Referenced by le_event().
|
static |
Definition at line 467 of file ng_hci_evnt.c.
References ng_hci_unit_con::bdaddr, ng_hci_unit_con::con_handle, ng_hci_unit_con::encryption_mode, event, ng_hci_unit_con::link_type, NG_FREE_M, NG_HCI_CON_HANDLE, NG_HCI_CON_OPEN, ng_hci_con_timeout(), ng_hci_con_untimeout(), NG_HCI_CON_W4_CONN_COMPLETE, NG_HCI_CON_W4_LP_CON_RSP, NG_HCI_ENCRYPTION_MODE_NONE, ng_hci_free_con(), NG_HCI_LINK_LE_PUBLIC, NG_HCI_LINK_LE_RANDOM, ng_hci_lp_con_cfm(), ng_hci_lp_con_ind(), NG_HCI_M_PULLUP, ng_hci_new_con(), and ng_hci_unit_con::state.
Referenced by le_event().
|
static |
Definition at line 567 of file ng_hci_evnt.c.
References event, and NG_FREE_M.
Referenced by le_event().
|
static |
Definition at line 577 of file ng_hci_evnt.c.
References event, le_advertizing_report(), le_connection_complete(), le_connection_update(), NG_FREE_M, NG_HCI_LEEV_ADVREP, NG_HCI_LEEV_CON_COMPL, NG_HCI_LEEV_CON_UPDATE_COMPL, NG_HCI_LEEV_LONG_TERM_KEY_REQUEST, NG_HCI_LEEV_READ_REMOTE_FEATURES_COMPL, and NG_HCI_M_PULLUP.
Referenced by ng_hci_process_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().
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().
void ng_hci_send_data | ( | ng_hci_unit_p | unit | ) |
Definition at line 217 of file ng_hci_evnt.c.
References ng_hci_unit::buffer, count, NG_HCI_BUFF_ACL_AVAIL, NG_HCI_BUFF_ACL_USE, NG_HCI_BUFF_SCO_AVAIL, NG_HCI_BUFF_SCO_USE, NG_HCI_INFO, NG_HCI_LINK_ACL, NG_HCI_LINK_SCO, NG_HCI_STAT_ACL_SENT, NG_HCI_STAT_SCO_SENT, NG_NODE_NAME, ng_hci_unit::node, send_data_packets(), and ng_hci_unit::stat.
Referenced by ng_hci_acl_rcvdata(), ng_hci_sco_rcvdata(), and num_compl_pkts().
|
static |
Definition at line 1122 of file ng_hci_evnt.c.
References ng_hci_unit::buffer, ng_hci_unit_con::con_handle, event, ng_hci_unit_con::link_type, NG_FREE_M, NG_HCI_ALERT, NG_HCI_BUFF_ACL_FREE, NG_HCI_BUFF_SCO_FREE, ng_hci_con_by_handle(), NG_HCI_CON_HANDLE, NG_HCI_LINK_SCO, NG_HCI_M_PULLUP, ng_hci_send_data(), NG_HCI_WARN, NG_NODE_NAME, ng_hci_unit::node, and ng_hci_unit_con::pending.
Referenced by ng_hci_process_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().
|
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().
|
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().
|
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().
|
static |
Definition at line 1235 of file ng_hci_evnt.c.
References ng_hci_neighbor::addrtype, ng_hci_unit_con::bdaddr, ng_hci_neighbor::bdaddr, ng_hci_neighbor::clock_offset, event, NG_FREE_M, NG_HCI_ALERT, ng_hci_con_by_handle(), NG_HCI_CON_HANDLE, NG_HCI_ERR, ng_hci_get_neighbor(), NG_HCI_LINK_ACL, NG_HCI_M_PULLUP, ng_hci_new_neighbor(), NG_NODE_NAME, ng_hci_unit::node, and ng_hci_neighbor::updated.
Referenced by ng_hci_process_event().
|
static |
Definition at line 977 of file ng_hci_evnt.c.
References ng_hci_neighbor::addrtype, ng_hci_unit_con::bdaddr, ng_hci_neighbor::bdaddr, event, ng_hci_neighbor::features, NG_FREE_M, NG_HCI_ALERT, ng_hci_con_by_handle(), NG_HCI_CON_HANDLE, NG_HCI_ERR, ng_hci_get_neighbor(), NG_HCI_LINK_ACL, NG_HCI_M_PULLUP, ng_hci_new_neighbor(), NG_NODE_NAME, ng_hci_unit::node, and ng_hci_neighbor::updated.
Referenced by ng_hci_process_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().
|
static |
Definition at line 253 of file ng_hci_evnt.c.
References ng_hci_unit_con::conq, ng_hci_unit::drv, ng_hci_unit_con::link_type, NG_BT_ITEMQ_DEQUEUE, NG_BT_ITEMQ_LEN, NG_FREE_ITEM, NG_FWD_ITEM_HOOK, NG_HCI_ERR, NG_HCI_HOOK_DRV, NG_HCI_INFO, NG_HCI_LINK_ACL, NG_HCI_LINK_SCO, ng_hci_mtap(), NG_HCI_STAT_BYTES_SENT, NG_HCI_UNIT_READY, NG_HOOK_IS_VALID, NG_NODE_NAME, NGI_M, ng_hci_unit::node, ng_hci_unit_con::pending, ng_hci_unit::stat, ng_hci_unit::state, and sync_con_queue().
Referenced by ng_hci_send_data().
|
static |
Definition at line 351 of file ng_hci_evnt.c.
References ng_hci_unit::acl, ng_hci_unit_con::con_handle, ng_mesg::data, ng_hci_unit_con::link_type, NG_HCI_LINK_SCO, NG_HOOK_NOT_VALID, NG_MKMESSAGE, NG_SEND_MSG_HOOK, NGM_HCI_COOKIE, NGM_HCI_SYNC_CON_QUEUE, ng_hci_unit::node, and ng_hci_unit::sco.
Referenced by send_data_packets().