• Thinh Nguyen's avatar
    usb: dwc3: gadget: Handle stream transfers · 140ca4cf
    Thinh Nguyen authored
    Overview of stream transfer requirement:
     * A transfer will have a set of TRBs of the same stream ID.
     * A transfer is started with a stream ID in START_TRANSFER command.
     * A new stream will only start when the previous completes.
    
    Overview of stream events:
     * A "prime" from host indicates that its endpoints are active
       (buffers prepared and ready to receive/transmit data). The controller
       automatically initiates stream if it sees this.
     * A "NoStream" rejection event indicates that the host isn't ready.
       Host will put the endpoint back to idle state. Device may need to
       reinitiate the stream to start transfer again.
     * A Stream Found event means host accepted device initiated stream.
       Nothing needs to be done from driver.
    
    To initiate a stream, the driver will issue START_TRANSFER command with
    a stream ID. To reinitiate the stream, the driver must issue
    END_TRANSFER and restart the transfer with START_TRANSFER command with
    the same stream ID.
    
    This implementation handles device-initated streams (e.g. UASP driver).
    It also handles some hosts' quirky behavior where they only prime each
    endpoint once.
    Signed-off-by: default avatarThinh Nguyen <thinhn@synopsys.com>
    Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
    140ca4cf
core.h 48.5 KB