Commit 3ce72726 authored by Oren Weil's avatar Oren Weil Committed by Greg Kroah-Hartman

staging/mei: MEI link layer

Implementation of the communication between host and ME.
connect/disconnect to/from a client, send MEI message,
read MEI message, flow control handling.

Each MEI message has mei_msg_hdr followed by a payload.
Driver is oblivious the payload.

ME Address/ID 	- This is the logical address of the ME
		feature/client of that message.
Host Address/ID	- This is the logical address of the Host
		  client of that message
Length 		- This is the Length of message payload in bytes
Reserved 	-  reserved for future use.
Message Complete - This bit is used to indicative that
		this is the last message of multi message
		MEI transfer of a client message that is larger
		then the MEI circular buffer.
Payload		- Message payload (data) up to 512bytes

The HW data registers are consist two circular buffers,
one for data from ME and other data from Host application.
Each buffer has two pointers, read_ptr (H_CBRP)
and write_ptr (H_CBWP).
The buffers size is defined by depth value that exists
in the status registers (H_CBD and ME_CBD_HRA).
Every read from ME circular buffer cause read_ptr++
Every write to the Host  circular buffer write_ptr++

Flow control MEI message that ME and MEI Driver use to notify
each other that a ME feature/client or Host client buffer is ready
to receive data.
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarItzhak Tzeel-Krupp <itzhak.tzeel-krupp@intel.com>
Signed-off-by: default avatarOren Weil <oren.jer.weil@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent fb7d879f
This diff is collapsed.
/*
*
* Intel Management Engine Interface (Intel MEI) Linux driver
* Copyright (c) 2003-2011, Intel Corporation.
*
* 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_
#include "mei.h"
#include "mei_dev.h"
#define AMT_WD_VALUE 120 /* seconds */
#define MEI_WATCHDOG_DATA_SIZE 16
#define MEI_START_WD_DATA_SIZE 20
#define MEI_WD_PARAMS_SIZE 4
void mei_read_slots(struct mei_device *dev,
unsigned char *buffer, unsigned long buffer_length);
int mei_write_message(struct mei_device *dev,
struct mei_msg_hdr *header,
unsigned char *write_buffer,
unsigned long write_length);
int mei_host_buffer_is_empty(struct mei_device *dev);
int mei_count_full_read_slots(struct mei_device *dev);
int mei_count_empty_write_slots(struct mei_device *dev);
int mei_flow_ctrl_creds(struct mei_device *dev, struct mei_cl *cl);
int mei_wd_send(struct mei_device *dev);
int mei_wd_stop(struct mei_device *dev, bool preserve);
void mei_wd_host_init(struct mei_device *dev);
void mei_wd_start_setup(struct mei_device *dev);
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_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment