Skip to content

Commit

Permalink
mei: enable marking internal commands
Browse files Browse the repository at this point in the history
Set hbm header bit 30 for internal commands
This mark commands that are generated by
the device driver

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Tomas Winkler authored and Greg Kroah-Hartman committed Dec 19, 2013
1 parent 725fc13 commit 479327f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions drivers/misc/mei/amthif.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ static int mei_amthif_send_cmd(struct mei_device *dev, struct mei_cl_cb *cb)
mei_hdr.host_addr = dev->iamthif_cl.host_client_id;
mei_hdr.me_addr = dev->iamthif_cl.me_client_id;
mei_hdr.reserved = 0;
mei_hdr.internal = 0;
dev->iamthif_msg_buf_index += mei_hdr.length;
ret = mei_write_message(dev, &mei_hdr, dev->iamthif_msg_buf);
if (ret)
Expand Down Expand Up @@ -477,6 +478,7 @@ int mei_amthif_irq_write_complete(struct mei_cl *cl, struct mei_cl_cb *cb,
mei_hdr.host_addr = cl->host_client_id;
mei_hdr.me_addr = cl->me_client_id;
mei_hdr.reserved = 0;
mei_hdr.internal = 0;

if (*slots >= msg_slots) {
mei_hdr.length = len;
Expand Down
2 changes: 2 additions & 0 deletions drivers/misc/mei/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ int mei_cl_irq_write_complete(struct mei_cl *cl, struct mei_cl_cb *cb,
mei_hdr.host_addr = cl->host_client_id;
mei_hdr.me_addr = cl->me_client_id;
mei_hdr.reserved = 0;
mei_hdr.internal = cb->internal;

if (*slots >= msg_slots) {
mei_hdr.length = len;
Expand Down Expand Up @@ -826,6 +827,7 @@ int mei_cl_write(struct mei_cl *cl, struct mei_cl_cb *cb, bool blocking)
mei_hdr.host_addr = cl->host_client_id;
mei_hdr.me_addr = cl->me_client_id;
mei_hdr.reserved = 0;
mei_hdr.internal = cb->internal;


rets = mei_write_message(dev, &mei_hdr, buf->data);
Expand Down
3 changes: 2 additions & 1 deletion drivers/misc/mei/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ struct mei_msg_hdr {
u32 me_addr:8;
u32 host_addr:8;
u32 length:9;
u32 reserved:6;
u32 reserved:5;
u32 internal:1;
u32 msg_complete:1;
} __packed;

Expand Down
5 changes: 3 additions & 2 deletions drivers/misc/mei/mei_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ struct mei_cl_cb {
unsigned long buf_idx;
unsigned long read_time;
struct file *file_object;
u32 internal:1;
};

/* MEI client instance carried as file->pirvate_data*/
Expand Down Expand Up @@ -637,9 +638,9 @@ static inline void mei_dbgfs_deregister(struct mei_device *dev) {}
int mei_register(struct mei_device *dev);
void mei_deregister(struct mei_device *dev);

#define MEI_HDR_FMT "hdr:host=%02d me=%02d len=%d comp=%1d"
#define MEI_HDR_FMT "hdr:host=%02d me=%02d len=%d internal=%1d comp=%1d"
#define MEI_HDR_PRM(hdr) \
(hdr)->host_addr, (hdr)->me_addr, \
(hdr)->length, (hdr)->msg_complete
(hdr)->length, (hdr)->internal, (hdr)->msg_complete

#endif
1 change: 1 addition & 0 deletions drivers/misc/mei/wd.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ int mei_wd_send(struct mei_device *dev)
hdr.me_addr = dev->wd_cl.me_client_id;
hdr.msg_complete = 1;
hdr.reserved = 0;
hdr.internal = 0;

if (!memcmp(dev->wd_data, mei_start_wd_params, MEI_WD_HDR_SIZE))
hdr.length = MEI_WD_START_MSG_SIZE;
Expand Down

0 comments on commit 479327f

Please sign in to comment.