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) | |
download | rockbox-7a73a9cd4e882ebbc37831160ec18d0f251f14bd.tar.gz rockbox-7a73a9cd4e882ebbc37831160ec18d0f251f14bd.zip |
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) | |||
496 | struct command_block_wrapper* cbw = (void*)cbw_buffer; | 496 | struct command_block_wrapper* cbw = (void*)cbw_buffer; |
497 | struct tm tm; | 497 | struct tm tm; |
498 | 498 | ||
499 | //logf("transfer result %X %d", status, length); | 499 | logf("transfer result for ep %d/%d %X %d", ep,dir,status, length); |
500 | switch(state) { | 500 | switch(state) { |
501 | case RECEIVING_BLOCKS: | 501 | case RECEIVING_BLOCKS: |
502 | if(dir==USB_DIR_IN) { | 502 | if(dir==USB_DIR_IN) { |
@@ -580,6 +580,8 @@ void usb_storage_transfer_complete(int ep,int dir,int status,int length) | |||
580 | } | 580 | } |
581 | //logf("csw sent, now go back to idle"); | 581 | //logf("csw sent, now go back to idle"); |
582 | state = WAITING_FOR_COMMAND; | 582 | state = WAITING_FOR_COMMAND; |
583 | /* Already start waiting for the next command */ | ||
584 | usb_drv_recv(ep_out, cbw_buffer, 1024); | ||
583 | #if 0 | 585 | #if 0 |
584 | if(cur_cmd.cur_cmd == SCSI_WRITE_10) | 586 | if(cur_cmd.cur_cmd == SCSI_WRITE_10) |
585 | { | 587 | { |
@@ -1178,8 +1180,6 @@ static void send_csw(int status) | |||
1178 | sizeof(struct command_status_wrapper)); | 1180 | sizeof(struct command_status_wrapper)); |
1179 | state = SENDING_CSW; | 1181 | state = SENDING_CSW; |
1180 | //logf("CSW: %X",status); | 1182 | //logf("CSW: %X",status); |
1181 | /* Already start waiting for the next command */ | ||
1182 | usb_drv_recv(ep_out, cbw_buffer, 1024); | ||
1183 | 1183 | ||
1184 | if(status == UMS_STATUS_GOOD) { | 1184 | if(status == UMS_STATUS_GOOD) { |
1185 | cur_sense_data.sense_key=0; | 1185 | cur_sense_data.sense_key=0; |