diff options
author | Paul Mundt <lethal@linux-sh.org> | 2012-08-01 13:49:13 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2012-08-01 13:49:13 +0900 |
commit | 91ba548cfd5cc8ee93b9435527efb8fa4caf5c5e (patch) | |
tree | c96ed92413044a28d17783e84a8824bfd2437af1 /drivers/misc/mei/interface.h | |
parent | b9ccfda293ee6fca9a89a1584f0900e0627b975e (diff) | |
parent | 4dc4c51675c137c30838425ecc8d471ff5eb138b (diff) |
Merge branch 'sh/dmaengine' into sh-latest
Diffstat (limited to 'drivers/misc/mei/interface.h')
-rw-r--r-- | drivers/misc/mei/interface.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/misc/mei/interface.h b/drivers/misc/mei/interface.h index ddff5d16616..fb5c7db4723 100644 --- a/drivers/misc/mei/interface.h +++ b/drivers/misc/mei/interface.h @@ -41,14 +41,28 @@ int mei_write_message(struct mei_device *dev, unsigned char *write_buffer, unsigned long write_length); -int mei_host_buffer_is_empty(struct mei_device *dev); +bool mei_hbuf_is_empty(struct mei_device *dev); + +int mei_hbuf_empty_slots(struct mei_device *dev); + +static inline size_t mei_hbuf_max_data(const struct mei_device *dev) +{ + return dev->hbuf_depth * sizeof(u32) - sizeof(struct mei_msg_hdr); +} + +/* 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); +} 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); int mei_wd_host_init(struct mei_device *dev); |