aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-roccat-pyra.h
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-12-09 08:29:34 -0500
committerJiri Kosina <jkosina@suse.cz>2011-01-07 19:18:35 -0500
commit4d043101897768dfde30a6f2674fc7cec403d6b0 (patch)
tree84e4e7aa4082a1eceec91ee51a3524ec874d017a /drivers/hid/hid-roccat-pyra.h
parent47dbdbffe15b9582a41727766d43f1d4208e977e (diff)
HID: roccat: don't use #pragma pack
Replace #pragma pack ocurences with __atribute__((__packed__)); Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-roccat-pyra.h')
-rw-r--r--drivers/hid/hid-roccat-pyra.h26
1 files changed, 9 insertions, 17 deletions
diff --git a/drivers/hid/hid-roccat-pyra.h b/drivers/hid/hid-roccat-pyra.h
index ac5996e8817c..14cbbe1621e0 100644
--- a/drivers/hid/hid-roccat-pyra.h
+++ b/drivers/hid/hid-roccat-pyra.h
@@ -14,17 +14,11 @@
14 14
15#include <linux/types.h> 15#include <linux/types.h>
16 16
17/*
18 * Binary data structures used for hardware communication must have no padding.
19 */
20#pragma pack(push)
21#pragma pack(1)
22
23struct pyra_b { 17struct pyra_b {
24 uint8_t command; /* PYRA_COMMAND_B */ 18 uint8_t command; /* PYRA_COMMAND_B */
25 uint8_t size; /* always 3 */ 19 uint8_t size; /* always 3 */
26 uint8_t unknown; /* 1 */ 20 uint8_t unknown; /* 1 */
27}; 21} __attribute__ ((__packed__));
28 22
29struct pyra_control { 23struct pyra_control {
30 uint8_t command; /* PYRA_COMMAND_CONTROL */ 24 uint8_t command; /* PYRA_COMMAND_CONTROL */
@@ -34,7 +28,7 @@ struct pyra_control {
34 */ 28 */
35 uint8_t value; /* Range 0-4 */ 29 uint8_t value; /* Range 0-4 */
36 uint8_t request; 30 uint8_t request;
37}; 31} __attribute__ ((__packed__));
38 32
39enum pyra_control_requests { 33enum pyra_control_requests {
40 PYRA_CONTROL_REQUEST_STATUS = 0x00, 34 PYRA_CONTROL_REQUEST_STATUS = 0x00,
@@ -46,7 +40,7 @@ struct pyra_settings {
46 uint8_t command; /* PYRA_COMMAND_SETTINGS */ 40 uint8_t command; /* PYRA_COMMAND_SETTINGS */
47 uint8_t size; /* always 3 */ 41 uint8_t size; /* always 3 */
48 uint8_t startup_profile; /* Range 0-4! */ 42 uint8_t startup_profile; /* Range 0-4! */
49}; 43} __attribute__ ((__packed__));
50 44
51struct pyra_profile_settings { 45struct pyra_profile_settings {
52 uint8_t command; /* PYRA_COMMAND_PROFILE_SETTINGS */ 46 uint8_t command; /* PYRA_COMMAND_PROFILE_SETTINGS */
@@ -61,7 +55,7 @@ struct pyra_profile_settings {
61 uint8_t light_effect; 55 uint8_t light_effect;
62 uint8_t handedness; 56 uint8_t handedness;
63 uint16_t checksum; /* byte sum */ 57 uint16_t checksum; /* byte sum */
64}; 58} __attribute__ ((__packed__));
65 59
66struct pyra_profile_buttons { 60struct pyra_profile_buttons {
67 uint8_t command; /* PYRA_COMMAND_PROFILE_BUTTONS */ 61 uint8_t command; /* PYRA_COMMAND_PROFILE_BUTTONS */
@@ -69,7 +63,7 @@ struct pyra_profile_buttons {
69 uint8_t number; /* Range 0-4 */ 63 uint8_t number; /* Range 0-4 */
70 uint8_t buttons[14]; 64 uint8_t buttons[14];
71 uint16_t checksum; /* byte sum */ 65 uint16_t checksum; /* byte sum */
72}; 66} __attribute__ ((__packed__));
73 67
74struct pyra_info { 68struct pyra_info {
75 uint8_t command; /* PYRA_COMMAND_INFO */ 69 uint8_t command; /* PYRA_COMMAND_INFO */
@@ -78,7 +72,7 @@ struct pyra_info {
78 uint8_t unknown1; /* always 0 */ 72 uint8_t unknown1; /* always 0 */
79 uint8_t unknown2; /* always 1 */ 73 uint8_t unknown2; /* always 1 */
80 uint8_t unknown3; /* always 0 */ 74 uint8_t unknown3; /* always 0 */
81}; 75} __attribute__ ((__packed__));
82 76
83enum pyra_commands { 77enum pyra_commands {
84 PYRA_COMMAND_CONTROL = 0x4, 78 PYRA_COMMAND_CONTROL = 0x4,
@@ -110,13 +104,13 @@ struct pyra_mouse_event_button {
110 uint8_t type; 104 uint8_t type;
111 uint8_t data1; 105 uint8_t data1;
112 uint8_t data2; 106 uint8_t data2;
113}; 107} __attribute__ ((__packed__));
114 108
115struct pyra_mouse_event_audio { 109struct pyra_mouse_event_audio {
116 uint8_t report_number; /* always 2 */ 110 uint8_t report_number; /* always 2 */
117 uint8_t type; 111 uint8_t type;
118 uint8_t unused; /* always 0 */ 112 uint8_t unused; /* always 0 */
119}; 113} __attribute__ ((__packed__));
120 114
121/* hid audio controls */ 115/* hid audio controls */
122enum pyra_mouse_event_audio_types { 116enum pyra_mouse_event_audio_types {
@@ -170,9 +164,7 @@ struct pyra_roccat_report {
170 uint8_t type; 164 uint8_t type;
171 uint8_t value; 165 uint8_t value;
172 uint8_t key; 166 uint8_t key;
173}; 167} __attribute__ ((__packed__));
174
175#pragma pack(pop)
176 168
177struct pyra_device { 169struct pyra_device {
178 int actual_profile; 170 int actual_profile;