aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorVishal Agarwal <vishal.agarwal@stericsson.com>2012-04-26 09:49:56 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-05-16 15:13:19 -0400
commit9d939d948469b49912a76e789f7d4059eb1f8bc7 (patch)
treeab3a2255a084909fb69086abb26dbf0ecb5b783e /net
parenta24299e6c82f624cd2c717c91f04f1d79113ada8 (diff)
Bluetooth: Fix EIR data generation for mgmt_device_found
The mgmt_device_found function expects to receive only the significant part of the EIR data so it needs to be removed before calling the function. This patch adds a new eir_get_length() helper function to calculate the length of the significant part. Signed-off-by: Vishal Agarwal <vishal.agarwal@stericsson.com> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_event.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index fac840afd131..9c60e0d8db5f 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3001,6 +3001,7 @@ static inline void hci_extended_inquiry_result_evt(struct hci_dev *hdev, struct
3001 struct inquiry_data data; 3001 struct inquiry_data data;
3002 struct extended_inquiry_info *info = (void *) (skb->data + 1); 3002 struct extended_inquiry_info *info = (void *) (skb->data + 1);
3003 int num_rsp = *((__u8 *) skb->data); 3003 int num_rsp = *((__u8 *) skb->data);
3004 size_t eir_len;
3004 3005
3005 BT_DBG("%s num_rsp %d", hdev->name, num_rsp); 3006 BT_DBG("%s num_rsp %d", hdev->name, num_rsp);
3006 3007
@@ -3033,9 +3034,10 @@ static inline void hci_extended_inquiry_result_evt(struct hci_dev *hdev, struct
3033 3034
3034 name_known = hci_inquiry_cache_update(hdev, &data, name_known, 3035 name_known = hci_inquiry_cache_update(hdev, &data, name_known,
3035 &ssp); 3036 &ssp);
3037 eir_len = eir_get_length(info->data, sizeof(info->data));
3036 mgmt_device_found(hdev, &info->bdaddr, ACL_LINK, 0x00, 3038 mgmt_device_found(hdev, &info->bdaddr, ACL_LINK, 0x00,
3037 info->dev_class, info->rssi, !name_known, 3039 info->dev_class, info->rssi, !name_known,
3038 ssp, info->data, sizeof(info->data)); 3040 ssp, info->data, eir_len);
3039 } 3041 }
3040 3042
3041 hci_dev_unlock(hdev); 3043 hci_dev_unlock(hdev);