aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2011-03-22 08:12:22 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-03-31 13:22:57 -0400
commit2763eda6ccaf126633bb3180f440c8f3589f0679 (patch)
tree7239d220f4a233b31184ddb50c2914f7406c4675 /net/bluetooth/hci_event.c
parentc35938b2f56547ee77b5a038fe0db394aeac59bb (diff)
Bluetooth: Add add/remove_remote_oob_data management commands
This patch adds commands to add and remove remote OOB data to the managment interface. Remote data is stored in kernel and can be used by corresponding HCI commands and events when needed. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 582ef60a8bc0..e0aaf3053667 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2471,6 +2471,37 @@ static inline void hci_remote_host_features_evt(struct hci_dev *hdev, struct sk_
2471 hci_dev_unlock(hdev); 2471 hci_dev_unlock(hdev);
2472} 2472}
2473 2473
2474static inline void hci_remote_oob_data_request_evt(struct hci_dev *hdev,
2475 struct sk_buff *skb)
2476{
2477 struct hci_ev_remote_oob_data_request *ev = (void *) skb->data;
2478 struct oob_data *data;
2479
2480 BT_DBG("%s", hdev->name);
2481
2482 hci_dev_lock(hdev);
2483
2484 data = hci_find_remote_oob_data(hdev, &ev->bdaddr);
2485 if (data) {
2486 struct hci_cp_remote_oob_data_reply cp;
2487
2488 bacpy(&cp.bdaddr, &ev->bdaddr);
2489 memcpy(cp.hash, data->hash, sizeof(cp.hash));
2490 memcpy(cp.randomizer, data->randomizer, sizeof(cp.randomizer));
2491
2492 hci_send_cmd(hdev, HCI_OP_REMOTE_OOB_DATA_REPLY, sizeof(cp),
2493 &cp);
2494 } else {
2495 struct hci_cp_remote_oob_data_neg_reply cp;
2496
2497 bacpy(&cp.bdaddr, &ev->bdaddr);
2498 hci_send_cmd(hdev, HCI_OP_REMOTE_OOB_DATA_NEG_REPLY, sizeof(cp),
2499 &cp);
2500 }
2501
2502 hci_dev_unlock(hdev);
2503}
2504
2474static inline void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) 2505static inline void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
2475{ 2506{
2476 struct hci_ev_le_conn_complete *ev = (void *) skb->data; 2507 struct hci_ev_le_conn_complete *ev = (void *) skb->data;
@@ -2673,6 +2704,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
2673 hci_le_meta_evt(hdev, skb); 2704 hci_le_meta_evt(hdev, skb);
2674 break; 2705 break;
2675 2706
2707 case HCI_EV_REMOTE_OOB_DATA_REQUEST:
2708 hci_remote_oob_data_request_evt(hdev, skb);
2709 break;
2710
2676 default: 2711 default:
2677 BT_DBG("%s event 0x%x", hdev->name, event); 2712 BT_DBG("%s event 0x%x", hdev->name, event);
2678 break; 2713 break;