altos: Use all 16 bits of setup packet len when limiting reply len
authorKeith Packard <keithp@keithp.com>
Wed, 18 Dec 2013 07:50:54 +0000 (23:50 -0800)
committerKeith Packard <keithp@keithp.com>
Wed, 18 Dec 2013 07:53:59 +0000 (23:53 -0800)
We were only using the low 8 bits of the setup packet reply max len,
which meant that if the other side sent a weird max len (as Windows 7
does), then we'd truncate our setup reply to whatever was in the low 8
bits of that value.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/lpc/ao_usb_lpc.c
src/stm/ao_usb_stm.c

index 144d10752b3ba2eb8642c1173586b4bb0eac71db..108822ced73f2fe72b3c333d73d1464f0fd1ce5e 100644 (file)
@@ -450,7 +450,7 @@ ao_usb_ep0_out_set(uint8_t *data, uint8_t len)
 }
 
 static void
-ao_usb_ep0_in_start(uint8_t max)
+ao_usb_ep0_in_start(uint16_t max)
 {
        /* Don't send more than asked for */
        if (ao_usb_ep0_in_len > max)
index 11dde92eedf1d583df74c57252d3aa8e048dd1b9..b00390ec0318b14901a68156ad29597df5b08f2f 100644 (file)
@@ -572,7 +572,7 @@ ao_usb_ep0_out_set(uint8_t *data, uint8_t len)
 }
 
 static void
-ao_usb_ep0_in_start(uint8_t max)
+ao_usb_ep0_in_start(uint16_t max)
 {
        /* Don't send more than asked for */
        if (ao_usb_ep0_in_len > max)