Files
OpenCellular/include/blob.h
Bill Richardson 45d19984ec 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>
2015-06-04 19:33:00 +00:00

27 lines
809 B
C

/* 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 */