.. | .. |
---|
27 | 27 | |
---|
28 | 28 | #define HCI_MAX_ACL_SIZE 1024 |
---|
29 | 29 | #define HCI_MAX_SCO_SIZE 255 |
---|
| 30 | +#define HCI_MAX_ISO_SIZE 251 |
---|
30 | 31 | #define HCI_MAX_EVENT_SIZE 260 |
---|
31 | 32 | #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) |
---|
32 | 33 | |
---|
.. | .. |
---|
52 | 53 | #define HCI_NOTIFY_CONN_ADD 1 |
---|
53 | 54 | #define HCI_NOTIFY_CONN_DEL 2 |
---|
54 | 55 | #define HCI_NOTIFY_VOICE_SETTING 3 |
---|
| 56 | +#define HCI_NOTIFY_ENABLE_SCO_CVSD 4 |
---|
| 57 | +#define HCI_NOTIFY_ENABLE_SCO_TRANSP 5 |
---|
| 58 | +#define HCI_NOTIFY_DISABLE_SCO 6 |
---|
55 | 59 | |
---|
56 | 60 | /* HCI bus types */ |
---|
57 | 61 | #define HCI_VIRTUAL 0 |
---|
.. | .. |
---|
64 | 68 | #define HCI_SPI 7 |
---|
65 | 69 | #define HCI_I2C 8 |
---|
66 | 70 | #define HCI_SMD 9 |
---|
| 71 | +#define HCI_VIRTIO 10 |
---|
67 | 72 | |
---|
68 | 73 | /* HCI controller types */ |
---|
69 | 74 | #define HCI_PRIMARY 0x00 |
---|
.. | .. |
---|
114 | 119 | * wrongly configured local features that will require forcing |
---|
115 | 120 | * them to enable this mode. Getting RSSI information with the |
---|
116 | 121 | * inquiry responses is preferred since it allows for a better |
---|
117 | | - * user expierence. |
---|
| 122 | + * user experience. |
---|
118 | 123 | * |
---|
119 | 124 | * This quirk must be set before hci_register_dev is called. |
---|
120 | 125 | */ |
---|
.. | .. |
---|
141 | 146 | |
---|
142 | 147 | /* When this quirk is set, an external configuration step |
---|
143 | 148 | * is required and will be indicated with the controller |
---|
144 | | - * configuation. |
---|
| 149 | + * configuration. |
---|
145 | 150 | * |
---|
146 | 151 | * This quirk can be set before hci_register_dev is called or |
---|
147 | 152 | * during the hdev->setup vendor callback. |
---|
.. | .. |
---|
157 | 162 | * during the hdev->setup vendor callback. |
---|
158 | 163 | */ |
---|
159 | 164 | HCI_QUIRK_INVALID_BDADDR, |
---|
| 165 | + |
---|
| 166 | + /* When this quirk is set, the public Bluetooth address |
---|
| 167 | + * initially reported by HCI Read BD Address command |
---|
| 168 | + * is considered invalid. The public BD Address can be |
---|
| 169 | + * specified in the fwnode property 'local-bd-address'. |
---|
| 170 | + * If this property does not exist or is invalid controller |
---|
| 171 | + * configuration is required before this device can be used. |
---|
| 172 | + * |
---|
| 173 | + * This quirk can be set before hci_register_dev is called or |
---|
| 174 | + * during the hdev->setup vendor callback. |
---|
| 175 | + */ |
---|
| 176 | + HCI_QUIRK_USE_BDADDR_PROPERTY, |
---|
160 | 177 | |
---|
161 | 178 | /* When this quirk is set, the duplicate filtering during |
---|
162 | 179 | * scanning is based on Bluetooth devices addresses. To allow |
---|
.. | .. |
---|
192 | 209 | * |
---|
193 | 210 | */ |
---|
194 | 211 | HCI_QUIRK_NON_PERSISTENT_SETUP, |
---|
| 212 | + |
---|
| 213 | + /* When this quirk is set, wide band speech is supported by |
---|
| 214 | + * the driver since no reliable mechanism exist to report |
---|
| 215 | + * this from the hardware, a driver flag is use to convey |
---|
| 216 | + * this support |
---|
| 217 | + * |
---|
| 218 | + * This quirk must be set before hci_register_dev is called. |
---|
| 219 | + */ |
---|
| 220 | + HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, |
---|
| 221 | + |
---|
| 222 | + /* When this quirk is set, the controller has validated that |
---|
| 223 | + * LE states reported through the HCI_LE_READ_SUPPORTED_STATES are |
---|
| 224 | + * valid. This mechanism is necessary as many controllers have |
---|
| 225 | + * been seen has having trouble initiating a connectable |
---|
| 226 | + * advertisement despite the state combination being reported as |
---|
| 227 | + * supported. |
---|
| 228 | + */ |
---|
| 229 | + HCI_QUIRK_VALID_LE_STATES, |
---|
| 230 | + |
---|
| 231 | + /* When this quirk is set, then erroneous data reporting |
---|
| 232 | + * is ignored. This is mainly due to the fact that the HCI |
---|
| 233 | + * Read Default Erroneous Data Reporting command is advertised, |
---|
| 234 | + * but not supported; these controllers often reply with unknown |
---|
| 235 | + * command and tend to lock up randomly. Needing a hard reset. |
---|
| 236 | + * |
---|
| 237 | + * This quirk can be set before hci_register_dev is called or |
---|
| 238 | + * during the hdev->setup vendor callback. |
---|
| 239 | + */ |
---|
| 240 | + HCI_QUIRK_BROKEN_ERR_DATA_REPORTING, |
---|
| 241 | + |
---|
| 242 | + /* |
---|
| 243 | + * When this quirk is set, then the hci_suspend_notifier is not |
---|
| 244 | + * registered. This is intended for devices which drop completely |
---|
| 245 | + * from the bus on system-suspend and which will show up as a new |
---|
| 246 | + * HCI after resume. |
---|
| 247 | + */ |
---|
| 248 | + HCI_QUIRK_NO_SUSPEND_NOTIFIER, |
---|
195 | 249 | }; |
---|
196 | 250 | |
---|
197 | 251 | /* HCI device flags */ |
---|
.. | .. |
---|
223 | 277 | HCI_MGMT_DEV_CLASS_EVENTS, |
---|
224 | 278 | HCI_MGMT_LOCAL_NAME_EVENTS, |
---|
225 | 279 | HCI_MGMT_OOB_DATA_EVENTS, |
---|
| 280 | + HCI_MGMT_EXP_FEATURE_EVENTS, |
---|
226 | 281 | }; |
---|
227 | 282 | |
---|
228 | 283 | /* |
---|
.. | .. |
---|
264 | 319 | HCI_FAST_CONNECTABLE, |
---|
265 | 320 | HCI_BREDR_ENABLED, |
---|
266 | 321 | HCI_LE_SCAN_INTERRUPTED, |
---|
| 322 | + HCI_WIDEBAND_SPEECH_ENABLED, |
---|
267 | 323 | |
---|
268 | 324 | HCI_DUT_MODE, |
---|
269 | 325 | HCI_VENDOR_DIAG, |
---|
270 | 326 | HCI_FORCE_BREDR_SMP, |
---|
271 | 327 | HCI_FORCE_STATIC_ADDR, |
---|
272 | 328 | HCI_LL_RPA_RESOLUTION, |
---|
| 329 | + HCI_ENABLE_LL_PRIVACY, |
---|
273 | 330 | HCI_CMD_PENDING, |
---|
| 331 | + HCI_FORCE_NO_MITM, |
---|
274 | 332 | |
---|
275 | 333 | __HCI_NUM_FLAGS, |
---|
276 | 334 | }; |
---|
.. | .. |
---|
291 | 349 | #define HCI_ACLDATA_PKT 0x02 |
---|
292 | 350 | #define HCI_SCODATA_PKT 0x03 |
---|
293 | 351 | #define HCI_EVENT_PKT 0x04 |
---|
| 352 | +#define HCI_ISODATA_PKT 0x05 |
---|
294 | 353 | #define HCI_DIAG_PKT 0xf0 |
---|
295 | 354 | #define HCI_VENDOR_PKT 0xff |
---|
296 | 355 | |
---|
.. | .. |
---|
340 | 399 | #define ACL_ACTIVE_BCAST 0x04 |
---|
341 | 400 | #define ACL_PICO_BCAST 0x08 |
---|
342 | 401 | |
---|
| 402 | +/* ISO PB flags */ |
---|
| 403 | +#define ISO_START 0x00 |
---|
| 404 | +#define ISO_CONT 0x01 |
---|
| 405 | +#define ISO_SINGLE 0x02 |
---|
| 406 | +#define ISO_END 0x03 |
---|
| 407 | + |
---|
| 408 | +/* ISO TS flags */ |
---|
| 409 | +#define ISO_TS 0x01 |
---|
| 410 | + |
---|
343 | 411 | /* Baseband links */ |
---|
344 | 412 | #define SCO_LINK 0x00 |
---|
345 | 413 | #define ACL_LINK 0x01 |
---|
.. | .. |
---|
347 | 415 | /* Low Energy links do not have defined link type. Use invented one */ |
---|
348 | 416 | #define LE_LINK 0x80 |
---|
349 | 417 | #define AMP_LINK 0x81 |
---|
| 418 | +#define ISO_LINK 0x82 |
---|
350 | 419 | #define INVALID_LINK 0xff |
---|
351 | 420 | |
---|
352 | 421 | /* LMP features */ |
---|
.. | .. |
---|
421 | 490 | #define HCI_LE_SLAVE_FEATURES 0x08 |
---|
422 | 491 | #define HCI_LE_PING 0x10 |
---|
423 | 492 | #define HCI_LE_DATA_LEN_EXT 0x20 |
---|
424 | | -#define HCI_LE_PHY_2M 0x01 |
---|
425 | | -#define HCI_LE_PHY_CODED 0x08 |
---|
426 | | -#define HCI_LE_EXT_ADV 0x10 |
---|
| 493 | +#define HCI_LE_LL_PRIVACY 0x40 |
---|
427 | 494 | #define HCI_LE_EXT_SCAN_POLICY 0x80 |
---|
428 | 495 | #define HCI_LE_PHY_2M 0x01 |
---|
429 | 496 | #define HCI_LE_PHY_CODED 0x08 |
---|
| 497 | +#define HCI_LE_EXT_ADV 0x10 |
---|
430 | 498 | #define HCI_LE_CHAN_SEL_ALG2 0x40 |
---|
| 499 | +#define HCI_LE_CIS_MASTER 0x10 |
---|
| 500 | +#define HCI_LE_CIS_SLAVE 0x20 |
---|
431 | 501 | |
---|
432 | 502 | /* Connection modes */ |
---|
433 | 503 | #define HCI_CM_ACTIVE 0x0000 |
---|
.. | .. |
---|
906 | 976 | #define HCI_OP_RESET 0x0c03 |
---|
907 | 977 | |
---|
908 | 978 | #define HCI_OP_SET_EVENT_FLT 0x0c05 |
---|
909 | | -struct hci_cp_set_event_flt { |
---|
910 | | - __u8 flt_type; |
---|
911 | | - __u8 cond_type; |
---|
912 | | - __u8 condition[0]; |
---|
| 979 | +#define HCI_SET_EVENT_FLT_SIZE 9 |
---|
| 980 | +struct hci_cp_set_event_filter { |
---|
| 981 | + __u8 flt_type; |
---|
| 982 | + __u8 cond_type; |
---|
| 983 | + struct { |
---|
| 984 | + bdaddr_t bdaddr; |
---|
| 985 | + __u8 auto_accept; |
---|
| 986 | + } __packed addr_conn_flt; |
---|
913 | 987 | } __packed; |
---|
914 | 988 | |
---|
915 | 989 | /* Filter types */ |
---|
.. | .. |
---|
923 | 997 | #define HCI_CONN_SETUP_ALLOW_BDADDR 0x02 |
---|
924 | 998 | |
---|
925 | 999 | /* CONN_SETUP Conditions */ |
---|
926 | | -#define HCI_CONN_SETUP_AUTO_OFF 0x01 |
---|
927 | | -#define HCI_CONN_SETUP_AUTO_ON 0x02 |
---|
| 1000 | +#define HCI_CONN_SETUP_AUTO_OFF 0x01 |
---|
| 1001 | +#define HCI_CONN_SETUP_AUTO_ON 0x02 |
---|
| 1002 | +#define HCI_CONN_SETUP_AUTO_ON_WITH_RS 0x03 |
---|
928 | 1003 | |
---|
929 | 1004 | #define HCI_OP_READ_STORED_LINK_KEY 0x0c0d |
---|
930 | 1005 | struct hci_cp_read_stored_link_key { |
---|
.. | .. |
---|
1060 | 1135 | __s8 tx_power; |
---|
1061 | 1136 | } __packed; |
---|
1062 | 1137 | |
---|
| 1138 | +#define HCI_OP_READ_DEF_ERR_DATA_REPORTING 0x0c5a |
---|
| 1139 | + #define ERR_DATA_REPORTING_DISABLED 0x00 |
---|
| 1140 | + #define ERR_DATA_REPORTING_ENABLED 0x01 |
---|
| 1141 | +struct hci_rp_read_def_err_data_reporting { |
---|
| 1142 | + __u8 status; |
---|
| 1143 | + __u8 err_data_reporting; |
---|
| 1144 | +} __packed; |
---|
| 1145 | + |
---|
| 1146 | +#define HCI_OP_WRITE_DEF_ERR_DATA_REPORTING 0x0c5b |
---|
| 1147 | +struct hci_cp_write_def_err_data_reporting { |
---|
| 1148 | + __u8 err_data_reporting; |
---|
| 1149 | +} __packed; |
---|
| 1150 | + |
---|
1063 | 1151 | #define HCI_OP_SET_EVENT_MASK_PAGE_2 0x0c63 |
---|
1064 | 1152 | |
---|
1065 | 1153 | #define HCI_OP_READ_LOCATION_DATA 0x0c64 |
---|
.. | .. |
---|
1131 | 1219 | __u8 support; |
---|
1132 | 1220 | } __packed; |
---|
1133 | 1221 | |
---|
| 1222 | +#define HCI_OP_READ_AUTH_PAYLOAD_TO 0x0c7b |
---|
| 1223 | +struct hci_cp_read_auth_payload_to { |
---|
| 1224 | + __le16 handle; |
---|
| 1225 | +} __packed; |
---|
| 1226 | +struct hci_rp_read_auth_payload_to { |
---|
| 1227 | + __u8 status; |
---|
| 1228 | + __le16 handle; |
---|
| 1229 | + __le16 timeout; |
---|
| 1230 | +} __packed; |
---|
| 1231 | + |
---|
| 1232 | +#define HCI_OP_WRITE_AUTH_PAYLOAD_TO 0x0c7c |
---|
| 1233 | +struct hci_cp_write_auth_payload_to { |
---|
| 1234 | + __le16 handle; |
---|
| 1235 | + __le16 timeout; |
---|
| 1236 | +} __packed; |
---|
| 1237 | +struct hci_rp_write_auth_payload_to { |
---|
| 1238 | + __u8 status; |
---|
| 1239 | + __le16 handle; |
---|
| 1240 | +} __packed; |
---|
| 1241 | + |
---|
1134 | 1242 | #define HCI_OP_READ_LOCAL_OOB_EXT_DATA 0x0c7d |
---|
1135 | 1243 | struct hci_rp_read_local_oob_ext_data { |
---|
1136 | 1244 | __u8 status; |
---|
.. | .. |
---|
1197 | 1305 | } __packed; |
---|
1198 | 1306 | |
---|
1199 | 1307 | #define HCI_OP_READ_LOCAL_CODECS 0x100b |
---|
| 1308 | + |
---|
| 1309 | +#define HCI_OP_READ_LOCAL_PAIRING_OPTS 0x100c |
---|
| 1310 | +struct hci_rp_read_local_pairing_opts { |
---|
| 1311 | + __u8 status; |
---|
| 1312 | + __u8 pairing_opts; |
---|
| 1313 | + __u8 max_key_size; |
---|
| 1314 | +} __packed; |
---|
1200 | 1315 | |
---|
1201 | 1316 | #define HCI_OP_READ_PAGE_SCAN_ACTIVITY 0x0c1b |
---|
1202 | 1317 | struct hci_rp_read_page_scan_activity { |
---|
.. | .. |
---|
1289 | 1404 | __u8 status; |
---|
1290 | 1405 | __u8 phy_handle; |
---|
1291 | 1406 | __le16 rem_len; |
---|
1292 | | - __u8 frag[0]; |
---|
| 1407 | + __u8 frag[]; |
---|
1293 | 1408 | } __packed; |
---|
1294 | 1409 | |
---|
1295 | 1410 | #define HCI_OP_WRITE_REMOTE_AMP_ASSOC 0x140b |
---|
.. | .. |
---|
1297 | 1412 | __u8 phy_handle; |
---|
1298 | 1413 | __le16 len_so_far; |
---|
1299 | 1414 | __le16 rem_len; |
---|
1300 | | - __u8 frag[0]; |
---|
| 1415 | + __u8 frag[]; |
---|
1301 | 1416 | } __packed; |
---|
1302 | 1417 | struct hci_rp_write_remote_amp_assoc { |
---|
1303 | 1418 | __u8 status; |
---|
.. | .. |
---|
1518 | 1633 | __le16 tx_time; |
---|
1519 | 1634 | } __packed; |
---|
1520 | 1635 | |
---|
| 1636 | +#define HCI_OP_LE_ADD_TO_RESOLV_LIST 0x2027 |
---|
| 1637 | +struct hci_cp_le_add_to_resolv_list { |
---|
| 1638 | + __u8 bdaddr_type; |
---|
| 1639 | + bdaddr_t bdaddr; |
---|
| 1640 | + __u8 peer_irk[16]; |
---|
| 1641 | + __u8 local_irk[16]; |
---|
| 1642 | +} __packed; |
---|
| 1643 | + |
---|
| 1644 | +#define HCI_OP_LE_DEL_FROM_RESOLV_LIST 0x2028 |
---|
| 1645 | +struct hci_cp_le_del_from_resolv_list { |
---|
| 1646 | + __u8 bdaddr_type; |
---|
| 1647 | + bdaddr_t bdaddr; |
---|
| 1648 | +} __packed; |
---|
| 1649 | + |
---|
1521 | 1650 | #define HCI_OP_LE_CLEAR_RESOLV_LIST 0x2029 |
---|
1522 | 1651 | |
---|
1523 | 1652 | #define HCI_OP_LE_READ_RESOLV_LIST_SIZE 0x202a |
---|
.. | .. |
---|
1527 | 1656 | } __packed; |
---|
1528 | 1657 | |
---|
1529 | 1658 | #define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d |
---|
| 1659 | + |
---|
| 1660 | +#define HCI_OP_LE_SET_RPA_TIMEOUT 0x202e |
---|
1530 | 1661 | |
---|
1531 | 1662 | #define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f |
---|
1532 | 1663 | struct hci_rp_le_read_max_data_len { |
---|
.. | .. |
---|
1553 | 1684 | __u8 own_addr_type; |
---|
1554 | 1685 | __u8 filter_policy; |
---|
1555 | 1686 | __u8 scanning_phys; |
---|
1556 | | - __u8 data[0]; |
---|
| 1687 | + __u8 data[]; |
---|
1557 | 1688 | } __packed; |
---|
1558 | 1689 | |
---|
1559 | 1690 | #define LE_SCAN_PHY_1M 0x01 |
---|
.. | .. |
---|
1581 | 1712 | __u8 peer_addr_type; |
---|
1582 | 1713 | bdaddr_t peer_addr; |
---|
1583 | 1714 | __u8 phys; |
---|
1584 | | - __u8 data[0]; |
---|
| 1715 | + __u8 data[]; |
---|
1585 | 1716 | } __packed; |
---|
1586 | 1717 | |
---|
1587 | 1718 | struct hci_cp_le_ext_conn_param { |
---|
.. | .. |
---|
1633 | 1764 | struct hci_cp_le_set_ext_adv_enable { |
---|
1634 | 1765 | __u8 enable; |
---|
1635 | 1766 | __u8 num_of_sets; |
---|
1636 | | - __u8 data[0]; |
---|
| 1767 | + __u8 data[]; |
---|
1637 | 1768 | } __packed; |
---|
1638 | 1769 | |
---|
1639 | 1770 | struct hci_cp_ext_adv_set { |
---|
.. | .. |
---|
1664 | 1795 | |
---|
1665 | 1796 | #define LE_SET_ADV_DATA_NO_FRAG 0x01 |
---|
1666 | 1797 | |
---|
| 1798 | +#define HCI_OP_LE_REMOVE_ADV_SET 0x203c |
---|
| 1799 | + |
---|
1667 | 1800 | #define HCI_OP_LE_CLEAR_ADV_SETS 0x203d |
---|
1668 | 1801 | |
---|
1669 | 1802 | #define HCI_OP_LE_SET_ADV_SET_RAND_ADDR 0x2035 |
---|
1670 | 1803 | struct hci_cp_le_set_adv_set_rand_addr { |
---|
1671 | 1804 | __u8 handle; |
---|
1672 | 1805 | bdaddr_t bdaddr; |
---|
| 1806 | +} __packed; |
---|
| 1807 | + |
---|
| 1808 | +#define HCI_OP_LE_READ_BUFFER_SIZE_V2 0x2060 |
---|
| 1809 | +struct hci_rp_le_read_buffer_size_v2 { |
---|
| 1810 | + __u8 status; |
---|
| 1811 | + __le16 acl_mtu; |
---|
| 1812 | + __u8 acl_max_pkt; |
---|
| 1813 | + __le16 iso_mtu; |
---|
| 1814 | + __u8 iso_max_pkt; |
---|
| 1815 | +} __packed; |
---|
| 1816 | + |
---|
| 1817 | +#define HCI_OP_LE_READ_ISO_TX_SYNC 0x2061 |
---|
| 1818 | +struct hci_cp_le_read_iso_tx_sync { |
---|
| 1819 | + __le16 handle; |
---|
| 1820 | +} __packed; |
---|
| 1821 | + |
---|
| 1822 | +struct hci_rp_le_read_iso_tx_sync { |
---|
| 1823 | + __u8 status; |
---|
| 1824 | + __le16 handle; |
---|
| 1825 | + __le16 seq; |
---|
| 1826 | + __le32 imestamp; |
---|
| 1827 | + __u8 offset[3]; |
---|
| 1828 | +} __packed; |
---|
| 1829 | + |
---|
| 1830 | +#define HCI_OP_LE_SET_CIG_PARAMS 0x2062 |
---|
| 1831 | +struct hci_cis_params { |
---|
| 1832 | + __u8 cis_id; |
---|
| 1833 | + __le16 m_sdu; |
---|
| 1834 | + __le16 s_sdu; |
---|
| 1835 | + __u8 m_phy; |
---|
| 1836 | + __u8 s_phy; |
---|
| 1837 | + __u8 m_rtn; |
---|
| 1838 | + __u8 s_rtn; |
---|
| 1839 | +} __packed; |
---|
| 1840 | + |
---|
| 1841 | +struct hci_cp_le_set_cig_params { |
---|
| 1842 | + __u8 cig_id; |
---|
| 1843 | + __u8 m_interval[3]; |
---|
| 1844 | + __u8 s_interval[3]; |
---|
| 1845 | + __u8 sca; |
---|
| 1846 | + __u8 packing; |
---|
| 1847 | + __u8 framing; |
---|
| 1848 | + __le16 m_latency; |
---|
| 1849 | + __le16 s_latency; |
---|
| 1850 | + __u8 num_cis; |
---|
| 1851 | + struct hci_cis_params cis[]; |
---|
| 1852 | +} __packed; |
---|
| 1853 | + |
---|
| 1854 | +struct hci_rp_le_set_cig_params { |
---|
| 1855 | + __u8 status; |
---|
| 1856 | + __u8 cig_id; |
---|
| 1857 | + __u8 num_handles; |
---|
| 1858 | + __le16 handle[]; |
---|
| 1859 | +} __packed; |
---|
| 1860 | + |
---|
| 1861 | +#define HCI_OP_LE_CREATE_CIS 0x2064 |
---|
| 1862 | +struct hci_cis { |
---|
| 1863 | + __le16 cis_handle; |
---|
| 1864 | + __le16 acl_handle; |
---|
| 1865 | +} __packed; |
---|
| 1866 | + |
---|
| 1867 | +struct hci_cp_le_create_cis { |
---|
| 1868 | + __u8 num_cis; |
---|
| 1869 | + struct hci_cis cis[]; |
---|
| 1870 | +} __packed; |
---|
| 1871 | + |
---|
| 1872 | +#define HCI_OP_LE_REMOVE_CIG 0x2065 |
---|
| 1873 | +struct hci_cp_le_remove_cig { |
---|
| 1874 | + __u8 cig_id; |
---|
| 1875 | +} __packed; |
---|
| 1876 | + |
---|
| 1877 | +#define HCI_OP_LE_ACCEPT_CIS 0x2066 |
---|
| 1878 | +struct hci_cp_le_accept_cis { |
---|
| 1879 | + __le16 handle; |
---|
| 1880 | +} __packed; |
---|
| 1881 | + |
---|
| 1882 | +#define HCI_OP_LE_REJECT_CIS 0x2067 |
---|
| 1883 | +struct hci_cp_le_reject_cis { |
---|
| 1884 | + __le16 handle; |
---|
| 1885 | + __u8 reason; |
---|
1673 | 1886 | } __packed; |
---|
1674 | 1887 | |
---|
1675 | 1888 | /* ---- HCI Events ---- */ |
---|
.. | .. |
---|
1797 | 2010 | |
---|
1798 | 2011 | struct hci_ev_num_comp_pkts { |
---|
1799 | 2012 | __u8 num_hndl; |
---|
1800 | | - struct hci_comp_pkts_info handles[0]; |
---|
| 2013 | + struct hci_comp_pkts_info handles[]; |
---|
1801 | 2014 | } __packed; |
---|
1802 | 2015 | |
---|
1803 | 2016 | #define HCI_EV_MODE_CHANGE 0x14 |
---|
.. | .. |
---|
2030 | 2243 | struct hci_ev_num_comp_blocks { |
---|
2031 | 2244 | __le16 num_blocks; |
---|
2032 | 2245 | __u8 num_hndl; |
---|
2033 | | - struct hci_comp_blocks_info handles[0]; |
---|
| 2246 | + struct hci_comp_blocks_info handles[]; |
---|
2034 | 2247 | } __packed; |
---|
2035 | 2248 | |
---|
2036 | 2249 | #define HCI_EV_SYNC_TRAIN_COMPLETE 0x4F |
---|
.. | .. |
---|
2077 | 2290 | #define LE_EXT_ADV_SCAN_RSP 0x0008 |
---|
2078 | 2291 | #define LE_EXT_ADV_LEGACY_PDU 0x0010 |
---|
2079 | 2292 | |
---|
2080 | | -#define ADDR_LE_DEV_PUBLIC 0x00 |
---|
2081 | | -#define ADDR_LE_DEV_RANDOM 0x01 |
---|
| 2293 | +#define ADDR_LE_DEV_PUBLIC 0x00 |
---|
| 2294 | +#define ADDR_LE_DEV_RANDOM 0x01 |
---|
| 2295 | +#define ADDR_LE_DEV_PUBLIC_RESOLVED 0x02 |
---|
| 2296 | +#define ADDR_LE_DEV_RANDOM_RESOLVED 0x03 |
---|
2082 | 2297 | |
---|
2083 | 2298 | #define HCI_EV_LE_ADVERTISING_REPORT 0x02 |
---|
2084 | 2299 | struct hci_ev_le_advertising_info { |
---|
.. | .. |
---|
2086 | 2301 | __u8 bdaddr_type; |
---|
2087 | 2302 | bdaddr_t bdaddr; |
---|
2088 | 2303 | __u8 length; |
---|
2089 | | - __u8 data[0]; |
---|
| 2304 | + __u8 data[]; |
---|
2090 | 2305 | } __packed; |
---|
2091 | 2306 | |
---|
2092 | 2307 | #define HCI_EV_LE_CONN_UPDATE_COMPLETE 0x03 |
---|
.. | .. |
---|
2140 | 2355 | __s8 rssi; |
---|
2141 | 2356 | } __packed; |
---|
2142 | 2357 | |
---|
| 2358 | +#define HCI_EV_LE_PHY_UPDATE_COMPLETE 0x0c |
---|
| 2359 | +struct hci_ev_le_phy_update_complete { |
---|
| 2360 | + __u8 status; |
---|
| 2361 | + __le16 handle; |
---|
| 2362 | + __u8 tx_phy; |
---|
| 2363 | + __u8 rx_phy; |
---|
| 2364 | +} __packed; |
---|
| 2365 | + |
---|
2143 | 2366 | #define HCI_EV_LE_EXT_ADV_REPORT 0x0d |
---|
2144 | 2367 | struct hci_ev_le_ext_adv_report { |
---|
2145 | 2368 | __le16 evt_type; |
---|
.. | .. |
---|
2154 | 2377 | __u8 direct_addr_type; |
---|
2155 | 2378 | bdaddr_t direct_addr; |
---|
2156 | 2379 | __u8 length; |
---|
2157 | | - __u8 data[0]; |
---|
| 2380 | + __u8 data[]; |
---|
2158 | 2381 | } __packed; |
---|
2159 | 2382 | |
---|
2160 | 2383 | #define HCI_EV_LE_ENHANCED_CONN_COMPLETE 0x0a |
---|
.. | .. |
---|
2180 | 2403 | __u8 num_evts; |
---|
2181 | 2404 | } __packed; |
---|
2182 | 2405 | |
---|
| 2406 | +#define HCI_EVT_LE_CIS_ESTABLISHED 0x19 |
---|
| 2407 | +struct hci_evt_le_cis_established { |
---|
| 2408 | + __u8 status; |
---|
| 2409 | + __le16 handle; |
---|
| 2410 | + __u8 cig_sync_delay[3]; |
---|
| 2411 | + __u8 cis_sync_delay[3]; |
---|
| 2412 | + __u8 m_latency[3]; |
---|
| 2413 | + __u8 s_latency[3]; |
---|
| 2414 | + __u8 m_phy; |
---|
| 2415 | + __u8 s_phy; |
---|
| 2416 | + __u8 nse; |
---|
| 2417 | + __u8 m_bn; |
---|
| 2418 | + __u8 s_bn; |
---|
| 2419 | + __u8 m_ft; |
---|
| 2420 | + __u8 s_ft; |
---|
| 2421 | + __le16 m_mtu; |
---|
| 2422 | + __le16 s_mtu; |
---|
| 2423 | + __le16 interval; |
---|
| 2424 | +} __packed; |
---|
| 2425 | + |
---|
| 2426 | +#define HCI_EVT_LE_CIS_REQ 0x1a |
---|
| 2427 | +struct hci_evt_le_cis_req { |
---|
| 2428 | + __le16 acl_handle; |
---|
| 2429 | + __le16 cis_handle; |
---|
| 2430 | + __u8 cig_id; |
---|
| 2431 | + __u8 cis_id; |
---|
| 2432 | +} __packed; |
---|
| 2433 | + |
---|
2183 | 2434 | #define HCI_EV_VENDOR 0xff |
---|
2184 | 2435 | |
---|
2185 | 2436 | /* Internal events generated by Bluetooth stack */ |
---|
2186 | 2437 | #define HCI_EV_STACK_INTERNAL 0xfd |
---|
2187 | 2438 | struct hci_ev_stack_internal { |
---|
2188 | 2439 | __u16 type; |
---|
2189 | | - __u8 data[0]; |
---|
| 2440 | + __u8 data[]; |
---|
2190 | 2441 | } __packed; |
---|
2191 | 2442 | |
---|
2192 | 2443 | #define HCI_EV_SI_DEVICE 0x01 |
---|
.. | .. |
---|
2208 | 2459 | #define HCI_EVENT_HDR_SIZE 2 |
---|
2209 | 2460 | #define HCI_ACL_HDR_SIZE 4 |
---|
2210 | 2461 | #define HCI_SCO_HDR_SIZE 3 |
---|
| 2462 | +#define HCI_ISO_HDR_SIZE 4 |
---|
2211 | 2463 | |
---|
2212 | 2464 | struct hci_command_hdr { |
---|
2213 | 2465 | __le16 opcode; /* OCF & OGF */ |
---|
.. | .. |
---|
2228 | 2480 | __le16 handle; |
---|
2229 | 2481 | __u8 dlen; |
---|
2230 | 2482 | } __packed; |
---|
| 2483 | + |
---|
| 2484 | +struct hci_iso_hdr { |
---|
| 2485 | + __le16 handle; |
---|
| 2486 | + __le16 dlen; |
---|
| 2487 | + __u8 data[]; |
---|
| 2488 | +} __packed; |
---|
| 2489 | + |
---|
| 2490 | +/* ISO data packet status flags */ |
---|
| 2491 | +#define HCI_ISO_STATUS_VALID 0x00 |
---|
| 2492 | +#define HCI_ISO_STATUS_INVALID 0x01 |
---|
| 2493 | +#define HCI_ISO_STATUS_NOP 0x02 |
---|
| 2494 | + |
---|
| 2495 | +#define HCI_ISO_DATA_HDR_SIZE 4 |
---|
| 2496 | +struct hci_iso_data_hdr { |
---|
| 2497 | + __le16 sn; |
---|
| 2498 | + __le16 slen; |
---|
| 2499 | +}; |
---|
| 2500 | + |
---|
| 2501 | +#define HCI_ISO_TS_DATA_HDR_SIZE 8 |
---|
| 2502 | +struct hci_iso_ts_data_hdr { |
---|
| 2503 | + __le32 ts; |
---|
| 2504 | + __le16 sn; |
---|
| 2505 | + __le16 slen; |
---|
| 2506 | +}; |
---|
2231 | 2507 | |
---|
2232 | 2508 | static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) |
---|
2233 | 2509 | { |
---|
.. | .. |
---|
2254 | 2530 | #define hci_handle(h) (h & 0x0fff) |
---|
2255 | 2531 | #define hci_flags(h) (h >> 12) |
---|
2256 | 2532 | |
---|
| 2533 | +/* ISO handle and flags pack/unpack */ |
---|
| 2534 | +#define hci_iso_flags_pb(f) (f & 0x0003) |
---|
| 2535 | +#define hci_iso_flags_ts(f) ((f >> 2) & 0x0001) |
---|
| 2536 | +#define hci_iso_flags_pack(pb, ts) ((pb & 0x03) | ((ts & 0x01) << 2)) |
---|
| 2537 | + |
---|
| 2538 | +/* ISO data length and flags pack/unpack */ |
---|
| 2539 | +#define hci_iso_data_len_pack(h, f) ((__u16) ((h) | ((f) << 14))) |
---|
| 2540 | +#define hci_iso_data_len(h) ((h) & 0x3fff) |
---|
| 2541 | +#define hci_iso_data_flags(h) ((h) >> 14) |
---|
| 2542 | + |
---|
| 2543 | +/* le24 support */ |
---|
| 2544 | +static inline void hci_cpu_to_le24(__u32 val, __u8 dst[3]) |
---|
| 2545 | +{ |
---|
| 2546 | + dst[0] = val & 0xff; |
---|
| 2547 | + dst[1] = (val & 0xff00) >> 8; |
---|
| 2548 | + dst[2] = (val & 0xff0000) >> 16; |
---|
| 2549 | +} |
---|
| 2550 | + |
---|
2257 | 2551 | #endif /* __HCI_H */ |
---|