Skip to contentSkip to conversation

input: Fix checking LE bonding on HIDP

PATCH In review Luiz Augusto von Dentz 3 participants 4 messages Apr 21 – Apr 22 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 input: Fix checking LE bonding on HIDP

From: Luiz Augusto von Dentz <[email protected]>

HIDP is classic only, LE uses HOG, so there is no point in checking the bonding with the address type which in case the device supports dual-mode will map to LE random/public address.

---
 profiles/input/device.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
profiles/input/device.c +1 -2
index 6bdc5ee3aaf3..0ee6988c4e90 100644
@@ -127,8 +127,7 @@ static int connection_disconnect(struct input_device *idev, uint32_t flags);
 
 static bool input_device_bonded(struct input_device *idev)
 {
-	return device_is_bonded(idev->device,
-				btd_device_get_bdaddr_type(idev->device));
+	return device_is_bonded(idev->device, BDADDR_BREDR);
 }
 
 static void input_device_free(struct input_device *idev)
Signature · 1 line
2.53.0
#1 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1084033

---Test result---

Test Summary:

CheckPatch                    PASS      0.48 seconds
GitLint                       PASS      0.35 seconds
BuildEll                      PASS      20.23 seconds
BluezMake                     PASS      591.70 seconds
MakeCheck                     PASS      1.01 seconds
MakeDistcheck                 PASS      235.32 seconds
CheckValgrind                 PASS      201.19 seconds
CheckSmatch                   PASS      321.82 seconds
bluezmakeextell               PASS      165.86 seconds
IncrementalBuild              PASS      590.54 seconds
ScanBuild                     PASS      913.84 seconds

https://github.com/bluez/bluez/pull/2061

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Luiz Augusto von Dentz
Quoted 24 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

HIDP is classic only, LE uses HOG, so there is no point in checking the
bonding with the address type which in case the device supports dual-mode will map to LE random/public address.

---
 profiles/input/device.c | 3 +--

 1 file changed, 1 insertion(+), 2 deletions(-)
profiles/input/device.c +0 -0
index 6bdc5ee3aaf3..0ee6988c4e90 100644
@@ -127,8 +127,7 @@ static int connection_disconnect(struct
 input_device *idev, uint32_t flags);


 static bool input_device_bonded(struct input_device *idev) {

profiles/input/device.c +0 -2
-	return device_is_bonded(idev->device,
-				btd_device_get_bdaddr_type(idev-
Quoted 1 line

device));

profiles/input/device.c static int connection_disconnect(struct input_device *idev, uint32_t flags); · line 130

Quoted 1 line
profiles/input/device.c +1 -0
+	return device_is_bonded(idev->device, BDADDR_BREDR);

Do we want to do the same in virtual_cable_unplug() in that same file?

Do we also want to apply this to hog_accept() with BDADDR_LE in profiles/input/hog.c ?

Quoted 3 lines

 }

 static void input_device_free(struct input_device *idev)

author maintainer
#3 lore raw

Hi Bastien,

Quoted 21 lines · Bastien Nocera
Quoted 19 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

HIDP is classic only, LE uses HOG, so there is no point in checking the
bonding with the address type which in case the device supports dual-mode will map to LE random/public address.

---
 profiles/input/device.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
profiles/input/device.c +0 -0
index 6bdc5ee3aaf3..0ee6988c4e90 100644
@@ -127,8 +127,7 @@ static int connection_disconnect(struct
 input_device *idev, uint32_t flags);
 
Quoted 8 lines

profiles/input/device.c static int connection_disconnect(struct input_device *idev, uint32_t flags); · line 130

Quoted 6 lines
profiles/input/device.c +1 -2
 static bool input_device_bonded(struct input_device *idev)
 {
-     return device_is_bonded(idev->device,
-                             btd_device_get_bdaddr_type(idev-
 >device));
+     return device_is_bonded(idev->device, BDADDR_BREDR);

Do we want to do the same in virtual_cable_unplug() in that same file?

Yep.

Quoted 2 lines

Do we also want to apply this to hog_accept() with BDADDR_LE in profiles/input/hog.c ?

Not really. In the case of LE you really need to specify the address type since there are multiple options: random versus public.

Quoted 3 lines
Quoted 3 lines
profiles/input/device.c +0 -0
 }

static void input_device_free(struct input_device *idev)

Signature · 1 line
Luiz Augusto von Dentz