blob: ddff5d16616fe80bf4bab59c21c06c0695d26f28 [file] [log] [blame]
Oren Weil3ce72722011-05-15 13:43:43 +03001/*
2 *
3 * Intel Management Engine Interface (Intel MEI) Linux driver
Tomas Winkler733ba912012-02-09 19:25:53 +02004 * Copyright (c) 2003-2012, Intel Corporation.
Oren Weil3ce72722011-05-15 13:43:43 +03005 *
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
18
19#ifndef _MEI_INTERFACE_H_
20#define _MEI_INTERFACE_H_
21
Tomas Winkler4f3afe12012-05-09 16:38:59 +030022#include <linux/mei.h>
Oren Weil3ce72722011-05-15 13:43:43 +030023#include "mei_dev.h"
24
25
Oren Weil9ce178e2011-09-07 09:03:09 +030026#define AMT_WD_DEFAULT_TIMEOUT 120 /* seconds */
27#define AMT_WD_MIN_TIMEOUT 120 /* seconds */
28#define AMT_WD_MAX_TIMEOUT 65535 /* seconds */
Oren Weil3ce72722011-05-15 13:43:43 +030029
30#define MEI_WATCHDOG_DATA_SIZE 16
31#define MEI_START_WD_DATA_SIZE 20
32#define MEI_WD_PARAMS_SIZE 4
33
34
35void mei_read_slots(struct mei_device *dev,
Tomas Winkleredf1eed2012-02-09 19:25:54 +020036 unsigned char *buffer,
37 unsigned long buffer_length);
Oren Weil3ce72722011-05-15 13:43:43 +030038
39int mei_write_message(struct mei_device *dev,
40 struct mei_msg_hdr *header,
41 unsigned char *write_buffer,
42 unsigned long write_length);
43
44int mei_host_buffer_is_empty(struct mei_device *dev);
45
46int mei_count_full_read_slots(struct mei_device *dev);
47
48int mei_count_empty_write_slots(struct mei_device *dev);
49
50int mei_flow_ctrl_creds(struct mei_device *dev, struct mei_cl *cl);
51
52int mei_wd_send(struct mei_device *dev);
53int mei_wd_stop(struct mei_device *dev, bool preserve);
Tomas Winkler9487eb02012-04-03 23:34:58 +030054int mei_wd_host_init(struct mei_device *dev);
Tomas Winkler70cd5332011-12-22 18:50:50 +020055/*
56 * mei_watchdog_register - Registering watchdog interface
57 * once we got connection to the WD Client
58 * @dev - mei device
59 */
60void mei_watchdog_register(struct mei_device *dev);
61/*
Justin P. Mattock5f9092f32012-03-12 07:18:09 -070062 * mei_watchdog_unregister - Unregistering watchdog interface
Tomas Winkler70cd5332011-12-22 18:50:50 +020063 * @dev - mei device
64 */
65void mei_watchdog_unregister(struct mei_device *dev);
Oren Weil3ce72722011-05-15 13:43:43 +030066
67int mei_flow_ctrl_reduce(struct mei_device *dev, struct mei_cl *cl);
68
69int mei_send_flow_control(struct mei_device *dev, struct mei_cl *cl);
70
71int mei_disconnect(struct mei_device *dev, struct mei_cl *cl);
72int mei_other_client_is_connecting(struct mei_device *dev, struct mei_cl *cl);
73int mei_connect(struct mei_device *dev, struct mei_cl *cl);
74
75#endif /* _MEI_INTERFACE_H_ */