mei: revamp hbm state machine

1. Rename init_clients_state to hbm_state and use
MEI_HBM_ prefix for HBM states

2. Remove recvd_msg and use hbm state for synchronizing
hbm protocol has successful start.
We can wake up the hbm event from start response handler
and remove the hack from the interrupt thread

3. mei_hbm_start_wait function encapsulate start completion
waiting

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Tomas Winkler
2013-04-18 23:03:48 +03:00
committed by Greg Kroah-Hartman
parent 3a189b3ba0
commit 9b0d5efc42
7 changed files with 72 additions and 59 deletions

View File

@@ -25,6 +25,7 @@
#include "hw.h"
#include "hw-me-regs.h"
#include "hbm.h"
/*
* watch dog definition
@@ -104,13 +105,6 @@ enum mei_dev_state {
const char *mei_dev_state_str(int state);
/* init clients states*/
enum mei_init_clients_states {
MEI_START_MESSAGE = 0,
MEI_ENUM_CLIENTS_MESSAGE,
MEI_CLIENT_PROPERTIES_MESSAGE
};
enum iamthif_states {
MEI_IAMTHIF_IDLE,
MEI_IAMTHIF_WRITING,
@@ -338,6 +332,7 @@ struct mei_cl_device {
/**
* struct mei_device - MEI private device struct
* @hbm_state - state of host bus message protocol
* @mem_addr - mem mapped base register address
* @hbuf_depth - depth of hardware host/write buffer is slots
@@ -370,8 +365,6 @@ struct mei_device {
struct delayed_work timer_work; /* MEI timer delayed work (timeouts) */
bool recvd_hw_ready;
bool recvd_msg;
/*
* waiting queue for receive message from FW
*/
@@ -383,7 +376,7 @@ struct mei_device {
* mei device states
*/
enum mei_dev_state dev_state;
enum mei_init_clients_states init_clients_state;
enum mei_hbm_state hbm_state;
u16 init_clients_timer;
unsigned char rd_msg_buf[MEI_RD_MSG_BUF_SIZE]; /* control messages */