diff options
author | Jonny Svärd <jonny.svaerd@arm.com> | 2021-01-14 19:53:17 +0100 |
---|---|---|
committer | Jonny Svärd <jonny.svaerd@arm.com> | 2021-01-26 15:42:49 +0100 |
commit | 7c24c770be3b3e25822cf7c45619ee20ed61c172 (patch) | |
tree | 1d04dd3708100e444e3f8c1e19e61899d75a61f7 /kernel/ethosu_mailbox.h | |
parent | 9d8d92cc3ce5fd5ced815a7334b8d500eec42a27 (diff) | |
download | ethos-u-linux-driver-stack-7c24c770be3b3e25822cf7c45619ee20ed61c172.tar.gz |
Improve mailbox message handling
Introduce a 32b magic for each message. Verify the magic for
all incoming messages.
Add reset function - in case of protocol error, effectively
reset/empty the incoming queue.
Add an error message type and message
Add version request/response
Verify payload length of responses (when applicable)
Change-Id: I8aadd4012024492533d52e2cdb38630fce5c36e2
Diffstat (limited to 'kernel/ethosu_mailbox.h')
-rw-r--r-- | kernel/ethosu_mailbox.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/ethosu_mailbox.h b/kernel/ethosu_mailbox.h index 8f539ee..0bc5ffb 100644 --- a/kernel/ethosu_mailbox.h +++ b/kernel/ethosu_mailbox.h @@ -24,6 +24,7 @@ /**************************************************************************** * Includes ****************************************************************************/ +#include "ethosu_core_interface.h" #include <linux/types.h> #include <linux/mailbox_client.h> @@ -87,6 +88,11 @@ int ethosu_mailbox_read(struct ethosu_mailbox *mbox, size_t length); /** + * ethosu_mailbox_reset() - Reset to end of queue + */ +void ethosu_mailbox_reset(struct ethosu_mailbox *mbox); + +/** * ethosu_mailbox_ping() - Send ping message * * Return: 0 on success, else error code. @@ -94,6 +100,20 @@ int ethosu_mailbox_read(struct ethosu_mailbox *mbox, int ethosu_mailbox_ping(struct ethosu_mailbox *mbox); /** + * ethosu_mailbox_pong() - Send pong response + * + * Return: 0 on success, else error code. + */ +int ethosu_mailbox_pong(struct ethosu_mailbox *mbox); + +/** + * ethosu_mailbox_version_response - Send version request + * + * Return: 0 on succes, else error code + */ +int ethosu_mailbox_version_request(struct ethosu_mailbox *mbox); + +/** * ethosu_mailbox_inference() - Send inference * * Return: 0 on success, else error code. |