Index: ng_hci.h =================================================================== RCS file: /home/ncvs/src/sys/netgraph/bluetooth/include/ng_hci.h,v retrieving revision 1.6 diff -u -r1.6 ng_hci.h --- ng_hci.h 7 Jan 2005 01:45:43 -0000 1.6 +++ ng_hci.h 20 Feb 2006 12:07:52 -0000 #define NG_HCI_CLASS_SIZE 3 /* unit class */ #define NG_HCI_FEATURES_SIZE 8 /* LMP features */ #define NG_HCI_UNIT_NAME_SIZE 248 /* unit name size */ +#define NG_HCI_COMMANDS_SIZE 64 /* commands */ +#define NG_HCI_AFH_CHANNEL_MAP_SIZE 10 /* AFH channel map */ /* HCI specification */ -#define NG_HCI_SPEC_V10 0x00 /* v1.0 */ +#define NG_HCI_SPEC_V10 0x00 /* v1.0b */ #define NG_HCI_SPEC_V11 0x01 /* v1.1 */ -/* 0x02 - 0xFF - reserved for future use */ +#define NG_HCI_SPEC_V12 0x02 /* v1.2 */ +#define NG_HCI_SPEC_V20 0x03 /* v2.0 */ +/* 0x04 - 0xFF - reserved for future use */ /* LMP features */ /* ------------------- byte 0 --------------------*/ @@ -111,6 +115,23 @@ #define NG_HCI_LMP_FLOW_CONTROL_LAG0 0x10 #define NG_HCI_LMP_FLOW_CONTROL_LAG1 0x20 #define NG_HCI_LMP_FLOW_CONTROL_LAG2 0x40 +#define NG_HCI_LMP_BROADCAST_ENCRYPTION 0x80 +/* ------------------- byte 3 --------------------*/ +#define NG_HCI_LMP_ENHANCED_INQUIRY_SCAN 0x08 +#define NG_HCI_LMP_INTERLACED_INQUIRY_SCAN 0x10 +#define NG_HCI_LMP_INTERLACED_PAGE_SCAN 0x20 +#define NG_HCI_LMP_RSSI_INQUIRY 0x40 +#define NG_HCI_LMP_EXT_SCO 0x80 +/* ------------------- byte 4 --------------------*/ +#define NG_HCI_LMP_EV4 0x01 +#define NG_HCI_LMP_EV5 0x02 +#define NG_HCI_LMP_AFH_CAPABLE_SLAVE 0x08 +#define NG_HCI_LMP_AFH_CLASSIFICATION_SLAVE 0x10 +/* ------------------- byte 5 --------------------*/ +#define NG_HCI_LMP_AFH_CAPABLE_MASTER 0x08 +#define NG_HCI_LMP_AFH_CLASSIFICATION_MASTER 0x10 +/* ------------------- byte 7 --------------------*/ +#define NG_HCI_LMP_EXT_FEATURES 0x80 /* Link types */ #define NG_HCI_LINK_SCO 0x00 /* Voice */ @@ -145,6 +166,16 @@ #define NG_HCI_UNIT_MODE_PARK 0x03 /* 0x04 - 0xFF - reserved for future use */ +/* Inquiry scan type */ +#define NG_HCI_STANDARD_SCAN 0x00 +#define NG_HCI_INTERLACED_SCAN 0x01 +/* 0x02 - 0xFF - reserved for future use */ + +/* Inquiry mode */ +#define NG_HCI_STANDARD_INQUIRY_RESULT 0x00 +#define NG_HCI_RSSI_INQUIRY_RESULT 0x01 +/* 0x02 - 0xFF - reserved for future use */ + /* Page scan modes */ #define NG_HCI_MANDATORY_PAGE_SCAN_MODE 0x00 #define NG_HCI_OPTIONAL_PAGE_SCAN_MODE1 0x01 @@ -171,13 +202,6 @@ #define NG_HCI_INQUIRY_ENABLE_PAGE_ENABLE 0x03 /* 0x04 - 0xFF - reserved for future use */ -/* Hold mode activities */ -#define NG_HCI_HOLD_MODE_NO_CHANGE 0x00 -#define NG_HCI_HOLD_MODE_SUSPEND_PAGE_SCAN 0x01 -#define NG_HCI_HOLD_MODE_SUSPEND_INQUIRY_SCAN 0x02 -#define NG_HCI_HOLD_MODE_SUSPEND_PERIOD_INQUIRY 0x04 -/* 0x08 - 0x80 - reserved for future use */ - /* Connection roles */ #define NG_HCI_ROLE_MASTER 0x00 #define NG_HCI_ROLE_SLAVE 0x01 @@ -210,6 +234,18 @@ #define NG_HCI_SERVICE_TYPE_GUARANTEED 0x02 /* 0x03 - 0xFF - reserved for future use */ +/* Authentication */ +#define NG_HCI_AUTH_NONE 0x00 +#define NG_HCI_AUTH_ALL 0x01 +/* 0x02 - 0xFF - reserved for future use */ + +/* Hold mode activities */ +#define NG_HCI_HOLD_MODE_NO_CHANGE 0x00 +#define NG_HCI_HOLD_MODE_SUSPEND_PAGE_SCAN 0x01 +#define NG_HCI_HOLD_MODE_SUSPEND_INQUIRY_SCAN 0x02 +#define NG_HCI_HOLD_MODE_SUSPEND_PERIOD_INQUIRY 0x04 +/* 0x08 - 0x80 - reserved for future use */ + /* Link policy settings */ #define NG_HCI_LINK_POLICY_DISABLE_ALL_LM_MODES 0x0000 #define NG_HCI_LINK_POLICY_ENABLE_ROLE_SWITCH 0x0001 /* Master/Slave switch */ @@ -218,8 +254,148 @@ #define NG_HCI_LINK_POLICY_ENABLE_PARK_MODE 0x0008 /* 0x0010 - 0x8000 - reserved for future use */ +/* Synchronous flow control */ +#define NG_HCI_SYNCHRONOUS_FLOW_DISABLED 0x00 +#define NG_HCI_SYNCHRONOUS_FLOW_ENABLED 0x01 + +/* Supported commands */ +/* ------------------- byte 0 --------------------*/ +#define NG_HCI_CMD_INQUIRY 0x01 +#define NG_HCI_CMD_INQUIRY_CANCEL 0x02 +#define NG_HCI_CMD_PERIODIC_INQUIRY 0x04 +#define NG_HCI_CMD_EXIT_PERIODIC_INQUIRY 0x08 +#define NG_HCI_CMD_CREATE_CON 0x10 +#define NG_HCI_CMD_DISCON 0x20 +#define NG_HCI_CMD_ADD_SCO_CON 0x40 +#define NG_HCI_CMD_CREATE_CON_CANCEL 0x80 +/* ------------------- byte 1 --------------------*/ +#define NG_HCI_CMD_ACCEPT_CON 0x01 +#define NG_HCI_CMD_REJECT_CON 0x02 +#define NG_HCI_CMD_LINK_KEY_REP 0x04 +#define NG_HCI_CMD_LINK_KEY_NEG_REP 0x08 +#define NG_HCI_CMD_PIN_CODE_REP 0x10 +#define NG_HCI_CMD_PIN_CODE_NEG_REP 0x20 +#define NG_HCI_CMD_CHANGE_CON_PKT_TYPE 0x40 +#define NG_HCI_CMD_AUTH_REQ 0x80 +/* ------------------- byte 2 --------------------*/ +#define NG_HCI_CMD_SET_CON_ENCRYPTION 0x01 +#define NG_HCI_CMD_CHANGE_CON_LINK_KEY 0x02 +#define NG_HCI_CMD_MASTER_LINK_KEY 0x04 +#define NG_HCI_CMD_REMOTE_NAME_REQ 0x08 +#define NG_HCI_CMD_REMOTE_NAME_REQ_CANCEL 0x10 +#define NG_HCI_CMD_READ_REMOTE_FEATURES 0x20 +#define NG_HCI_CMD_READ_REMOTE_EXT_FEATURES 0x40 +#define NG_HCI_CMD_READ_REMOTE_VER_INFO 0x80 +/* ------------------- byte 3 --------------------*/ +#define NG_HCI_CMD_READ_CLOCK_OFFSET 0x01 +#define NG_HCI_CMD_READ_LMP_HANDLE 0x02 +/* ------------------- byte 4 --------------------*/ +#define NG_HCI_CMD_HOLD_MODE 0x02 +#define NG_HCI_CMD_SNIFF_MODE 0x04 +#define NG_HCI_CMD_EXIT_SNIFF_MODE 0x08 +#define NG_HCI_CMD_PARK_MODE 0x10 +#define NG_HCI_CMD_EXIT_PARK_MODE 0x20 +#define NG_HCI_CMD_QOS_SETUP 0x40 +#define NG_HCI_CMD_ROLE_DISCOVERY 0x80 +/* ------------------- byte 5 --------------------*/ +#define NG_HCI_CMD_SWITCH_ROLE 0x01 +#define NG_HCI_CMD_READ_LINK_POLICY_SETTINGS 0x02 +#define NG_HCI_CMD_WRITE_LINK_POLICY_SETTINGS 0x04 +#define NG_HCI_CMD_READ_DEFAULT_LINK_POLICY_SETTINGS 0x08 +#define NG_HCI_CMD_WRITE_DEFAULT_LINK_POLICY_SETTINGS 0x10 +#define NG_HCI_CMD_FLOW_SPEC 0x20 +#define NG_HCI_CMD_SET_EVENT_MASK 0x40 +#define NG_HCI_CMD_RESET 0x80 +/* ------------------- byte 6 --------------------*/ +#define NG_HCI_CMD_SET_EVENT_FILTER 0x01 +#define NG_HCI_CMD_FLUSH 0x02 +#define NG_HCI_CMD_READ_PIN_TYPE 0x04 +#define NG_HCI_CMD_WRITE_PIN_TYPE 0x08 +#define NG_HCI_CMD_CREATE_NEW_UNIT_KEY 0x10 +#define NG_HCI_CMD_READ_STORED_LINK_KEY 0x20 +#define NG_HCI_CMD_WRITE_STORED_LINK_KEY 0x40 +#define NG_HCI_CMD_DELETE_STORED_LINK_KEY 0x80 +/* ------------------- byte 7 --------------------*/ +#define NG_HCI_CMD_CHANGE_LOCAL_NAME 0x01 +#define NG_HCI_CMD_READ_LOCAL_NAME 0x02 +#define NG_HCI_CMD_READ_CON_ACCEPT_TIMO 0x04 +#define NG_HCI_CMD_WRITE_CON_ACCEPT_TIMO 0x08 +#define NG_HCI_CMD_READ_PAGE_TIMO 0x10 +#define NG_HCI_CMD_WRITE_PAGE_TIMO 0x20 +#define NG_HCI_CMD_READ_SCAN_ENABLE 0x40 +#define NG_HCI_CMD_WRITE_SCAN_ENABLE 0x80 +/* ------------------- byte 8 --------------------*/ +#define NG_HCI_CMD_READ_PAGE_SCAN_ACTIVITY 0x01 +#define NG_HCI_CMD_WRITE_PAGE_SCAN_ACTIVITY 0x02 +#define NG_HCI_CMD_READ_INQUIRY_SCAN_ACTIVITY 0x04 +#define NG_HCI_CMD_WRITE_INQUIRY_SCAN_ACTIVITY 0x08 +#define NG_HCI_CMD_READ_AUTH_ENABLE 0x10 +#define NG_HCI_CMD_WRITE_AUTH_ENABLE 0x20 +#define NG_HCI_CMD_READ_ENCRYPTION_MODE 0x40 +#define NG_HCI_CMD_WRITE_ENCRYPTION_MODE 0x80 +/* ------------------- byte 9 --------------------*/ +#define NG_HCI_CMD_READ_UNIT_CLASS 0x01 +#define NG_HCI_CMD_WRITE_UNIT_CLASS 0x02 +#define NG_HCI_CMD_READ_VOICE_SETTINGS 0x04 +#define NG_HCI_CMD_WRITE_VOICE_SETTINGS 0x08 +#define NG_HCI_CMD_READ_AUTO_FLUSH_TIMO 0x10 +#define NG_HCI_CMD_WRITE_AUTO_FLUSH_TIMO 0x20 +#define NG_HCI_CMD_READ_NUM_BROADCAST_RETRANS 0x40 +#define NG_HCI_CMD_WRITE_NUM_BROADCAST_RETRANS 0x80 +/* ------------------- byte 10 -------------------*/ +#define NG_HCI_CMD_READ_HOLD_MODE_ACTIVITY 0x01 +#define NG_HCI_CMD_WRITE_HOLD_MODE_ACTIVITY 0x02 +#define NG_HCI_CMD_READ_XMIT_LEVEL 0x04 +#define NG_HCI_CMD_READ_SCO_FLOW_CONTROL 0x08 +#define NG_HCI_CMD_WRITE_SCO_FLOW_CONTROL 0x10 +#define NG_HCI_CMD_H2HC_FLOW_CONTROL 0x20 +#define NG_HCI_CMD_HOST_BUFFER_SIZE 0x40 +#define NG_HCI_CMD_HOST_NUM_COMPL_PKTS 0x80 +/* ------------------- byte 11 -------------------*/ +#define NG_HCI_CMD_READ_LINK_SUPERVISION_TIMO 0x01 +#define NG_HCI_CMD_WRITE_LINK_SUPERVISION_TIMO 0x02 +#define NG_HCI_CMD_READ_SUPPORTED_IAC_NUM 0x04 +#define NG_HCI_CMD_READ_IAC_LAP 0x08 +#define NG_HCI_CMD_WRITE_IAC_LAP 0x10 +#define NG_HCI_CMD_READ_PAGE_SCAN_PERIOD_MODE 0x20 +#define NG_HCI_CMD_WRITE_PAGE_SCAN_PERIOD_MODE 0x40 +#define NG_HCI_CMD_READ_PAGE_SCAN_MODE 0x80 +/* ------------------- byte 12 -------------------*/ +#define NG_HCI_CMD_WRITE_PAGE_SCAN_MODE 0x01 +#define NG_HCI_CMD_SET_AFH_CHAN_CLASSIFICATION 0x02 +#define NG_HCI_CMD_READ_INQUIRY_SCAN_TYPE 0x10 +#define NG_HCI_CMD_WRITE_INQUIRY_SCAN_TYPE 0x20 +#define NG_HCI_CMD_READ_INQUIRY_MODE 0x40 +#define NG_HCI_CMD_WRITE_INQUIRY_MODE 0x80 +/* ------------------- byte 13 -------------------*/ +#define NG_HCI_CMD_READ_PAGE_SCAN_TYPE 0x01 +#define NG_HCI_CMD_WRITE_PAGE_SCAN_TYPE 0x02 +#define NG_HCI_CMD_READ_AFH_CHAN_ASSESSMENT_MODE 0x04 +#define NG_HCI_CMD_WRITE_AFH_CHAN_ASSESSMENT_MODE 0x08 +/* ------------------- byte 14 -------------------*/ +#define NG_HCI_CMD_READ_LOCAL_VER 0x08 +#define NG_HCI_CMD_READ_LOCAL_FEATURES 0x20 +#define NG_HCI_CMD_READ_LOCAL_EXT_FEATURES 0x40 +#define NG_HCI_CMD_READ_BUFFER_SIZE 0x80 +/* ------------------- byte 15 -------------------*/ +#define NG_HCI_CMD_READ_COUNTRY_CODE 0x01 +#define NG_HCI_CMD_READ_BDADDR 0x02 +#define NG_HCI_CMD_READ_FAILED_CONTACT_CNTR 0x04 +#define NG_HCI_CMD_RESET_FAILED_CONTACT_CNTR 0x08 +#define NG_HCI_CMD_GET_LINK_QUALITY 0x10 +#define NG_HCI_CMD_READ_RSSI 0x20 +#define NG_HCI_CMD_READ_AFH_CHANNEL_MAP 0x40 +#define NG_HCI_CMD_READ_BD_CLOCK 0x80 +/* ------------------- byte 16 -------------------*/ +#define NG_HCI_CMD_READ_LOOKBACK_MODE 0x01 +#define NG_HCI_CMD_WRITE_LOOKBACK_MODE 0x02 +#define NG_HCI_CMD_ENABLE_UNIT_UNDER_TEST 0x04 +#define NG_HCI_CMD_SETUP_SCO_CON 0x08 +#define NG_HCI_CMD_ACCEPT_SCO_CON 0x10 +#define NG_HCI_CMD_REJECT_SCO_CON 0x20 + /* Event masks */ -#define NG_HCI_EVMSK_ALL 0x00000000ffffffff +#define NG_HCI_EVMSK_ALL 0x00001fffffffffff #define NG_HCI_EVMSK_NONE 0x0000000000000000 #define NG_HCI_EVMSK_INQUIRY_COMPL 0x0000000000000001 #define NG_HCI_EVMSK_INQUIRY_RESULT 0x0000000000000002 @@ -253,7 +429,13 @@ #define NG_HCI_EVMSK_QOS_VIOLATION 0x0000000020000000 #define NG_HCI_EVMSK_PAGE_SCAN_MODE_CHANGE 0x0000000040000000 #define NG_HCI_EVMSK_PAGE_SCAN_REP_MODE_CHANGE 0x0000000080000000 -/* 0x0000000100000000 - 0x8000000000000000 - reserved for future use */ +#define NG_HCI_EVMSK_FLOW_SPEC_COMPL 0x0000000100000000 +#define NG_HCI_EVMSK_INQUIRY_RESULT_RSSI 0x0000000200000000 +#define NG_HCI_EVMSK_READ_REMOTE_EXT_FEATURES_COMPL 0x0000000400000000 +/* 0x0000000800000000 - 0x0000040000000000 - reserved */ +#define NG_HCI_EVMSK_SCO_CON_COMPL 0x0000080000000000 +#define NG_HCI_EVMSK_SCO_CON_CHANGE 0x0000100000000000 +/* 0x0000100000000000 - 0xFFFFE00000000000 - reserved for future use */ /* Filter types */ #define NG_HCI_FILTER_TYPE_NONE 0x00 @@ -664,6 +846,16 @@ } __attribute__ ((packed)) ng_hci_add_sco_con_cp; /* No return parameter(s) */ +#define NG_HCI_OCF_CREATE_CON_CANCEL 0x0008 +typedef struct { + bdaddr_t bdaddr; /* remote address */ +} __attribute__ ((packed)) ng_hci_create_con_cancel_cp; + +typedef struct { + u_int8_t status; /* 0x00 - success */ + bdaddr_t bdaddr; /* unit address */ +} __attribute__ ((packed)) ng_hci_create_con_cancel_rp; + #define NG_HCI_OCF_ACCEPT_CON 0x0009 typedef struct { bdaddr_t bdaddr; /* address of unit to be connected */ @@ -762,24 +954,84 @@ } __attribute__ ((packed)) ng_hci_remote_name_req_cp; /* No return parameter(s) */ +#define NG_HCI_OCF_REMOTE_NAME_REQ_CANCEL 0x001a +typedef struct { + bdaddr_t bdaddr; /* remote address */ +} __attribute__ ((packed)) ng_hci_remote_name_req_cancel_cp; + +typedef struct { + u_int8_t status; /* 0x00 - success */ + bdaddr_t bdaddr; /* unit address */ +} __attribute__ ((packed)) ng_hci_remote_name_req_cancel_rp; + #define NG_HCI_OCF_READ_REMOTE_FEATURES 0x001b typedef struct { u_int16_t con_handle; /* connection handle */ } __attribute__ ((packed)) ng_hci_read_remote_features_cp; /* No return parameter(s) */ +#define NG_HCI_OCF_READ_REMOTE_EXT_FEATURES 0x001c +typedef struct { + u_int16_t con_handle; /* connection handle */ + u_int8_t page; /* page number of features */ +} __attribute__ ((packed)) ng_hci_read_remote_ext_features_cp; +/* No return parameter(s) */ + #define NG_HCI_OCF_READ_REMOTE_VER_INFO 0x001d typedef struct { u_int16_t con_handle; /* connection handle */ } __attribute__ ((packed)) ng_hci_read_remote_ver_info_cp; /* No return parameter(s) */ -#define NG_HCI_OCF_READ_CLOCK_OFFSET 0x001f +#define NG_HCI_OCF_READ_CLOCK_OFFSET 0x001f typedef struct { u_int16_t con_handle; /* connection handle */ } __attribute__ ((packed)) ng_hci_read_clock_offset_cp; /* No return parameter(s) */ +#define NG_HCI_OCF_READ_LMP_HANDLE 0x0020 +typedef struct { + u_int16_t con_handle; /* connection handle */ +} __attribute__ ((packed)) ng_hci_read_lmp_handle_cp; + +typedef struct { + u_int8_t status; /* 0x00 - success */ + u_int16_t con_handle; /* connection handle */ + u_int8_t lmp_handle; /* lmp handle */ + u_int32_t reserved; /* reserved for future use */ +} __attribute__ ((packed)) ng_hci_read_lmp_handle_rp; + +#define NG_HCI_OCF_SETUP_SCO_CON 0x0028 +typedef struct { + u_int16_t con_handle; /* connection handle */ + u_int32_t tx_bandwidth; /* transmit bandwidth in byte/s */ + u_int32_t rx_bandwidth; /* receive bandwidth in byte/s */ + u_int16_t max_latency; /* max latency */ + u_int16_t voice_setting; /* voice setting */ + u_int8_t retrans_effort; /* retransmission effort */ + u_int16_t pkt_type; /* packet type */ +} __attribute__ ((packed)) ng_hci_setup_sync_con_cp; +/* No return parameter(s) */ + +#define NG_HCI_OCF_ACCEPT_SCO_CON_REQ 0x0029 +typedef struct { + bdaddr_t bdaddr; /* remote address */ + u_int32_t tx_bandwidth; /* max transmit bandwidth in byte/s */ + u_int32_t rx_bandwidth; /* max receive bandwidth in byte/s */ + u_int16_t max_latency; /* max latency */ + u_int16_t content_format; /* content format */ + u_int8_t retrans_effort; /* retransmission effort */ + u_int16_t pkt_type; /* packet type */ +} __attribute__ ((packed)) ng_hci_accept_sync_con_req_cp; +/* No return parameter(s) */ + +#define NG_HCI_OCF_REJECT_SCO_CON_REQ 0x002a +typedef struct { + bdaddr_t bdaddr; /* remote address */ + u_int8_t reason; /* reason to reject */ +} __attribute__ ((packed)) ng_hci_reject_sync_con_req_cp; +/* No return parameter(s) */ + /************************************************************************** ************************************************************************** ** Link policy commands and return parameters @@ -878,6 +1130,36 @@ u_int16_t con_handle; /* connection handle */ } __attribute__ ((packed)) ng_hci_write_link_policy_settings_rp; +#define NG_HCI_OCF_READ_DEFAULT_LINK_POLICY_SETTINGS 0x000e +/* No command parameter(s) */ +typedef struct { + u_int8_t status; /* 0x00 - success */ + u_int16_t settings; /* link policy settings */ +} __attribute__ ((packed)) ng_hci_read_default_link_policy_settings_rp; + +#define NG_HCI_OCF_WRITE_DEFAULT_LINK_POLICY_SETTINGS 0x000f +typedef struct { + u_int16_t settings; /* link policy settings */ +} __attribute__ ((packed)) ng_hci_write_default_link_policy_settings_cp; + +typedef struct { + u_int8_t status; /* 0x00 - success */ +} __attribute__ ((packed)) ng_hci_write_default_link_policy_settings_rp; + +#define NG_HCI_OCF_FLOW_SPEC 0x0010 +typedef struct { + u_int16_t con_handle; /* connection handle */ + u_int8_t flags; /* reserved for future use */ + u_int8_t flow_direction; /* flow direction */ + u_int8_t service_type; /* service type */ + u_int32_t token_rate; /* token rate in byte/s */ + u_int32_t token_bucket_size; /* token bucket size in bytes */ + u_int32_t peak_bandwidth; /* peak bandwidth in byte/s */ + u_int32_t latency; /* access latency */ +} __attribute__ ((packed)) ng_hci_flow_spec_cp; +/* No return parameter(s) */ + + /************************************************************************** ************************************************************************** ** Host controller and baseband commands and return parameters @@ -1263,33 +1545,96 @@ typedef ng_hci_status_rp ng_hci_write_iac_lap_rp; -#define NG_HCI_OCF_READ_PAGE_SCAN_PERIOD 0x003b +#define NG_HCI_OCF_READ_PAGE_SCAN_PERIOD_MODE 0x003b /* No command parameter(s) */ typedef struct { u_int8_t status; /* 0x00 - success */ u_int8_t page_scan_period_mode; /* Page scan period mode */ -} __attribute__ ((packed)) ng_hci_read_page_scan_period_rp; +} __attribute__ ((packed)) ng_hci_read_page_scan_period_mode_rp; -#define NG_HCI_OCF_WRITE_PAGE_SCAN_PERIOD 0x003c +#define NG_HCI_OCF_WRITE_PAGE_SCAN_PERIOD_MODE 0x003c typedef struct { u_int8_t page_scan_period_mode; /* Page scan period mode */ -} __attribute__ ((packed)) ng_hci_write_page_scan_period_cp; +} __attribute__ ((packed)) ng_hci_write_page_scan_period_mode_cp; -typedef ng_hci_status_rp ng_hci_write_page_scan_period_rp; +typedef ng_hci_status_rp ng_hci_write_page_scan_period_mode_rp; -#define NG_HCI_OCF_READ_PAGE_SCAN 0x003d +#define NG_HCI_OCF_READ_PAGE_SCAN_MODE 0x003d /* No command parameter(s) */ typedef struct { u_int8_t status; /* 0x00 - success */ u_int8_t page_scan_mode; /* Page scan mode */ -} __attribute__ ((packed)) ng_hci_read_page_scan_rp; +} __attribute__ ((packed)) ng_hci_read_page_scan_mode_rp; -#define NG_HCI_OCF_WRITE_PAGE_SCAN 0x003e +#define NG_HCI_OCF_WRITE_PAGE_SCAN_MODE 0x003e typedef struct { u_int8_t page_scan_mode; /* Page scan mode */ -} __attribute__ ((packed)) ng_hci_write_page_scan_cp; +} __attribute__ ((packed)) ng_hci_write_page_scan_mode_cp; + +typedef ng_hci_status_rp ng_hci_write_page_scan_mode_rp; + +#define NG_HCI_OCF_AFH_HOST_CHAN_CLASSIFICATION 0x003f +typedef struct { + u_int8_t afh_host_chan_classification[NG_HCI_AFH_CHANNEL_MAP_SIZE]; +} __attribute__ ((packed)) ng_hci_afh_host_chan_classification_cp; + +typedef ng_hci_status_rp ng_hci_afh_host_chan_classification_rp; + +#define NG_HCI_OCF_READ_INQUIRY_SCAN_TYPE 0x0042 +/* No command parameter(s) */ +typedef struct { + u_int8_t status; /* 0x00 - success */ + u_int8_t inquiry_scan_type; /* Inquiry scan type */ +} __attribute__ ((packed)) ng_hci_read_inquiry_scan_type_rp; + +#define NG_HCI_OCF_WRITE_INQUIRY_SCAN_TYPE 0x0043 +typedef struct { + u_int8_t inquiry_scan_type; /* Inquiry scan type */ +} __attribute__ ((packed)) ng_hci_write_inquiry_scan_type_cp; + +typedef ng_hci_status_rp ng_hci_write_inquiry_scan_type_rp; + +#define NG_HCI_OCF_READ_INQUIRY_MODE 0x0044 +/* No command parameter(s) */ +typedef struct { + u_int8_t status; /* 0x00 - success */ + u_int8_t inquiry_mode; /* Inquiry mode */ +} __attribute__ ((packed)) ng_hci_read_inquiry_mode_rp; + +#define NG_HCI_OCF_WRITE_INQUIRY_MODE 0x0045 +typedef struct { + u_int8_t inquiry_mode; /* Inquiry mode */ +} __attribute__ ((packed)) ng_hci_write_inquiry_mode_cp; + +typedef ng_hci_status_rp ng_hci_write_inquiry_mode_rp; + +#define NG_HCI_OCF_READ_PAGE_SCAN_TYPE 0x0046 +/* No command parameter(s) */ +typedef struct { + u_int8_t status; /* 0x00 - success */ + u_int8_t page_scan_type; /* Page scan type */ +} __attribute__ ((packed)) ng_hci_read_page_scan_type_rp; + +#define NG_HCI_OCF_WRITE_PAGE_SCAN_TYPE 0x0047 +typedef struct { + u_int8_t page_scan_type; /* Page scan type */ +} __attribute__ ((packed)) ng_hci_write_page_scan_type_cp; + +typedef ng_hci_status_rp ng_hci_write_page_scan_type_rp; + +#define NG_HCI_OCF_READ_AFH_CHAN_ASSESSMENT_MODE 0x0048 +/* No command parameter(s) */ +typedef struct { + u_int8_t status; /* 0x00 - success */ + u_int8_t afh_chan_assessment_mode; +} __attribute__ ((packed)) ng_hci_read_afh_chan_assessment_mode_rp; + +#define NG_HCI_OCF_WRITE_AFH_CHAN_ASSESSMENT_MODE 0x0049 +typedef struct { + u_int8_t afh_chan_assessment_mode; +} __attribute__ ((packed)) ng_hci_write_afh_chan_assessment_mode_cp; -typedef ng_hci_status_rp ng_hci_write_page_scan_rp; +typedef ng_hci_status_rp ng_hci_write_afh_chan_assessment_mode_rp; /************************************************************************** ************************************************************************** @@ -1301,6 +1646,7 @@ #define NG_HCI_OGF_INFO 0x04 /* OpCode Group Field */ #define NG_HCI_OCF_READ_LOCAL_VER 0x0001 +/* No command parameter(s) */ typedef struct { u_int8_t status; /* 0x00 - success */ u_int8_t hci_version; /* HCI version */ @@ -1310,13 +1656,34 @@ u_int16_t lmp_subversion; /* LMP sub-version */ } __attribute__ ((packed)) ng_hci_read_local_ver_rp; +#define NG_HCI_OCF_READ_LOCAL_COMMANDS 0x0002 +/* No command parameter(s) */ +typedef struct { + u_int8_t status; /* 0x00 - success */ + u_int8_t commands[NG_HCI_COMMANDS_SIZE]; /* commands */ +} __attribute__ ((packed)) ng_hci_read_local_commands_rp; + #define NG_HCI_OCF_READ_LOCAL_FEATURES 0x0003 +/* No command parameter(s) */ typedef struct { u_int8_t status; /* 0x00 - success */ u_int8_t features[NG_HCI_FEATURES_SIZE]; /* LMP features bitmsk*/ } __attribute__ ((packed)) ng_hci_read_local_features_rp; +#define NG_HCI_OCF_READ_LOCAL_EXT_FEATURES 0x0004 +typedef struct { + u_int8_t page; /* Page number */ +} __attribute__ ((packed)) ng_hci_read_local_ext_features_cp; + +typedef struct { + u_int8_t status; /* 0x00 - success */ + u_int8_t page; /* Page number */ + u_int8_t max_page; /* Max. page number */ + u_int8_t features[NG_HCI_FEATURES_SIZE]; /* LMP features bitmsk*/ +} __attribute__ ((packed)) ng_hci_read_local_ext_features_rp; + #define NG_HCI_OCF_READ_BUFFER_SIZE 0x0005 +/* No command parameter(s) */ typedef struct { u_int8_t status; /* 0x00 - success */ u_int16_t max_acl_size; /* Max. size of ACL packet (bytes) */ @@ -1326,12 +1693,14 @@ } __attribute__ ((packed)) ng_hci_read_buffer_size_rp; #define NG_HCI_OCF_READ_COUNTRY_CODE 0x0007 +/* No command parameter(s) */ typedef struct { u_int8_t status; /* 0x00 - success */ u_int8_t country_code; /* 0x00 - NAM, EUR, JP; 0x01 - France */ } __attribute__ ((packed)) ng_hci_read_country_code_rp; #define NG_HCI_OCF_READ_BDADDR 0x0009 +/* No command parameter(s) */ typedef struct { u_int8_t status; /* 0x00 - success */ bdaddr_t bdaddr; /* unit address */ @@ -1388,6 +1757,31 @@ char rssi; /* -127 <= rssi <= 127 dB */ } __attribute__ ((packed)) ng_hci_read_rssi_rp; +#define NG_HCI_OCF_READ_AFH_CHANNEL_MAP 0x0006 +typedef struct { + u_int16_t con_handle; /* connection handle */ +} __attribute__ ((packed)) ng_hci_read_afh_channel_map_cp; + +typedef struct { + u_int8_t status; /* 0x00 - success */ + u_int16_t con_handle; /* connection handle */ + u_int8_t afh_mode; /* 0x00 - disabled */ + u_int8_t afh_channel_map[NG_HCI_AFH_CHANNEL_MAP_SIZE]; /* channel map */ +} __attribute__ ((packed)) ng_hci_read_afh_channel_map_rp; + +#define NG_HCI_OCF_READ_CLOCK 0x0007 +typedef struct { + u_int16_t con_handle; /* connection handle */ + u_int8_t clock; /* which clock */ +} __attribute__ ((packed)) ng_hci_read_clock_cp; + +typedef struct { + u_int8_t status; /* 0x00 - success */ + u_int16_t con_handle; /* connection handle */ + u_int32_t clock; /* clock */ + u_int16_t accuracy; /* n * 0.3125 msec */ +} __attribute__ ((packed)) ng_hci_read_clock_rp; + /************************************************************************** ************************************************************************** ** Testing commands and return parameters @@ -1653,6 +2047,63 @@ u_int8_t page_scan_rep_mode; /* page scan repetition mode */ } __attribute__ ((packed)) ng_hci_page_scan_rep_mode_change_ep; +#define NG_HCI_EVENT_FLOW_SPEC_COMPL 0x21 +typedef struct { + u_int8_t status; /* 0x00 - success */ + u_int16_t con_handle; /* connection handle */ + u_int8_t flags; /* reserved for future use */ + u_int8_t flow_direction; /* flow direction */ + u_int8_t service_type; /* service_type */ + u_int32_t token_rate; /* token rate in byte/s */ + u_int32_t token_bucket_size; /* toke bucket size in byte */ + u_int32_t peak_bandwidth; /* peak bandwidth in byte/s */ + u_int32_t access_latency; /* access latency in msec */ +} __attribute__ ((packed)) ng_hci_flow_spec_compl_ep; + +#define NG_HCI_EVENT_INQUIRY_RESULT_RSSI 0x22 +typedef struct { + u_int8_t num_responses; /* # of responses */ +/* these are repeated "num_responses" times + bdaddr_t bdaddr; --- remote address(es) + u_int8_t page_scan_rep_mode; --- page scan repetition mode + u_int8_t reserved; --- reserved + u_int8_t uclass[NG_HCI_CLASS_SIZE]; --- unit class + u_int16_t clock_offset; --- clock offset + char rssi; --- -127 <= rssi <= 20 dBm */ +} __attribute__ ((packed)) ng_hci_inquiry_result_rssi_ep; + +#define NG_HCI_EVENT_READ_REMOTE_EXT_FEATURES_COMPL 0x23 +typedef struct { + u_int8_t status; /* 0x00 - success */ + u_int16_t con_handle; /* connection handle */ + u_int8_t page; /* page number */ + u_int8_t max_page; /* maximum page number */ + u_int8_t features[NG_HCI_FEATURES_SIZE]; /* ext. LMP features */ +} __attribute__ ((packed)) ng_hci_read_remote_ext_features_compl_ep; + +#define NG_HCI_EVENT_SCO_CON_COMPL 0x2c +typedef struct { + u_int8_t status; /* 0x00 - success */ + u_int16_t con_handle; /* connection handle */ + bdaddr_t bdaddr; /* destination address */ + u_int8_t link_type; /* link type */ + u_int8_t transmission_interval; /* transm. interval in slots */ + u_int8_t retrans_window; /* retransmission window in slots */ + u_int16_t rx_pkt_length; /* rx packet length */ + u_int16_t tx_pkt_length; /* tx packet length */ + u_int8_t air_mode; /* air mode */ +} __attribute__ ((packed)) ng_hci_sco_con_compl_ep; + +#define NG_HCI_EVENT_SCO_CON_CHANGED 0x2d +typedef struct { + u_int8_t status; /* 0x00 - success */ + u_int16_t con_handle; /* connection handle */ + u_int8_t transmission_interval; /* transm. interval in slots */ + u_int8_t retrans_window; /* retransmission window in slots */ + u_int16_t rx_pkt_length; /* rx packet length */ + u_int16_t tx_pkt_length; /* tx packet length */ +} __attribute__ ((packed)) ng_hci_sco_con_changed_ep; + #define NG_HCI_EVENT_BT_LOGO 0xfe #define NG_HCI_EVENT_VENDOR 0xff