Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 289162
b: refs/heads/master
c: 1ca7e78
h: refs/heads/master
v: v3
  • Loading branch information
Tomas Winkler authored and Greg Kroah-Hartman committed Feb 29, 2012
1 parent 6398c9c commit a113893
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dc91e2f1c01a579e055ebd25c32c1628041b0eca
refs/heads/master: 1ca7e782864222bcdbe305e543df25df4e343963
43 changes: 21 additions & 22 deletions trunk/drivers/staging/mei/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ access to ME_CBD */
#define HBM_MAJOR_VERSION 1
#define HBM_TIMEOUT 1 /* 1 second */

/* Host bus message command opcode */
#define MEI_HBM_CMD_OP_MSK 0x7f
/* Host bus message command RESPONSE */
#define MEI_HBM_CMD_RES_MSK 0x80

/*
* MEI Bus Message Command IDs
*/
Expand All @@ -164,7 +169,7 @@ access to ME_CBD */
#define CLIENT_DISCONNECT_REQ_CMD 0x07
#define CLIENT_DISCONNECT_RES_CMD 0x87

#define MEI_FLOW_CONTROL_CMD 0x08
#define MEI_FLOW_CONTROL_CMD 0x08

/*
* MEI Stop Reason
Expand Down Expand Up @@ -213,15 +218,9 @@ struct mei_msg_hdr {
} __packed;


struct hbm_cmd {
u8 cmd:7;
u8 is_response:1;
} __packed;


struct mei_bus_message {
struct hbm_cmd cmd;
u8 command_specific_data[];
u8 hbm_cmd;
u8 data[0];
} __packed;

struct hbm_version {
Expand All @@ -230,41 +229,41 @@ struct hbm_version {
} __packed;

struct hbm_host_version_request {
struct hbm_cmd cmd;
u8 hbm_cmd;
u8 reserved;
struct hbm_version host_version;
} __packed;

struct hbm_host_version_response {
struct hbm_cmd cmd;
u8 hbm_cmd;
u8 host_version_supported;
struct hbm_version me_max_version;
} __packed;

struct hbm_host_stop_request {
struct hbm_cmd cmd;
u8 hbm_cmd;
u8 reason;
u8 reserved[2];
} __packed;

struct hbm_host_stop_response {
struct hbm_cmd cmd;
u8 hbm_cmd;
u8 reserved[3];
} __packed;

struct hbm_me_stop_request {
struct hbm_cmd cmd;
u8 hbm_cmd;
u8 reason;
u8 reserved[2];
} __packed;

struct hbm_host_enum_request {
struct hbm_cmd cmd;
u8 hbm_cmd;
u8 reserved[3];
} __packed;

struct hbm_host_enum_response {
struct hbm_cmd cmd;
u8 hbm_cmd;
u8 reserved[3];
u8 valid_addresses[32];
} __packed;
Expand All @@ -279,36 +278,36 @@ struct mei_client_properties {
} __packed;

struct hbm_props_request {
struct hbm_cmd cmd;
u8 hbm_cmd;
u8 address;
u8 reserved[2];
} __packed;


struct hbm_props_response {
struct hbm_cmd cmd;
u8 hbm_cmd;
u8 address;
u8 status;
u8 reserved[1];
struct mei_client_properties client_properties;
} __packed;

struct hbm_client_connect_request {
struct hbm_cmd cmd;
u8 hbm_cmd;
u8 me_addr;
u8 host_addr;
u8 reserved;
} __packed;

struct hbm_client_connect_response {
struct hbm_cmd cmd;
u8 hbm_cmd;
u8 me_addr;
u8 host_addr;
u8 status;
} __packed;

struct hbm_client_disconnect_request {
struct hbm_cmd cmd;
u8 hbm_cmd;
u8 me_addr;
u8 host_addr;
u8 reserved[1];
Expand All @@ -317,7 +316,7 @@ struct hbm_client_disconnect_request {
#define MEI_FC_MESSAGE_RESERVED_LENGTH 5

struct hbm_flow_control {
struct hbm_cmd cmd;
u8 hbm_cmd;
u8 me_addr;
u8 host_addr;
u8 reserved[MEI_FC_MESSAGE_RESERVED_LENGTH];
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/staging/mei/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ void mei_host_start_message(struct mei_device *dev)
host_start_req =
(struct hbm_host_version_request *) &dev->wr_msg_buf[1];
memset(host_start_req, 0, sizeof(struct hbm_host_version_request));
host_start_req->cmd.cmd = HOST_START_REQ_CMD;
host_start_req->hbm_cmd = HOST_START_REQ_CMD;
host_start_req->host_version.major_version = HBM_MAJOR_VERSION;
host_start_req->host_version.minor_version = HBM_MINOR_VERSION;
dev->recvd_msg = false;
Expand Down Expand Up @@ -398,7 +398,7 @@ void mei_host_enum_clients_message(struct mei_device *dev)

host_enum_req = (struct hbm_host_enum_request *) &dev->wr_msg_buf[1];
memset(host_enum_req, 0, sizeof(struct hbm_host_enum_request));
host_enum_req->cmd.cmd = HOST_ENUM_REQ_CMD;
host_enum_req->hbm_cmd = HOST_ENUM_REQ_CMD;
if (!mei_write_message(dev, mei_hdr, (unsigned char *)host_enum_req,
mei_hdr->length)) {
dev->mei_state = MEI_RESETING;
Expand Down Expand Up @@ -482,7 +482,7 @@ int mei_host_client_properties(struct mei_device *dev)

memset(host_cli_req, 0, sizeof(struct hbm_props_request));

host_cli_req->cmd.cmd = HOST_CLIENT_PROPERTIES_REQ_CMD;
host_cli_req->hbm_cmd = HOST_CLIENT_PROPERTIES_REQ_CMD;
host_cli_req->address = b;

if (!mei_write_message(dev, mei_header,
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/staging/mei/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ int mei_send_flow_control(struct mei_device *dev, struct mei_cl *cl)
memset(mei_flow_control, 0, sizeof(*mei_flow_control));
mei_flow_control->host_addr = cl->host_client_id;
mei_flow_control->me_addr = cl->me_client_id;
mei_flow_control->cmd.cmd = MEI_FLOW_CONTROL_CMD;
mei_flow_control->hbm_cmd = MEI_FLOW_CONTROL_CMD;
memset(mei_flow_control->reserved, 0,
sizeof(mei_flow_control->reserved));
dev_dbg(&dev->pdev->dev, "sending flow control host client = %d, ME client = %d\n",
Expand Down Expand Up @@ -390,7 +390,7 @@ int mei_disconnect(struct mei_device *dev, struct mei_cl *cl)
memset(mei_cli_disconnect, 0, sizeof(*mei_cli_disconnect));
mei_cli_disconnect->host_addr = cl->host_client_id;
mei_cli_disconnect->me_addr = cl->me_client_id;
mei_cli_disconnect->cmd.cmd = CLIENT_DISCONNECT_REQ_CMD;
mei_cli_disconnect->hbm_cmd = CLIENT_DISCONNECT_REQ_CMD;
mei_cli_disconnect->reserved[0] = 0;

if (!mei_write_message(dev, mei_hdr,
Expand Down Expand Up @@ -425,7 +425,7 @@ int mei_connect(struct mei_device *dev, struct mei_cl *cl)
(struct hbm_client_connect_request *) &dev->wr_msg_buf[1];
mei_cli_connect->host_addr = cl->host_client_id;
mei_cli_connect->me_addr = cl->me_client_id;
mei_cli_connect->cmd.cmd = CLIENT_CONNECT_REQ_CMD;
mei_cli_connect->hbm_cmd = CLIENT_CONNECT_REQ_CMD;
mei_cli_connect->reserved = 0;

if (!mei_write_message(dev, mei_hdr,
Expand Down
9 changes: 4 additions & 5 deletions trunk/drivers/staging/mei/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,7 @@ static void mei_client_disconnect_request(struct mei_device *dev,
&dev->ext_msg_buf[1];
disconnect_res->host_addr = cl_pos->host_client_id;
disconnect_res->me_addr = cl_pos->me_client_id;
*(u8 *) (&disconnect_res->cmd) =
CLIENT_DISCONNECT_RES_CMD;
disconnect_res->hbm_cmd = CLIENT_DISCONNECT_RES_CMD;
disconnect_res->status = 0;
dev->extra_write_index = 2;
break;
Expand Down Expand Up @@ -634,7 +633,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev,
mei_read_slots(dev, dev->rd_msg_buf, mei_hdr->length);
mei_msg = (struct mei_bus_message *)dev->rd_msg_buf;

switch (*(u8 *) mei_msg) {
switch (mei_msg->hbm_cmd) {
case HOST_START_RES_CMD:
version_res = (struct hbm_host_version_response *) mei_msg;
if (version_res->host_version_supported) {
Expand Down Expand Up @@ -665,7 +664,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev,
memset(host_stop_req,
0,
sizeof(struct hbm_host_stop_request));
host_stop_req->cmd.cmd = HOST_STOP_REQ_CMD;
host_stop_req->hbm_cmd = HOST_STOP_REQ_CMD;
host_stop_req->reason = DRIVER_STOP_REQUEST;
mei_write_message(dev, mei_hdr,
(unsigned char *) (host_stop_req),
Expand Down Expand Up @@ -805,7 +804,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev,
host_stop_req =
(struct hbm_host_stop_request *) &dev->ext_msg_buf[1];
memset(host_stop_req, 0, sizeof(struct hbm_host_stop_request));
host_stop_req->cmd.cmd = HOST_STOP_REQ_CMD;
host_stop_req->hbm_cmd = HOST_STOP_REQ_CMD;
host_stop_req->reason = DRIVER_STOP_REQUEST;
host_stop_req->reserved[0] = 0;
host_stop_req->reserved[1] = 0;
Expand Down

0 comments on commit a113893

Please sign in to comment.