Commit 87cc34e
committed
usb-device-{cdc, hid}: Fix handling of zero length OUT control xfers.
This fix relies on a corresponding change in the low-level USBDevice class.
Without the low-level change, HID and CDC devices may not work correctly at
all.
Zero length OUT control requests were being processed on the device but
stalling the endpoint so the host saw a failure (or hang followed by
failure).
Specifically:
- CDC set control line state and send break requests
- HID set idle or set protocol
This commit also simplifies HID set report logic (tested to still work even
when buffer size doesn't match report length).
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>1 parent a215fc4 commit 87cc34e
2 files changed
+35
-53
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
293 | 292 | | |
294 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
295 | 297 | | |
296 | 298 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
324 | 318 | | |
325 | 319 | | |
326 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
209 | 217 | | |
210 | 218 | | |
211 | | - | |
212 | | - | |
| 219 | + | |
213 | 220 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
| 221 | + | |
234 | 222 | | |
235 | 223 | | |
236 | 224 | | |
237 | 225 | | |
238 | | - | |
239 | | - | |
| 226 | + | |
| 227 | + | |
240 | 228 | | |
241 | 229 | | |
242 | 230 | | |
| |||
0 commit comments