powerpc/pseries: Factor HVSI header struct in packet definitions
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / powerpc / include / asm / hvsi.h
blobab2ddd76c2e05de7411e62bf657052db8e14a65c
1 #ifndef _HVSI_H
2 #define _HVSI_H
4 #define VS_DATA_PACKET_HEADER 0xff
5 #define VS_CONTROL_PACKET_HEADER 0xfe
6 #define VS_QUERY_PACKET_HEADER 0xfd
7 #define VS_QUERY_RESPONSE_PACKET_HEADER 0xfc
9 /* control verbs */
10 #define VSV_SET_MODEM_CTL 1 /* to service processor only */
11 #define VSV_MODEM_CTL_UPDATE 2 /* from service processor only */
12 #define VSV_CLOSE_PROTOCOL 3
14 /* query verbs */
15 #define VSV_SEND_VERSION_NUMBER 1
16 #define VSV_SEND_MODEM_CTL_STATUS 2
18 /* yes, these masks are not consecutive. */
19 #define HVSI_TSDTR 0x01
20 #define HVSI_TSCD 0x20
22 #define HVSI_MAX_OUTGOING_DATA 12
23 #define HVSI_VERSION 1
25 struct hvsi_header {
26 uint8_t type;
27 uint8_t len;
28 uint16_t seqno;
29 } __attribute__((packed));
31 struct hvsi_data {
32 struct hvsi_header hdr;
33 uint8_t data[HVSI_MAX_OUTGOING_DATA];
34 } __attribute__((packed));
36 struct hvsi_control {
37 struct hvsi_header hdr;
38 uint16_t verb;
39 /* optional depending on verb: */
40 uint32_t word;
41 uint32_t mask;
42 } __attribute__((packed));
44 struct hvsi_query {
45 struct hvsi_header hdr;
46 uint16_t verb;
47 } __attribute__((packed));
49 struct hvsi_query_response {
50 struct hvsi_header hdr;
51 uint16_t verb;
52 uint16_t query_seqno;
53 union {
54 uint8_t version;
55 uint32_t mctrl_word;
56 } u;
57 } __attribute__((packed));
60 #endif /* _HVSI_H */