aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/hci.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/bluetooth/hci.h')
-rw-r--r--include/net/bluetooth/hci.h224
1 files changed, 224 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 1668211297a9..cdd9f1fe7cfa 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -183,6 +183,15 @@ enum {
183 * during the hdev->setup vendor callback. 183 * during the hdev->setup vendor callback.
184 */ 184 */
185 HCI_QUIRK_NON_PERSISTENT_DIAG, 185 HCI_QUIRK_NON_PERSISTENT_DIAG,
186
187 /* When this quirk is set, setup() would be run after every
188 * open() and not just after the first open().
189 *
190 * This quirk can be set before hci_register_dev is called or
191 * during the hdev->setup vendor callback.
192 *
193 */
194 HCI_QUIRK_NON_PERSISTENT_SETUP,
186}; 195};
187 196
188/* HCI device flags */ 197/* HCI device flags */
@@ -260,6 +269,7 @@ enum {
260 HCI_VENDOR_DIAG, 269 HCI_VENDOR_DIAG,
261 HCI_FORCE_BREDR_SMP, 270 HCI_FORCE_BREDR_SMP,
262 HCI_FORCE_STATIC_ADDR, 271 HCI_FORCE_STATIC_ADDR,
272 HCI_LL_RPA_RESOLUTION,
263 273
264 __HCI_NUM_FLAGS, 274 __HCI_NUM_FLAGS,
265}; 275};
@@ -291,6 +301,14 @@ enum {
291#define HCI_DH3 0x0800 301#define HCI_DH3 0x0800
292#define HCI_DH5 0x8000 302#define HCI_DH5 0x8000
293 303
304/* HCI packet types inverted masks */
305#define HCI_2DH1 0x0002
306#define HCI_3DH1 0x0004
307#define HCI_2DH3 0x0100
308#define HCI_3DH3 0x0200
309#define HCI_2DH5 0x1000
310#define HCI_3DH5 0x2000
311
294#define HCI_HV1 0x0020 312#define HCI_HV1 0x0020
295#define HCI_HV2 0x0040 313#define HCI_HV2 0x0040
296#define HCI_HV3 0x0080 314#define HCI_HV3 0x0080
@@ -354,6 +372,8 @@ enum {
354#define LMP_PCONTROL 0x04 372#define LMP_PCONTROL 0x04
355#define LMP_TRANSPARENT 0x08 373#define LMP_TRANSPARENT 0x08
356 374
375#define LMP_EDR_2M 0x02
376#define LMP_EDR_3M 0x04
357#define LMP_RSSI_INQ 0x40 377#define LMP_RSSI_INQ 0x40
358#define LMP_ESCO 0x80 378#define LMP_ESCO 0x80
359 379
@@ -361,7 +381,9 @@ enum {
361#define LMP_EV5 0x02 381#define LMP_EV5 0x02
362#define LMP_NO_BREDR 0x20 382#define LMP_NO_BREDR 0x20
363#define LMP_LE 0x40 383#define LMP_LE 0x40
384#define LMP_EDR_3SLOT 0x80
364 385
386#define LMP_EDR_5SLOT 0x01
365#define LMP_SNIFF_SUBR 0x02 387#define LMP_SNIFF_SUBR 0x02
366#define LMP_PAUSE_ENC 0x04 388#define LMP_PAUSE_ENC 0x04
367#define LMP_EDR_ESCO_2M 0x20 389#define LMP_EDR_ESCO_2M 0x20
@@ -398,7 +420,12 @@ enum {
398#define HCI_LE_SLAVE_FEATURES 0x08 420#define HCI_LE_SLAVE_FEATURES 0x08
399#define HCI_LE_PING 0x10 421#define HCI_LE_PING 0x10
400#define HCI_LE_DATA_LEN_EXT 0x20 422#define HCI_LE_DATA_LEN_EXT 0x20
423#define HCI_LE_PHY_2M 0x01
424#define HCI_LE_PHY_CODED 0x08
425#define HCI_LE_EXT_ADV 0x10
401#define HCI_LE_EXT_SCAN_POLICY 0x80 426#define HCI_LE_EXT_SCAN_POLICY 0x80
427#define HCI_LE_PHY_2M 0x01
428#define HCI_LE_PHY_CODED 0x08
402#define HCI_LE_CHAN_SEL_ALG2 0x40 429#define HCI_LE_CHAN_SEL_ALG2 0x40
403 430
404/* Connection modes */ 431/* Connection modes */
@@ -1490,6 +1517,16 @@ struct hci_cp_le_write_def_data_len {
1490 __le16 tx_time; 1517 __le16 tx_time;
1491} __packed; 1518} __packed;
1492 1519
1520#define HCI_OP_LE_CLEAR_RESOLV_LIST 0x2029
1521
1522#define HCI_OP_LE_READ_RESOLV_LIST_SIZE 0x202a
1523struct hci_rp_le_read_resolv_list_size {
1524 __u8 status;
1525 __u8 size;
1526} __packed;
1527
1528#define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d
1529
1493#define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f 1530#define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f
1494struct hci_rp_le_read_max_data_len { 1531struct hci_rp_le_read_max_data_len {
1495 __u8 status; 1532 __u8 status;
@@ -1506,6 +1543,134 @@ struct hci_cp_le_set_default_phy {
1506 __u8 rx_phys; 1543 __u8 rx_phys;
1507} __packed; 1544} __packed;
1508 1545
1546#define HCI_LE_SET_PHY_1M 0x01
1547#define HCI_LE_SET_PHY_2M 0x02
1548#define HCI_LE_SET_PHY_CODED 0x04
1549
1550#define HCI_OP_LE_SET_EXT_SCAN_PARAMS 0x2041
1551struct hci_cp_le_set_ext_scan_params {
1552 __u8 own_addr_type;
1553 __u8 filter_policy;
1554 __u8 scanning_phys;
1555 __u8 data[0];
1556} __packed;
1557
1558#define LE_SCAN_PHY_1M 0x01
1559#define LE_SCAN_PHY_2M 0x02
1560#define LE_SCAN_PHY_CODED 0x04
1561
1562struct hci_cp_le_scan_phy_params {
1563 __u8 type;
1564 __le16 interval;
1565 __le16 window;
1566} __packed;
1567
1568#define HCI_OP_LE_SET_EXT_SCAN_ENABLE 0x2042
1569struct hci_cp_le_set_ext_scan_enable {
1570 __u8 enable;
1571 __u8 filter_dup;
1572 __le16 duration;
1573 __le16 period;
1574} __packed;
1575
1576#define HCI_OP_LE_EXT_CREATE_CONN 0x2043
1577struct hci_cp_le_ext_create_conn {
1578 __u8 filter_policy;
1579 __u8 own_addr_type;
1580 __u8 peer_addr_type;
1581 bdaddr_t peer_addr;
1582 __u8 phys;
1583 __u8 data[0];
1584} __packed;
1585
1586struct hci_cp_le_ext_conn_param {
1587 __le16 scan_interval;
1588 __le16 scan_window;
1589 __le16 conn_interval_min;
1590 __le16 conn_interval_max;
1591 __le16 conn_latency;
1592 __le16 supervision_timeout;
1593 __le16 min_ce_len;
1594 __le16 max_ce_len;
1595} __packed;
1596
1597#define HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS 0x203b
1598struct hci_rp_le_read_num_supported_adv_sets {
1599 __u8 status;
1600 __u8 num_of_sets;
1601} __packed;
1602
1603#define HCI_OP_LE_SET_EXT_ADV_PARAMS 0x2036
1604struct hci_cp_le_set_ext_adv_params {
1605 __u8 handle;
1606 __le16 evt_properties;
1607 __u8 min_interval[3];
1608 __u8 max_interval[3];
1609 __u8 channel_map;
1610 __u8 own_addr_type;
1611 __u8 peer_addr_type;
1612 bdaddr_t peer_addr;
1613 __u8 filter_policy;
1614 __u8 tx_power;
1615 __u8 primary_phy;
1616 __u8 secondary_max_skip;
1617 __u8 secondary_phy;
1618 __u8 sid;
1619 __u8 notif_enable;
1620} __packed;
1621
1622#define HCI_ADV_PHY_1M 0X01
1623#define HCI_ADV_PHY_2M 0x02
1624#define HCI_ADV_PHY_CODED 0x03
1625
1626struct hci_rp_le_set_ext_adv_params {
1627 __u8 status;
1628 __u8 tx_power;
1629} __packed;
1630
1631#define HCI_OP_LE_SET_EXT_ADV_ENABLE 0x2039
1632struct hci_cp_le_set_ext_adv_enable {
1633 __u8 enable;
1634 __u8 num_of_sets;
1635 __u8 data[0];
1636} __packed;
1637
1638struct hci_cp_ext_adv_set {
1639 __u8 handle;
1640 __le16 duration;
1641 __u8 max_events;
1642} __packed;
1643
1644#define HCI_OP_LE_SET_EXT_ADV_DATA 0x2037
1645struct hci_cp_le_set_ext_adv_data {
1646 __u8 handle;
1647 __u8 operation;
1648 __u8 frag_pref;
1649 __u8 length;
1650 __u8 data[HCI_MAX_AD_LENGTH];
1651} __packed;
1652
1653#define HCI_OP_LE_SET_EXT_SCAN_RSP_DATA 0x2038
1654struct hci_cp_le_set_ext_scan_rsp_data {
1655 __u8 handle;
1656 __u8 operation;
1657 __u8 frag_pref;
1658 __u8 length;
1659 __u8 data[HCI_MAX_AD_LENGTH];
1660} __packed;
1661
1662#define LE_SET_ADV_DATA_OP_COMPLETE 0x03
1663
1664#define LE_SET_ADV_DATA_NO_FRAG 0x01
1665
1666#define HCI_OP_LE_CLEAR_ADV_SETS 0x203d
1667
1668#define HCI_OP_LE_SET_ADV_SET_RAND_ADDR 0x2035
1669struct hci_cp_le_set_adv_set_rand_addr {
1670 __u8 handle;
1671 bdaddr_t bdaddr;
1672} __packed;
1673
1509/* ---- HCI Events ---- */ 1674/* ---- HCI Events ---- */
1510#define HCI_EV_INQUIRY_COMPLETE 0x01 1675#define HCI_EV_INQUIRY_COMPLETE 0x01
1511 1676
@@ -1893,6 +2058,23 @@ struct hci_ev_le_conn_complete {
1893#define LE_ADV_SCAN_IND 0x02 2058#define LE_ADV_SCAN_IND 0x02
1894#define LE_ADV_NONCONN_IND 0x03 2059#define LE_ADV_NONCONN_IND 0x03
1895#define LE_ADV_SCAN_RSP 0x04 2060#define LE_ADV_SCAN_RSP 0x04
2061#define LE_ADV_INVALID 0x05
2062
2063/* Legacy event types in extended adv report */
2064#define LE_LEGACY_ADV_IND 0x0013
2065#define LE_LEGACY_ADV_DIRECT_IND 0x0015
2066#define LE_LEGACY_ADV_SCAN_IND 0x0012
2067#define LE_LEGACY_NONCONN_IND 0x0010
2068#define LE_LEGACY_SCAN_RSP_ADV 0x001b
2069#define LE_LEGACY_SCAN_RSP_ADV_SCAN 0x001a
2070
2071/* Extended Advertising event types */
2072#define LE_EXT_ADV_NON_CONN_IND 0x0000
2073#define LE_EXT_ADV_CONN_IND 0x0001
2074#define LE_EXT_ADV_SCAN_IND 0x0002
2075#define LE_EXT_ADV_DIRECT_IND 0x0004
2076#define LE_EXT_ADV_SCAN_RSP 0x0008
2077#define LE_EXT_ADV_LEGACY_PDU 0x0010
1896 2078
1897#define ADDR_LE_DEV_PUBLIC 0x00 2079#define ADDR_LE_DEV_PUBLIC 0x00
1898#define ADDR_LE_DEV_RANDOM 0x01 2080#define ADDR_LE_DEV_RANDOM 0x01
@@ -1957,6 +2139,48 @@ struct hci_ev_le_direct_adv_info {
1957 __s8 rssi; 2139 __s8 rssi;
1958} __packed; 2140} __packed;
1959 2141
2142#define HCI_EV_LE_EXT_ADV_REPORT 0x0d
2143struct hci_ev_le_ext_adv_report {
2144 __le16 evt_type;
2145 __u8 bdaddr_type;
2146 bdaddr_t bdaddr;
2147 __u8 primary_phy;
2148 __u8 secondary_phy;
2149 __u8 sid;
2150 __u8 tx_power;
2151 __s8 rssi;
2152 __le16 interval;
2153 __u8 direct_addr_type;
2154 bdaddr_t direct_addr;
2155 __u8 length;
2156 __u8 data[0];
2157} __packed;
2158
2159#define HCI_EV_LE_ENHANCED_CONN_COMPLETE 0x0a
2160struct hci_ev_le_enh_conn_complete {
2161 __u8 status;
2162 __le16 handle;
2163 __u8 role;
2164 __u8 bdaddr_type;
2165 bdaddr_t bdaddr;
2166 bdaddr_t local_rpa;
2167 bdaddr_t peer_rpa;
2168 __le16 interval;
2169 __le16 latency;
2170 __le16 supervision_timeout;
2171 __u8 clk_accurancy;
2172} __packed;
2173
2174#define HCI_EV_LE_EXT_ADV_SET_TERM 0x12
2175struct hci_evt_le_ext_adv_set_term {
2176 __u8 status;
2177 __u8 handle;
2178 __le16 conn_handle;
2179 __u8 num_evts;
2180} __packed;
2181
2182#define HCI_EV_VENDOR 0xff
2183
1960/* Internal events generated by Bluetooth stack */ 2184/* Internal events generated by Bluetooth stack */
1961#define HCI_EV_STACK_INTERNAL 0xfd 2185#define HCI_EV_STACK_INTERNAL 0xfd
1962struct hci_ev_stack_internal { 2186struct hci_ev_stack_internal {