hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/include/net/bluetooth/hci.h
....@@ -27,6 +27,7 @@
2727
2828 #define HCI_MAX_ACL_SIZE 1024
2929 #define HCI_MAX_SCO_SIZE 255
30
+#define HCI_MAX_ISO_SIZE 251
3031 #define HCI_MAX_EVENT_SIZE 260
3132 #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4)
3233
....@@ -52,6 +53,9 @@
5253 #define HCI_NOTIFY_CONN_ADD 1
5354 #define HCI_NOTIFY_CONN_DEL 2
5455 #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
5559
5660 /* HCI bus types */
5761 #define HCI_VIRTUAL 0
....@@ -64,6 +68,7 @@
6468 #define HCI_SPI 7
6569 #define HCI_I2C 8
6670 #define HCI_SMD 9
71
+#define HCI_VIRTIO 10
6772
6873 /* HCI controller types */
6974 #define HCI_PRIMARY 0x00
....@@ -114,7 +119,7 @@
114119 * wrongly configured local features that will require forcing
115120 * them to enable this mode. Getting RSSI information with the
116121 * inquiry responses is preferred since it allows for a better
117
- * user expierence.
122
+ * user experience.
118123 *
119124 * This quirk must be set before hci_register_dev is called.
120125 */
....@@ -141,7 +146,7 @@
141146
142147 /* When this quirk is set, an external configuration step
143148 * is required and will be indicated with the controller
144
- * configuation.
149
+ * configuration.
145150 *
146151 * This quirk can be set before hci_register_dev is called or
147152 * during the hdev->setup vendor callback.
....@@ -157,6 +162,18 @@
157162 * during the hdev->setup vendor callback.
158163 */
159164 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,
160177
161178 /* When this quirk is set, the duplicate filtering during
162179 * scanning is based on Bluetooth devices addresses. To allow
....@@ -192,6 +209,43 @@
192209 *
193210 */
194211 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,
195249 };
196250
197251 /* HCI device flags */
....@@ -223,6 +277,7 @@
223277 HCI_MGMT_DEV_CLASS_EVENTS,
224278 HCI_MGMT_LOCAL_NAME_EVENTS,
225279 HCI_MGMT_OOB_DATA_EVENTS,
280
+ HCI_MGMT_EXP_FEATURE_EVENTS,
226281 };
227282
228283 /*
....@@ -264,13 +319,16 @@
264319 HCI_FAST_CONNECTABLE,
265320 HCI_BREDR_ENABLED,
266321 HCI_LE_SCAN_INTERRUPTED,
322
+ HCI_WIDEBAND_SPEECH_ENABLED,
267323
268324 HCI_DUT_MODE,
269325 HCI_VENDOR_DIAG,
270326 HCI_FORCE_BREDR_SMP,
271327 HCI_FORCE_STATIC_ADDR,
272328 HCI_LL_RPA_RESOLUTION,
329
+ HCI_ENABLE_LL_PRIVACY,
273330 HCI_CMD_PENDING,
331
+ HCI_FORCE_NO_MITM,
274332
275333 __HCI_NUM_FLAGS,
276334 };
....@@ -291,6 +349,7 @@
291349 #define HCI_ACLDATA_PKT 0x02
292350 #define HCI_SCODATA_PKT 0x03
293351 #define HCI_EVENT_PKT 0x04
352
+#define HCI_ISODATA_PKT 0x05
294353 #define HCI_DIAG_PKT 0xf0
295354 #define HCI_VENDOR_PKT 0xff
296355
....@@ -340,6 +399,15 @@
340399 #define ACL_ACTIVE_BCAST 0x04
341400 #define ACL_PICO_BCAST 0x08
342401
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
+
343411 /* Baseband links */
344412 #define SCO_LINK 0x00
345413 #define ACL_LINK 0x01
....@@ -347,6 +415,7 @@
347415 /* Low Energy links do not have defined link type. Use invented one */
348416 #define LE_LINK 0x80
349417 #define AMP_LINK 0x81
418
+#define ISO_LINK 0x82
350419 #define INVALID_LINK 0xff
351420
352421 /* LMP features */
....@@ -421,13 +490,14 @@
421490 #define HCI_LE_SLAVE_FEATURES 0x08
422491 #define HCI_LE_PING 0x10
423492 #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
427494 #define HCI_LE_EXT_SCAN_POLICY 0x80
428495 #define HCI_LE_PHY_2M 0x01
429496 #define HCI_LE_PHY_CODED 0x08
497
+#define HCI_LE_EXT_ADV 0x10
430498 #define HCI_LE_CHAN_SEL_ALG2 0x40
499
+#define HCI_LE_CIS_MASTER 0x10
500
+#define HCI_LE_CIS_SLAVE 0x20
431501
432502 /* Connection modes */
433503 #define HCI_CM_ACTIVE 0x0000
....@@ -906,10 +976,14 @@
906976 #define HCI_OP_RESET 0x0c03
907977
908978 #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;
913987 } __packed;
914988
915989 /* Filter types */
....@@ -923,8 +997,9 @@
923997 #define HCI_CONN_SETUP_ALLOW_BDADDR 0x02
924998
925999 /* 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
9281003
9291004 #define HCI_OP_READ_STORED_LINK_KEY 0x0c0d
9301005 struct hci_cp_read_stored_link_key {
....@@ -1060,6 +1135,19 @@
10601135 __s8 tx_power;
10611136 } __packed;
10621137
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
+
10631151 #define HCI_OP_SET_EVENT_MASK_PAGE_2 0x0c63
10641152
10651153 #define HCI_OP_READ_LOCATION_DATA 0x0c64
....@@ -1131,6 +1219,26 @@
11311219 __u8 support;
11321220 } __packed;
11331221
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
+
11341242 #define HCI_OP_READ_LOCAL_OOB_EXT_DATA 0x0c7d
11351243 struct hci_rp_read_local_oob_ext_data {
11361244 __u8 status;
....@@ -1197,6 +1305,13 @@
11971305 } __packed;
11981306
11991307 #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;
12001315
12011316 #define HCI_OP_READ_PAGE_SCAN_ACTIVITY 0x0c1b
12021317 struct hci_rp_read_page_scan_activity {
....@@ -1289,7 +1404,7 @@
12891404 __u8 status;
12901405 __u8 phy_handle;
12911406 __le16 rem_len;
1292
- __u8 frag[0];
1407
+ __u8 frag[];
12931408 } __packed;
12941409
12951410 #define HCI_OP_WRITE_REMOTE_AMP_ASSOC 0x140b
....@@ -1297,7 +1412,7 @@
12971412 __u8 phy_handle;
12981413 __le16 len_so_far;
12991414 __le16 rem_len;
1300
- __u8 frag[0];
1415
+ __u8 frag[];
13011416 } __packed;
13021417 struct hci_rp_write_remote_amp_assoc {
13031418 __u8 status;
....@@ -1518,6 +1633,20 @@
15181633 __le16 tx_time;
15191634 } __packed;
15201635
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
+
15211650 #define HCI_OP_LE_CLEAR_RESOLV_LIST 0x2029
15221651
15231652 #define HCI_OP_LE_READ_RESOLV_LIST_SIZE 0x202a
....@@ -1527,6 +1656,8 @@
15271656 } __packed;
15281657
15291658 #define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d
1659
+
1660
+#define HCI_OP_LE_SET_RPA_TIMEOUT 0x202e
15301661
15311662 #define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f
15321663 struct hci_rp_le_read_max_data_len {
....@@ -1553,7 +1684,7 @@
15531684 __u8 own_addr_type;
15541685 __u8 filter_policy;
15551686 __u8 scanning_phys;
1556
- __u8 data[0];
1687
+ __u8 data[];
15571688 } __packed;
15581689
15591690 #define LE_SCAN_PHY_1M 0x01
....@@ -1581,7 +1712,7 @@
15811712 __u8 peer_addr_type;
15821713 bdaddr_t peer_addr;
15831714 __u8 phys;
1584
- __u8 data[0];
1715
+ __u8 data[];
15851716 } __packed;
15861717
15871718 struct hci_cp_le_ext_conn_param {
....@@ -1633,7 +1764,7 @@
16331764 struct hci_cp_le_set_ext_adv_enable {
16341765 __u8 enable;
16351766 __u8 num_of_sets;
1636
- __u8 data[0];
1767
+ __u8 data[];
16371768 } __packed;
16381769
16391770 struct hci_cp_ext_adv_set {
....@@ -1664,12 +1795,94 @@
16641795
16651796 #define LE_SET_ADV_DATA_NO_FRAG 0x01
16661797
1798
+#define HCI_OP_LE_REMOVE_ADV_SET 0x203c
1799
+
16671800 #define HCI_OP_LE_CLEAR_ADV_SETS 0x203d
16681801
16691802 #define HCI_OP_LE_SET_ADV_SET_RAND_ADDR 0x2035
16701803 struct hci_cp_le_set_adv_set_rand_addr {
16711804 __u8 handle;
16721805 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;
16731886 } __packed;
16741887
16751888 /* ---- HCI Events ---- */
....@@ -1797,7 +2010,7 @@
17972010
17982011 struct hci_ev_num_comp_pkts {
17992012 __u8 num_hndl;
1800
- struct hci_comp_pkts_info handles[0];
2013
+ struct hci_comp_pkts_info handles[];
18012014 } __packed;
18022015
18032016 #define HCI_EV_MODE_CHANGE 0x14
....@@ -2030,7 +2243,7 @@
20302243 struct hci_ev_num_comp_blocks {
20312244 __le16 num_blocks;
20322245 __u8 num_hndl;
2033
- struct hci_comp_blocks_info handles[0];
2246
+ struct hci_comp_blocks_info handles[];
20342247 } __packed;
20352248
20362249 #define HCI_EV_SYNC_TRAIN_COMPLETE 0x4F
....@@ -2077,8 +2290,10 @@
20772290 #define LE_EXT_ADV_SCAN_RSP 0x0008
20782291 #define LE_EXT_ADV_LEGACY_PDU 0x0010
20792292
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
20822297
20832298 #define HCI_EV_LE_ADVERTISING_REPORT 0x02
20842299 struct hci_ev_le_advertising_info {
....@@ -2086,7 +2301,7 @@
20862301 __u8 bdaddr_type;
20872302 bdaddr_t bdaddr;
20882303 __u8 length;
2089
- __u8 data[0];
2304
+ __u8 data[];
20902305 } __packed;
20912306
20922307 #define HCI_EV_LE_CONN_UPDATE_COMPLETE 0x03
....@@ -2140,6 +2355,14 @@
21402355 __s8 rssi;
21412356 } __packed;
21422357
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
+
21432366 #define HCI_EV_LE_EXT_ADV_REPORT 0x0d
21442367 struct hci_ev_le_ext_adv_report {
21452368 __le16 evt_type;
....@@ -2154,7 +2377,7 @@
21542377 __u8 direct_addr_type;
21552378 bdaddr_t direct_addr;
21562379 __u8 length;
2157
- __u8 data[0];
2380
+ __u8 data[];
21582381 } __packed;
21592382
21602383 #define HCI_EV_LE_ENHANCED_CONN_COMPLETE 0x0a
....@@ -2180,13 +2403,41 @@
21802403 __u8 num_evts;
21812404 } __packed;
21822405
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
+
21832434 #define HCI_EV_VENDOR 0xff
21842435
21852436 /* Internal events generated by Bluetooth stack */
21862437 #define HCI_EV_STACK_INTERNAL 0xfd
21872438 struct hci_ev_stack_internal {
21882439 __u16 type;
2189
- __u8 data[0];
2440
+ __u8 data[];
21902441 } __packed;
21912442
21922443 #define HCI_EV_SI_DEVICE 0x01
....@@ -2208,6 +2459,7 @@
22082459 #define HCI_EVENT_HDR_SIZE 2
22092460 #define HCI_ACL_HDR_SIZE 4
22102461 #define HCI_SCO_HDR_SIZE 3
2462
+#define HCI_ISO_HDR_SIZE 4
22112463
22122464 struct hci_command_hdr {
22132465 __le16 opcode; /* OCF & OGF */
....@@ -2228,6 +2480,30 @@
22282480 __le16 handle;
22292481 __u8 dlen;
22302482 } __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
+};
22312507
22322508 static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb)
22332509 {
....@@ -2254,4 +2530,22 @@
22542530 #define hci_handle(h) (h & 0x0fff)
22552531 #define hci_flags(h) (h >> 12)
22562532
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
+
22572551 #endif /* __HCI_H */