Bluetooth: Add mgmt_auth_failed event

To properly track bonding completion an event to indicate authentication
failure is needed. This event will be sent whenever an authentication
complete HCI event with a non-zero status comes. It will also be sent
when we're acting in acceptor role for SSP authentication in which case
the controller will send a Simple Pairing Complete event.

Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:
Johan Hedberg
2011-02-19 12:06:00 -03:00
committed by Gustavo F. Padovan
parent ac56fb13c0
commit 2a61169209
4 changed files with 35 additions and 3 deletions

View File

@ -1647,3 +1647,14 @@ int mgmt_user_confirm_neg_reply_complete(u16 index, bdaddr_t *bdaddr,
return confirm_reply_complete(index, bdaddr, status,
MGMT_OP_USER_CONFIRM_NEG_REPLY);
}
int mgmt_auth_failed(u16 index, bdaddr_t *bdaddr, u8 status)
{
struct mgmt_ev_auth_failed ev;
put_unaligned_le16(index, &ev.index);
bacpy(&ev.bdaddr, bdaddr);
ev.status = status;
return mgmt_event(MGMT_EV_AUTH_FAILED, &ev, sizeof(ev), NULL);
}