• Daniel Mack's avatar
    usb: gadget: hidg: register OUT INT endpoint for SET_REPORT · 99c51500
    Daniel Mack authored
    The hidg function driver currently handles its SET_REPORT calls via EP0.
    This is the implicit behaviour when no OUT interrupt endpoint is
    configured and generally works fine.
    
    The problem is that due to EP0's role in the gadget framework, we cannot
    hold back packets and control traffic flow to sync it to the char device,
    and hence there's a high risk of loosing packets with this
    implementation.
    
    This patch adds an OUT interrupt endpoint to the interface and queues a
    fix number of request to catch SET_REPORT events. According to the
    specs, host drivers should always use the dedicated OUT endpoint when
    present.
    
    The char device's read implementation was rewritten to retrieve data
    from the list of completed output requests.
    Signed-off-by: default avatarDaniel Mack <zonque@gmail.com>
    Cc: Felipe Balbi <balbi@ti.com>
    Cc: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
    99c51500
f_hid.c 19.6 KB