summaryrefslogtreecommitdiffstats
path: root/firmware/target
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
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')
-rw-r--r--firmware/target/arm/as3525/usb-drv-as3525.c7
-rw-r--r--firmware/target/arm/rk27xx/usb-drv-rk27xx.c2
-rw-r--r--firmware/target/arm/tms320dm320/sansa-connect/tnetv105_usb_drv.c8
-rw-r--r--firmware/target/arm/usb-drv-arc.c2
-rw-r--r--firmware/target/arm/usb-s3c6400x.c2
-rw-r--r--firmware/target/arm/usb-tcc.c2
-rw-r--r--firmware/target/mips/ingenic_jz47xx/usb-jz4740.c2
-rw-r--r--firmware/target/mips/ingenic_jz47xx/usb-jz4760.c2
8 files changed, 13 insertions, 14 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)
restore_irq(flags);
}
-int usb_drv_recv(int ep, void *ptr, int len)
+int usb_drv_recv_nonblocking(int ep, void *ptr, int len)
{
struct usb_dev_dma_desc *uc_desc = endpoints[ep][1].uc_desc;
ep &= 0x7f;
- logf("usb_drv_recv(%d,%x,%d)\n", ep, (int)ptr, len);
+ logf("usb_drv_recv_nonblocking(%d,%x,%d)\n", ep, (int)ptr, len);
if (len > USB_DMA_DESC_RXTX_BYTES)
panicf("usb_recv: len=%d > %d", len, USB_DMA_DESC_RXTX_BYTES);
@@ -674,7 +674,8 @@ static void handle_out_ep(int ep)
* The usb_storage buffer is 63KB, but Linux sends 120KB.
* We get the first part, but upon re-enabling receive dma we
* get a 'buffer not available' error from the hardware, since
- * we haven't gotten the next usb_drv_recv() from the stack yet.
+ * we haven't gotten the next usb_drv_recv_nonblocking() from
+ * the stack yet.
* It seems the NAK bit is ignored here and the HW tries to dma
* the incoming data anyway.
* In theory I think the BNA error should be recoverable, but
diff --git a/firmware/target/arm/rk27xx/usb-drv-rk27xx.c b/firmware/target/arm/rk27xx/usb-drv-rk27xx.c
index 057ecf6ebc..aac271c47a 100644
--- a/firmware/target/arm/rk27xx/usb-drv-rk27xx.c
+++ b/firmware/target/arm/rk27xx/usb-drv-rk27xx.c
@@ -355,7 +355,7 @@ int usb_drv_send_nonblocking(int endpoint, void *ptr, int length)
}
/* Setup a receive transfer. (non blocking) */
-int usb_drv_recv(int endpoint, void* ptr, int length)
+int usb_drv_recv_nonblocking(int endpoint, void* ptr, int length)
{
logf("udc: recv(%x)", endpoint);
struct endpoint_t *ep;
diff --git a/firmware/target/arm/tms320dm320/sansa-connect/tnetv105_usb_drv.c b/firmware/target/arm/tms320dm320/sansa-connect/tnetv105_usb_drv.c
index 5563a40814..f1acc9c964 100644
--- a/firmware/target/arm/tms320dm320/sansa-connect/tnetv105_usb_drv.c
+++ b/firmware/target/arm/tms320dm320/sansa-connect/tnetv105_usb_drv.c
@@ -1026,8 +1026,8 @@ static bool tnetv_handle_cppi(void)
if (rx_intstatus || tx_intstatus || rcv_sched)
{
/* Request calling again after short delay
- * Needed when for example when OUT endpoint has pending
- * data but the USB task did not call usb_drv_recv() yet.
+ * Needed when for example when OUT endpoint has pending data
+ * but the USB task did not call usb_drv_recv_nonblocking() yet.
*/
return true;
}
@@ -1371,7 +1371,7 @@ int usb_drv_send_nonblocking(int endpoint, void* ptr, int length)
return _usb_drv_send(endpoint, ptr, length, false);
}
-int usb_drv_recv(int endpoint, void* ptr, int length)
+int usb_drv_recv_nonblocking(int endpoint, void* ptr, int length)
{
int epn = EP_NUM(endpoint);
struct ep_runtime_t *ep;
@@ -1388,8 +1388,6 @@ int usb_drv_recv(int endpoint, void* ptr, int length)
return 0;
}
-void usb_drv_ack(struct usb_ctrlrequest* req);
-
void usb_drv_set_address(int address)
{
UsbCtrlType usbCtrl;
diff --git a/firmware/target/arm/usb-drv-arc.c b/firmware/target/arm/usb-drv-arc.c
index b19b635923..4c53108f12 100644
--- a/firmware/target/arm/usb-drv-arc.c
+++ b/firmware/target/arm/usb-drv-arc.c
@@ -593,7 +593,7 @@ int usb_drv_send(int endpoint, void* ptr, int length)
return prime_transfer(EP_NUM(endpoint), ptr, length, true, true);
}
-int usb_drv_recv(int endpoint, void* ptr, int length)
+int usb_drv_recv_nonblocking(int endpoint, void* ptr, int length)
{
//logf("usbrecv(%x, %d)", ptr, length);
return prime_transfer(EP_NUM(endpoint), ptr, length, false, false);
diff --git a/firmware/target/arm/usb-s3c6400x.c b/firmware/target/arm/usb-s3c6400x.c
index 920d1a6286..71d04e6f2a 100644
--- a/firmware/target/arm/usb-s3c6400x.c
+++ b/firmware/target/arm/usb-s3c6400x.c
@@ -166,7 +166,7 @@ int usb_drv_send_nonblocking(int endpoint, void *ptr, int length)
return 0;
}
-int usb_drv_recv(int endpoint, void* ptr, int length)
+int usb_drv_recv_nonblocking(int endpoint, void* ptr, int length)
{
ep_transfer(EP_NUM(endpoint), ptr, length, true);
return 0;
diff --git a/firmware/target/arm/usb-tcc.c b/firmware/target/arm/usb-tcc.c
index 1b5f16c223..8ce75b6764 100644
--- a/firmware/target/arm/usb-tcc.c
+++ b/firmware/target/arm/usb-tcc.c
@@ -609,7 +609,7 @@ int usb_drv_send_nonblocking(int endpoint, void *ptr, int length)
return rc;
}
-int usb_drv_recv(int endpoint, void* ptr, int length)
+int usb_drv_recv_nonblocking(int endpoint, void* ptr, int length)
{
volatile struct tcc_ep *tcc_ep = &tcc_endpoints[endpoint & 0x7f];
int flags;
diff --git a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
index 162aeec97a..8d04c54a68 100644
--- a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
@@ -743,7 +743,7 @@ int usb_drv_send(int endpoint, void* ptr, int length)
return 0;
}
-int usb_drv_recv(int endpoint, void* ptr, int length)
+int usb_drv_recv_nonblocking(int endpoint, void* ptr, int length)
{
int flags;
struct usb_endpoint *ep;
diff --git a/firmware/target/mips/ingenic_jz47xx/usb-jz4760.c b/firmware/target/mips/ingenic_jz47xx/usb-jz4760.c
index 37df1b3bb6..5dbf9455e3 100644
--- a/firmware/target/mips/ingenic_jz47xx/usb-jz4760.c
+++ b/firmware/target/mips/ingenic_jz47xx/usb-jz4760.c
@@ -1118,7 +1118,7 @@ int usb_drv_send(int endpoint, void* ptr, int length)
return -1;
}
-int usb_drv_recv(int endpoint, void* ptr, int length)
+int usb_drv_recv_nonblocking(int endpoint, void* ptr, int length)
{
int flags;
struct usb_endpoint *ep;