mei: bus: run rescan on me_clients list change
[deliverable/linux.git] / drivers / misc / mei / hw.h
CommitLineData
5a6003f2
OW
1/*
2 *
3 * Intel Management Engine Interface (Intel MEI) Linux driver
733ba91c 4 * Copyright (c) 2003-2012, Intel Corporation.
5a6003f2
OW
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 */
16
17#ifndef _MEI_HW_TYPES_H_
18#define _MEI_HW_TYPES_H_
19
20#include <linux/uuid.h>
21
22/*
3870c320 23 * Timeouts in Seconds
5a6003f2 24 */
7d93e58d 25#define MEI_HW_READY_TIMEOUT 2 /* Timeout on ready message */
3870c320 26#define MEI_CONNECT_TIMEOUT 3 /* HPS: at least 2 seconds */
5a6003f2 27
3870c320
TW
28#define MEI_CL_CONNECT_TIMEOUT 15 /* HPS: Client Connect Timeout */
29#define MEI_CLIENTS_INIT_TIMEOUT 15 /* HPS: Clients Enumeration Timeout */
5a6003f2 30
3870c320 31#define MEI_IAMTHIF_STALL_TIMER 12 /* HPS */
5a6003f2 32
859ef2ff
AU
33#define MEI_PGI_TIMEOUT 1 /* PG Isolation time response 1 sec */
34#define MEI_D0I3_TIMEOUT 5 /* D0i3 set/unset max response time */
35#define MEI_HBM_TIMEOUT 1 /* 1 second */
5a6003f2
OW
36
37/*
38 * MEI Version
39 */
155718cf
TW
40#define HBM_MINOR_VERSION 0
41#define HBM_MAJOR_VERSION 2
5a6003f2 42
ee7e5afd
TW
43/*
44 * MEI version with PGI support
45 */
46#define HBM_MINOR_VERSION_PGI 1
47#define HBM_MAJOR_VERSION_PGI 1
48
70ef835c
TW
49/*
50 * MEI version with Dynamic clients support
51 */
52#define HBM_MINOR_VERSION_DC 0
53#define HBM_MAJOR_VERSION_DC 2
54
18901357
AU
55/*
56 * MEI version with disconnect on connection timeout support
57 */
58#define HBM_MINOR_VERSION_DOT 0
59#define HBM_MAJOR_VERSION_DOT 2
60
4d99877d
TW
61/*
62 * MEI version with notifcation support
63 */
64#define HBM_MINOR_VERSION_EV 0
65#define HBM_MAJOR_VERSION_EV 2
66
f4e06246
AU
67/*
68 * MEI version with fixed address client support
69 */
70#define HBM_MINOR_VERSION_FA 0
71#define HBM_MAJOR_VERSION_FA 2
72
1ca7e782
TW
73/* Host bus message command opcode */
74#define MEI_HBM_CMD_OP_MSK 0x7f
75/* Host bus message command RESPONSE */
76#define MEI_HBM_CMD_RES_MSK 0x80
77
5a6003f2
OW
78/*
79 * MEI Bus Message Command IDs
80 */
81#define HOST_START_REQ_CMD 0x01
82#define HOST_START_RES_CMD 0x81
83
84#define HOST_STOP_REQ_CMD 0x02
85#define HOST_STOP_RES_CMD 0x82
86
87#define ME_STOP_REQ_CMD 0x03
88
89#define HOST_ENUM_REQ_CMD 0x04
90#define HOST_ENUM_RES_CMD 0x84
91
92#define HOST_CLIENT_PROPERTIES_REQ_CMD 0x05
93#define HOST_CLIENT_PROPERTIES_RES_CMD 0x85
94
95#define CLIENT_CONNECT_REQ_CMD 0x06
96#define CLIENT_CONNECT_RES_CMD 0x86
97
98#define CLIENT_DISCONNECT_REQ_CMD 0x07
99#define CLIENT_DISCONNECT_RES_CMD 0x87
100
1ca7e782 101#define MEI_FLOW_CONTROL_CMD 0x08
5a6003f2 102
4fcbc99b
TW
103#define MEI_PG_ISOLATION_ENTRY_REQ_CMD 0x0a
104#define MEI_PG_ISOLATION_ENTRY_RES_CMD 0x8a
105#define MEI_PG_ISOLATION_EXIT_REQ_CMD 0x0b
106#define MEI_PG_ISOLATION_EXIT_RES_CMD 0x8b
107
70ef835c
TW
108#define MEI_HBM_ADD_CLIENT_REQ_CMD 0x0f
109#define MEI_HBM_ADD_CLIENT_RES_CMD 0x8f
d3c1c809
TW
110
111#define MEI_HBM_NOTIFY_REQ_CMD 0x10
112#define MEI_HBM_NOTIFY_RES_CMD 0x90
113#define MEI_HBM_NOTIFICATION_CMD 0x11
114
5a6003f2
OW
115/*
116 * MEI Stop Reason
117 * used by hbm_host_stop_request.reason
118 */
119enum mei_stop_reason_types {
120 DRIVER_STOP_REQUEST = 0x00,
121 DEVICE_D1_ENTRY = 0x01,
122 DEVICE_D2_ENTRY = 0x02,
123 DEVICE_D3_ENTRY = 0x03,
124 SYSTEM_S1_ENTRY = 0x04,
125 SYSTEM_S2_ENTRY = 0x05,
126 SYSTEM_S3_ENTRY = 0x06,
127 SYSTEM_S4_ENTRY = 0x07,
128 SYSTEM_S5_ENTRY = 0x08
129};
130
89778d6e
TW
131
132/**
a8605ea2 133 * enum mei_hbm_status - mei host bus messages return values
89778d6e 134 *
a8605ea2
AU
135 * @MEI_HBMS_SUCCESS : status success
136 * @MEI_HBMS_CLIENT_NOT_FOUND : client not found
137 * @MEI_HBMS_ALREADY_EXISTS : connection already established
138 * @MEI_HBMS_REJECTED : connection is rejected
139 * @MEI_HBMS_INVALID_PARAMETER : invalid parameter
140 * @MEI_HBMS_NOT_ALLOWED : operation not allowed
141 * @MEI_HBMS_ALREADY_STARTED : system is already started
142 * @MEI_HBMS_NOT_STARTED : system not started
ce23139c
AU
143 *
144 * @MEI_HBMS_MAX : sentinel
89778d6e
TW
145 */
146enum mei_hbm_status {
147 MEI_HBMS_SUCCESS = 0,
148 MEI_HBMS_CLIENT_NOT_FOUND = 1,
149 MEI_HBMS_ALREADY_EXISTS = 2,
150 MEI_HBMS_REJECTED = 3,
151 MEI_HBMS_INVALID_PARAMETER = 4,
152 MEI_HBMS_NOT_ALLOWED = 5,
153 MEI_HBMS_ALREADY_STARTED = 6,
154 MEI_HBMS_NOT_STARTED = 7,
155
156 MEI_HBMS_MAX
157};
158
159
5a6003f2
OW
160/*
161 * Client Connect Status
162 * used by hbm_client_connect_response.status
163 */
285e2996 164enum mei_cl_connect_status {
89778d6e
TW
165 MEI_CL_CONN_SUCCESS = MEI_HBMS_SUCCESS,
166 MEI_CL_CONN_NOT_FOUND = MEI_HBMS_CLIENT_NOT_FOUND,
167 MEI_CL_CONN_ALREADY_STARTED = MEI_HBMS_ALREADY_EXISTS,
168 MEI_CL_CONN_OUT_OF_RESOURCES = MEI_HBMS_REJECTED,
169 MEI_CL_CONN_MESSAGE_SMALL = MEI_HBMS_INVALID_PARAMETER,
71e117f2 170 MEI_CL_CONN_NOT_ALLOWED = MEI_HBMS_NOT_ALLOWED,
5a6003f2
OW
171};
172
173/*
174 * Client Disconnect Status
175 */
285e2996 176enum mei_cl_disconnect_status {
89778d6e 177 MEI_CL_DISCONN_SUCCESS = MEI_HBMS_SUCCESS
5a6003f2
OW
178};
179
180/*
181 * MEI BUS Interface Section
182 */
183struct mei_msg_hdr {
184 u32 me_addr:8;
185 u32 host_addr:8;
186 u32 length:9;
479327fc
TW
187 u32 reserved:5;
188 u32 internal:1;
5a6003f2
OW
189 u32 msg_complete:1;
190} __packed;
191
192
5a6003f2 193struct mei_bus_message {
1ca7e782
TW
194 u8 hbm_cmd;
195 u8 data[0];
5a6003f2
OW
196} __packed;
197
cd51ed64
TW
198/**
199 * struct hbm_cl_cmd - client specific host bus command
200 * CONNECT, DISCONNECT, and FlOW CONTROL
201 *
a8605ea2
AU
202 * @hbm_cmd: bus message command header
203 * @me_addr: address of the client in ME
204 * @host_addr: address of the client in the driver
205 * @data: generic data
cd51ed64
TW
206 */
207struct mei_hbm_cl_cmd {
208 u8 hbm_cmd;
209 u8 me_addr;
210 u8 host_addr;
211 u8 data;
212};
213
5a6003f2
OW
214struct hbm_version {
215 u8 minor_version;
216 u8 major_version;
217} __packed;
218
219struct hbm_host_version_request {
1ca7e782 220 u8 hbm_cmd;
5a6003f2
OW
221 u8 reserved;
222 struct hbm_version host_version;
223} __packed;
224
225struct hbm_host_version_response {
1ca7e782 226 u8 hbm_cmd;
4b00706c 227 u8 host_version_supported;
5a6003f2
OW
228 struct hbm_version me_max_version;
229} __packed;
230
231struct hbm_host_stop_request {
1ca7e782 232 u8 hbm_cmd;
5a6003f2
OW
233 u8 reason;
234 u8 reserved[2];
235} __packed;
236
237struct hbm_host_stop_response {
1ca7e782 238 u8 hbm_cmd;
5a6003f2
OW
239 u8 reserved[3];
240} __packed;
241
242struct hbm_me_stop_request {
1ca7e782 243 u8 hbm_cmd;
5a6003f2
OW
244 u8 reason;
245 u8 reserved[2];
246} __packed;
247
70ef835c
TW
248/**
249 * struct hbm_host_enum_request - enumeration request from host to fw
250 *
251 * @hbm_cmd: bus message command header
252 * @allow_add: allow dynamic clients add HBM version >= 2.0
253 * @reserved: reserved
254 */
5a6003f2 255struct hbm_host_enum_request {
1ca7e782 256 u8 hbm_cmd;
70ef835c
TW
257 u8 allow_add;
258 u8 reserved[2];
5a6003f2
OW
259} __packed;
260
261struct hbm_host_enum_response {
1ca7e782 262 u8 hbm_cmd;
5a6003f2
OW
263 u8 reserved[3];
264 u8 valid_addresses[32];
265} __packed;
266
267struct mei_client_properties {
268 uuid_le protocol_name;
269 u8 protocol_version;
270 u8 max_number_of_connections;
271 u8 fixed_address;
272 u8 single_recv_buf;
273 u32 max_msg_length;
274} __packed;
275
276struct hbm_props_request {
1ca7e782 277 u8 hbm_cmd;
3438c1f3 278 u8 me_addr;
5a6003f2
OW
279 u8 reserved[2];
280} __packed;
281
5a6003f2 282struct hbm_props_response {
1ca7e782 283 u8 hbm_cmd;
3438c1f3 284 u8 me_addr;
5a6003f2
OW
285 u8 status;
286 u8 reserved[1];
287 struct mei_client_properties client_properties;
288} __packed;
289
70ef835c
TW
290/**
291 * struct hbm_add_client_request - request to add a client
292 * might be sent by fw after enumeration has already completed
293 *
294 * @hbm_cmd: bus message command header
295 * @me_addr: address of the client in ME
296 * @reserved: reserved
297 * @client_properties: client properties
298 */
299struct hbm_add_client_request {
300 u8 hbm_cmd;
301 u8 me_addr;
302 u8 reserved[2];
303 struct mei_client_properties client_properties;
304} __packed;
305
306/**
307 * struct hbm_add_client_response - response to add a client
308 * sent by the host to report client addition status to fw
309 *
310 * @hbm_cmd: bus message command header
311 * @me_addr: address of the client in ME
312 * @status: if HBMS_SUCCESS then the client can now accept connections.
313 * @reserved: reserved
314 */
315struct hbm_add_client_response {
316 u8 hbm_cmd;
317 u8 me_addr;
318 u8 status;
319 u8 reserved[1];
320} __packed;
321
4fcbc99b
TW
322/**
323 * struct hbm_power_gate - power gate request/response
324 *
a8605ea2
AU
325 * @hbm_cmd: bus message command header
326 * @reserved: reserved
4fcbc99b
TW
327 */
328struct hbm_power_gate {
329 u8 hbm_cmd;
330 u8 reserved[3];
331} __packed;
332
aeba4a06
TW
333/**
334 * struct hbm_client_connect_request - connect/disconnect request
335 *
a8605ea2
AU
336 * @hbm_cmd: bus message command header
337 * @me_addr: address of the client in ME
338 * @host_addr: address of the client in the driver
339 * @reserved: reserved
aeba4a06 340 */
5a6003f2 341struct hbm_client_connect_request {
1ca7e782 342 u8 hbm_cmd;
5a6003f2
OW
343 u8 me_addr;
344 u8 host_addr;
345 u8 reserved;
346} __packed;
347
aeba4a06
TW
348/**
349 * struct hbm_client_connect_response - connect/disconnect response
350 *
a8605ea2
AU
351 * @hbm_cmd: bus message command header
352 * @me_addr: address of the client in ME
353 * @host_addr: address of the client in the driver
354 * @status: status of the request
aeba4a06 355 */
5a6003f2 356struct hbm_client_connect_response {
1ca7e782 357 u8 hbm_cmd;
5a6003f2
OW
358 u8 me_addr;
359 u8 host_addr;
360 u8 status;
361} __packed;
362
5a6003f2
OW
363
364#define MEI_FC_MESSAGE_RESERVED_LENGTH 5
365
366struct hbm_flow_control {
1ca7e782 367 u8 hbm_cmd;
5a6003f2
OW
368 u8 me_addr;
369 u8 host_addr;
370 u8 reserved[MEI_FC_MESSAGE_RESERVED_LENGTH];
371} __packed;
372
d3c1c809
TW
373#define MEI_HBM_NOTIFICATION_START 1
374#define MEI_HBM_NOTIFICATION_STOP 0
375/**
376 * struct hbm_notification_request - start/stop notification request
377 *
378 * @hbm_cmd: bus message command header
379 * @me_addr: address of the client in ME
380 * @host_addr: address of the client in the driver
381 * @start: start = 1 or stop = 0 asynchronous notifications
382 */
383struct hbm_notification_request {
384 u8 hbm_cmd;
385 u8 me_addr;
386 u8 host_addr;
387 u8 start;
388} __packed;
389
390/**
391 * struct hbm_notification_response - start/stop notification response
392 *
393 * @hbm_cmd: bus message command header
394 * @me_addr: address of the client in ME
395 * @host_addr: - address of the client in the driver
396 * @status: (mei_hbm_status) response status for the request
397 * - MEI_HBMS_SUCCESS: successful stop/start
398 * - MEI_HBMS_CLIENT_NOT_FOUND: if the connection could not be found.
399 * - MEI_HBMS_ALREADY_STARTED: for start requests for a previously
400 * started notification.
401 * - MEI_HBMS_NOT_STARTED: for stop request for a connected client for whom
402 * asynchronous notifications are currently disabled.
403 *
404 * @start: start = 1 or stop = 0 asynchronous notifications
405 * @reserved: reserved
406 */
407struct hbm_notification_response {
408 u8 hbm_cmd;
409 u8 me_addr;
410 u8 host_addr;
411 u8 status;
412 u8 start;
413 u8 reserved[3];
414} __packed;
415
416/**
417 * struct hbm_notification - notification event
418 *
419 * @hbm_cmd: bus message command header
420 * @me_addr: address of the client in ME
421 * @host_addr: address of the client in the driver
422 * @reserved: reserved for alignment
423 */
424struct hbm_notification {
425 u8 hbm_cmd;
426 u8 me_addr;
427 u8 host_addr;
428 u8 reserved[1];
429} __packed;
5a6003f2
OW
430
431#endif
This page took 0.277024 seconds and 5 git commands to generate.