diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2010-01-25 22:33:53 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2010-01-25 22:33:53 +0000 |
commit | 7a73a9cd4e882ebbc37831160ec18d0f251f14bd (patch) | |
tree | 4009b1e85ca9026980882262b7aff6c636428a49 /firmware/usbstack/usb_storage.c | |
parent | cbc549def7d3be12dd033752a36b9bf7ded19f42 (diff) |
don't start waiting for the new command in send_csw(). Although on the USB level this is entirely correct, and about 10% to 15% faster, usb_storage_transfer_complete() could get slightly confused by this.
The proper fix is obviously to make usb_storage_transfer_complete() not get confused, but that's a lot more work, and I prefer things to be correct to them being a bit faster right now
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24333 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/usbstack/usb_storage.c')
-rw-r--r-- | firmware/usbstack/usb_storage.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c index f8e3aba839..144603348b 100644 --- a/firmware/usbstack/usb_storage.c +++ b/firmware/usbstack/usb_storage.c @@ -496,7 +496,7 @@ void usb_storage_transfer_complete(int ep,int dir,int status,int length) struct command_block_wrapper* cbw = (void*)cbw_buffer; struct tm tm; - //logf("transfer result %X %d", status, length); + logf("transfer result for ep %d/%d %X %d", ep,dir,status, length); switch(state) { case RECEIVING_BLOCKS: if(dir==USB_DIR_IN) { @@ -580,6 +580,8 @@ void usb_storage_transfer_complete(int ep,int dir,int status,int length) } //logf("csw sent, now go back to idle"); state = WAITING_FOR_COMMAND; + /* Already start waiting for the next command */ + usb_drv_recv(ep_out, cbw_buffer, 1024); #if 0 if(cur_cmd.cur_cmd == SCSI_WRITE_10) { @@ -1178,8 +1180,6 @@ static void send_csw(int status) sizeof(struct command_status_wrapper)); state = SENDING_CSW; //logf("CSW: %X",status); - /* Already start waiting for the next command */ - usb_drv_recv(ep_out, cbw_buffer, 1024); if(status == UMS_STATUS_GOOD) { cur_sense_data.sense_key=0; |