From f52ebd0dbafa475f6c8a5e7adeda78d0b385fbb4 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Wed, 6 Sep 2017 10:10:26 +0200 Subject: [PATCH] hidpp20: move up hidpp20_internal_profile Signed-off-by: Benjamin Tissoires --- src/hidpp20.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/hidpp20.c b/src/hidpp20.c index 83b70287..bae9cc4e 100644 --- a/src/hidpp20.c +++ b/src/hidpp20.c @@ -1051,6 +1051,30 @@ int hidpp20_adjustable_dpi_set_sensor_dpi(struct hidpp20_device *device, #define HIDPP20_ONBOARD_PROFILES_PROFILE_TYPE_G900 0x03 #define HIDPP20_ONBOARD_PROFILES_MACRO_TYPE_G402 0x01 +union hidpp20_internal_profile { + uint8_t data[HIDPP20_PROFILE_SIZE]; + struct { + uint8_t report_rate; + uint8_t default_dpi; + uint8_t switched_dpi; + uint16_t dpi[5]; + struct hidpp20_color profile_color; + uint8_t power_mode; + uint8_t angle_snapping; + uint8_t reserved[14]; + union hidpp20_button_binding buttons[16]; + union hidpp20_button_binding alternate_buttons[16]; + union { + char txt[16 * 3]; + uint8_t raw[16 * 3]; + } name; + struct hidpp20_internal_led leds[2]; /* G303, g502, g900 only */ + uint8_t free[24]; + uint16_t crc; + } __attribute__((packed)) profile; +}; +_Static_assert(sizeof(union hidpp20_internal_profile) == HIDPP20_PROFILE_SIZE, "Invalid size"); + int hidpp20_onboard_profiles_get_profiles_desc(struct hidpp20_device *device, struct hidpp20_onboard_profiles_info *info) @@ -1804,30 +1828,6 @@ hidpp20_onboard_profiles_set_enable_profile(struct hidpp20_device *device, return rc; } -union hidpp20_internal_profile { - uint8_t data[HIDPP20_PROFILE_SIZE]; - struct { - uint8_t report_rate; - uint8_t default_dpi; - uint8_t switched_dpi; - uint16_t dpi[5]; - struct hidpp20_color profile_color; - uint8_t power_mode; - uint8_t angle_snapping; - uint8_t reserved[14]; - union hidpp20_button_binding buttons[16]; - union hidpp20_button_binding alternate_buttons[16]; - union { - char txt[16 * 3]; - uint8_t raw[16 * 3]; - } name; - struct hidpp20_internal_led leds[2]; /* G303, g502, g900 only */ - uint8_t free[24]; - uint16_t crc; - } __attribute__((packed)) profile; -}; -_Static_assert(sizeof(union hidpp20_internal_profile) == HIDPP20_PROFILE_SIZE, "Invalid size"); - static void hidpp20_buttons_to_cpu(struct hidpp20_device *device, struct hidpp20_profiles *profiles,