diff options
-rw-r--r-- | include/net/bluetooth/mgmt.h | 2 | ||||
-rw-r--r-- | net/bluetooth/mgmt.c | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h index c7d537f1bd19..80606d2fe086 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h | |||
@@ -669,3 +669,5 @@ struct mgmt_ev_new_conn_param { | |||
669 | #define MGMT_EV_UNCONF_INDEX_ADDED 0x001d | 669 | #define MGMT_EV_UNCONF_INDEX_ADDED 0x001d |
670 | 670 | ||
671 | #define MGMT_EV_UNCONF_INDEX_REMOVED 0x001e | 671 | #define MGMT_EV_UNCONF_INDEX_REMOVED 0x001e |
672 | |||
673 | #define MGMT_EV_NEW_CONFIG_OPTIONS 0x001f | ||
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 4ef73523d95b..f514eb15e0fb 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -123,6 +123,7 @@ static const u16 mgmt_events[] = { | |||
123 | MGMT_EV_NEW_CONN_PARAM, | 123 | MGMT_EV_NEW_CONN_PARAM, |
124 | MGMT_EV_UNCONF_INDEX_ADDED, | 124 | MGMT_EV_UNCONF_INDEX_ADDED, |
125 | MGMT_EV_UNCONF_INDEX_REMOVED, | 125 | MGMT_EV_UNCONF_INDEX_REMOVED, |
126 | MGMT_EV_NEW_CONFIG_OPTIONS, | ||
126 | }; | 127 | }; |
127 | 128 | ||
128 | #define CACHE_TIMEOUT msecs_to_jiffies(2 * 1000) | 129 | #define CACHE_TIMEOUT msecs_to_jiffies(2 * 1000) |
@@ -500,6 +501,14 @@ static __le32 get_missing_options(struct hci_dev *hdev) | |||
500 | return cpu_to_le32(options); | 501 | return cpu_to_le32(options); |
501 | } | 502 | } |
502 | 503 | ||
504 | static int new_options(struct hci_dev *hdev, struct sock *skip) | ||
505 | { | ||
506 | __le32 options = get_missing_options(hdev); | ||
507 | |||
508 | return mgmt_event(MGMT_EV_NEW_CONFIG_OPTIONS, hdev, &options, | ||
509 | sizeof(options), skip); | ||
510 | } | ||
511 | |||
503 | static int send_options_rsp(struct sock *sk, u16 opcode, struct hci_dev *hdev) | 512 | static int send_options_rsp(struct sock *sk, u16 opcode, struct hci_dev *hdev) |
504 | { | 513 | { |
505 | __le32 options = get_missing_options(hdev); | 514 | __le32 options = get_missing_options(hdev); |
@@ -5415,6 +5424,8 @@ static int set_external_config(struct sock *sk, struct hci_dev *hdev, | |||
5415 | if (!changed) | 5424 | if (!changed) |
5416 | goto unlock; | 5425 | goto unlock; |
5417 | 5426 | ||
5427 | err = new_options(hdev, sk); | ||
5428 | |||
5418 | if (test_bit(HCI_UNCONFIGURED, &hdev->dev_flags) == is_configured(hdev)) { | 5429 | if (test_bit(HCI_UNCONFIGURED, &hdev->dev_flags) == is_configured(hdev)) { |
5419 | mgmt_index_removed(hdev); | 5430 | mgmt_index_removed(hdev); |
5420 | change_bit(HCI_UNCONFIGURED, &hdev->dev_flags); | 5431 | change_bit(HCI_UNCONFIGURED, &hdev->dev_flags); |