Bluetooth: Fix UUID values in debugfs file
The uuid entry struct is used for the UUID byte stream. That is actually the wrong value. The correct value is uuid->uuid. Besides fixing this up, use the %pUb modifier to print the UUID string. However since the UUID is stored in big endian with reversed byte order, change the byte order before printing. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
committed by
Johan Hedberg
parent
4b4148e9ac
commit
58f01aa93f
@@ -193,18 +193,16 @@ static int uuids_show(struct seq_file *f, void *p)
|
|||||||
|
|
||||||
hci_dev_lock(hdev);
|
hci_dev_lock(hdev);
|
||||||
list_for_each_entry(uuid, &hdev->uuids, list) {
|
list_for_each_entry(uuid, &hdev->uuids, list) {
|
||||||
u32 data0, data5;
|
u8 i, val[16];
|
||||||
u16 data1, data2, data3, data4;
|
|
||||||
|
|
||||||
data5 = get_unaligned_le32(uuid);
|
/* The Bluetooth UUID values are stored in big endian,
|
||||||
data4 = get_unaligned_le16(uuid + 4);
|
* but with reversed byte order. So convert them into
|
||||||
data3 = get_unaligned_le16(uuid + 6);
|
* the right order for the %pUb modifier.
|
||||||
data2 = get_unaligned_le16(uuid + 8);
|
*/
|
||||||
data1 = get_unaligned_le16(uuid + 10);
|
for (i = 0; i < 16; i++)
|
||||||
data0 = get_unaligned_le32(uuid + 12);
|
val[i] = uuid->uuid[15 - i];
|
||||||
|
|
||||||
seq_printf(f, "%.8x-%.4x-%.4x-%.4x-%.4x%.8x\n",
|
seq_printf(f, "%pUb\n", val);
|
||||||
data0, data1, data2, data3, data4, data5);
|
|
||||||
}
|
}
|
||||||
hci_dev_unlock(hdev);
|
hci_dev_unlock(hdev);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user