From 4dce920c793e9aa0e107a7680fb9702cbcff1738 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 15 Nov 2017 08:42:35 -0800 Subject: [PATCH] Scubapro G2 usb: always use exactly 32-byte packets (plus report byte) It turns out that the Scubapro G2 itself does not care at all, but apparently some of the other dive computers that use the same protocol do). In particular, Vincent reports that his Scubapro Aladin Square downloads ok with the USB ID's switched to c251:2006, but only if we send 32-byte USB HID payload packets, even though the command itself is much smaller. Otherwise it will simply not reply at all. To actually download correctly, we'll still need to do some model- specific USB ID updates, and there will be some model changes for the Aladin Square, but this at least fixes the transport side. Jef had actually already done this because of the Windows behavior side, I just hadn't thought it could possibly matter. Mea Culpa. Reported-and-tested-by: Vincent Cc: Berthold Stoeger Cc: Jef Driesen Signed-off-by: Linus Torvalds --- src/scubapro_g2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scubapro_g2.c b/src/scubapro_g2.c index 04a83a2..aed823e 100644 --- a/src/scubapro_g2.c +++ b/src/scubapro_g2.c @@ -113,7 +113,7 @@ static dc_status_t scubapro_g2_transfer(scubapro_g2_device_t *g2, const unsigned char command[], unsigned int csize, unsigned char answer[], unsigned int asize) { dc_custom_io_t *io = _dc_context_custom_io(g2->base.context); - unsigned char buf[TX_PACKET_SIZE] = { 0 }; + unsigned char buf[TX_PACKET_SIZE+1] = { 0 }; // the +1 is for the report type byte dc_status_t status = DC_STATUS_SUCCESS; size_t transferred = 0;