aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-02-19 08:18:31 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-02-19 11:04:24 -0500
commit95fbac8a8e459262c580ee4172e4713cdc60929b (patch)
tree4d5950c90f2b12f08e6f171b24e5ae232f5ddab8 /net/bluetooth/mgmt.c
parent35d702719d6464a9de2bf98d536c6e054f0a8f7e (diff)
Bluetooth: Add support for sending New IRK event
This patch adds the necessary helper function to send the New IRK mgmt event and makes sure that the function is called at when SMP key distribution has completed. The event is sent before the New LTK event so user space knows which remote device to associate with the keys. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index bcfc6da67a5c..1daa837da091 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -4792,6 +4792,21 @@ void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key)
4792 mgmt_event(MGMT_EV_NEW_LONG_TERM_KEY, hdev, &ev, sizeof(ev), NULL); 4792 mgmt_event(MGMT_EV_NEW_LONG_TERM_KEY, hdev, &ev, sizeof(ev), NULL);
4793} 4793}
4794 4794
4795void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk)
4796{
4797 struct mgmt_ev_new_irk ev;
4798
4799 memset(&ev, 0, sizeof(ev));
4800
4801 ev.store_hint = 0x01;
4802 bacpy(&ev.rpa, &irk->rpa);
4803 bacpy(&ev.irk.addr.bdaddr, &irk->bdaddr);
4804 ev.irk.addr.type = link_to_bdaddr(LE_LINK, irk->addr_type);
4805 memcpy(ev.irk.val, irk->val, sizeof(irk->val));
4806
4807 mgmt_event(MGMT_EV_NEW_IRK, hdev, &ev, sizeof(ev), NULL);
4808}
4809
4795static inline u16 eir_append_data(u8 *eir, u16 eir_len, u8 type, u8 *data, 4810static inline u16 eir_append_data(u8 *eir, u16 eir_len, u8 type, u8 *data,
4796 u8 data_len) 4811 u8 data_len)
4797{ 4812{