hci.h (f81483aaeb59da530b286fe5d081e1705eb5c886) | hci.h (72279d17df54d5e4e7910b39c61a3f3464e36633) |
---|---|
1/* 2 BlueZ - Bluetooth protocol stack for Linux 3 Copyright (C) 2000-2001 Qualcomm Incorporated 4 5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License version 2 as --- 232 unchanged lines hidden (view full) --- 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, | 1/* 2 BlueZ - Bluetooth protocol stack for Linux 3 Copyright (C) 2000-2001 Qualcomm Incorporated 4 5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License version 2 as --- 232 unchanged lines hidden (view full) --- 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, |
249 250 /* 251 * When this quirk is set, LE tx power is not queried on startup 252 * and the min/max tx power values default to HCI_TX_POWER_INVALID. 253 * 254 * This quirk can be set before hci_register_dev is called or 255 * during the hdev->setup vendor callback. 256 */ 257 HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, |
|
249}; 250 251/* HCI device flags */ 252enum { 253 HCI_UP, 254 HCI_INIT, 255 HCI_RUNNING, 256 --- 70 unchanged lines hidden (view full) --- 327 HCI_FORCE_BREDR_SMP, 328 HCI_FORCE_STATIC_ADDR, 329 HCI_LL_RPA_RESOLUTION, 330 HCI_ENABLE_LL_PRIVACY, 331 HCI_CMD_PENDING, 332 HCI_FORCE_NO_MITM, 333 HCI_QUALITY_REPORT, 334 HCI_OFFLOAD_CODECS_ENABLED, | 258}; 259 260/* HCI device flags */ 261enum { 262 HCI_UP, 263 HCI_INIT, 264 HCI_RUNNING, 265 --- 70 unchanged lines hidden (view full) --- 336 HCI_FORCE_BREDR_SMP, 337 HCI_FORCE_STATIC_ADDR, 338 HCI_LL_RPA_RESOLUTION, 339 HCI_ENABLE_LL_PRIVACY, 340 HCI_CMD_PENDING, 341 HCI_FORCE_NO_MITM, 342 HCI_QUALITY_REPORT, 343 HCI_OFFLOAD_CODECS_ENABLED, |
344 HCI_LE_SIMULTANEOUS_ROLES, |
|
335 336 __HCI_NUM_FLAGS, 337}; 338 339/* HCI timeouts */ 340#define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 341#define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ 342#define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ --- 218 unchanged lines hidden (view full) --- 561#define HCI_ERROR_REMOTE_USER_TERM 0x13 562#define HCI_ERROR_REMOTE_LOW_RESOURCES 0x14 563#define HCI_ERROR_REMOTE_POWER_OFF 0x15 564#define HCI_ERROR_LOCAL_HOST_TERM 0x16 565#define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 566#define HCI_ERROR_INVALID_LL_PARAMS 0x1e 567#define HCI_ERROR_UNSPECIFIED 0x1f 568#define HCI_ERROR_ADVERTISING_TIMEOUT 0x3c | 345 346 __HCI_NUM_FLAGS, 347}; 348 349/* HCI timeouts */ 350#define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 351#define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ 352#define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ --- 218 unchanged lines hidden (view full) --- 571#define HCI_ERROR_REMOTE_USER_TERM 0x13 572#define HCI_ERROR_REMOTE_LOW_RESOURCES 0x14 573#define HCI_ERROR_REMOTE_POWER_OFF 0x15 574#define HCI_ERROR_LOCAL_HOST_TERM 0x16 575#define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 576#define HCI_ERROR_INVALID_LL_PARAMS 0x1e 577#define HCI_ERROR_UNSPECIFIED 0x1f 578#define HCI_ERROR_ADVERTISING_TIMEOUT 0x3c |
579#define HCI_ERROR_CANCELLED_BY_HOST 0x44 |
|
569 570/* Flow control modes */ 571#define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 572#define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 573 574/* The core spec defines 127 as the "not available" value */ 575#define HCI_TX_POWER_INVALID 127 576#define HCI_RSSI_INVALID 127 --- 464 unchanged lines hidden (view full) --- 1041 1042#define HCI_OP_READ_STORED_LINK_KEY 0x0c0d 1043struct hci_cp_read_stored_link_key { 1044 bdaddr_t bdaddr; 1045 __u8 read_all; 1046} __packed; 1047struct hci_rp_read_stored_link_key { 1048 __u8 status; | 580 581/* Flow control modes */ 582#define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 583#define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 584 585/* The core spec defines 127 as the "not available" value */ 586#define HCI_TX_POWER_INVALID 127 587#define HCI_RSSI_INVALID 127 --- 464 unchanged lines hidden (view full) --- 1052 1053#define HCI_OP_READ_STORED_LINK_KEY 0x0c0d 1054struct hci_cp_read_stored_link_key { 1055 bdaddr_t bdaddr; 1056 __u8 read_all; 1057} __packed; 1058struct hci_rp_read_stored_link_key { 1059 __u8 status; |
1049 __u8 max_keys; 1050 __u8 num_keys; | 1060 __le16 max_keys; 1061 __le16 num_keys; |
1051} __packed; 1052 1053#define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 1054struct hci_cp_delete_stored_link_key { 1055 bdaddr_t bdaddr; 1056 __u8 delete_all; 1057} __packed; 1058struct hci_rp_delete_stored_link_key { 1059 __u8 status; | 1062} __packed; 1063 1064#define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 1065struct hci_cp_delete_stored_link_key { 1066 bdaddr_t bdaddr; 1067 __u8 delete_all; 1068} __packed; 1069struct hci_rp_delete_stored_link_key { 1070 __u8 status; |
1060 __u8 num_keys; | 1071 __le16 num_keys; |
1061} __packed; 1062 1063#define HCI_MAX_NAME_LENGTH 248 1064 1065#define HCI_OP_WRITE_LOCAL_NAME 0x0c13 1066struct hci_cp_write_local_name { 1067 __u8 name[HCI_MAX_NAME_LENGTH]; 1068} __packed; --- 856 unchanged lines hidden (view full) --- 1925 1926#define HCI_OP_LE_READ_TRANSMIT_POWER 0x204b 1927struct hci_rp_le_read_transmit_power { 1928 __u8 status; 1929 __s8 min_le_tx_power; 1930 __s8 max_le_tx_power; 1931} __packed; 1932 | 1072} __packed; 1073 1074#define HCI_MAX_NAME_LENGTH 248 1075 1076#define HCI_OP_WRITE_LOCAL_NAME 0x0c13 1077struct hci_cp_write_local_name { 1078 __u8 name[HCI_MAX_NAME_LENGTH]; 1079} __packed; --- 856 unchanged lines hidden (view full) --- 1936 1937#define HCI_OP_LE_READ_TRANSMIT_POWER 0x204b 1938struct hci_rp_le_read_transmit_power { 1939 __u8 status; 1940 __s8 min_le_tx_power; 1941 __s8 max_le_tx_power; 1942} __packed; 1943 |
1944#define HCI_NETWORK_PRIVACY 0x00 1945#define HCI_DEVICE_PRIVACY 0x01 1946 1947#define HCI_OP_LE_SET_PRIVACY_MODE 0x204e 1948struct hci_cp_le_set_privacy_mode { 1949 __u8 bdaddr_type; 1950 bdaddr_t bdaddr; 1951 __u8 mode; 1952} __packed; 1953 |
|
1933#define HCI_OP_LE_READ_BUFFER_SIZE_V2 0x2060 1934struct hci_rp_le_read_buffer_size_v2 { 1935 __u8 status; 1936 __le16 acl_mtu; 1937 __u8 acl_max_pkt; 1938 __le16 iso_mtu; 1939 __u8 iso_max_pkt; 1940} __packed; --- 65 unchanged lines hidden (view full) --- 2006 2007#define HCI_OP_LE_REJECT_CIS 0x2067 2008struct hci_cp_le_reject_cis { 2009 __le16 handle; 2010 __u8 reason; 2011} __packed; 2012 2013/* ---- HCI Events ---- */ | 1954#define HCI_OP_LE_READ_BUFFER_SIZE_V2 0x2060 1955struct hci_rp_le_read_buffer_size_v2 { 1956 __u8 status; 1957 __le16 acl_mtu; 1958 __u8 acl_max_pkt; 1959 __le16 iso_mtu; 1960 __u8 iso_max_pkt; 1961} __packed; --- 65 unchanged lines hidden (view full) --- 2027 2028#define HCI_OP_LE_REJECT_CIS 0x2067 2029struct hci_cp_le_reject_cis { 2030 __le16 handle; 2031 __u8 reason; 2032} __packed; 2033 2034/* ---- HCI Events ---- */ |
2035struct hci_ev_status { 2036 __u8 status; 2037} __packed; 2038 |
|
2014#define HCI_EV_INQUIRY_COMPLETE 0x01 2015 2016#define HCI_EV_INQUIRY_RESULT 0x02 2017struct inquiry_info { 2018 bdaddr_t bdaddr; 2019 __u8 pscan_rep_mode; 2020 __u8 pscan_period_mode; 2021 __u8 pscan_mode; 2022 __u8 dev_class[3]; 2023 __le16 clock_offset; 2024} __packed; 2025 | 2039#define HCI_EV_INQUIRY_COMPLETE 0x01 2040 2041#define HCI_EV_INQUIRY_RESULT 0x02 2042struct inquiry_info { 2043 bdaddr_t bdaddr; 2044 __u8 pscan_rep_mode; 2045 __u8 pscan_period_mode; 2046 __u8 pscan_mode; 2047 __u8 dev_class[3]; 2048 __le16 clock_offset; 2049} __packed; 2050 |
2051struct hci_ev_inquiry_result { 2052 __u8 num; 2053 struct inquiry_info info[]; 2054}; 2055 |
|
2026#define HCI_EV_CONN_COMPLETE 0x03 2027struct hci_ev_conn_complete { 2028 __u8 status; 2029 __le16 handle; 2030 bdaddr_t bdaddr; 2031 __u8 link_type; 2032 __u8 encr_mode; 2033} __packed; --- 95 unchanged lines hidden (view full) --- 2129 2130#define HCI_EV_NUM_COMP_PKTS 0x13 2131struct hci_comp_pkts_info { 2132 __le16 handle; 2133 __le16 count; 2134} __packed; 2135 2136struct hci_ev_num_comp_pkts { | 2056#define HCI_EV_CONN_COMPLETE 0x03 2057struct hci_ev_conn_complete { 2058 __u8 status; 2059 __le16 handle; 2060 bdaddr_t bdaddr; 2061 __u8 link_type; 2062 __u8 encr_mode; 2063} __packed; --- 95 unchanged lines hidden (view full) --- 2159 2160#define HCI_EV_NUM_COMP_PKTS 0x13 2161struct hci_comp_pkts_info { 2162 __le16 handle; 2163 __le16 count; 2164} __packed; 2165 2166struct hci_ev_num_comp_pkts { |
2137 __u8 num_hndl; | 2167 __u8 num; |
2138 struct hci_comp_pkts_info handles[]; 2139} __packed; 2140 2141#define HCI_EV_MODE_CHANGE 0x14 2142struct hci_ev_mode_change { 2143 __u8 status; 2144 __le16 handle; 2145 __u8 mode; --- 33 unchanged lines hidden (view full) --- 2179 2180#define HCI_EV_PSCAN_REP_MODE 0x20 2181struct hci_ev_pscan_rep_mode { 2182 bdaddr_t bdaddr; 2183 __u8 pscan_rep_mode; 2184} __packed; 2185 2186#define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22 | 2168 struct hci_comp_pkts_info handles[]; 2169} __packed; 2170 2171#define HCI_EV_MODE_CHANGE 0x14 2172struct hci_ev_mode_change { 2173 __u8 status; 2174 __le16 handle; 2175 __u8 mode; --- 33 unchanged lines hidden (view full) --- 2209 2210#define HCI_EV_PSCAN_REP_MODE 0x20 2211struct hci_ev_pscan_rep_mode { 2212 bdaddr_t bdaddr; 2213 __u8 pscan_rep_mode; 2214} __packed; 2215 2216#define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22 |
2187struct inquiry_info_with_rssi { | 2217struct inquiry_info_rssi { |
2188 bdaddr_t bdaddr; 2189 __u8 pscan_rep_mode; 2190 __u8 pscan_period_mode; 2191 __u8 dev_class[3]; 2192 __le16 clock_offset; 2193 __s8 rssi; 2194} __packed; | 2218 bdaddr_t bdaddr; 2219 __u8 pscan_rep_mode; 2220 __u8 pscan_period_mode; 2221 __u8 dev_class[3]; 2222 __le16 clock_offset; 2223 __s8 rssi; 2224} __packed; |
2195struct inquiry_info_with_rssi_and_pscan_mode { | 2225struct inquiry_info_rssi_pscan { |
2196 bdaddr_t bdaddr; 2197 __u8 pscan_rep_mode; 2198 __u8 pscan_period_mode; 2199 __u8 pscan_mode; 2200 __u8 dev_class[3]; 2201 __le16 clock_offset; 2202 __s8 rssi; 2203} __packed; | 2226 bdaddr_t bdaddr; 2227 __u8 pscan_rep_mode; 2228 __u8 pscan_period_mode; 2229 __u8 pscan_mode; 2230 __u8 dev_class[3]; 2231 __le16 clock_offset; 2232 __s8 rssi; 2233} __packed; |
2234struct hci_ev_inquiry_result_rssi { 2235 __u8 num; 2236 __u8 data[]; 2237} __packed; |
|
2204 2205#define HCI_EV_REMOTE_EXT_FEATURES 0x23 2206struct hci_ev_remote_ext_features { 2207 __u8 status; 2208 __le16 handle; 2209 __u8 page; 2210 __u8 max_page; 2211 __u8 features[8]; --- 38 unchanged lines hidden (view full) --- 2250 __u8 pscan_rep_mode; 2251 __u8 pscan_period_mode; 2252 __u8 dev_class[3]; 2253 __le16 clock_offset; 2254 __s8 rssi; 2255 __u8 data[240]; 2256} __packed; 2257 | 2238 2239#define HCI_EV_REMOTE_EXT_FEATURES 0x23 2240struct hci_ev_remote_ext_features { 2241 __u8 status; 2242 __le16 handle; 2243 __u8 page; 2244 __u8 max_page; 2245 __u8 features[8]; --- 38 unchanged lines hidden (view full) --- 2284 __u8 pscan_rep_mode; 2285 __u8 pscan_period_mode; 2286 __u8 dev_class[3]; 2287 __le16 clock_offset; 2288 __s8 rssi; 2289 __u8 data[240]; 2290} __packed; 2291 |
2292struct hci_ev_ext_inquiry_result { 2293 __u8 num; 2294 struct extended_inquiry_info info[]; 2295} __packed; 2296 |
|
2258#define HCI_EV_KEY_REFRESH_COMPLETE 0x30 2259struct hci_ev_key_refresh_complete { 2260 __u8 status; 2261 __le16 handle; 2262} __packed; 2263 2264#define HCI_EV_IO_CAPA_REQUEST 0x31 2265struct hci_ev_io_capa_request { --- 151 unchanged lines hidden (view full) --- 2417 2418#define ADDR_LE_DEV_PUBLIC 0x00 2419#define ADDR_LE_DEV_RANDOM 0x01 2420#define ADDR_LE_DEV_PUBLIC_RESOLVED 0x02 2421#define ADDR_LE_DEV_RANDOM_RESOLVED 0x03 2422 2423#define HCI_EV_LE_ADVERTISING_REPORT 0x02 2424struct hci_ev_le_advertising_info { | 2297#define HCI_EV_KEY_REFRESH_COMPLETE 0x30 2298struct hci_ev_key_refresh_complete { 2299 __u8 status; 2300 __le16 handle; 2301} __packed; 2302 2303#define HCI_EV_IO_CAPA_REQUEST 0x31 2304struct hci_ev_io_capa_request { --- 151 unchanged lines hidden (view full) --- 2456 2457#define ADDR_LE_DEV_PUBLIC 0x00 2458#define ADDR_LE_DEV_RANDOM 0x01 2459#define ADDR_LE_DEV_PUBLIC_RESOLVED 0x02 2460#define ADDR_LE_DEV_RANDOM_RESOLVED 0x03 2461 2462#define HCI_EV_LE_ADVERTISING_REPORT 0x02 2463struct hci_ev_le_advertising_info { |
2425 __u8 evt_type; | 2464 __u8 type; |
2426 __u8 bdaddr_type; 2427 bdaddr_t bdaddr; 2428 __u8 length; 2429 __u8 data[]; 2430} __packed; 2431 | 2465 __u8 bdaddr_type; 2466 bdaddr_t bdaddr; 2467 __u8 length; 2468 __u8 data[]; 2469} __packed; 2470 |
2471struct hci_ev_le_advertising_report { 2472 __u8 num; 2473 struct hci_ev_le_advertising_info info[]; 2474} __packed; 2475 |
|
2432#define HCI_EV_LE_CONN_UPDATE_COMPLETE 0x03 2433struct hci_ev_le_conn_update_complete { 2434 __u8 status; 2435 __le16 handle; 2436 __le16 interval; 2437 __le16 latency; 2438 __le16 supervision_timeout; 2439} __packed; --- 27 unchanged lines hidden (view full) --- 2467 __le16 tx_len; 2468 __le16 tx_time; 2469 __le16 rx_len; 2470 __le16 rx_time; 2471} __packed; 2472 2473#define HCI_EV_LE_DIRECT_ADV_REPORT 0x0B 2474struct hci_ev_le_direct_adv_info { | 2476#define HCI_EV_LE_CONN_UPDATE_COMPLETE 0x03 2477struct hci_ev_le_conn_update_complete { 2478 __u8 status; 2479 __le16 handle; 2480 __le16 interval; 2481 __le16 latency; 2482 __le16 supervision_timeout; 2483} __packed; --- 27 unchanged lines hidden (view full) --- 2511 __le16 tx_len; 2512 __le16 tx_time; 2513 __le16 rx_len; 2514 __le16 rx_time; 2515} __packed; 2516 2517#define HCI_EV_LE_DIRECT_ADV_REPORT 0x0B 2518struct hci_ev_le_direct_adv_info { |
2475 __u8 evt_type; | 2519 __u8 type; |
2476 __u8 bdaddr_type; 2477 bdaddr_t bdaddr; 2478 __u8 direct_addr_type; 2479 bdaddr_t direct_addr; 2480 __s8 rssi; 2481} __packed; 2482 | 2520 __u8 bdaddr_type; 2521 bdaddr_t bdaddr; 2522 __u8 direct_addr_type; 2523 bdaddr_t direct_addr; 2524 __s8 rssi; 2525} __packed; 2526 |
2527struct hci_ev_le_direct_adv_report { 2528 __u8 num; 2529 struct hci_ev_le_direct_adv_info info[]; 2530} __packed; 2531 |
|
2483#define HCI_EV_LE_PHY_UPDATE_COMPLETE 0x0c 2484struct hci_ev_le_phy_update_complete { 2485 __u8 status; 2486 __le16 handle; 2487 __u8 tx_phy; 2488 __u8 rx_phy; 2489} __packed; 2490 2491#define HCI_EV_LE_EXT_ADV_REPORT 0x0d | 2532#define HCI_EV_LE_PHY_UPDATE_COMPLETE 0x0c 2533struct hci_ev_le_phy_update_complete { 2534 __u8 status; 2535 __le16 handle; 2536 __u8 tx_phy; 2537 __u8 rx_phy; 2538} __packed; 2539 2540#define HCI_EV_LE_EXT_ADV_REPORT 0x0d |
2492struct hci_ev_le_ext_adv_report { 2493 __le16 evt_type; | 2541struct hci_ev_le_ext_adv_info { 2542 __le16 type; |
2494 __u8 bdaddr_type; 2495 bdaddr_t bdaddr; 2496 __u8 primary_phy; 2497 __u8 secondary_phy; 2498 __u8 sid; 2499 __u8 tx_power; 2500 __s8 rssi; | 2543 __u8 bdaddr_type; 2544 bdaddr_t bdaddr; 2545 __u8 primary_phy; 2546 __u8 secondary_phy; 2547 __u8 sid; 2548 __u8 tx_power; 2549 __s8 rssi; |
2501 __le16 interval; 2502 __u8 direct_addr_type; | 2550 __le16 interval; 2551 __u8 direct_addr_type; |
2503 bdaddr_t direct_addr; | 2552 bdaddr_t direct_addr; |
2504 __u8 length; 2505 __u8 data[]; | 2553 __u8 length; 2554 __u8 data[]; |
2506} __packed; 2507 | 2555} __packed; 2556 |
2557struct hci_ev_le_ext_adv_report { 2558 __u8 num; 2559 struct hci_ev_le_ext_adv_info info[]; 2560} __packed; 2561 |
|
2508#define HCI_EV_LE_ENHANCED_CONN_COMPLETE 0x0a 2509struct hci_ev_le_enh_conn_complete { 2510 __u8 status; 2511 __le16 handle; 2512 __u8 role; 2513 __u8 bdaddr_type; 2514 bdaddr_t bdaddr; 2515 bdaddr_t local_rpa; --- 164 unchanged lines hidden --- | 2562#define HCI_EV_LE_ENHANCED_CONN_COMPLETE 0x0a 2563struct hci_ev_le_enh_conn_complete { 2564 __u8 status; 2565 __le16 handle; 2566 __u8 role; 2567 __u8 bdaddr_type; 2568 bdaddr_t bdaddr; 2569 bdaddr_t local_rpa; --- 164 unchanged lines hidden --- |