diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-12-09 08:29:34 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-01-07 19:18:35 -0500 |
commit | 4d043101897768dfde30a6f2674fc7cec403d6b0 (patch) | |
tree | 84e4e7aa4082a1eceec91ee51a3524ec874d017a | |
parent | 47dbdbffe15b9582a41727766d43f1d4208e977e (diff) |
HID: roccat: don't use #pragma pack
Replace #pragma pack ocurences with __atribute__((__packed__));
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r-- | drivers/hid/hid-roccat-kone.h | 22 | ||||
-rw-r--r-- | drivers/hid/hid-roccat-koneplus.h | 36 | ||||
-rw-r--r-- | drivers/hid/hid-roccat-pyra.h | 26 |
3 files changed, 30 insertions, 54 deletions
diff --git a/drivers/hid/hid-roccat-kone.h b/drivers/hid/hid-roccat-kone.h index 11203a75b0f9..64abb5b8a59a 100644 --- a/drivers/hid/hid-roccat-kone.h +++ b/drivers/hid/hid-roccat-kone.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 | |||
23 | struct kone_keystroke { | 17 | struct kone_keystroke { |
24 | uint8_t key; | 18 | uint8_t key; |
25 | uint8_t action; | 19 | uint8_t action; |
26 | uint16_t period; /* in milliseconds */ | 20 | uint16_t period; /* in milliseconds */ |
27 | }; | 21 | } __attribute__ ((__packed__)); |
28 | 22 | ||
29 | enum kone_keystroke_buttons { | 23 | enum kone_keystroke_buttons { |
30 | kone_keystroke_button_1 = 0xf0, /* left mouse button */ | 24 | kone_keystroke_button_1 = 0xf0, /* left mouse button */ |
@@ -47,7 +41,7 @@ struct kone_button_info { | |||
47 | uint8_t macro_name[16]; /* can be max 15 chars long */ | 41 | uint8_t macro_name[16]; /* can be max 15 chars long */ |
48 | uint8_t count; | 42 | uint8_t count; |
49 | struct kone_keystroke keystrokes[20]; | 43 | struct kone_keystroke keystrokes[20]; |
50 | }; | 44 | } __attribute__ ((__packed__)); |
51 | 45 | ||
52 | enum kone_button_info_types { | 46 | enum kone_button_info_types { |
53 | /* valid button types until firmware 1.32 */ | 47 | /* valid button types until firmware 1.32 */ |
@@ -98,7 +92,7 @@ struct kone_light_info { | |||
98 | uint8_t red; /* range 0x00-0xff */ | 92 | uint8_t red; /* range 0x00-0xff */ |
99 | uint8_t green; /* range 0x00-0xff */ | 93 | uint8_t green; /* range 0x00-0xff */ |
100 | uint8_t blue; /* range 0x00-0xff */ | 94 | uint8_t blue; /* range 0x00-0xff */ |
101 | }; | 95 | } __attribute__ ((__packed__)); |
102 | 96 | ||
103 | struct kone_profile { | 97 | struct kone_profile { |
104 | uint16_t size; /* always 975 */ | 98 | uint16_t size; /* always 975 */ |
@@ -133,7 +127,7 @@ struct kone_profile { | |||
133 | struct kone_button_info button_infos[8]; | 127 | struct kone_button_info button_infos[8]; |
134 | 128 | ||
135 | uint16_t checksum; /* \brief holds checksum of struct */ | 129 | uint16_t checksum; /* \brief holds checksum of struct */ |
136 | }; | 130 | } __attribute__ ((__packed__)); |
137 | 131 | ||
138 | enum kone_polling_rates { | 132 | enum kone_polling_rates { |
139 | kone_polling_rate_125 = 1, | 133 | kone_polling_rate_125 = 1, |
@@ -150,7 +144,7 @@ struct kone_settings { | |||
150 | uint8_t calibration_data[4]; | 144 | uint8_t calibration_data[4]; |
151 | uint8_t unknown3[2]; | 145 | uint8_t unknown3[2]; |
152 | uint16_t checksum; | 146 | uint16_t checksum; |
153 | }; | 147 | } __attribute__ ((__packed__)); |
154 | 148 | ||
155 | /* | 149 | /* |
156 | * 12 byte mouse event read by interrupt_read | 150 | * 12 byte mouse event read by interrupt_read |
@@ -166,7 +160,7 @@ struct kone_mouse_event { | |||
166 | uint8_t event; | 160 | uint8_t event; |
167 | uint8_t value; /* press = 0, release = 1 */ | 161 | uint8_t value; /* press = 0, release = 1 */ |
168 | uint8_t macro_key; /* 0 to 8 */ | 162 | uint8_t macro_key; /* 0 to 8 */ |
169 | }; | 163 | } __attribute__ ((__packed__)); |
170 | 164 | ||
171 | enum kone_mouse_events { | 165 | enum kone_mouse_events { |
172 | /* osd events are thought to be display on screen */ | 166 | /* osd events are thought to be display on screen */ |
@@ -194,9 +188,7 @@ struct kone_roccat_report { | |||
194 | uint8_t event; | 188 | uint8_t event; |
195 | uint8_t value; /* holds dpi or profile value */ | 189 | uint8_t value; /* holds dpi or profile value */ |
196 | uint8_t key; /* macro key on overlong macro execution */ | 190 | uint8_t key; /* macro key on overlong macro execution */ |
197 | }; | 191 | } __attribute__ ((__packed__)); |
198 | |||
199 | #pragma pack(pop) | ||
200 | 192 | ||
201 | struct kone_device { | 193 | struct kone_device { |
202 | /* | 194 | /* |
diff --git a/drivers/hid/hid-roccat-koneplus.h b/drivers/hid/hid-roccat-koneplus.h index 905e33d45354..57a5c1ab7b05 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 | ||
37 | enum koneplus_control_requests { | 31 | enum 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 | ||
55 | struct koneplus_profile_settings { | 49 | struct 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 | ||
77 | struct koneplus_profile_buttons { | 71 | struct 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 | ||
85 | struct koneplus_macro { | 79 | struct 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 | ||
94 | struct koneplus_info { | 88 | struct 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 | ||
101 | struct koneplus_e { | 95 | struct 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 | ||
107 | struct koneplus_sensor { | 101 | struct 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 | ||
113 | struct koneplus_firmware_write { | 107 | struct 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 | ||
118 | struct koneplus_firmware_write_control { | 112 | struct 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 | ||
128 | struct koneplus_tcu { | 122 | struct 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 | ||
133 | struct koneplus_tcu_image { | 127 | struct 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 | ||
139 | enum koneplus_commands { | 133 | enum 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 | ||
182 | enum koneplus_mouse_report_button_types { | 176 | enum 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 | ||
218 | struct koneplus_device { | 210 | struct koneplus_device { |
219 | int actual_profile; | 211 | int actual_profile; |
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 | |||
23 | struct pyra_b { | 17 | struct 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 | ||
29 | struct pyra_control { | 23 | struct 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 | ||
39 | enum pyra_control_requests { | 33 | enum 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 | ||
51 | struct pyra_profile_settings { | 45 | struct 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 | ||
66 | struct pyra_profile_buttons { | 60 | struct 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 | ||
74 | struct pyra_info { | 68 | struct 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 | ||
83 | enum pyra_commands { | 77 | enum 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 | ||
115 | struct pyra_mouse_event_audio { | 109 | struct 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 */ |
122 | enum pyra_mouse_event_audio_types { | 116 | enum 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 | ||
177 | struct pyra_device { | 169 | struct pyra_device { |
178 | int actual_profile; | 170 | int actual_profile; |