diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/ieee802154.h | 2 | ||||
| -rw-r--r-- | include/net/bluetooth/bluetooth.h | 3 | ||||
| -rw-r--r-- | include/net/bluetooth/hci.h | 22 | ||||
| -rw-r--r-- | include/net/bluetooth/hci_core.h | 59 | ||||
| -rw-r--r-- | include/net/bluetooth/mgmt.h | 2 |
5 files changed, 64 insertions, 24 deletions
diff --git a/include/linux/ieee802154.h b/include/linux/ieee802154.h index 40b0ab953937..8872ca103d06 100644 --- a/include/linux/ieee802154.h +++ b/include/linux/ieee802154.h | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #define IEEE802154_MTU 127 | 30 | #define IEEE802154_MTU 127 |
| 31 | #define IEEE802154_ACK_PSDU_LEN 5 | 31 | #define IEEE802154_ACK_PSDU_LEN 5 |
| 32 | #define IEEE802154_MIN_PSDU_LEN 9 | 32 | #define IEEE802154_MIN_PSDU_LEN 9 |
| 33 | #define IEEE802154_FCS_LEN 2 | ||
| 33 | 34 | ||
| 34 | #define IEEE802154_PAN_ID_BROADCAST 0xffff | 35 | #define IEEE802154_PAN_ID_BROADCAST 0xffff |
| 35 | #define IEEE802154_ADDR_SHORT_BROADCAST 0xffff | 36 | #define IEEE802154_ADDR_SHORT_BROADCAST 0xffff |
| @@ -39,6 +40,7 @@ | |||
| 39 | 40 | ||
| 40 | #define IEEE802154_LIFS_PERIOD 40 | 41 | #define IEEE802154_LIFS_PERIOD 40 |
| 41 | #define IEEE802154_SIFS_PERIOD 12 | 42 | #define IEEE802154_SIFS_PERIOD 12 |
| 43 | #define IEEE802154_MAX_SIFS_FRAME_SIZE 18 | ||
| 42 | 44 | ||
| 43 | #define IEEE802154_MAX_CHANNEL 26 | 45 | #define IEEE802154_MAX_CHANNEL 26 |
| 44 | #define IEEE802154_MAX_PAGE 31 | 46 | #define IEEE802154_MAX_PAGE 31 |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 6bb97df16d2d..e598ca096ec9 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
| @@ -354,6 +354,9 @@ void l2cap_exit(void); | |||
| 354 | int sco_init(void); | 354 | int sco_init(void); |
| 355 | void sco_exit(void); | 355 | void sco_exit(void); |
| 356 | 356 | ||
| 357 | int mgmt_init(void); | ||
| 358 | void mgmt_exit(void); | ||
| 359 | |||
| 357 | void bt_sock_reclassify_lock(struct sock *sk, int proto); | 360 | void bt_sock_reclassify_lock(struct sock *sk, int proto); |
| 358 | 361 | ||
| 359 | #endif /* __BLUETOOTH_H */ | 362 | #endif /* __BLUETOOTH_H */ |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 8e54f825153c..d942fedbaedd 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
| @@ -179,15 +179,6 @@ enum { | |||
| 179 | HCI_RESET, | 179 | HCI_RESET, |
| 180 | }; | 180 | }; |
| 181 | 181 | ||
| 182 | /* BR/EDR and/or LE controller flags: the flags defined here should represent | ||
| 183 | * states configured via debugfs for debugging and testing purposes only. | ||
| 184 | */ | ||
| 185 | enum { | ||
| 186 | HCI_DUT_MODE, | ||
| 187 | HCI_FORCE_BREDR_SMP, | ||
| 188 | HCI_FORCE_STATIC_ADDR, | ||
| 189 | }; | ||
| 190 | |||
| 191 | /* | 182 | /* |
| 192 | * BR/EDR and/or LE controller flags: the flags defined here should represent | 183 | * BR/EDR and/or LE controller flags: the flags defined here should represent |
| 193 | * states from the controller. | 184 | * states from the controller. |
| @@ -217,6 +208,7 @@ enum { | |||
| 217 | HCI_HS_ENABLED, | 208 | HCI_HS_ENABLED, |
| 218 | HCI_LE_ENABLED, | 209 | HCI_LE_ENABLED, |
| 219 | HCI_ADVERTISING, | 210 | HCI_ADVERTISING, |
| 211 | HCI_ADVERTISING_CONNECTABLE, | ||
| 220 | HCI_CONNECTABLE, | 212 | HCI_CONNECTABLE, |
| 221 | HCI_DISCOVERABLE, | 213 | HCI_DISCOVERABLE, |
| 222 | HCI_LIMITED_DISCOVERABLE, | 214 | HCI_LIMITED_DISCOVERABLE, |
| @@ -225,13 +217,13 @@ enum { | |||
| 225 | HCI_FAST_CONNECTABLE, | 217 | HCI_FAST_CONNECTABLE, |
| 226 | HCI_BREDR_ENABLED, | 218 | HCI_BREDR_ENABLED, |
| 227 | HCI_LE_SCAN_INTERRUPTED, | 219 | HCI_LE_SCAN_INTERRUPTED, |
| 228 | }; | ||
| 229 | 220 | ||
| 230 | /* A mask for the flags that are supposed to remain when a reset happens | 221 | HCI_DUT_MODE, |
| 231 | * or the HCI device is closed. | 222 | HCI_FORCE_BREDR_SMP, |
| 232 | */ | 223 | HCI_FORCE_STATIC_ADDR, |
| 233 | #define HCI_PERSISTENT_MASK (BIT(HCI_LE_SCAN) | BIT(HCI_PERIODIC_INQ) | \ | 224 | |
| 234 | BIT(HCI_FAST_CONNECTABLE) | BIT(HCI_LE_ADV)) | 225 | __HCI_NUM_FLAGS, |
| 226 | }; | ||
| 235 | 227 | ||
| 236 | /* HCI timeouts */ | 228 | /* HCI timeouts */ |
| 237 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ | 229 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index acec9140c3f9..6afbf5b014a1 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
| @@ -76,6 +76,7 @@ struct discovery_state { | |||
| 76 | u8 last_adv_data[HCI_MAX_AD_LENGTH]; | 76 | u8 last_adv_data[HCI_MAX_AD_LENGTH]; |
| 77 | u8 last_adv_data_len; | 77 | u8 last_adv_data_len; |
| 78 | bool report_invalid_rssi; | 78 | bool report_invalid_rssi; |
| 79 | bool result_filtering; | ||
| 79 | s8 rssi; | 80 | s8 rssi; |
| 80 | u16 uuid_count; | 81 | u16 uuid_count; |
| 81 | u8 (*uuids)[16]; | 82 | u8 (*uuids)[16]; |
| @@ -352,8 +353,7 @@ struct hci_dev { | |||
| 352 | 353 | ||
| 353 | struct rfkill *rfkill; | 354 | struct rfkill *rfkill; |
| 354 | 355 | ||
| 355 | unsigned long dbg_flags; | 356 | DECLARE_BITMAP(dev_flags, __HCI_NUM_FLAGS); |
| 356 | unsigned long dev_flags; | ||
| 357 | 357 | ||
| 358 | struct delayed_work le_scan_disable; | 358 | struct delayed_work le_scan_disable; |
| 359 | struct delayed_work le_scan_restart; | 359 | struct delayed_work le_scan_restart; |
| @@ -501,6 +501,21 @@ extern struct list_head hci_cb_list; | |||
| 501 | extern rwlock_t hci_dev_list_lock; | 501 | extern rwlock_t hci_dev_list_lock; |
| 502 | extern struct mutex hci_cb_list_lock; | 502 | extern struct mutex hci_cb_list_lock; |
| 503 | 503 | ||
| 504 | #define hci_dev_set_flag(hdev, nr) set_bit((nr), (hdev)->dev_flags) | ||
| 505 | #define hci_dev_clear_flag(hdev, nr) clear_bit((nr), (hdev)->dev_flags) | ||
| 506 | #define hci_dev_change_flag(hdev, nr) change_bit((nr), (hdev)->dev_flags) | ||
| 507 | #define hci_dev_test_flag(hdev, nr) test_bit((nr), (hdev)->dev_flags) | ||
| 508 | #define hci_dev_test_and_set_flag(hdev, nr) test_and_set_bit((nr), (hdev)->dev_flags) | ||
| 509 | #define hci_dev_test_and_clear_flag(hdev, nr) test_and_clear_bit((nr), (hdev)->dev_flags) | ||
| 510 | #define hci_dev_test_and_change_flag(hdev, nr) test_and_change_bit((nr), (hdev)->dev_flags) | ||
| 511 | |||
| 512 | #define hci_dev_clear_volatile_flags(hdev) \ | ||
| 513 | do { \ | ||
| 514 | hci_dev_clear_flag(hdev, HCI_LE_SCAN); \ | ||
| 515 | hci_dev_clear_flag(hdev, HCI_LE_ADV); \ | ||
| 516 | hci_dev_clear_flag(hdev, HCI_PERIODIC_INQ); \ | ||
| 517 | } while (0) | ||
| 518 | |||
| 504 | /* ----- HCI interface to upper protocols ----- */ | 519 | /* ----- HCI interface to upper protocols ----- */ |
| 505 | int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); | 520 | int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); |
| 506 | int l2cap_disconn_ind(struct hci_conn *hcon); | 521 | int l2cap_disconn_ind(struct hci_conn *hcon); |
| @@ -525,6 +540,7 @@ static inline void discovery_init(struct hci_dev *hdev) | |||
| 525 | 540 | ||
| 526 | static inline void hci_discovery_filter_clear(struct hci_dev *hdev) | 541 | static inline void hci_discovery_filter_clear(struct hci_dev *hdev) |
| 527 | { | 542 | { |
| 543 | hdev->discovery.result_filtering = false; | ||
| 528 | hdev->discovery.report_invalid_rssi = true; | 544 | hdev->discovery.report_invalid_rssi = true; |
| 529 | hdev->discovery.rssi = HCI_RSSI_INVALID; | 545 | hdev->discovery.rssi = HCI_RSSI_INVALID; |
| 530 | hdev->discovery.uuid_count = 0; | 546 | hdev->discovery.uuid_count = 0; |
| @@ -596,14 +612,14 @@ enum { | |||
| 596 | static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) | 612 | static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) |
| 597 | { | 613 | { |
| 598 | struct hci_dev *hdev = conn->hdev; | 614 | struct hci_dev *hdev = conn->hdev; |
| 599 | return test_bit(HCI_SSP_ENABLED, &hdev->dev_flags) && | 615 | return hci_dev_test_flag(hdev, HCI_SSP_ENABLED) && |
| 600 | test_bit(HCI_CONN_SSP_ENABLED, &conn->flags); | 616 | test_bit(HCI_CONN_SSP_ENABLED, &conn->flags); |
| 601 | } | 617 | } |
| 602 | 618 | ||
| 603 | static inline bool hci_conn_sc_enabled(struct hci_conn *conn) | 619 | static inline bool hci_conn_sc_enabled(struct hci_conn *conn) |
| 604 | { | 620 | { |
| 605 | struct hci_dev *hdev = conn->hdev; | 621 | struct hci_dev *hdev = conn->hdev; |
| 606 | return test_bit(HCI_SC_ENABLED, &hdev->dev_flags) && | 622 | return hci_dev_test_flag(hdev, HCI_SC_ENABLED) && |
| 607 | test_bit(HCI_CONN_SC_ENABLED, &conn->flags); | 623 | test_bit(HCI_CONN_SC_ENABLED, &conn->flags); |
| 608 | } | 624 | } |
| 609 | 625 | ||
| @@ -965,6 +981,8 @@ struct smp_irk *hci_add_irk(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
| 965 | void hci_remove_irk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type); | 981 | void hci_remove_irk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type); |
| 966 | void hci_smp_irks_clear(struct hci_dev *hdev); | 982 | void hci_smp_irks_clear(struct hci_dev *hdev); |
| 967 | 983 | ||
| 984 | bool hci_bdaddr_is_paired(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | ||
| 985 | |||
| 968 | void hci_remote_oob_data_clear(struct hci_dev *hdev); | 986 | void hci_remote_oob_data_clear(struct hci_dev *hdev); |
| 969 | struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev, | 987 | struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev, |
| 970 | bdaddr_t *bdaddr, u8 bdaddr_type); | 988 | bdaddr_t *bdaddr, u8 bdaddr_type); |
| @@ -1021,10 +1039,10 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
| 1021 | #define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE)) | 1039 | #define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE)) |
| 1022 | #define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR)) | 1040 | #define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR)) |
