hci_event.c (8d08d324fdcb7729f22b236a3e20fa37a8a29e43) hci_event.c (70a6b8de6af5c3e517bfd2ce8dccbd65c3f5bb4f)
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved.
4
5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 2 as

--- 5172 unchanged lines hidden (view full) ---

5181 }
5182
5183 return eir_len;
5184}
5185
5186static void hci_extended_inquiry_result_evt(struct hci_dev *hdev,
5187 struct sk_buff *skb)
5188{
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved.
4
5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 2 as

--- 5172 unchanged lines hidden (view full) ---

5181 }
5182
5183 return eir_len;
5184}
5185
5186static void hci_extended_inquiry_result_evt(struct hci_dev *hdev,
5187 struct sk_buff *skb)
5188{
5189 struct hci_ev_ext_inquiry_result *ev;
5189 struct inquiry_data data;
5190 struct inquiry_data data;
5190 struct extended_inquiry_info *info = (void *) (skb->data + 1);
5191 int num_rsp = *((__u8 *) skb->data);
5192 size_t eir_len;
5191 size_t eir_len;
5192 int i;
5193
5193
5194 BT_DBG("%s num_rsp %d", hdev->name, num_rsp);
5194 ev = hci_ev_skb_pull(hdev, skb, HCI_EV_EXTENDED_INQUIRY_RESULT,
5195 sizeof(*ev));
5196 if (!ev)
5197 return;
5195
5198
5196 if (!num_rsp || skb->len < num_rsp * sizeof(*info) + 1)
5199 if (!hci_ev_skb_pull(hdev, skb, HCI_EV_EXTENDED_INQUIRY_RESULT,
5200 flex_array_size(ev, info, ev->num)))
5197 return;
5198
5201 return;
5202
5203 BT_DBG("%s num %d", hdev->name, ev->num);
5204
5205 if (!ev->num)
5206 return;
5207
5199 if (hci_dev_test_flag(hdev, HCI_PERIODIC_INQ))
5200 return;
5201
5202 hci_dev_lock(hdev);
5203
5208 if (hci_dev_test_flag(hdev, HCI_PERIODIC_INQ))
5209 return;
5210
5211 hci_dev_lock(hdev);
5212
5204 for (; num_rsp; num_rsp--, info++) {
5213 for (i = 0; i < ev->num; i++) {
5214 struct extended_inquiry_info *info = &ev->info[i];
5205 u32 flags;
5206 bool name_known;
5207
5208 bacpy(&data.bdaddr, &info->bdaddr);
5209 data.pscan_rep_mode = info->pscan_rep_mode;
5210 data.pscan_period_mode = info->pscan_period_mode;
5211 data.pscan_mode = 0x00;
5212 memcpy(data.dev_class, info->dev_class, 3);

--- 2044 unchanged lines hidden ---
5215 u32 flags;
5216 bool name_known;
5217
5218 bacpy(&data.bdaddr, &info->bdaddr);
5219 data.pscan_rep_mode = info->pscan_rep_mode;
5220 data.pscan_period_mode = info->pscan_period_mode;
5221 data.pscan_mode = 0x00;
5222 memcpy(data.dev_class, info->dev_class, 3);

--- 2044 unchanged lines hidden ---