aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-roccat-koneplus.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-roccat-koneplus.h')
-rw-r--r--drivers/hid/hid-roccat-koneplus.h36
1 files changed, 14 insertions, 22 deletions
diff --git a/drivers/hid/hid-roccat-koneplus.h b/drivers/hid/hid-roccat-koneplus.h
index 905e33d4535..57a5c1ab7b0 100644
--- a/drivers/hid/hid-roccat-koneplus.h
+++ b/drivers/hid/hid-roccat-koneplus.h
@@ -15,12 +15,6 @@
15#include <linux/types.h> 15#include <linux/types.h>
16 16
17/* 17/*
18 * Binary data structures used for hardware communication must have no padding.
19 */
20#pragma pack(push)
21#pragma pack(1)
22
23/*
24 * case 1: writes request 80 and reads value 1 18 * case 1: writes request 80 and reads value 1
25 * 19 *
26 */ 20 */
@@ -32,7 +26,7 @@ struct koneplus_control {
32 */ 26 */
33 uint8_t value; 27 uint8_t value;
34 uint8_t request; 28 uint8_t request;
35}; 29} __attribute__ ((__packed__));
36 30
37enum koneplus_control_requests { 31enum koneplus_control_requests {
38 KONEPLUS_CONTROL_REQUEST_STATUS = 0x00, 32 KONEPLUS_CONTROL_REQUEST_STATUS = 0x00,
@@ -50,7 +44,7 @@ struct koneplus_startup_profile {
50 uint8_t command; /* KONEPLUS_COMMAND_STARTUP_PROFILE */ 44 uint8_t command; /* KONEPLUS_COMMAND_STARTUP_PROFILE */
51 uint8_t size; /* always 3 */ 45 uint8_t size; /* always 3 */
52 uint8_t startup_profile; /* Range 0-4! */ 46 uint8_t startup_profile; /* Range 0-4! */
53}; 47} __attribute__ ((__packed__));
54 48
55struct koneplus_profile_settings { 49struct koneplus_profile_settings {
56 uint8_t command; /* KONEPLUS_COMMAND_PROFILE_SETTINGS */ 50 uint8_t command; /* KONEPLUS_COMMAND_PROFILE_SETTINGS */
@@ -72,7 +66,7 @@ struct koneplus_profile_settings {
72 uint8_t light_effect_speed; 66 uint8_t light_effect_speed;
73 uint8_t lights[16]; 67 uint8_t lights[16];
74 uint16_t checksum; 68 uint16_t checksum;
75}; 69} __attribute__ ((__packed__));
76 70
77struct koneplus_profile_buttons { 71struct koneplus_profile_buttons {
78 uint8_t command; /* KONEPLUS_COMMAND_PROFILE_BUTTONS */ 72 uint8_t command; /* KONEPLUS_COMMAND_PROFILE_BUTTONS */
@@ -80,7 +74,7 @@ struct koneplus_profile_buttons {
80 uint8_t number; /* range 0-4 */ 74 uint8_t number; /* range 0-4 */
81 uint8_t data[72]; 75 uint8_t data[72];
82 uint16_t checksum; 76 uint16_t checksum;
83}; 77} __attribute__ ((__packed__));
84 78
85struct koneplus_macro { 79struct koneplus_macro {
86 uint8_t command; /* KONEPLUS_COMMAND_MACRO */ 80 uint8_t command; /* KONEPLUS_COMMAND_MACRO */
@@ -89,31 +83,31 @@ struct koneplus_macro {
89 uint8_t button; /* range 0-23 */ 83 uint8_t button; /* range 0-23 */
90 uint8_t data[2075]; 84 uint8_t data[2075];
91 uint16_t checksum; 85 uint16_t checksum;
92}; 86} __attribute__ ((__packed__));
93 87
94struct koneplus_info { 88struct koneplus_info {
95 uint8_t command; /* KONEPLUS_COMMAND_INFO */ 89 uint8_t command; /* KONEPLUS_COMMAND_INFO */
96 uint8_t size; /* always 6 */ 90 uint8_t size; /* always 6 */
97 uint8_t firmware_version; 91 uint8_t firmware_version;
98 uint8_t unknown[3]; 92 uint8_t unknown[3];
99}; 93} __attribute__ ((__packed__));
100 94
101struct koneplus_e { 95struct koneplus_e {
102 uint8_t command; /* KONEPLUS_COMMAND_E */ 96 uint8_t command; /* KONEPLUS_COMMAND_E */
103 uint8_t size; /* always 3 */ 97 uint8_t size; /* always 3 */
104 uint8_t unknown; /* TODO 1; 0 before firmware update */ 98 uint8_t unknown; /* TODO 1; 0 before firmware update */
105}; 99} __attribute__ ((__packed__));
106 100
107struct koneplus_sensor { 101struct koneplus_sensor {
108 uint8_t command; /* KONEPLUS_COMMAND_SENSOR */ 102 uint8_t command; /* KONEPLUS_COMMAND_SENSOR */
109 uint8_t size; /* always 6 */ 103 uint8_t size; /* always 6 */
110 uint8_t data[4]; 104 uint8_t data[4];
111}; 105} __attribute__ ((__packed__));
112 106
113struct koneplus_firmware_write { 107struct koneplus_firmware_write {
114 uint8_t command; /* KONEPLUS_COMMAND_FIRMWARE_WRITE */ 108 uint8_t command; /* KONEPLUS_COMMAND_FIRMWARE_WRITE */
115 uint8_t unknown[1025]; 109 uint8_t unknown[1025];
116}; 110} __attribute__ ((__packed__));
117 111
118struct koneplus_firmware_write_control { 112struct koneplus_firmware_write_control {
119 uint8_t command; /* KONEPLUS_COMMAND_FIRMWARE_WRITE_CONTROL */ 113 uint8_t command; /* KONEPLUS_COMMAND_FIRMWARE_WRITE_CONTROL */
@@ -123,18 +117,18 @@ struct koneplus_firmware_write_control {
123 */ 117 */
124 uint8_t value; 118 uint8_t value;
125 uint8_t unknown; /* always 0x75 */ 119 uint8_t unknown; /* always 0x75 */
126}; 120} __attribute__ ((__packed__));
127 121
128struct koneplus_tcu { 122struct koneplus_tcu {
129 uint16_t usb_command; /* KONEPLUS_USB_COMMAND_TCU */ 123 uint16_t usb_command; /* KONEPLUS_USB_COMMAND_TCU */
130 uint8_t data[2]; 124 uint8_t data[2];
131}; 125} __attribute__ ((__packed__));
132 126
133struct koneplus_tcu_image { 127struct koneplus_tcu_image {
134 uint16_t usb_command; /* KONEPLUS_USB_COMMAND_TCU */ 128 uint16_t usb_command; /* KONEPLUS_USB_COMMAND_TCU */
135 uint8_t data[1024]; 129 uint8_t data[1024];
136 uint16_t checksum; 130 uint16_t checksum;
137}; 131} __attribute__ ((__packed__));
138 132
139enum koneplus_commands { 133enum koneplus_commands {
140 KONEPLUS_COMMAND_CONTROL = 0x4, 134 KONEPLUS_COMMAND_CONTROL = 0x4,
@@ -177,7 +171,7 @@ struct koneplus_mouse_report_button {
177 uint8_t data2; 171 uint8_t data2;
178 uint8_t zero2; 172 uint8_t zero2;
179 uint8_t unknown[2]; 173 uint8_t unknown[2];
180}; 174} __attribute__ ((__packed__));
181 175
182enum koneplus_mouse_report_button_types { 176enum koneplus_mouse_report_button_types {
183 /* data1 = new profile range 1-5 */ 177 /* data1 = new profile range 1-5 */
@@ -211,9 +205,7 @@ struct koneplus_roccat_report {
211 uint8_t data1; 205 uint8_t data1;
212 uint8_t data2; 206 uint8_t data2;
213 uint8_t profile; 207 uint8_t profile;
214}; 208} __attribute__ ((__packed__));
215
216#pragma pack(pop)
217 209
218struct koneplus_device { 210struct koneplus_device {
219 int actual_profile; 211 int actual_profile;