1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Aidan MacDonald 2021-09-19 10:54:26 +01:00
parent 99f333c64f
commit 672bbe434b
16 changed files with 36 additions and 38 deletions

View file

@ -470,7 +470,7 @@ void usb_storage_init_connection(void)
ramdisk_buffer = tb.transfer_buffer + ALLOCATE_BUFFER_SIZE;
#endif
#endif
usb_drv_recv(ep_out, cbw_buffer, MAX_CBW_SIZE);
usb_drv_recv_nonblocking(ep_out, cbw_buffer, MAX_CBW_SIZE);
int i;
for(i=0;i<storage_num_drives();i++) {
@ -685,7 +685,7 @@ bool usb_storage_control_request(struct usb_ctrlrequest* req, unsigned char* des
if(skip_first) (*tb.max_lun) --;
#endif
logf("ums: getmaxlun");
usb_drv_recv(EP_CONTROL, NULL, 0); /* ack */
usb_drv_recv_nonblocking(EP_CONTROL, NULL, 0); /* ack */
usb_drv_send(EP_CONTROL, tb.max_lun, 1);
handled = true;
break;
@ -1187,14 +1187,14 @@ static void send_command_failed_result(void)
#if CONFIG_RTC
static void receive_time(void)
{
usb_drv_recv(ep_out, tb.transfer_buffer, 12);
usb_drv_recv_nonblocking(ep_out, tb.transfer_buffer, 12);
state = RECEIVING_TIME;
}
#endif /* CONFIG_RTC */
static void receive_block_data(void *data,int size)
{
usb_drv_recv(ep_out, data, size);
usb_drv_recv_nonblocking(ep_out, data, size);
state = RECEIVING_BLOCKS;
}
@ -1210,7 +1210,7 @@ static void send_csw(int status)
state = WAITING_FOR_CSW_COMPLETION_OR_COMMAND;
//logf("CSW: %X",status);
/* Already start waiting for the next command */
usb_drv_recv(ep_out, cbw_buffer, MAX_CBW_SIZE);
usb_drv_recv_nonblocking(ep_out, cbw_buffer, MAX_CBW_SIZE);
/* The next completed transfer will be either the CSW one
* or the new command */