From 704d5d2e6566fa8999741a2d242c6861f4e76e88 Mon Sep 17 00:00:00 2001 From: Yaroslav Chvanov Date: Thu, 21 Apr 2022 17:30:05 +0300 Subject: [PATCH] sinowealth: decrease minimal configuration size Configuration size on 1007 mice is smaller for sure. With these changes the driver has been reported to successfully work with Marvo Scorpion G961. --- src/driver-sinowealth.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/driver-sinowealth.c b/src/driver-sinowealth.c index 1facb5e4..45101175 100644 --- a/src/driver-sinowealth.c +++ b/src/driver-sinowealth.c @@ -58,7 +58,7 @@ _Static_assert(sizeof(enum sinowealth_command_id) == sizeof(uint8_t), "Invalid s /* Report length commands that get configuration data should use. */ #define SINOWEALTH_CONFIG_REPORT_SIZE 520 #define SINOWEALTH_CONFIG_SIZE_MAX 167 -#define SINOWEALTH_CONFIG_SIZE_MIN 131 +#define SINOWEALTH_CONFIG_SIZE_MIN 123 #define SINOWEALTH_MACRO_SIZE 515 @@ -222,6 +222,12 @@ struct sinowealth_config_report { uint8_t unknown3[12]; struct sinowealth_rgb_mode rave_mode; struct sinowealth_color rave_colors[2]; + + /* From here onward goes the data not available in short mice. + * .. judging by the size of this struct. The data in them may + * actually be different, we didn't test this yet. + */ + struct sinowealth_rgb_mode random_mode; struct sinowealth_rgb_mode wave_mode; struct sinowealth_rgb_mode breathing1_mode; @@ -235,7 +241,7 @@ struct sinowealth_config_report { /* From here onward goes the data only available in long mice. */ - uint8_t unknown5[SINOWEALTH_CONFIG_SIZE_MAX - SINOWEALTH_CONFIG_SIZE_MIN]; + uint8_t unknown5[36]; uint8_t padding[SINOWEALTH_CONFIG_REPORT_SIZE - SINOWEALTH_CONFIG_SIZE_MAX]; } __attribute__((packed));