1 #ifndef __HID_ROCCAT_KONEPLUS_H
2 #define __HID_ROCCAT_KONEPLUS_H
5 * Copyright (c) 2010 Stefan Achatz <erazor_de@users.sourceforge.net>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the Free
11 * Software Foundation; either version 2 of the License, or (at your option)
15 #include <linux/types.h>
17 struct koneplus_talk
{
18 uint8_t command
; /* KONEPLUS_COMMAND_TALK */
19 uint8_t size
; /* always 0x10 */
23 enum koneplus_control_requests
{
24 KONEPLUS_CONTROL_REQUEST_PROFILE_SETTINGS
= 0x80,
25 KONEPLUS_CONTROL_REQUEST_PROFILE_BUTTONS
= 0x90,
28 struct koneplus_actual_profile
{
29 uint8_t command
; /* KONEPLUS_COMMAND_ACTUAL_PROFILE */
30 uint8_t size
; /* always 3 */
31 uint8_t actual_profile
; /* Range 0-4! */
32 } __attribute__ ((__packed__
));
34 struct koneplus_profile_settings
{
35 uint8_t command
; /* KONEPLUS_COMMAND_PROFILE_SETTINGS */
36 uint8_t size
; /* always 43 */
37 uint8_t number
; /* range 0-4 */
38 uint8_t advanced_sensitivity
;
39 uint8_t sensitivity_x
;
40 uint8_t sensitivity_y
;
41 uint8_t cpi_levels_enabled
;
42 uint8_t cpi_levels_x
[5];
43 uint8_t cpi_startup_level
; /* range 0-4 */
44 uint8_t cpi_levels_y
[5]; /* range 1-60 means 100-6000 cpi */
47 uint8_t lights_enabled
;
48 uint8_t light_effect_mode
;
49 uint8_t color_flow_effect
;
50 uint8_t light_effect_type
;
51 uint8_t light_effect_speed
;
54 } __attribute__ ((__packed__
));
56 struct koneplus_profile_buttons
{
57 uint8_t command
; /* KONEPLUS_COMMAND_PROFILE_BUTTONS */
58 uint8_t size
; /* always 77 */
59 uint8_t number
; /* range 0-4 */
62 } __attribute__ ((__packed__
));
64 struct koneplus_macro
{
65 uint8_t command
; /* KONEPLUS_COMMAND_MACRO */
66 uint16_t size
; /* always 0x822 little endian */
67 uint8_t profile
; /* range 0-4 */
68 uint8_t button
; /* range 0-23 */
71 } __attribute__ ((__packed__
));
73 struct koneplus_info
{
74 uint8_t command
; /* KONEPLUS_COMMAND_INFO */
75 uint8_t size
; /* always 6 */
76 uint8_t firmware_version
;
78 } __attribute__ ((__packed__
));
81 uint8_t command
; /* KONEPLUS_COMMAND_E */
82 uint8_t size
; /* always 3 */
83 uint8_t unknown
; /* TODO 1; 0 before firmware update */
84 } __attribute__ ((__packed__
));
86 struct koneplus_sensor
{
87 uint8_t command
; /* KONEPLUS_COMMAND_SENSOR */
88 uint8_t size
; /* always 6 */
90 } __attribute__ ((__packed__
));
92 struct koneplus_firmware_write
{
93 uint8_t command
; /* KONEPLUS_COMMAND_FIRMWARE_WRITE */
94 uint8_t unknown
[1025];
95 } __attribute__ ((__packed__
));
97 struct koneplus_firmware_write_control
{
98 uint8_t command
; /* KONEPLUS_COMMAND_FIRMWARE_WRITE_CONTROL */
100 * value is 1 on success
101 * 3 means "not finished yet"
104 uint8_t unknown
; /* always 0x75 */
105 } __attribute__ ((__packed__
));
107 struct koneplus_tcu
{
108 uint16_t usb_command
; /* KONEPLUS_USB_COMMAND_TCU */
110 } __attribute__ ((__packed__
));
112 struct koneplus_tcu_image
{
113 uint16_t usb_command
; /* KONEPLUS_USB_COMMAND_TCU */
116 } __attribute__ ((__packed__
));
118 enum koneplus_commands
{
119 KONEPLUS_COMMAND_ACTUAL_PROFILE
= 0x5,
120 KONEPLUS_COMMAND_PROFILE_SETTINGS
= 0x6,
121 KONEPLUS_COMMAND_PROFILE_BUTTONS
= 0x7,
122 KONEPLUS_COMMAND_MACRO
= 0x8,
123 KONEPLUS_COMMAND_INFO
= 0x9,
124 KONEPLUS_COMMAND_TCU
= 0xc,
125 KONEPLUS_COMMAND_E
= 0xe,
126 KONEPLUS_COMMAND_SENSOR
= 0xf,
127 KONEPLUS_COMMAND_TALK
= 0x10,
128 KONEPLUS_COMMAND_FIRMWARE_WRITE
= 0x1b,
129 KONEPLUS_COMMAND_FIRMWARE_WRITE_CONTROL
= 0x1c,
132 enum koneplus_mouse_report_numbers
{
133 KONEPLUS_MOUSE_REPORT_NUMBER_HID
= 1,
134 KONEPLUS_MOUSE_REPORT_NUMBER_AUDIO
= 2,
135 KONEPLUS_MOUSE_REPORT_NUMBER_BUTTON
= 3,
138 struct koneplus_mouse_report_button
{
139 uint8_t report_number
; /* always KONEPLUS_MOUSE_REPORT_NUMBER_BUTTON */
146 } __attribute__ ((__packed__
));
148 enum koneplus_mouse_report_button_types
{
149 /* data1 = new profile range 1-5 */
150 KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE
= 0x20,
152 /* data1 = button number range 1-24; data2 = action */
153 KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_QUICKLAUNCH
= 0x60,
155 /* data1 = button number range 1-24; data2 = action */
156 KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_TIMER
= 0x80,
158 /* data1 = setting number range 1-5 */
159 KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_CPI
= 0xb0,
161 /* data1 and data2 = range 0x1-0xb */
162 KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_SENSITIVITY
= 0xc0,
164 /* data1 = 22 = next track...
167 KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_MULTIMEDIA
= 0xf0,
168 KONEPLUS_MOUSE_REPORT_TALK
= 0xff,
171 enum koneplus_mouse_report_button_action
{
172 KONEPLUS_MOUSE_REPORT_BUTTON_ACTION_PRESS
= 0,
173 KONEPLUS_MOUSE_REPORT_BUTTON_ACTION_RELEASE
= 1,
176 struct koneplus_roccat_report
{
181 } __attribute__ ((__packed__
));
183 struct koneplus_device
{
189 struct mutex koneplus_lock
;
191 struct koneplus_info info
;
192 struct koneplus_profile_settings profile_settings
[5];
193 struct koneplus_profile_buttons profile_buttons
[5];