Skip to contentSkip to conversation

HID: Send SwID in GetProtocolVersion

PATCH Applied Andreas Bergmeier 3 participants 3 messages Nov 11, 2022 – Nov 21, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: Send SwID in GetProtocolVersion

According to docs a SwID should be sent for GetProtocolVersion.

Quoted 1 line

0x10.DeviceIndex.0x00.0x1n

where n is SwID

---
 drivers/hid/hid-logitech-hidpp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-logitech-hidpp.c +1 -1
index a0c148a8df6c..964a523c3de7 100644
@@ -896,7 +896,7 @@ static int hidpp_root_get_protocol_version(struct hidpp_device *hidpp)
 
 	ret = hidpp_send_rap_command_sync(hidpp,
 			HIDPP_PAGE_ROOT_IDX,
-			CMD_ROOT_GET_PROTOCOL_VERSION,
+			CMD_ROOT_GET_PROTOCOL_VERSION | LINUX_KERNEL_SW_ID,
 			ping_data, sizeof(ping_data), &response);
 
 	if (ret == HIDPP_ERROR_INVALID_SUBID) {

--
2.34.1

reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Andreas Bergmeier

According to docs a SwID should be sent for GetProtocolVersion.

Quoted 1 line

0x10.DeviceIndex.0x00.0x1n

where n is SwID

I would mention the value of CMD_ROOT_GET_PROTOCOL_VERSION (0x10) in the commit message, but otherwise looks good to me.

Quoted 25 lines

---
 drivers/hid/hid-logitech-hidpp.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid- renamed from drivers/hid/hid-logitech-hidpp.c +0 -0

logitech-hidpp.c
index a0c148a8df6c..964a523c3de7 100644

drivers/hid/hid-logitech-hidpp.c +1 -1
@@ -896,7 +896,7 @@ static int hidpp_root_get_protocol_version(struct
 hidpp_device *hidpp)
 
         ret = hidpp_send_rap_command_sync(hidpp,
                         HIDPP_PAGE_ROOT_IDX,
-                       CMD_ROOT_GET_PROTOCOL_VERSION,
+                       CMD_ROOT_GET_PROTOCOL_VERSION |
 LINUX_KERNEL_SW_ID,
                         ping_data, sizeof(ping_data), &response);

        if (ret == HIDPP_ERROR_INVALID_SUBID) {
--
2.34.1

maintainer Applied
#2 lore raw
In reply to Andreas Bergmeier
Quoted 14 lines · Andreas Bergmeier

According to docs a SwID should be sent for GetProtocolVersion.

Quoted 1 line

0x10.DeviceIndex.0x00.0x1n

where n is SwID

---
 drivers/hid/hid-logitech-hidpp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-logitech-hidpp.c +0 -0
index a0c148a8df6c..964a523c3de7 100644

drivers/hid/hid-logitech-hidpp.c static int hidpp_root_get_protocol_version(struct hidpp_device *hidpp) · line 902

Quoted 8 lines
drivers/hid/hid-logitech-hidpp.c +1 -1
@@ -896,7 +896,7 @@ static int hidpp_root_get_protocol_version(struct hidpp_device *hidpp)
 
 	ret = hidpp_send_rap_command_sync(hidpp,
 			HIDPP_PAGE_ROOT_IDX,
-			CMD_ROOT_GET_PROTOCOL_VERSION,
+			CMD_ROOT_GET_PROTOCOL_VERSION | LINUX_KERNEL_SW_ID,
 			ping_data, sizeof(ping_data), &response);
 
 	if (ret == HIDPP_ERROR_INVALID_SUBID) {

Applied, thanks Andreas.

Signature · 2 lines
Jiri Kosina
SUSE Labs