1#ifndef __HID_ROCCAT_KOVAPLUS_H
2#define __HID_ROCCAT_KOVAPLUS_H
3
4
5
6
7
8
9
10
11
12
13
14
15#include <linux/types.h>
16
17struct kovaplus_control {
18 uint8_t command;
19 uint8_t value;
20 uint8_t request;
21} __packed;
22
23enum kovaplus_control_requests {
24
25 KOVAPLUS_CONTROL_REQUEST_STATUS = 0x0,
26
27 KOVAPLUS_CONTROL_REQUEST_PROFILE_SETTINGS = 0x10,
28
29 KOVAPLUS_CONTROL_REQUEST_PROFILE_BUTTONS = 0x20,
30};
31
32enum kovaplus_control_values {
33 KOVAPLUS_CONTROL_REQUEST_STATUS_OVERLOAD = 0,
34 KOVAPLUS_CONTROL_REQUEST_STATUS_OK = 1,
35 KOVAPLUS_CONTROL_REQUEST_STATUS_WAIT = 3,
36};
37
38struct kovaplus_actual_profile {
39 uint8_t command;
40 uint8_t size;
41 uint8_t actual_profile;
42} __packed;
43
44struct kovaplus_profile_settings {
45 uint8_t command;
46 uint8_t size;
47 uint8_t profile_index;
48 uint8_t unknown1;
49 uint8_t sensitivity_x;
50 uint8_t sensitivity_y;
51 uint8_t cpi_levels_enabled;
52 uint8_t cpi_startup_level;
53 uint8_t data[8];
54} __packed;
55
56struct kovaplus_profile_buttons {
57 uint8_t command;
58 uint8_t size;
59 uint8_t profile_index;
60 uint8_t data[20];
61} __packed;
62
63struct kovaplus_info {
64 uint8_t command;
65 uint8_t size;
66 uint8_t firmware_version;
67 uint8_t unknown[3];
68} __packed;
69
70
71struct kovaplus_a {
72 uint8_t command;
73 uint8_t size;
74 uint8_t unknown;
75} __packed;
76
77enum kovaplus_commands {
78 KOVAPLUS_COMMAND_CONTROL = 0x4,
79 KOVAPLUS_COMMAND_ACTUAL_PROFILE = 0x5,
80 KOVAPLUS_COMMAND_PROFILE_SETTINGS = 0x6,
81 KOVAPLUS_COMMAND_PROFILE_BUTTONS = 0x7,
82 KOVAPLUS_COMMAND_INFO = 0x9,
83 KOVAPLUS_COMMAND_A = 0xa,
84};
85
86enum kovaplus_mouse_report_numbers {
87 KOVAPLUS_MOUSE_REPORT_NUMBER_MOUSE = 1,
88 KOVAPLUS_MOUSE_REPORT_NUMBER_AUDIO = 2,
89 KOVAPLUS_MOUSE_REPORT_NUMBER_BUTTON = 3,
90 KOVAPLUS_MOUSE_REPORT_NUMBER_KBD = 4,
91};
92
93struct kovaplus_mouse_report_button {
94 uint8_t report_number;
95 uint8_t unknown1;
96 uint8_t type;
97 uint8_t data1;
98 uint8_t data2;
99} __packed;
100
101enum kovaplus_mouse_report_button_types {
102
103 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE_1 = 0x20,
104
105 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE_2 = 0x30,
106
107 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_MACRO = 0x40,
108
109 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_SHORTCUT = 0x50,
110
111 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_QUICKLAUNCH = 0x60,
112
113 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_TIMER = 0x80,
114
115 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_CPI = 0xb0,
116
117 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_SENSITIVITY = 0xc0,
118
119 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_MULTIMEDIA = 0xf0,
120};
121
122enum kovaplus_mouse_report_button_actions {
123 KOVAPLUS_MOUSE_REPORT_BUTTON_ACTION_PRESS = 0,
124 KOVAPLUS_MOUSE_REPORT_BUTTON_ACTION_RELEASE = 1,
125};
126
127struct kovaplus_roccat_report {
128 uint8_t type;
129 uint8_t profile;
130 uint8_t button;
131 uint8_t data1;
132 uint8_t data2;
133} __packed;
134
135struct kovaplus_device {
136 int actual_profile;
137 int actual_cpi;
138 int actual_x_sensitivity;
139 int actual_y_sensitivity;
140 int roccat_claimed;
141 int chrdev_minor;
142 struct mutex kovaplus_lock;
143 struct kovaplus_info info;
144 struct kovaplus_profile_settings profile_settings[5];
145 struct kovaplus_profile_buttons profile_buttons[5];
146};
147
148#endif
149