mirror of
https://github.com/ipxe/ipxe
synced 2026-01-01 17:34:42 +03:00
[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>
This commit is contained in:
@@ -145,7 +145,7 @@ static int ncm_rx_refill ( struct ncm_device *ncm, struct ncm_rx_ring *ring ) {
|
||||
iob_put ( iobuf, ( ring->mtu - iob_len ( iobuf ) ) );
|
||||
|
||||
/* Enqueue I/O buffer */
|
||||
if ( ( rc = usb_stream ( &ring->ep, iobuf ) ) != 0 ) {
|
||||
if ( ( rc = usb_stream ( &ring->ep, iobuf, 0 ) ) != 0 ) {
|
||||
DBGC ( ncm, "NCM %p could not enqueue %s: %s\n", ncm,
|
||||
ncm_rx_name ( ncm, ring ), strerror ( rc ) );
|
||||
/* Leave in recycled list and wait for next refill */
|
||||
@@ -548,7 +548,7 @@ static int ncm_out_transmit ( struct ncm_device *ncm,
|
||||
memset ( &header->desc[1], 0, sizeof ( header->desc[1] ) );
|
||||
|
||||
/* Enqueue I/O buffer */
|
||||
if ( ( rc = usb_stream ( &ncm->out.ep, iobuf ) ) != 0 )
|
||||
if ( ( rc = usb_stream ( &ncm->out.ep, iobuf, 0 ) ) != 0 )
|
||||
return rc;
|
||||
|
||||
/* Increment sequence number */
|
||||
|
||||
Reference in New Issue
Block a user