diff options
author | Corey Minyard <cminyard@mvista.com> | 2008-04-29 04:01:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:15 -0400 |
commit | 73f2bdb975751eb11de0df1970710e6c40badc26 (patch) | |
tree | 7814f5715169e4f85544fe230963ba4eb2cddf69 /drivers | |
parent | b2655f2615e92e92ca3d55132b32776f1fe1a05c (diff) |
IPMI: convert message handler defines to an enum
Convert the #defines for statistics into an enum in the IPMI message
handler.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 125 |
1 files changed, 67 insertions, 58 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 4a5e159dc0f5..ea6ba35b3d7e 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -189,90 +189,99 @@ struct bmc_device | |||
189 | * Various statistics for IPMI, these index stats[] in the ipmi_smi | 189 | * Various statistics for IPMI, these index stats[] in the ipmi_smi |
190 | * structure. | 190 | * structure. |
191 | */ | 191 | */ |
192 | /* Commands we got from the user that were invalid. */ | 192 | enum ipmi_stat_indexes { |
193 | #define IPMI_STAT_sent_invalid_commands 0 | 193 | /* Commands we got from the user that were invalid. */ |
194 | IPMI_STAT_sent_invalid_commands = 0, | ||
194 | 195 | ||
195 | /* Commands we sent to the MC. */ | 196 | /* Commands we sent to the MC. */ |
196 | #define IPMI_STAT_sent_local_commands 1 | 197 | IPMI_STAT_sent_local_commands, |
197 | 198 | ||
198 | /* Responses from the MC that were delivered to a user. */ | 199 | /* Responses from the MC that were delivered to a user. */ |
199 | #define IPMI_STAT_handled_local_responses 2 | 200 | IPMI_STAT_handled_local_responses, |
200 | 201 | ||
201 | /* Responses from the MC that were not delivered to a user. */ | 202 | /* Responses from the MC that were not delivered to a user. */ |
202 | #define IPMI_STAT_unhandled_local_responses 3 | 203 | IPMI_STAT_unhandled_local_responses, |
203 | 204 | ||
204 | /* Commands we sent out to the IPMB bus. */ | 205 | /* Commands we sent out to the IPMB bus. */ |
205 | #define IPMI_STAT_sent_ipmb_commands 4 | 206 | IPMI_STAT_sent_ipmb_commands, |
206 | 207 | ||
207 | /* Commands sent on the IPMB that had errors on the SEND CMD */ | 208 | /* Commands sent on the IPMB that had errors on the SEND CMD */ |
208 | #define IPMI_STAT_sent_ipmb_command_errs 5 | 209 | IPMI_STAT_sent_ipmb_command_errs, |
209 | 210 | ||
210 | /* Each retransmit increments this count. */ | 211 | /* Each retransmit increments this count. */ |
211 | #define IPMI_STAT_retransmitted_ipmb_commands 6 | 212 | IPMI_STAT_retransmitted_ipmb_commands, |
212 | 213 | ||
213 | /* When a message times out (runs out of retransmits) this is incremented. */ | 214 | /* |
214 | #define IPMI_STAT_timed_out_ipmb_commands 7 | 215 | * When a message times out (runs out of retransmits) this is |
216 | * incremented. | ||
217 | */ | ||
218 | IPMI_STAT_timed_out_ipmb_commands, | ||
215 | 219 | ||
216 | /* | 220 | /* |
217 | * This is like above, but for broadcasts. Broadcasts are | 221 | * This is like above, but for broadcasts. Broadcasts are |
218 | * *not* included in the above count (they are expected to | 222 | * *not* included in the above count (they are expected to |
219 | * time out). | 223 | * time out). |
220 | */ | 224 | */ |
221 | #define IPMI_STAT_timed_out_ipmb_broadcasts 8 | 225 | IPMI_STAT_timed_out_ipmb_broadcasts, |
222 | 226 | ||
223 | /* Responses I have sent to the IPMB bus. */ | 227 | /* Responses I have sent to the IPMB bus. */ |
224 | #define IPMI_STAT_sent_ipmb_responses 9 | 228 | IPMI_STAT_sent_ipmb_responses, |
225 | 229 | ||
226 | /* The response was delivered to the user. */ | 230 | /* The response was delivered to the user. */ |
227 | #define IPMI_STAT_handled_ipmb_responses 10 | 231 | IPMI_STAT_handled_ipmb_responses, |
228 | 232 | ||
229 | /* The response had invalid data in it. */ | 233 | /* The response had invalid data in it. */ |
230 | #define IPMI_STAT_invalid_ipmb_responses 11 | 234 | IPMI_STAT_invalid_ipmb_responses, |
231 | 235 | ||
232 | /* The response didn't have anyone waiting for it. */ | 236 | /* The response didn't have anyone waiting for it. */ |
233 | #define IPMI_STAT_unhandled_ipmb_responses 12 | 237 | IPMI_STAT_unhandled_ipmb_responses, |
234 | 238 | ||
235 | /* Commands we sent out to the IPMB bus. */ | 239 | /* Commands we sent out to the IPMB bus. */ |
236 | #define IPMI_STAT_sent_lan_commands 13 | 240 | IPMI_STAT_sent_lan_commands, |
237 | 241 | ||
238 | /* Commands sent on the IPMB that had errors on the SEND CMD */ | 242 | /* Commands sent on the IPMB that had errors on the SEND CMD */ |
239 | #define IPMI_STAT_sent_lan_command_errs 14 | 243 | IPMI_STAT_sent_lan_command_errs, |
240 | 244 | ||
241 | /* Each retransmit increments this count. */ | 245 | /* Each retransmit increments this count. */ |
242 | #define IPMI_STAT_retransmitted_lan_commands 15 | 246 | IPMI_STAT_retransmitted_lan_commands, |
243 | 247 | ||
244 | /* When a message times out (runs out of retransmits) this is incremented. */ | 248 | /* |
245 | #define IPMI_STAT_timed_out_lan_commands 16 | 249 | * When a message times out (runs out of retransmits) this is |
250 | * incremented. | ||
251 | */ | ||
252 | IPMI_STAT_timed_out_lan_commands, | ||
246 | 253 | ||
247 | /* Responses I have sent to the IPMB bus. */ | 254 | /* Responses I have sent to the IPMB bus. */ |
248 | #define IPMI_STAT_sent_lan_responses 17 | 255 | IPMI_STAT_sent_lan_responses, |
249 | 256 | ||
250 | /* The response was delivered to the user. */ | 257 | /* The response was delivered to the user. */ |
251 | #define IPMI_STAT_handled_lan_responses 18 | 258 | IPMI_STAT_handled_lan_responses, |
252 | 259 | ||
253 | /* The response had invalid data in it. */ | 260 | /* The response had invalid data in it. */ |
254 | #define IPMI_STAT_invalid_lan_responses 19 | 261 | IPMI_STAT_invalid_lan_responses, |
255 | 262 | ||
256 | /* The response didn't have anyone waiting for it. */ | 263 | /* The response didn't have anyone waiting for it. */ |
257 | #define IPMI_STAT_unhandled_lan_responses 20 | 264 | IPMI_STAT_unhandled_lan_responses, |
258 | 265 | ||
259 | /* The command was delivered to the user. */ | 266 | /* The command was delivered to the user. */ |
260 | #define IPMI_STAT_handled_commands 21 | 267 | IPMI_STAT_handled_commands, |
261 | 268 | ||
262 | /* The command had invalid data in it. */ | 269 | /* The command had invalid data in it. */ |
263 | #define IPMI_STAT_invalid_commands 22 | 270 | IPMI_STAT_invalid_commands, |
264 | 271 | ||
265 | /* The command didn't have anyone waiting for it. */ | 272 | /* The command didn't have anyone waiting for it. */ |
266 | #define IPMI_STAT_unhandled_commands 23 | 273 | IPMI_STAT_unhandled_commands, |
267 | 274 | ||
268 | /* Invalid data in an event. */ | 275 | /* Invalid data in an event. */ |
269 | #define IPMI_STAT_invalid_events 24 | 276 | IPMI_STAT_invalid_events, |
270 | 277 | ||
271 | /* Events that were received with the proper format. */ | 278 | /* Events that were received with the proper format. */ |
272 | #define IPMI_STAT_events 25 | 279 | IPMI_STAT_events, |
273 | 280 | ||
274 | /* When you add a statistic, you must update this value. */ | 281 | |
275 | #define IPMI_NUM_STATS 26 | 282 | /* This *must* remain last, add new values above this. */ |
283 | IPMI_NUM_STATS | ||
284 | }; | ||
276 | 285 | ||
277 | 286 | ||
278 | #define IPMI_IPMB_NUM_SEQ 64 | 287 | #define IPMI_IPMB_NUM_SEQ 64 |