Skip to content
Commit f35cdfc1 authored by Raúl Sánchez Siles's avatar Raúl Sánchez Siles Committed by Carles Cufí
Browse files

drivers: usb_dc_native_posix fill in data amount



Fill in received bytes in USBIP_RET_SUBMIT packet

Currently this field is unconditionally set to 0 and therefore not
filled in conveniently. This may mislead the USB host which is correctly
acknowledged that the transaction was sucessful but it cannot check the
actual received bytes.

Test application:

```python
import usb

data = (0xFF, 0xFF)
print("Opening loopback device")
device = usb.core.find(idVendor=0x2FE3, idProduct=0x0009)
print("Writing test data", data)
written = device.write(0x1, data)
print("Written", written, "bytes")
```

Before:
```
$ ./test_loopback.py
Opening loopback device
Writing test data (255, 255)
Written 0 bytes
```

After:
```
$ ./test_loopback.py
Opening loopback device
Writing test data (255, 255)
Written 2 bytes
```

Signed-off-by: default avatarRaúl Sánchez Siles <rsanchezs@k-lagan.com>
parent 1d7b63d0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment