]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Bluetooth: Handle EIR tags for Device ID
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 12 Mar 2012 02:32:12 +0000 (19:32 -0700)
committerGustavo Padovan <gustavo@padovan.org>
Wed, 28 Mar 2012 14:39:07 +0000 (11:39 -0300)
The Device ID information can be provided via Extended Inquiry Data
as well. If a valid source is present, then include it.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
include/net/bluetooth/hci_core.h
net/bluetooth/mgmt.c

index 286de1ddb03b14f4da7373478652bc386dd6a821..eb28fa2a008d230c8f9d7bacbbc9389bab7ac6f2 100644 (file)
@@ -159,6 +159,10 @@ struct hci_dev {
        __u16           voice_setting;
        __u8            io_capability;
        __s8            inq_tx_power;
+       __u16           devid_source;
+       __u16           devid_vendor;
+       __u16           devid_product;
+       __u16           devid_version;
 
        __u16           pkt_type;
        __u16           esco_type;
index 564cd7b73e97a1465021929ad4188cab22037675..c4bce0d2ee9bc3d1802f369030e6bca270c1664c 100644 (file)
@@ -488,6 +488,19 @@ static void create_eir(struct hci_dev *hdev, u8 *data)
                ptr += 3;
        }
 
+       if (hdev->devid_source > 0) {
+               ptr[0] = 9;
+               ptr[1] = EIR_DEVICE_ID;
+
+               put_unaligned_le16(hdev->devid_source, ptr + 2);
+               put_unaligned_le16(hdev->devid_vendor, ptr + 4);
+               put_unaligned_le16(hdev->devid_product, ptr + 6);
+               put_unaligned_le16(hdev->devid_version, ptr + 8);
+
+               eir_len += 10;
+               ptr += 10;
+       }
+
        memset(uuid16_list, 0, sizeof(uuid16_list));
 
        /* Group all UUID16 types */