OSDN Git Service

usb:hsotg:samsung: Sending ZLP packet for IN EP0 transfers
authorLukasz Majewski <l.majewski@samsung.com>
Fri, 4 May 2012 12:17:04 +0000 (14:17 +0200)
committerFelipe Balbi <balbi@ti.com>
Fri, 4 May 2012 12:53:12 +0000 (15:53 +0300)
commitd3ca0259c56ee2dbc537d88a7496aba6b4712981
treefa653e8b924ec9269f3b54c081df405f49fb7e15
parent71225beeeba2bde80aac02fadb5c197389fa12e4
usb:hsotg:samsung: Sending ZLP packet for IN EP0 transfers

This commit targets following scenarios for IN requests:

1. HOST requests e.g. 256B (which is a multiple of MPS = 64B).
Then NO ZLP shall be sent, since host expects exact number of bytes.

2. HOST requested 4096B, but our data for sending is 256B. In this
situation ZLP shall be send to tell HOST that no more data is available
and it shall not wait for more data. This prevents HOST from hanging.

Tested with:
- DFU gadget (various size of the sent data - also packet = MPS)
- Ethernet gadget (CDC and RNDIS)
- Multi Function Gadget (g_multi)

HW:
- Samsung's C210 Universal rev.0
- Samsung's C110 GONI

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/s3c-hsotg.c