From 9165d0442c6ff785d93ee9d2bb8dd8fbbe13fd2e Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 22 Apr 2008 12:20:24 +0000 Subject: Don't use hci_disconnect for disconnection since it'll "eat up" the disconnection complete event and the mainloop will never see it --- hcid/security.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hcid/security.c b/hcid/security.c index 62a79509..c9e7dda7 100644 --- a/hcid/security.c +++ b/hcid/security.c @@ -318,9 +318,16 @@ static void link_key_notify(int dev, bdaddr_t *sba, void *ptr) hcid_dbus_bonding_process_complete(sba, dba, HCI_MEMORY_FULL); - if (get_handle(dev, sba, dba, &handle) == 0) - hci_disconnect(dev, htobs(handle), - HCI_OE_LOW_RESOURCES, 500); + if (get_handle(dev, sba, dba, &handle) == 0) { + disconnect_cp cp; + + memset(&cp, 0, sizeof(cp)); + cp.handle = htobs(handle); + cp.reason = HCI_OE_LOW_RESOURCES; + + hci_send_cmd(dev, OGF_LINK_CTL, OCF_DISCONNECT, + DISCONNECT_CP_SIZE, &cp); + } } else hcid_dbus_bonding_process_complete(sba, dba, 0); -- cgit