Hello. On 05-03-2012 15:11, Lukasz Majewski wrote:
For SETUP stage of USB control transmission, the NAK shall NOT be CLEAR.
The SNAK/CNAK control is crucial for this type of driver, since data arrives to earlier defined requests.
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
Signed-off-by: Lukasz Majewski<l.majewski@xxxxxxxxxxx> Signed-off-by: Kyungmin Park<kyungmin.park@xxxxxxxxxxx> --- drivers/usb/gadget/s3c-hsotg.c | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index b35c657..0492c20 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c
[...]
@@ -1530,6 +1541,12 @@ static void s3c_hsotg_handle_outdone(struct s3c_hsotg *hsotg, if (req->actual< req->length&& size_left == 0) { s3c_hsotg_start_req(hsotg, hs_ep, hs_req, true); return; + } else { + if (epnum == 0) {
Collapse this to *else if* please and save on {}.
+ /* After was_setup = 1 => + * set CNAK for non Setup requests */ + hsotg->setup = was_setup ? 0 : 1; + } } if (req->actual< req->length&& req->short_not_ok) {
WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html