Benjamin Herrenschmidt | 725e789 | 2011-06-16 15:08:12 +0000 | [diff] [blame^] | 1 | #ifndef _HVSI_H |
| 2 | #define _HVSI_H |
| 3 | |
| 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 |
| 8 | |
| 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 |
| 13 | |
| 14 | /* query verbs */ |
| 15 | #define VSV_SEND_VERSION_NUMBER 1 |
| 16 | #define VSV_SEND_MODEM_CTL_STATUS 2 |
| 17 | |
| 18 | /* yes, these masks are not consecutive. */ |
| 19 | #define HVSI_TSDTR 0x01 |
| 20 | #define HVSI_TSCD 0x20 |
| 21 | |
| 22 | #define HVSI_MAX_OUTGOING_DATA 12 |
| 23 | #define HVSI_VERSION 1 |
| 24 | |
| 25 | struct hvsi_header { |
| 26 | uint8_t type; |
| 27 | uint8_t len; |
| 28 | uint16_t seqno; |
| 29 | } __attribute__((packed)); |
| 30 | |
| 31 | struct hvsi_data { |
| 32 | uint8_t type; |
| 33 | uint8_t len; |
| 34 | uint16_t seqno; |
| 35 | uint8_t data[HVSI_MAX_OUTGOING_DATA]; |
| 36 | } __attribute__((packed)); |
| 37 | |
| 38 | struct hvsi_control { |
| 39 | uint8_t type; |
| 40 | uint8_t len; |
| 41 | uint16_t seqno; |
| 42 | uint16_t verb; |
| 43 | /* optional depending on verb: */ |
| 44 | uint32_t word; |
| 45 | uint32_t mask; |
| 46 | } __attribute__((packed)); |
| 47 | |
| 48 | struct hvsi_query { |
| 49 | uint8_t type; |
| 50 | uint8_t len; |
| 51 | uint16_t seqno; |
| 52 | uint16_t verb; |
| 53 | } __attribute__((packed)); |
| 54 | |
| 55 | struct hvsi_query_response { |
| 56 | uint8_t type; |
| 57 | uint8_t len; |
| 58 | uint16_t seqno; |
| 59 | uint16_t verb; |
| 60 | uint16_t query_seqno; |
| 61 | union { |
| 62 | uint8_t version; |
| 63 | uint32_t mctrl_word; |
| 64 | } u; |
| 65 | } __attribute__((packed)); |
| 66 | |
| 67 | |
| 68 | #endif /* _HVSI_H */ |