zephyr/drivers
Emil Obalski 773f02e6e9 usb: drivers: Fix ZLP handling for Nordic driver.
ZLP - zero length packet is used to indicate that the device
has no more data to send. If the Host asks for more data that the
device can provide and the data size is mutliplication of Endpoint
wMaxPacketSize then the device must terminate the data transfer
with ZLP.

Until this patch Nordic device driver controller was not aware of
the requested data length and could not determine when the ZLP was
required.

This patch introduces a fix that prevents the driver from starting
setup stage before the ZLP is being send.

For consistance with the Zephyr USB stack sending ZLP must be
issued from the stack level. Making trans_zlp flag true results
in blocking the driver from starting setup stage without required
ZLP.

After the data transfer finishes the driver will be prepared for ZLP
and will call back the stack to start writing ZLP. After the ZLP
is being send the driver will automatically start status stage and
end the Control Transfer.

This patch also removes CONFIG_USB_DEVICE_DISABLE_ZLP_EPIN_HANDLING
and aligns Nordic driver with others.

Without this patch the issue could occur when handling get requests.
Typical case is string descriptor of length equal to wMaxPacketSize.
Hosts usually asks for wLength = 255 Bytes when string descriptors
are being requested. In that case to successfully finish the data
stage of the Control transfer the device must send wMacPacketSize
Bytes of actual string descriptor and then ZLP to indicate that no
more data are present. After ZLP the status stage may start and the
request is finished successfully.

Without this patch the driver will not send ZLP making it unable
to end the Control Request successful - this may lead to failing
'Device Descriptor Test' from USB3CV test tool.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-11-17 18:06:26 +01:00
..
adc
audio
bluetooth drivers: Bluetooth: rpmsg: Fix typo in BT_QUIRK_NO_AUTO_DLE use 2020-11-13 10:13:22 +01:00
can
clock_control drivers: clock_control: nrf: Add handling of HFCLK192M_STARTED event 2020-11-17 11:32:10 +01:00
console
counter
crypto
dac
debug
display
dma
ec_host_cmd_periph
eeprom
entropy
espi
ethernet
flash drivers: flash: stm32f4: Don't invert an already inverted mask 2020-11-12 08:56:06 -06:00
gpio
hwinfo
i2c drivers: i2c: dw: Update to use new pcie_alloc_irq API 2020-11-14 11:13:00 +02:00
i2s
ieee802154 drivers: ieee802154: Deny use of nRF FICR registers in NS domain 2020-11-16 15:24:03 +01:00
interrupt_controller intc: Add support for GRLIB IRQMP 2020-11-13 14:53:55 -08:00
ipm
kscan
led
led_strip
lora
modem drivers: modem: gsm: Fix DEVICE_DEFINE() data ptr 2020-11-16 14:26:37 -05:00
net
neural_net
pcie drivers: pcie: Rename pcie_wired_irq to pcie_get_irq 2020-11-14 11:13:00 +02:00
peci
pinmux
ps2
ptp_clock
pwm
regulator
sensor
serial drivers: serial: ns16550: Update to use new pcie_alloc_irq API 2020-11-14 11:13:00 +02:00
spi
timer timer: Add support for GRLIB GPTIMER 2020-11-13 14:53:55 -08:00
usb usb: drivers: Fix ZLP handling for Nordic driver. 2020-11-17 18:06:26 +01:00
video
watchdog
wifi drivers: wifi: esp DHCP/Static IP Support 2020-11-12 07:59:10 +02:00
CMakeLists.txt
Kconfig