3 * Intel Management Engine Interface (Intel MEI) Linux driver
4 * Copyright (c) 2003-2012, Intel Corporation.
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.
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
19 #ifndef _MEI_INTERFACE_H_
20 #define _MEI_INTERFACE_H_
22 #include <linux/mei.h>
27 void mei_read_slots(struct mei_device *dev,
28 unsigned char *buffer,
29 unsigned long buffer_length);
31 int mei_write_message(struct mei_device *dev,
32 struct mei_msg_hdr *header,
35 bool mei_hbuf_is_empty(struct mei_device *dev);
37 int mei_hbuf_empty_slots(struct mei_device *dev);
39 static inline size_t mei_hbuf_max_data(const struct mei_device *dev)
41 return dev->hbuf_depth * sizeof(u32) - sizeof(struct mei_msg_hdr);
44 /* get slots (dwords) from a message length + header (bytes) */
45 static inline unsigned char mei_data2slots(size_t length)
47 return DIV_ROUND_UP(sizeof(struct mei_msg_hdr) + length, 4);
50 int mei_count_full_read_slots(struct mei_device *dev);
52 #endif /* _MEI_INTERFACE_H_ */