Commit | Line | Data |
---|---|---|
3ce72726 OW |
1 | /* |
2 | * | |
3 | * Intel Management Engine Interface (Intel MEI) Linux driver | |
733ba91c | 4 | * Copyright (c) 2003-2012, Intel Corporation. |
3ce72726 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 | ||
18 | ||
19 | #ifndef _MEI_INTERFACE_H_ | |
20 | #define _MEI_INTERFACE_H_ | |
21 | ||
4f3afe1d | 22 | #include <linux/mei.h> |
3ce72726 OW |
23 | #include "mei_dev.h" |
24 | ||
25 | ||
9ce178e5 OW |
26 | #define AMT_WD_DEFAULT_TIMEOUT 120 /* seconds */ |
27 | #define AMT_WD_MIN_TIMEOUT 120 /* seconds */ | |
28 | #define AMT_WD_MAX_TIMEOUT 65535 /* seconds */ | |
3ce72726 OW |
29 | |
30 | #define MEI_WATCHDOG_DATA_SIZE 16 | |
31 | #define MEI_START_WD_DATA_SIZE 20 | |
32 | #define MEI_WD_PARAMS_SIZE 4 | |
33 | ||
34 | ||
35 | void mei_read_slots(struct mei_device *dev, | |
edf1eed4 TW |
36 | unsigned char *buffer, |
37 | unsigned long buffer_length); | |
3ce72726 OW |
38 | |
39 | int mei_write_message(struct mei_device *dev, | |
40 | struct mei_msg_hdr *header, | |
41 | unsigned char *write_buffer, | |
42 | unsigned long write_length); | |
43 | ||
726917f0 | 44 | bool mei_hbuf_is_empty(struct mei_device *dev); |
3ce72726 | 45 | |
726917f0 | 46 | int mei_hbuf_empty_slots(struct mei_device *dev); |
3ce72726 | 47 | |
24aadc80 TW |
48 | static inline size_t mei_hbuf_max_data(const struct mei_device *dev) |
49 | { | |
50 | return dev->hbuf_depth * sizeof(u32) - sizeof(struct mei_msg_hdr); | |
51 | } | |
52 | ||
7bdf72d3 TW |
53 | /* get slots (dwords) from a message length + header (bytes) */ |
54 | static inline unsigned char mei_data2slots(size_t length) | |
55 | { | |
56 | return DIV_ROUND_UP(sizeof(struct mei_msg_hdr) + length, 4); | |
57 | } | |
58 | ||
726917f0 TW |
59 | int mei_count_full_read_slots(struct mei_device *dev); |
60 | ||
61 | ||
62 | int mei_flow_ctrl_creds(struct mei_device *dev, struct mei_cl *cl); | |
63 | ||
64 | ||
24aadc80 | 65 | |
3ce72726 OW |
66 | int mei_wd_send(struct mei_device *dev); |
67 | int mei_wd_stop(struct mei_device *dev, bool preserve); | |
9487eb0a | 68 | int mei_wd_host_init(struct mei_device *dev); |
70cd5337 TW |
69 | /* |
70 | * mei_watchdog_register - Registering watchdog interface | |
71 | * once we got connection to the WD Client | |
72 | * @dev - mei device | |
73 | */ | |
74 | void mei_watchdog_register(struct mei_device *dev); | |
75 | /* | |
5f9092f3 | 76 | * mei_watchdog_unregister - Unregistering watchdog interface |
70cd5337 TW |
77 | * @dev - mei device |
78 | */ | |
79 | void mei_watchdog_unregister(struct mei_device *dev); | |
3ce72726 OW |
80 | |
81 | int mei_flow_ctrl_reduce(struct mei_device *dev, struct mei_cl *cl); | |
82 | ||
83 | int mei_send_flow_control(struct mei_device *dev, struct mei_cl *cl); | |
84 | ||
85 | int mei_disconnect(struct mei_device *dev, struct mei_cl *cl); | |
86 | int mei_other_client_is_connecting(struct mei_device *dev, struct mei_cl *cl); | |
87 | int mei_connect(struct mei_device *dev, struct mei_cl *cl); | |
88 | ||
89 | #endif /* _MEI_INTERFACE_H_ */ |