Johan Hedberg says: ==================== pull request: bluetooth-next 2020-07-31 Here's the main bluetooth-next pull request for 5.9: - Fix firmware filenames for Marvell chipsets - Several suspend-related fixes - Addedd mgmt commands for runtime configuration - Multiple fixes for Qualcomm-based controllers - Add new monitoring feature for mgmt - Fix handling of legacy cipher (E4) together with security level 4 - Add support for Realtek 8822CE controller - Fix issues with Chinese controllers using fake VID/PID values - Multiple other smaller fixes & improvements ====================
Showing the changes to include (6 of 44 files). Show all
Unified · Split
| @@ -41,6 +41,8 @@ · 40 unmodified lines | ||
| 41 | 41 | #define BLUETOOTH_VER_1_1 1 |
| 42 | 42 | #define BLUETOOTH_VER_1_2 2 |
| 43 | 43 | #define BLUETOOTH_VER_2_0 3 |
| 44 | +#define BLUETOOTH_VER_2_1 4 | |
| 45 | +#define BLUETOOTH_VER_4_0 6 | |
| 44 | 46 | |
| 45 | 47 | /* Reserv for core and drivers use */ |
| 46 | 48 | #define BT_SKB_RESERVE 8 |
| @@ -147,6 +149,10 @@ struct bt_voice { · 100 unmodified lines | ||
| 147 | 149 | #define BT_MODE_LE_FLOWCTL 0x03 |
| 148 | 150 | #define BT_MODE_EXT_FLOWCTL 0x04 |
| 149 | 151 | |
| 152 | +#define BT_PKT_STATUS 16 | |
| 153 | + | |
| 154 | +#define BT_SCM_PKT_STATUS 0x03 | |
| 155 | + | |
| 150 | 156 | __printf(1, 2) |
| 151 | 157 | void bt_info(const char *fmt, ...); |
| 152 | 158 | __printf(1, 2) |
| @@ -286,6 +292,7 @@ struct bt_sock { · 133 unmodified lines | ||
| 286 | 292 | struct sock *parent; |
| 287 | 293 | unsigned long flags; |
| 288 | 294 | void (*skb_msg_name)(struct sk_buff *, void *, int *); |
| 295 | + void (*skb_put_cmsg)(struct sk_buff *, struct msghdr *, struct sock *); | |
| 289 | 296 | }; |
| 290 | 297 | |
| 291 | 298 | enum { |
| @@ -335,6 +342,10 @@ struct l2cap_ctrl { · 43 unmodified lines | ||
| 335 | 342 | struct l2cap_chan *chan; |
| 336 | 343 | }; |
| 337 | 344 | |
| 345 | +struct sco_ctrl { | |
| 346 | + u8 pkt_status; | |
| 347 | +}; | |
| 348 | + | |
| 338 | 349 | struct hci_dev; |
| 339 | 350 | |
| 340 | 351 | typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status, u16 opcode); |
| @@ -361,6 +372,7 @@ struct bt_skb_cb { · 20 unmodified lines | ||
| 361 | 372 | u8 incoming:1; |
| 362 | 373 | union { |
| 363 | 374 | struct l2cap_ctrl l2cap; |
| 375 | + struct sco_ctrl sco; | |
| 364 | 376 | struct hci_ctrl hci; |
| 365 | 377 | }; |
| 366 | 378 | }; |
| @@ -227,6 +227,17 @@ enum { · 226 unmodified lines | ||
| 227 | 227 | * supported. |
| 228 | 228 | */ |
| 229 | 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, | |
| 230 | 241 | }; |
| 231 | 242 | |
| 232 | 243 | /* HCI device flags */ |
| @@ -307,6 +318,7 @@ enum { · 74 unmodified lines | ||
| 307 | 318 | HCI_FORCE_BREDR_SMP, |
| 308 | 319 | HCI_FORCE_STATIC_ADDR, |
| 309 | 320 | HCI_LL_RPA_RESOLUTION, |
| 321 | + HCI_ENABLE_LL_PRIVACY, | |
| 310 | 322 | HCI_CMD_PENDING, |
| 311 | 323 | HCI_FORCE_NO_MITM, |
| 312 | 324 | |
| @@ -1637,6 +1649,8 @@ struct hci_rp_le_read_resolv_list_size { · 1324 unmodified lines | ||
| 1637 | 1649 | |
| 1638 | 1650 | #define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d |
| 1639 | 1651 | |
| 1652 | +#define HCI_OP_LE_SET_RPA_TIMEOUT 0x202e | |
| 1653 | + | |
| 1640 | 1654 | #define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f |
| 1641 | 1655 | struct hci_rp_le_read_max_data_len { |
| 1642 | 1656 | __u8 status; |
| @@ -2268,8 +2282,10 @@ struct hci_ev_le_conn_complete { · 625 unmodified lines | ||
| 2268 | 2282 | #define LE_EXT_ADV_SCAN_RSP 0x0008 |
| 2269 | 2283 | #define LE_EXT_ADV_LEGACY_PDU 0x0010 |
| 2270 | 2284 | |
| 2271 | −#define ADDR_LE_DEV_PUBLIC 0x00 | |
| 2272 | −#define ADDR_LE_DEV_RANDOM 0x01 | |
| 2285 | +#define ADDR_LE_DEV_PUBLIC 0x00 | |
| 2286 | +#define ADDR_LE_DEV_RANDOM 0x01 | |
| 2287 | +#define ADDR_LE_DEV_PUBLIC_RESOLVED 0x02 | |
| 2288 | +#define ADDR_LE_DEV_RANDOM_RESOLVED 0x03 | |
| 2273 | 2289 | |
| 2274 | 2290 | #define HCI_EV_LE_ADVERTISING_REPORT 0x02 |
| 2275 | 2291 | struct hci_ev_le_advertising_info { |
| @@ -2516,4 +2532,12 @@ static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) · 240 unmodified lines | ||
| 2516 | 2532 | #define hci_iso_data_len(h) ((h) & 0x3fff) |
| 2517 | 2533 | #define hci_iso_data_flags(h) ((h) >> 14) |
| 2518 | 2534 | |
| 2535 | +/* le24 support */ | |
| 2536 | +static inline void hci_cpu_to_le24(__u32 val, __u8 dst[3]) | |
| 2537 | +{ | |
| 2538 | + dst[0] = val & 0xff; | |
| 2539 | + dst[1] = (val & 0xff00) >> 8; | |
| 2540 | + dst[2] = (val & 0xff0000) >> 16; | |
| 2541 | +} | |
| 2542 | + | |
| 2519 | 2543 | #endif /* __HCI_H */ |
| @@ -25,6 +25,7 @@ · 24 unmodified lines | ||
| 25 | 25 | #ifndef __HCI_CORE_H |
| 26 | 26 | #define __HCI_CORE_H |
| 27 | 27 | |
| 28 | +#include <linux/idr.h> | |
| 28 | 29 | #include <linux/leds.h> |
| 29 | 30 | #include <linux/rculist.h> |
| 30 | 31 | |
| @@ -136,6 +137,23 @@ struct bdaddr_list_with_irk { · 105 unmodified lines | ||
| 136 | 137 | u8 local_irk[16]; |
| 137 | 138 | }; |
| 138 | 139 | |
| 140 | +struct bdaddr_list_with_flags { | |
| 141 | + struct list_head list; | |
| 142 | + bdaddr_t bdaddr; | |
| 143 | + u8 bdaddr_type; | |
| 144 | + u32 current_flags; | |
| 145 | +}; | |
| 146 | + | |
| 147 | +enum hci_conn_flags { | |
| 148 | + HCI_CONN_FLAG_REMOTE_WAKEUP, | |
| 149 | + HCI_CONN_FLAG_MAX | |
| 150 | +}; | |
| 151 | + | |
| 152 | +#define hci_conn_test_flag(nr, flags) ((flags) & (1U << nr)) | |
| 153 | + | |
| 154 | +/* Make sure number of flags doesn't exceed sizeof(current_flags) */ | |
| 155 | +static_assert(HCI_CONN_FLAG_MAX < 32); | |
| 156 | + | |
| 139 | 157 | struct bt_uuid { |
| 140 | 158 | struct list_head list; |
| 141 | 159 | u8 uuid[16]; |
| @@ -220,6 +238,24 @@ struct adv_info { · 78 unmodified lines | ||
| 220 | 238 | #define HCI_MAX_ADV_INSTANCES 5 |
| 221 | 239 | #define HCI_DEFAULT_ADV_DURATION 2 |
| 222 | 240 | |
| 241 | +struct adv_pattern { | |
| 242 | + struct list_head list; | |
| 243 | + __u8 ad_type; | |
| 244 | + __u8 offset; | |
| 245 | + __u8 length; | |
| 246 | + __u8 value[HCI_MAX_AD_LENGTH]; | |
| 247 | +}; | |
| 248 | + | |
| 249 | +struct adv_monitor { | |
| 250 | + struct list_head patterns; | |
| 251 | + bool active; | |
| 252 | + __u16 handle; | |
| 253 | +}; | |
| 254 | + | |
| 255 | +#define HCI_MIN_ADV_MONITOR_HANDLE 1 | |
| 256 | +#define HCI_MAX_ADV_MONITOR_NUM_HANDLES 32 | |
| 257 | +#define HCI_MAX_ADV_MONITOR_NUM_PATTERNS 16 | |
| 258 | + | |
| 223 | 259 | #define HCI_MAX_SHORT_NAME_LENGTH 10 |
| 224 | 260 | |
| 225 | 261 | /* Min encryption key size to match with SMP */ |
| @@ -295,6 +331,14 @@ struct hci_dev { · 69 unmodified lines | ||
| 295 | 331 | __u8 le_scan_type; |
| 296 | 332 | __u16 le_scan_interval; |
| 297 | 333 | __u16 le_scan_window; |
| 334 | + __u16 le_scan_int_suspend; | |
| 335 | + __u16 le_scan_window_suspend; | |
| 336 | + __u16 le_scan_int_discovery; | |
| 337 | + __u16 le_scan_window_discovery; | |
| 338 | + __u16 le_scan_int_adv_monitor; | |
| 339 | + __u16 le_scan_window_adv_monitor; | |
| 340 | + __u16 le_scan_int_connect; | |
| 341 | + __u16 le_scan_window_connect; | |
| 298 | 342 | __u16 le_conn_min_interval; |
| 299 | 343 | __u16 le_conn_max_interval; |
| 300 | 344 | __u16 le_conn_latency; |
| @@ -323,6 +367,17 @@ struct hci_dev { · 22 unmodified lines | ||
| 323 | 367 | __u16 devid_product; |
| 324 | 368 | __u16 devid_version; |
| 325 | 369 | |
| 370 | + __u8 def_page_scan_type; | |
| 371 | + __u16 def_page_scan_int; | |
| 372 | + __u16 def_page_scan_window; | |
| 373 | + __u8 def_inq_scan_type; | |
| 374 | + __u16 def_inq_scan_int; | |
| 375 | + __u16 def_inq_scan_window; | |
| 376 | + __u16 def_br_lsto; | |
| 377 | + __u16 def_page_timeout; | |
| 378 | + __u16 def_multi_adv_rotation_duration; | |
| 379 | + __u16 def_le_autoconnect_timeout; | |
| 380 | + | |
| 326 | 381 | __u16 pkt_type; |
| 327 | 382 | __u16 esco_type; |
| 328 | 383 | __u16 link_policy; |
| @@ -438,7 +493,6 @@ struct hci_dev { · 109 unmodified lines | ||
| 438 | 493 | struct list_head mgmt_pending; |
| 439 | 494 | struct list_head blacklist; |
| 440 | 495 | struct list_head whitelist; |
| 441 | − struct list_head wakeable; | |
| 442 | 496 | struct list_head uuids; |
| 443 | 497 | struct list_head link_keys; |
| 444 | 498 | struct list_head long_term_keys; |
| @@ -477,6 +531,9 @@ struct hci_dev { · 32 unmodified lines | ||
| 477 | 531 | __u16 adv_instance_timeout; |
| 478 | 532 | struct delayed_work adv_instance_expire; |
| 479 | 533 | |
| 534 | + struct idr adv_monitors_idr; | |
| 535 | + unsigned int adv_monitors_cnt; | |
| 536 | + | |
| 480 | 537 | __u8 irk[16]; |
| 481 | 538 | __u32 rpa_timeout; |
| 482 | 539 | struct delayed_work rpa_expired; |
| @@ -508,6 +565,12 @@ struct hci_dev { · 25 unmodified lines | ||
| 508 | 565 | |
| 509 | 566 | #define HCI_PHY_HANDLE(handle) (handle & 0xff) |
| 510 | 567 | |
| 568 | +enum conn_reasons { | |
| 569 | + CONN_REASON_PAIR_DEVICE, | |
| 570 | + CONN_REASON_L2CAP_CHAN, | |
| 571 | + CONN_REASON_SCO_CONNECT, | |
| 572 | +}; | |
| 573 | + | |
| 511 | 574 | struct hci_conn { |
| 512 | 575 | struct list_head list; |
| 513 | 576 | |
| @@ -559,6 +622,8 @@ struct hci_conn { · 45 unmodified lines | ||
| 559 | 622 | __s8 max_tx_power; |
| 560 | 623 | unsigned long flags; |
| 561 | 624 | |
| 625 | + enum conn_reasons conn_reason; | |
| 626 | + | |
| 562 | 627 | __u32 clock; |
| 563 | 628 | __u16 clock_accuracy; |
| 564 | 629 | |
| @@ -626,7 +691,7 @@ struct hci_conn_params { · 61 unmodified lines | ||
| 626 | 691 | |
| 627 | 692 | struct hci_conn *conn; |
| 628 | 693 | bool explicit_connect; |
| 629 | − bool wakeable; | |
| 694 | + u32 current_flags; | |
| 630 | 695 | }; |
| 631 | 696 | |
| 632 | 697 | extern struct list_head hci_dev_list; |
| @@ -984,12 +1049,14 @@ struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle); · 351 unmodified lines | ||
| 984 | 1049 | |
| 985 | 1050 | struct hci_conn *hci_connect_le_scan(struct hci_dev *hdev, bdaddr_t *dst, |
| 986 | 1051 | u8 dst_type, u8 sec_level, |
| 987 | − u16 conn_timeout); | |
| 1052 | + u16 conn_timeout, | |
| 1053 | + enum conn_reasons conn_reason); | |
| 988 | 1054 | struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst, |
| 989 | 1055 | u8 dst_type, u8 sec_level, u16 conn_timeout, |
| 990 | 1056 | u8 role, bdaddr_t *direct_rpa); |
| 991 | 1057 | struct hci_conn *hci_connect_acl(struct hci_dev *hdev, bdaddr_t *dst, |
| 992 | − u8 sec_level, u8 auth_type); | |
| 1058 | + u8 sec_level, u8 auth_type, | |
| 1059 | + enum conn_reasons conn_reason); | |
| 993 | 1060 | struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst, |
| 994 | 1061 | __u16 setting); |
| 995 | 1062 | int hci_conn_check_link_mode(struct hci_conn *conn); |
| @@ -1151,12 +1218,19 @@ struct bdaddr_list *hci_bdaddr_list_lookup(struct list_head *list, · 155 unmodified lines | ||
| 1151 | 1218 | struct bdaddr_list_with_irk *hci_bdaddr_list_lookup_with_irk( |
| 1152 | 1219 | struct list_head *list, bdaddr_t *bdaddr, |
| 1153 | 1220 | u8 type); |
| 1221 | +struct bdaddr_list_with_flags * | |
| 1222 | +hci_bdaddr_list_lookup_with_flags(struct list_head *list, bdaddr_t *bdaddr, | |
| 1223 | + u8 type); | |
| 1154 | 1224 | int hci_bdaddr_list_add(struct list_head *list, bdaddr_t *bdaddr, u8 type); |
| 1155 | 1225 | int hci_bdaddr_list_add_with_irk(struct list_head *list, bdaddr_t *bdaddr, |
| 1156 | − u8 type, u8 *peer_irk, u8 *local_irk); | |
| 1226 | + u8 type, u8 *peer_irk, u8 *local_irk); | |
| 1227 | +int hci_bdaddr_list_add_with_flags(struct list_head *list, bdaddr_t *bdaddr, | |
| 1228 | + u8 type, u32 flags); | |
| 1157 | 1229 | int hci_bdaddr_list_del(struct list_head *list, bdaddr_t *bdaddr, u8 type); |
| 1158 | 1230 | int hci_bdaddr_list_del_with_irk(struct list_head *list, bdaddr_t *bdaddr, |
| 1159 | − u8 type); | |
| 1231 | + u8 type); | |
| 1232 | +int hci_bdaddr_list_del_with_flags(struct list_head *list, bdaddr_t *bdaddr, | |
| 1233 | + u8 type); | |
| 1160 | 1234 | void hci_bdaddr_list_clear(struct list_head *list); |
| 1161 | 1235 | |
| 1162 | 1236 | struct hci_conn_params *hci_conn_params_lookup(struct hci_dev *hdev, |
| @@ -1217,6 +1291,12 @@ int hci_add_adv_instance(struct hci_dev *hdev, u8 instance, u32 flags, · 54 unmodified lines | ||
| 1217 | 1291 | int hci_remove_adv_instance(struct hci_dev *hdev, u8 instance); |
| 1218 | 1292 | void hci_adv_instances_set_rpa_expired(struct hci_dev *hdev, bool rpa_expired); |
| 1219 | 1293 | |
| 1294 | +void hci_adv_monitors_clear(struct hci_dev *hdev); | |
| 1295 | +void hci_free_adv_monitor(struct adv_monitor *monitor); | |
| 1296 | +int hci_add_adv_monitor(struct hci_dev *hdev, struct adv_monitor *monitor); | |
| 1297 | +int hci_remove_adv_monitor(struct hci_dev *hdev, u16 handle); | |
| 1298 | +bool hci_is_adv_monitoring(struct hci_dev *hdev); | |
| 1299 | + | |
| 1220 | 1300 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); |
| 1221 | 1301 | |
| 1222 | 1302 | void hci_init_sysfs(struct hci_dev *hdev); |
| @@ -1279,6 +1359,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn); · 56 unmodified lines | ||
| 1279 | 1359 | #define scan_coded(dev) (((dev)->le_tx_def_phys & HCI_LE_SET_PHY_CODED) || \ |
| 1280 | 1360 | ((dev)->le_rx_def_phys & HCI_LE_SET_PHY_CODED)) |
| 1281 | 1361 | |
| 1362 | +/* Use LL Privacy based address resolution if supported */ | |
| 1363 | +#define use_ll_privacy(dev) ((dev)->le_features[0] & HCI_LE_LL_PRIVACY) | |
| 1364 | + | |
| 1282 | 1365 | /* Use ext scanning if set ext scan param and ext scan enable is supported */ |
| 1283 | 1366 | #define use_ext_scan(dev) (((dev)->commands[37] & 0x20) && \ |
| 1284 | 1367 | ((dev)->commands[37] & 0x40)) |
| @@ -1387,7 +1470,7 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status) · 102 unmodified lines | ||
| 1387 | 1470 | __u8 encrypt; |
| 1388 | 1471 | |
| 1389 | 1472 | if (conn->state == BT_CONFIG) { |
| 1390 | − if (status) | |
| 1473 | + if (!status) | |
| 1391 | 1474 | conn->state = BT_CONNECTED; |
| 1392 | 1475 | |
| 1393 | 1476 | hci_connect_cfm(conn, status); |
| @@ -1402,11 +1485,13 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status) · 8 unmodified lines | ||
| 1402 | 1485 | else |
| 1403 | 1486 | encrypt = 0x01; |
| 1404 | 1487 | |
| 1405 | − if (conn->sec_level == BT_SECURITY_SDP) | |
| 1406 | − conn->sec_level = BT_SECURITY_LOW; | |
| 1488 | + if (!status) { | |
| 1489 | + if (conn->sec_level == BT_SECURITY_SDP) | |
| 1490 | + conn->sec_level = BT_SECURITY_LOW; | |
| 1407 | 1491 | |
| 1408 | − if (conn->pending_sec_level > conn->sec_level) | |
| 1409 | − conn->sec_level = conn->pending_sec_level; | |
| 1492 | + if (conn->pending_sec_level > conn->sec_level) | |
| 1493 | + conn->sec_level = conn->pending_sec_level; | |
| 1494 | + } | |
| 1410 | 1495 | |
| 1411 | 1496 | mutex_lock(&hci_cb_list_lock); |
| 1412 | 1497 | list_for_each_entry(cb, &hci_cb_list, list) { |
| @@ -31,8 +31,8 @@ · 30 unmodified lines | ||
| 31 | 31 | #define HCI_TIME_STAMP 3 |
| 32 | 32 | |
| 33 | 33 | /* CMSG flags */ |
| 34 | −#define HCI_CMSG_DIR 0x0001 | |
| 35 | −#define HCI_CMSG_TSTAMP 0x0002 | |
| 34 | +#define HCI_CMSG_DIR 0x01 | |
| 35 | +#define HCI_CMSG_TSTAMP 0x02 | |
| 36 | 36 | |
| 37 | 37 | struct sockaddr_hci { |
| 38 | 38 | sa_family_t hci_family; |
| @@ -52,6 +52,12 @@ struct mgmt_hdr { · 51 unmodified lines | ||
| 52 | 52 | __le16 len; |
| 53 | 53 | } __packed; |
| 54 | 54 | |
| 55 | +struct mgmt_tlv { | |
| 56 | + __le16 type; | |
| 57 | + __u8 length; | |
| 58 | + __u8 value[]; | |
| 59 | +} __packed; | |
| 60 | + | |
| 55 | 61 | struct mgmt_addr_info { |
| 56 | 62 | bdaddr_t bdaddr; |
| 57 | 63 | __u8 type; |
| @@ -702,6 +708,78 @@ struct mgmt_rp_set_exp_feature { · 644 unmodified lines | ||
| 702 | 708 | __le32 flags; |
| 703 | 709 | } __packed; |
| 704 | 710 | |
| 711 | +#define MGMT_OP_READ_DEF_SYSTEM_CONFIG 0x004b | |
| 712 | +#define MGMT_READ_DEF_SYSTEM_CONFIG_SIZE 0 | |
| 713 | + | |
| 714 | +#define MGMT_OP_SET_DEF_SYSTEM_CONFIG 0x004c | |
| 715 | +#define MGMT_SET_DEF_SYSTEM_CONFIG_SIZE 0 | |
| 716 | + | |
| 717 | +#define MGMT_OP_READ_DEF_RUNTIME_CONFIG 0x004d | |
| 718 | +#define MGMT_READ_DEF_RUNTIME_CONFIG_SIZE 0 | |
| 719 | + | |
| 720 | +#define MGMT_OP_SET_DEF_RUNTIME_CONFIG 0x004e | |
| 721 | +#define MGMT_SET_DEF_RUNTIME_CONFIG_SIZE 0 | |
| 722 | + | |
| 723 | +#define MGMT_OP_GET_DEVICE_FLAGS 0x004F | |
| 724 | +#define MGMT_GET_DEVICE_FLAGS_SIZE 7 | |
| 725 | +struct mgmt_cp_get_device_flags { | |
| 726 | + struct mgmt_addr_info addr; | |
| 727 | +} __packed; | |
| 728 | +struct mgmt_rp_get_device_flags { | |
| 729 | + struct mgmt_addr_info addr; | |
| 730 | + __le32 supported_flags; | |
| 731 | + __le32 current_flags; | |
| 732 | +} __packed; | |
| 733 | + | |
| 734 | +#define MGMT_OP_SET_DEVICE_FLAGS 0x0050 | |
| 735 | +#define MGMT_SET_DEVICE_FLAGS_SIZE 11 | |
| 736 | +struct mgmt_cp_set_device_flags { | |
| 737 | + struct mgmt_addr_info addr; | |
| 738 | + __le32 current_flags; | |
| 739 | +} __packed; | |
| 740 | +struct mgmt_rp_set_device_flags { | |
| 741 | + struct mgmt_addr_info addr; | |
| 742 | +} __packed; | |
| 743 | + | |
| 744 | +#define MGMT_ADV_MONITOR_FEATURE_MASK_OR_PATTERNS BIT(0) | |
| 745 | + | |
| 746 | +#define MGMT_OP_READ_ADV_MONITOR_FEATURES 0x0051 | |
| 747 | +#define MGMT_READ_ADV_MONITOR_FEATURES_SIZE 0 | |
| 748 | +struct mgmt_rp_read_adv_monitor_features { | |
| 749 | + __le32 supported_features; | |
| 750 | + __le32 enabled_features; | |
| 751 | + __le16 max_num_handles; | |
| 752 | + __u8 max_num_patterns; | |
| 753 | + __le16 num_handles; | |
| 754 | + __le16 handles[]; | |
| 755 | +} __packed; | |
| 756 | + | |
| 757 | +struct mgmt_adv_pattern { | |
| 758 | + __u8 ad_type; | |
| 759 | + __u8 offset; | |
| 760 | + __u8 length; | |
| 761 | + __u8 value[31]; | |
| 762 | +} __packed; | |
| 763 | + | |
| 764 | +#define MGMT_OP_ADD_ADV_PATTERNS_MONITOR 0x0052 | |
| 765 | +struct mgmt_cp_add_adv_patterns_monitor { | |
| 766 | + __u8 pattern_count; | |
| 767 | + struct mgmt_adv_pattern patterns[]; | |
| 768 | +} __packed; | |
| 769 | +#define MGMT_ADD_ADV_PATTERNS_MONITOR_SIZE 1 | |
| 770 | +struct mgmt_rp_add_adv_patterns_monitor { | |
| 771 | + __le16 monitor_handle; | |
| 772 | +} __packed; | |
| 773 | + | |
| 774 | +#define MGMT_OP_REMOVE_ADV_MONITOR 0x0053 | |
| 775 | +struct mgmt_cp_remove_adv_monitor { | |
| 776 | + __le16 monitor_handle; | |
| 777 | +} __packed; | |
| 778 | +#define MGMT_REMOVE_ADV_MONITOR_SIZE 2 | |
| 779 | +struct mgmt_rp_remove_adv_monitor { | |
| 780 | + __le16 monitor_handle; | |
| 781 | +} __packed; | |
| 782 | + | |
| 705 | 783 | #define MGMT_EV_CMD_COMPLETE 0x0001 |
| 706 | 784 | struct mgmt_ev_cmd_complete { |
| 707 | 785 | __le16 opcode; |
| @@ -933,3 +1011,20 @@ struct mgmt_ev_exp_feature_changed { · 225 unmodified lines | ||
| 933 | 1011 | __u8 uuid[16]; |
| 934 | 1012 | __le32 flags; |
| 935 | 1013 | } __packed; |
| 1014 | + | |
| 1015 | +#define MGMT_EV_DEVICE_FLAGS_CHANGED 0x002a | |
| 1016 | +struct mgmt_ev_device_flags_changed { | |
| 1017 | + struct mgmt_addr_info addr; | |
| 1018 | + __le32 supported_flags; | |
| 1019 | + __le32 current_flags; | |
| 1020 | +} __packed; | |
| 1021 | + | |
| 1022 | +#define MGMT_EV_ADV_MONITOR_ADDED 0x002b | |
| 1023 | +struct mgmt_ev_adv_monitor_added { | |
| 1024 | + __le16 monitor_handle; | |
| 1025 | +} __packed; | |
| 1026 | + | |
| 1027 | +#define MGMT_EV_ADV_MONITOR_REMOVED 0x002c | |
| 1028 | +struct mgmt_ev_adv_monitor_removed { | |
| 1029 | + __le16 monitor_handle; | |
| 1030 | +} __packed; | |
| @@ -46,4 +46,6 @@ struct sco_conninfo { · 45 unmodified lines | ||
| 46 | 46 | __u8 dev_class[3]; |
| 47 | 47 | }; |
| 48 | 48 | |
| 49 | +#define SCO_CMSG_PKT_STATUS 0x01 | |
| 50 | + | |
| 49 | 51 | #endif /* __SCO_H */ |