2011-05-15 18:43:43 +08:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Intel Management Engine Interface (Intel MEI) Linux driver
|
2012-02-10 01:25:53 +08:00
|
|
|
* Copyright (c) 2003-2012, Intel Corporation.
|
2011-05-15 18:43:43 +08:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU General Public License,
|
|
|
|
* version 2, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _MEI_INTERFACE_H_
|
|
|
|
#define _MEI_INTERFACE_H_
|
|
|
|
|
2012-05-09 21:38:59 +08:00
|
|
|
#include <linux/mei.h>
|
2011-05-15 18:43:43 +08:00
|
|
|
#include "mei_dev.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void mei_read_slots(struct mei_device *dev,
|
2012-02-10 01:25:54 +08:00
|
|
|
unsigned char *buffer,
|
|
|
|
unsigned long buffer_length);
|
2011-05-15 18:43:43 +08:00
|
|
|
|
|
|
|
int mei_write_message(struct mei_device *dev,
|
|
|
|
struct mei_msg_hdr *header,
|
|
|
|
unsigned char *write_buffer,
|
|
|
|
unsigned long write_length);
|
|
|
|
|
2012-06-26 04:46:28 +08:00
|
|
|
bool mei_hbuf_is_empty(struct mei_device *dev);
|
2011-05-15 18:43:43 +08:00
|
|
|
|
2012-06-26 04:46:28 +08:00
|
|
|
int mei_hbuf_empty_slots(struct mei_device *dev);
|
2011-05-15 18:43:43 +08:00
|
|
|
|
2012-06-26 04:46:27 +08:00
|
|
|
static inline size_t mei_hbuf_max_data(const struct mei_device *dev)
|
|
|
|
{
|
|
|
|
return dev->hbuf_depth * sizeof(u32) - sizeof(struct mei_msg_hdr);
|
|
|
|
}
|
|
|
|
|
2012-07-05 00:24:52 +08:00
|
|
|
/* get slots (dwords) from a message length + header (bytes) */
|
|
|
|
static inline unsigned char mei_data2slots(size_t length)
|
|
|
|
{
|
|
|
|
return DIV_ROUND_UP(sizeof(struct mei_msg_hdr) + length, 4);
|
|
|
|
}
|
|
|
|
|
2012-06-26 04:46:28 +08:00
|
|
|
int mei_count_full_read_slots(struct mei_device *dev);
|
|
|
|
|
|
|
|
|
|
|
|
int mei_flow_ctrl_creds(struct mei_device *dev, struct mei_cl *cl);
|
|
|
|
|
|
|
|
|
2012-06-26 04:46:27 +08:00
|
|
|
|
2011-05-15 18:43:43 +08:00
|
|
|
int mei_wd_send(struct mei_device *dev);
|
2012-08-17 00:39:43 +08:00
|
|
|
int mei_wd_stop(struct mei_device *dev);
|
2012-04-04 04:34:58 +08:00
|
|
|
int mei_wd_host_init(struct mei_device *dev);
|
2011-12-23 00:50:50 +08:00
|
|
|
/*
|
|
|
|
* mei_watchdog_register - Registering watchdog interface
|
|
|
|
* once we got connection to the WD Client
|
|
|
|
* @dev - mei device
|
|
|
|
*/
|
|
|
|
void mei_watchdog_register(struct mei_device *dev);
|
|
|
|
/*
|
2012-03-12 22:18:09 +08:00
|
|
|
* mei_watchdog_unregister - Unregistering watchdog interface
|
2011-12-23 00:50:50 +08:00
|
|
|
* @dev - mei device
|
|
|
|
*/
|
|
|
|
void mei_watchdog_unregister(struct mei_device *dev);
|
2011-05-15 18:43:43 +08:00
|
|
|
|
|
|
|
int mei_flow_ctrl_reduce(struct mei_device *dev, struct mei_cl *cl);
|
|
|
|
|
|
|
|
int mei_send_flow_control(struct mei_device *dev, struct mei_cl *cl);
|
|
|
|
|
|
|
|
int mei_disconnect(struct mei_device *dev, struct mei_cl *cl);
|
|
|
|
int mei_other_client_is_connecting(struct mei_device *dev, struct mei_cl *cl);
|
|
|
|
int mei_connect(struct mei_device *dev, struct mei_cl *cl);
|
|
|
|
|
|
|
|
#endif /* _MEI_INTERFACE_H_ */
|