Permalink
Browse files

softusb: end data stage of SETUP also when size limit is reached

USB 1.1, 5.5.3, page 37: "The Data stage [...] is complete when the endpoint
[...] Has transferred exactly the amount of data specified [.]"
  • Loading branch information...
1 parent 0031e5c commit 98e19c94c29f6171957c66bbeccca2721f426361 @wpwrak wpwrak committed with sbourdeauducq Nov 29, 2011
Showing with 2 additions and 3 deletions.
  1. +2 −3 softusb-input/main.c
View
5 softusb-input/main.c
@@ -362,8 +362,8 @@ static int control_transfer(unsigned char addr, struct setup_packet *p,
if(chunklen < ep0_size)
break;
}
- } else if(maxlen != 0) {
- while(1) {
+ } else
+ while(transferred != maxlen) {
rxlen = usb_in(addr, expected_data, usb_buffer,
ep0_size+3);
if(!rxlen)
@@ -382,7 +382,6 @@ static int control_transfer(unsigned char addr, struct setup_packet *p,
if(chunklen < ep0_size)
break;
}
- }
/* send IN/OUT token in the opposite direction to end transfer */
retry:

0 comments on commit 98e19c9

Please sign in to comment.