aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/usb.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2015-02-10 13:45:57 +0000
committerMichael Brown <mcb30@ipxe.org>2015-02-10 13:49:27 +0000
commit58c3e7f74771dd4748983cc47ed53241ac1864f1 (patch)
treee5baedb5b58a1abadf5ea3811fa66e87d14d40d7 /src/include/ipxe/usb.h
parent17aceb34da3bad166cab8579a3616806fff8e05b (diff)
downloadipxe-58c3e7f74771dd4748983cc47ed53241ac1864f1.tar.gz
[usb] Allow usb_stream() to enforce a terminating short packet
Some USB endpoints require that a short packet be used to terminate transfers, since they have no other way to determine message boundaries. If the message length happens to be an exact multiple of the USB packet size, then this requires the use of an additional zero-length packet. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/usb.h')
-rw-r--r--src/include/ipxe/usb.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/include/ipxe/usb.h b/src/include/ipxe/usb.h
index e21ca1c43..1f5a85ecd 100644
--- a/src/include/ipxe/usb.h
+++ b/src/include/ipxe/usb.h
@@ -428,10 +428,11 @@ struct usb_endpoint_host_operations {
*
* @v ep USB endpoint
* @v iobuf I/O buffer
+ * @v terminate Terminate using a short packet
* @ret rc Return status code
*/
- int ( * stream ) ( struct usb_endpoint *ep,
- struct io_buffer *iobuf );
+ int ( * stream ) ( struct usb_endpoint *ep, struct io_buffer *iobuf,
+ int terminate );
};
/** USB endpoint driver operations */
@@ -547,7 +548,8 @@ extern void usb_endpoint_close ( struct usb_endpoint *ep );
extern int usb_message ( struct usb_endpoint *ep, unsigned int request,
unsigned int value, unsigned int index,
struct io_buffer *iobuf );
-extern int usb_stream ( struct usb_endpoint *ep, struct io_buffer *iobuf );
+extern int usb_stream ( struct usb_endpoint *ep, struct io_buffer *iobuf,
+ int terminate );
extern void usb_complete_err ( struct usb_endpoint *ep,
struct io_buffer *iobuf, int rc );