diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-06-16 11:08:12 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-06-29 03:48:28 -0400 |
commit | 725e789f228641fdfafcd65458f0ac78b87acc5a (patch) | |
tree | 579d90a2a22de79dd6bec4e36434a3bf30b9513e /drivers/tty/hvc/hvsi.c | |
parent | 8a0360a563cffc9a0712426820bedbb96bbc511b (diff) |
powerpc/hvsi: Move HVSI protocol definitions to a header file
This moves various HVSI protocol definitions from the hvsi.c
driver to a header file that can be used later on by a udbg
implementation
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/tty/hvc/hvsi.c')
-rw-r--r-- | drivers/tty/hvc/hvsi.c | 63 |
1 files changed, 1 insertions, 62 deletions
diff --git a/drivers/tty/hvc/hvsi.c b/drivers/tty/hvc/hvsi.c index 8a8d6373f164..0b35793de1fa 100644 --- a/drivers/tty/hvc/hvsi.c +++ b/drivers/tty/hvc/hvsi.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <asm/uaccess.h> | 49 | #include <asm/uaccess.h> |
50 | #include <asm/vio.h> | 50 | #include <asm/vio.h> |
51 | #include <asm/param.h> | 51 | #include <asm/param.h> |
52 | #include <asm/hvsi.h> | ||
52 | 53 | ||
53 | #define HVSI_MAJOR 229 | 54 | #define HVSI_MAJOR 229 |
54 | #define HVSI_MINOR 128 | 55 | #define HVSI_MINOR 128 |
@@ -109,68 +110,6 @@ enum HVSI_PROTOCOL_STATE { | |||
109 | }; | 110 | }; |
110 | #define HVSI_CONSOLE 0x1 | 111 | #define HVSI_CONSOLE 0x1 |
111 | 112 | ||
112 | #define VS_DATA_PACKET_HEADER 0xff | ||
113 | #define VS_CONTROL_PACKET_HEADER 0xfe | ||
114 | #define VS_QUERY_PACKET_HEADER 0xfd | ||
115 | #define VS_QUERY_RESPONSE_PACKET_HEADER 0xfc | ||
116 | |||
117 | /* control verbs */ | ||
118 | #define VSV_SET_MODEM_CTL 1 /* to service processor only */ | ||
119 | #define VSV_MODEM_CTL_UPDATE 2 /* from service processor only */ | ||
120 | #define VSV_CLOSE_PROTOCOL 3 | ||
121 | |||
122 | /* query verbs */ | ||
123 | #define VSV_SEND_VERSION_NUMBER 1 | ||
124 | #define VSV_SEND_MODEM_CTL_STATUS 2 | ||
125 | |||
126 | /* yes, these masks are not consecutive. */ | ||
127 | #define HVSI_TSDTR 0x01 | ||
128 | #define HVSI_TSCD 0x20 | ||
129 | |||
130 | struct hvsi_header { | ||
131 | uint8_t type; | ||
132 | uint8_t len; | ||
133 | uint16_t seqno; | ||
134 | } __attribute__((packed)); | ||
135 | |||
136 | struct hvsi_data { | ||
137 | uint8_t type; | ||
138 | uint8_t len; | ||
139 | uint16_t seqno; | ||
140 | uint8_t data[HVSI_MAX_OUTGOING_DATA]; | ||
141 | } __attribute__((packed)); | ||
142 | |||
143 | struct hvsi_control { | ||
144 | uint8_t type; | ||
145 | uint8_t len; | ||
146 | uint16_t seqno; | ||
147 | uint16_t verb; | ||
148 | /* optional depending on verb: */ | ||
149 | uint32_t word; | ||
150 | uint32_t mask; | ||
151 | } __attribute__((packed)); | ||
152 | |||
153 | struct hvsi_query { | ||
154 | uint8_t type; | ||
155 | uint8_t len; | ||
156 | uint16_t seqno; | ||
157 | uint16_t verb; | ||
158 | } __attribute__((packed)); | ||
159 | |||
160 | struct hvsi_query_response { | ||
161 | uint8_t type; | ||
162 | uint8_t len; | ||
163 | uint16_t seqno; | ||
164 | uint16_t verb; | ||
165 | uint16_t query_seqno; | ||
166 | union { | ||
167 | uint8_t version; | ||
168 | uint32_t mctrl_word; | ||
169 | } u; | ||
170 | } __attribute__((packed)); | ||
171 | |||
172 | |||
173 | |||
174 | static inline int is_console(struct hvsi_struct *hp) | 113 | static inline int is_console(struct hvsi_struct *hp) |
175 | { | 114 | { |
176 | return hp->flags & HVSI_CONSOLE; | 115 | return hp->flags & HVSI_CONSOLE; |