aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/bluetooth/hci_event.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 82e478a459ff..5c0b6c161a01 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2677,6 +2677,27 @@ static void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *skb)
2677 queue_work(hdev->workqueue, &hdev->tx_work); 2677 queue_work(hdev->workqueue, &hdev->tx_work);
2678} 2678}
2679 2679
2680static struct hci_conn *__hci_conn_lookup_handle(struct hci_dev *hdev,
2681 __u16 handle)
2682{
2683 struct hci_chan *chan;
2684
2685 switch (hdev->dev_type) {
2686 case HCI_BREDR:
2687 return hci_conn_hash_lookup_handle(hdev, handle);
2688 case HCI_AMP:
2689 chan = hci_chan_lookup_handle(hdev, handle);
2690 if (chan)
2691 return chan->conn;
2692 break;
2693 default:
2694 BT_ERR("%s unknown dev_type %d", hdev->name, hdev->dev_type);
2695 break;
2696 }
2697
2698 return NULL;
2699}
2700
2680static void hci_num_comp_blocks_evt(struct hci_dev *hdev, struct sk_buff *skb) 2701static void hci_num_comp_blocks_evt(struct hci_dev *hdev, struct sk_buff *skb)
2681{ 2702{
2682 struct hci_ev_num_comp_blocks *ev = (void *) skb->data; 2703 struct hci_ev_num_comp_blocks *ev = (void *) skb->data;
@@ -2698,13 +2719,13 @@ static void hci_num_comp_blocks_evt(struct hci_dev *hdev, struct sk_buff *skb)
2698 2719
2699 for (i = 0; i < ev->num_hndl; i++) { 2720 for (i = 0; i < ev->num_hndl; i++) {
2700 struct hci_comp_blocks_info *info = &ev->handles[i]; 2721 struct hci_comp_blocks_info *info = &ev->handles[i];
2701 struct hci_conn *conn; 2722 struct hci_conn *conn = NULL;
2702 __u16 handle, block_count; 2723 __u16 handle, block_count;
2703 2724
2704 handle = __le16_to_cpu(info->handle); 2725 handle = __le16_to_cpu(info->handle);
2705 block_count = __le16_to_cpu(info->blocks); 2726 block_count = __le16_to_cpu(info->blocks);
2706 2727
2707 conn = hci_conn_hash_lookup_handle(hdev, handle); 2728 conn = __hci_conn_lookup_handle(hdev, handle);
2708 if (!conn) 2729 if (!conn)
2709 continue; 2730 continue;
2710 2731