summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-09-19 10:54:26 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-09-20 22:41:29 +0100
commit672bbe434b12d4730cf270f7245753fb98cf162d (patch)
tree3fdaa08ddc41f942336c968bb169e8806c7c3fa8 /firmware/target/arm/as3525
parent99f333c64f13c3f9a62b9f5e184ae87f053bf65a (diff)
downloadrockbox-672bbe434b12d4730cf270f7245753fb98cf162d.tar.gz
rockbox-672bbe434b12d4730cf270f7245753fb98cf162d.zip
usb: rename usb_drv_recv() to usb_recv_recv_nonblocking()
IMHO the current name is somewhat misleading: - usb_drv_send() is blocking and we have usb_drv_send_nonblocking() for the non-blocking case. This inconsistent naming can only promote confusion. (And what would we call a blocking receive?) - Other hardware abstraction APIs in Rockbox are usually blocking: storage, LCD, backlight, audio... in other words, blocking is the default expected behavior, with non-blocking calls being a rarity. Change-Id: I05b41088d09eab582697674f4f06fdca0c8950af
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r--firmware/target/arm/as3525/usb-drv-as3525.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/firmware/target/arm/as3525/usb-drv-as3525.c b/firmware/target/arm/as3525/usb-drv-as3525.c
index 01fae5f0ab..8369edc400 100644
--- a/firmware/target/arm/as3525/usb-drv-as3525.c
+++ b/firmware/target/arm/as3525/usb-drv-as3525.c
@@ -412,12 +412,12 @@ void usb_drv_cancel_all_transfers(void)
412 restore_irq(flags); 412 restore_irq(flags);
413} 413}
414 414
415int usb_drv_recv(int ep, void *ptr, int len) 415int usb_drv_recv_nonblocking(int ep, void *ptr, int len)
416{ 416{
417 struct usb_dev_dma_desc *uc_desc = endpoints[ep][1].uc_desc; 417 struct usb_dev_dma_desc *uc_desc = endpoints[ep][1].uc_desc;
418 418
419 ep &= 0x7f; 419 ep &= 0x7f;
420 logf("usb_drv_recv(%d,%x,%d)\n", ep, (int)ptr, len); 420 logf("usb_drv_recv_nonblocking(%d,%x,%d)\n", ep, (int)ptr, len);
421 421
422 if (len > USB_DMA_DESC_RXTX_BYTES) 422 if (len > USB_DMA_DESC_RXTX_BYTES)
423 panicf("usb_recv: len=%d > %d", len, USB_DMA_DESC_RXTX_BYTES); 423 panicf("usb_recv: len=%d > %d", len, USB_DMA_DESC_RXTX_BYTES);
@@ -674,7 +674,8 @@ static void handle_out_ep(int ep)
674 * The usb_storage buffer is 63KB, but Linux sends 120KB. 674 * The usb_storage buffer is 63KB, but Linux sends 120KB.
675 * We get the first part, but upon re-enabling receive dma we 675 * We get the first part, but upon re-enabling receive dma we
676 * get a 'buffer not available' error from the hardware, since 676 * get a 'buffer not available' error from the hardware, since
677 * we haven't gotten the next usb_drv_recv() from the stack yet. 677 * we haven't gotten the next usb_drv_recv_nonblocking() from
678 * the stack yet.
678 * It seems the NAK bit is ignored here and the HW tries to dma 679 * It seems the NAK bit is ignored here and the HW tries to dma
679 * the incoming data anyway. 680 * the incoming data anyway.
680 * In theory I think the BNA error should be recoverable, but 681 * In theory I think the BNA error should be recoverable, but