提交 4748fed2 编写于 作者: J Johan Hedberg 提交者: Gustavo F. Padovan

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: NJohan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
上级 655fe6ec
...@@ -775,7 +775,7 @@ int mgmt_index_removed(u16 index); ...@@ -775,7 +775,7 @@ int mgmt_index_removed(u16 index);
int mgmt_powered(u16 index, u8 powered); int mgmt_powered(u16 index, u8 powered);
int mgmt_discoverable(u16 index, u8 discoverable); int mgmt_discoverable(u16 index, u8 discoverable);
int mgmt_connectable(u16 index, u8 connectable); int mgmt_connectable(u16 index, u8 connectable);
int mgmt_new_key(u16 index, struct link_key *key, u8 old_key_type); int mgmt_new_key(u16 index, struct link_key *key);
int mgmt_connected(u16 index, bdaddr_t *bdaddr); int mgmt_connected(u16 index, bdaddr_t *bdaddr);
int mgmt_disconnected(u16 index, bdaddr_t *bdaddr); int mgmt_disconnected(u16 index, bdaddr_t *bdaddr);
int mgmt_disconnect_failed(u16 index); int mgmt_disconnect_failed(u16 index);
......
...@@ -231,7 +231,6 @@ struct mgmt_ev_controller_error { ...@@ -231,7 +231,6 @@ struct mgmt_ev_controller_error {
#define MGMT_EV_NEW_KEY 0x000A #define MGMT_EV_NEW_KEY 0x000A
struct mgmt_ev_new_key { struct mgmt_ev_new_key {
struct mgmt_key_info key; struct mgmt_key_info key;
__u8 old_key_type;
} __packed; } __packed;
#define MGMT_EV_CONNECTED 0x000B #define MGMT_EV_CONNECTED 0x000B
......
...@@ -1097,14 +1097,15 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, ...@@ -1097,14 +1097,15 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
bacpy(&key->bdaddr, bdaddr); bacpy(&key->bdaddr, bdaddr);
memcpy(key->val, val, 16); memcpy(key->val, val, 16);
key->type = type;
key->pin_len = pin_len; key->pin_len = pin_len;
if (new_key)
mgmt_new_key(hdev->id, key, old_key_type);
if (type == HCI_LK_CHANGED_COMBINATION) if (type == HCI_LK_CHANGED_COMBINATION)
key->type = old_key_type; key->type = old_key_type;
else
key->type = type;
if (new_key)
mgmt_new_key(hdev->id, key);
return 0; return 0;
} }
......
...@@ -1858,7 +1858,7 @@ int mgmt_connectable(u16 index, u8 connectable) ...@@ -1858,7 +1858,7 @@ int mgmt_connectable(u16 index, u8 connectable)
return ret; return ret;
} }
int mgmt_new_key(u16 index, struct link_key *key, u8 old_key_type) int mgmt_new_key(u16 index, struct link_key *key)
{ {
struct mgmt_ev_new_key ev; struct mgmt_ev_new_key ev;
...@@ -1868,7 +1868,6 @@ int mgmt_new_key(u16 index, struct link_key *key, u8 old_key_type) ...@@ -1868,7 +1868,6 @@ int mgmt_new_key(u16 index, struct link_key *key, u8 old_key_type)
ev.key.type = key->type; ev.key.type = key->type;
memcpy(ev.key.val, key->val, 16); memcpy(ev.key.val, key->val, 16);
ev.key.pin_len = key->pin_len; ev.key.pin_len = key->pin_len;
ev.old_key_type = old_key_type;
return mgmt_event(MGMT_EV_NEW_KEY, index, &ev, sizeof(ev), NULL); return mgmt_event(MGMT_EV_NEW_KEY, index, &ev, sizeof(ev), NULL);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册