From 8ed3c68b9286a06881280e0c41bfe8e79fed369f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 9 Jun 2008 16:33:58 +0000 Subject: Use kernel auth requirement if available --- hcid/dbus-hci.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c index 01a37455..93a9db63 100644 --- a/hcid/dbus-hci.c +++ b/hcid/dbus-hci.c @@ -2469,7 +2469,7 @@ void hcid_dbus_pin_code_reply(bdaddr_t *local, void *ptr) } } -static uint8_t get_auth_type(bdaddr_t *local, bdaddr_t *remote) +static uint8_t get_auth_requirement(bdaddr_t *local, bdaddr_t *remote) { struct hci_auth_info_req req; char addr[18]; @@ -2513,7 +2513,7 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote, uint8_t *cap, return -1; } - type = get_auth_type(local, remote); + type = get_auth_requirement(local, remote); debug("kernel authentication requirement = 0x%02x", type); @@ -2525,9 +2525,12 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote, uint8_t *cap, *auth = 0x03; } else { agent = adapter->agent; - *auth = 0x01; + *auth = 0x00; } + if (type != 0xff && type & 0x01) + *auth |= 0x01; + if (!agent) { error("No agent available for IO capability"); return -1; -- cgit