Bluetooth: Enable support for out of band association model
authorSzymon Janc <szymon.janc@tieto.com>
Tue, 22 Mar 2011 12:12:23 +0000 (13:12 +0100)
committerGustavo F. Padovan <padovan@profusion.mobi>
Thu, 31 Mar 2011 17:22:57 +0000 (14:22 -0300)
If remote side reports oob availability or we are pairing initiator
use oob data for pairing if available.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/hci_event.c

index e0aaf30536670fe991ca6ee04804fe873ca21063..da4c662dbc3096af9a48ce8afad63df10c8389bd 100644 (file)
@@ -2371,9 +2371,14 @@ static inline void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff
 
                bacpy(&cp.bdaddr, &ev->bdaddr);
                cp.capability = conn->io_capability;
-               cp.oob_data = 0;
                cp.authentication = hci_get_auth_req(conn);
 
+               if ((conn->out == 0x01 || conn->remote_oob == 0x01) &&
+                               hci_find_remote_oob_data(hdev, &conn->dst))
+                       cp.oob_data = 0x01;
+               else
+                       cp.oob_data = 0x00;
+
                hci_send_cmd(hdev, HCI_OP_IO_CAPABILITY_REPLY,
                                                        sizeof(cp), &cp);
        } else {