diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2011-04-28 14:29:02 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-04-28 15:14:42 -0400 |
commit | 4748fed2d1a2a7a816277754498b8aa70850e051 (patch) | |
tree | db0204847255d2326f084790f637ba298d8fe5bc | |
parent | 655fe6ece7e71b37c17577ae485d11bf701c95f7 (diff) |
Bluetooth: Remove old_key_type from mgmt_ev_new_key
User space shouldn't have any need for the old key type so remove it
from the corresponding Management interface event.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
-rw-r--r-- | include/net/bluetooth/hci_core.h | 2 | ||||
-rw-r--r-- | include/net/bluetooth/mgmt.h | 1 | ||||
-rw-r--r-- | net/bluetooth/hci_core.c | 9 | ||||
-rw-r--r-- | net/bluetooth/mgmt.c | 3 |
4 files changed, 7 insertions, 8 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 3a3f7b453803..88c2cd92eaea 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -775,7 +775,7 @@ int mgmt_index_removed(u16 index); | |||
775 | int mgmt_powered(u16 index, u8 powered); | 775 | int mgmt_powered(u16 index, u8 powered); |
776 | int mgmt_discoverable(u16 index, u8 discoverable); | 776 | int mgmt_discoverable(u16 index, u8 discoverable); |
777 | int mgmt_connectable(u16 index, u8 connectable); | 777 | int mgmt_connectable(u16 index, u8 connectable); |
778 | int mgmt_new_key(u16 index, struct link_key *key, u8 old_key_type); | 778 | int mgmt_new_key(u16 index, struct link_key *key); |
779 | int mgmt_connected(u16 index, bdaddr_t *bdaddr); | 779 | int mgmt_connected(u16 index, bdaddr_t *bdaddr); |
780 | int mgmt_disconnected(u16 index, bdaddr_t *bdaddr); | 780 | int mgmt_disconnected(u16 index, bdaddr_t *bdaddr); |
781 | int mgmt_disconnect_failed(u16 index); | 781 | int mgmt_disconnect_failed(u16 index); |
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h index c444a2b87e72..353a85dc2de0 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h | |||
@@ -231,7 +231,6 @@ struct mgmt_ev_controller_error { | |||
231 | #define MGMT_EV_NEW_KEY 0x000A | 231 | #define MGMT_EV_NEW_KEY 0x000A |
232 | struct mgmt_ev_new_key { | 232 | struct mgmt_ev_new_key { |
233 | struct mgmt_key_info key; | 233 | struct mgmt_key_info key; |
234 | __u8 old_key_type; | ||
235 | } __packed; | 234 | } __packed; |
236 | 235 | ||
237 | #define MGMT_EV_CONNECTED 0x000B | 236 | #define MGMT_EV_CONNECTED 0x000B |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 59ca4755b6b3..60260cae3a04 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -1097,14 +1097,15 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, | |||
1097 | 1097 | ||
1098 | bacpy(&key->bdaddr, bdaddr); | 1098 | bacpy(&key->bdaddr, bdaddr); |
1099 | memcpy(key->val, val, 16); | 1099 | memcpy(key->val, val, 16); |
1100 | key->type = type; | ||
1101 | key->pin_len = pin_len; | 1100 | key->pin_len = pin_len; |
1102 | 1101 | ||
1103 | if (new_key) | ||
1104 | mgmt_new_key(hdev->id, key, old_key_type); | ||
1105 | |||
1106 | if (type == HCI_LK_CHANGED_COMBINATION) | 1102 | if (type == HCI_LK_CHANGED_COMBINATION) |
1107 | key->type = old_key_type; | 1103 | key->type = old_key_type; |
1104 | else | ||
1105 | key->type = type; | ||
1106 | |||
1107 | if (new_key) | ||
1108 | mgmt_new_key(hdev->id, key); | ||
1108 | 1109 | ||
1109 | return 0; | 1110 | return 0; |
1110 | } | 1111 | } |
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index e1384fc6016c..232ea8bfff19 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -1858,7 +1858,7 @@ int mgmt_connectable(u16 index, u8 connectable) | |||
1858 | return ret; | 1858 | return ret; |
1859 | } | 1859 | } |
1860 | 1860 | ||
1861 | int mgmt_new_key(u16 index, struct link_key *key, u8 old_key_type) | 1861 | int mgmt_new_key(u16 index, struct link_key *key) |
1862 | { | 1862 | { |
1863 | struct mgmt_ev_new_key ev; | 1863 | struct mgmt_ev_new_key ev; |
1864 | 1864 | ||
@@ -1868,7 +1868,6 @@ int mgmt_new_key(u16 index, struct link_key *key, u8 old_key_type) | |||
1868 | ev.key.type = key->type; | 1868 | ev.key.type = key->type; |
1869 | memcpy(ev.key.val, key->val, 16); | 1869 | memcpy(ev.key.val, key->val, 16); |
1870 | ev.key.pin_len = key->pin_len; | 1870 | ev.key.pin_len = key->pin_len; |
1871 | ev.old_key_type = old_key_type; | ||
1872 | 1871 | ||
1873 | return mgmt_event(MGMT_EV_NEW_KEY, index, &ev, sizeof(ev), NULL); | 1872 | return mgmt_event(MGMT_EV_NEW_KEY, index, &ev, sizeof(ev), NULL); |
1874 | } | 1873 | } |