diff options
author | Bill Richardson <wfrichar@chromium.org> | 2015-06-03 12:18:30 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-06-04 19:33:00 +0000 |
commit | 45d19984ec35bc47e8e921269ec4b65ee055f772 (patch) | |
tree | fe9337907bec3b5b5cf1fb59251192f40d8b4110 /include/blob.h | |
parent | 09f8a93bb854fc9e2cbb2b2ccf7eea09cb2e6036 (diff) | |
download | chrome-ec-45d19984ec35bc47e8e921269ec4b65ee055f772.tar.gz |
Cr50: Add usb_blob handler framework
This adds a new task and endpoints to handle large opaque (to the
USB) chunks of data. The expected use case is that the USB
endpoint accepts bytes from the host and passes them blindly to
the blob-handling task. At some point, the blob-handling task may
wish to send bytes back to the host. What those bytes are and
what they mean is determined at higher levels of abstraction.
BUG=chrome-os-partner:40969
BRANCH=none
TEST=make buildall
This CL doesn't enable the blob-handler; it just makes it
available. The next CL will enable and test it.
Change-Id: I6eba8e8010466e71efe9c5e06848b9f403df835f
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/275131
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include/blob.h')
-rw-r--r-- | include/blob.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/blob.h b/include/blob.h new file mode 100644 index 0000000000..844e8d638a --- /dev/null +++ b/include/blob.h @@ -0,0 +1,26 @@ +/* Copyright 2015 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* Generic API for handling opaque blobs of data. */ + +#ifndef __CROS_EC_BLOB_H +#define __CROS_EC_BLOB_H + +#include <stddef.h> +#include <stdint.h> + +/* Call this to send data to the blob-handler */ +size_t put_bytes_to_blob(uint8_t *buffer, size_t count); + +/* Call this to get data back fom the blob-handler */ +size_t get_bytes_from_blob(uint8_t *buffer, size_t count); + +/* Implement this to be notified when the blob-handler can take more data */ +void blob_is_ready_for_more_bytes(void); + +/* Implement this to be notified when the blob-handler has data to give us */ +void blob_is_ready_to_emit_bytes(void); + +#endif /* __CROS_EC_BLOB_H */ |