0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #ifndef __HCI_SOCK_H
0026 #define __HCI_SOCK_H
0027
0028
0029 #define HCI_DATA_DIR 1
0030 #define HCI_FILTER 2
0031 #define HCI_TIME_STAMP 3
0032
0033
0034 #define HCI_CMSG_DIR 0x01
0035 #define HCI_CMSG_TSTAMP 0x02
0036
0037 struct sockaddr_hci {
0038 sa_family_t hci_family;
0039 unsigned short hci_dev;
0040 unsigned short hci_channel;
0041 };
0042 #define HCI_DEV_NONE 0xffff
0043
0044 #define HCI_CHANNEL_RAW 0
0045 #define HCI_CHANNEL_USER 1
0046 #define HCI_CHANNEL_MONITOR 2
0047 #define HCI_CHANNEL_CONTROL 3
0048 #define HCI_CHANNEL_LOGGING 4
0049
0050 struct hci_filter {
0051 unsigned long type_mask;
0052 unsigned long event_mask[2];
0053 __le16 opcode;
0054 };
0055
0056 struct hci_ufilter {
0057 __u32 type_mask;
0058 __u32 event_mask[2];
0059 __le16 opcode;
0060 };
0061
0062 #define HCI_FLT_TYPE_BITS 31
0063 #define HCI_FLT_EVENT_BITS 63
0064 #define HCI_FLT_OGF_BITS 63
0065 #define HCI_FLT_OCF_BITS 127
0066
0067
0068 #define HCIDEVUP _IOW('H', 201, int)
0069 #define HCIDEVDOWN _IOW('H', 202, int)
0070 #define HCIDEVRESET _IOW('H', 203, int)
0071 #define HCIDEVRESTAT _IOW('H', 204, int)
0072
0073 #define HCIGETDEVLIST _IOR('H', 210, int)
0074 #define HCIGETDEVINFO _IOR('H', 211, int)
0075 #define HCIGETCONNLIST _IOR('H', 212, int)
0076 #define HCIGETCONNINFO _IOR('H', 213, int)
0077 #define HCIGETAUTHINFO _IOR('H', 215, int)
0078
0079 #define HCISETRAW _IOW('H', 220, int)
0080 #define HCISETSCAN _IOW('H', 221, int)
0081 #define HCISETAUTH _IOW('H', 222, int)
0082 #define HCISETENCRYPT _IOW('H', 223, int)
0083 #define HCISETPTYPE _IOW('H', 224, int)
0084 #define HCISETLINKPOL _IOW('H', 225, int)
0085 #define HCISETLINKMODE _IOW('H', 226, int)
0086 #define HCISETACLMTU _IOW('H', 227, int)
0087 #define HCISETSCOMTU _IOW('H', 228, int)
0088
0089 #define HCIBLOCKADDR _IOW('H', 230, int)
0090 #define HCIUNBLOCKADDR _IOW('H', 231, int)
0091
0092 #define HCIINQUIRY _IOR('H', 240, int)
0093
0094
0095 struct hci_dev_stats {
0096 __u32 err_rx;
0097 __u32 err_tx;
0098 __u32 cmd_tx;
0099 __u32 evt_rx;
0100 __u32 acl_tx;
0101 __u32 acl_rx;
0102 __u32 sco_tx;
0103 __u32 sco_rx;
0104 __u32 byte_rx;
0105 __u32 byte_tx;
0106 };
0107
0108 struct hci_dev_info {
0109 __u16 dev_id;
0110 char name[8];
0111
0112 bdaddr_t bdaddr;
0113
0114 __u32 flags;
0115 __u8 type;
0116
0117 __u8 features[8];
0118
0119 __u32 pkt_type;
0120 __u32 link_policy;
0121 __u32 link_mode;
0122
0123 __u16 acl_mtu;
0124 __u16 acl_pkts;
0125 __u16 sco_mtu;
0126 __u16 sco_pkts;
0127
0128 struct hci_dev_stats stat;
0129 };
0130
0131 struct hci_conn_info {
0132 __u16 handle;
0133 bdaddr_t bdaddr;
0134 __u8 type;
0135 __u8 out;
0136 __u16 state;
0137 __u32 link_mode;
0138 };
0139
0140 struct hci_dev_req {
0141 __u16 dev_id;
0142 __u32 dev_opt;
0143 };
0144
0145 struct hci_dev_list_req {
0146 __u16 dev_num;
0147 struct hci_dev_req dev_req[];
0148 };
0149
0150 struct hci_conn_list_req {
0151 __u16 dev_id;
0152 __u16 conn_num;
0153 struct hci_conn_info conn_info[];
0154 };
0155
0156 struct hci_conn_info_req {
0157 bdaddr_t bdaddr;
0158 __u8 type;
0159 struct hci_conn_info conn_info[];
0160 };
0161
0162 struct hci_auth_info_req {
0163 bdaddr_t bdaddr;
0164 __u8 type;
0165 };
0166
0167 struct hci_inquiry_req {
0168 __u16 dev_id;
0169 __u16 flags;
0170 __u8 lap[3];
0171 __u8 length;
0172 __u8 num_rsp;
0173 };
0174 #define IREQ_CACHE_FLUSH 0x0001
0175
0176 #endif