aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 61a04a3de7ad..326609fa3bda 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -6915,14 +6915,6 @@ void mgmt_read_local_oob_data_complete(struct hci_dev *hdev, u8 *hash192,
6915 mgmt_pending_remove(cmd); 6915 mgmt_pending_remove(cmd);
6916} 6916}
6917 6917
6918/* this is reversed hex representation of bluetooth base uuid. We need it for
6919 * service uuid parsing in eir.
6920 */
6921static const u8 reverse_base_uuid[] = {
6922 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80,
6923 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
6924};
6925
6926static inline bool has_uuid(u8 *uuid, u16 uuid_count, u8 (*uuids)[16]) 6918static inline bool has_uuid(u8 *uuid, u16 uuid_count, u8 (*uuids)[16])
6927{ 6919{
6928 int i; 6920 int i;
@@ -6954,7 +6946,7 @@ static bool eir_has_uuids(u8 *eir, u16 eir_len, u16 uuid_count, u8 (*uuids)[16])
6954 case EIR_UUID16_ALL: 6946 case EIR_UUID16_ALL:
6955 case EIR_UUID16_SOME: 6947 case EIR_UUID16_SOME:
6956 for (i = 0; i + 3 <= field_len; i += 2) { 6948 for (i = 0; i + 3 <= field_len; i += 2) {
6957 memcpy(uuid, reverse_base_uuid, 16); 6949 memcpy(uuid, bluetooth_base_uuid, 16);
6958 uuid[13] = eir[i + 3]; 6950 uuid[13] = eir[i + 3];
6959 uuid[12] = eir[i + 2]; 6951 uuid[12] = eir[i + 2];
6960 if (has_uuid(uuid, uuid_count, uuids)) 6952 if (has_uuid(uuid, uuid_count, uuids))
@@ -6964,7 +6956,7 @@ static bool eir_has_uuids(u8 *eir, u16 eir_len, u16 uuid_count, u8 (*uuids)[16])
6964 case EIR_UUID32_ALL: 6956 case EIR_UUID32_ALL:
6965 case EIR_UUID32_SOME: 6957 case EIR_UUID32_SOME:
6966 for (i = 0; i + 5 <= field_len; i += 4) { 6958 for (i = 0; i + 5 <= field_len; i += 4) {
6967 memcpy(uuid, reverse_base_uuid, 16); 6959 memcpy(uuid, bluetooth_base_uuid, 16);
6968 uuid[15] = eir[i + 5]; 6960 uuid[15] = eir[i + 5];
6969 uuid[14] = eir[i + 4]; 6961 uuid[14] = eir[i + 4];
6970 uuid[13] = eir[i + 3]; 6962 uuid[13] = eir[i + 3];