Re: [RFC/PATCH] usb: dwc3: gadget: implement streams support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/29/2011 01:02 PM, Felipe Balbi wrote:

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index c9b011a..8270671 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -264,6 +264,12 @@ static int dwc3_gadget_set_ep_config(struct dwc3 *dwc, struct dwc3_ep *dep,
  	params.param1.depcfg.xfer_complete_enable = true;
  	params.param1.depcfg.xfer_not_ready_enable = true;

+	if (usb_endpoint_xfer_bulk(desc)&&  dep->endpoint.max_streams) {
Should we test for SS speed as well?

+		params.param1.depcfg.stream_capable = true;
+		params.param1.depcfg.stream_event_enable = true;
this is just used to enable some debug output. Could we put an ifdef
debug around it?

+		dep->stream_capable = true;
+	}
+
  	if (usb_endpoint_xfer_isoc(desc))
  		params.param1.depcfg.xfer_in_progress_enable = true;

@@ -633,6 +640,9 @@ static struct dwc3_request *dwc3_prepare_trbs(struct dwc3_ep *dep,
  			trb.lst = last_one;
  		}

+		if (usb_endpoint_xfer_bulk(dep->desc)&&  dep->stream_capable)
+			trb.sid_sofn = req->request.stream_id;

Hmmm. The XferNotReady event tells us which stream we are waiting for.
I think we have to take this into account here.
So if the gadget queues a req for stream 3 and host asks for stream 5 no
transfer is going on because we start a transfer for stream 3 which the
host is not interested in, right?. Even worse, because once stream 5 is
queued by the gadget it sits there and waits until stream 3 is
finished. So everything stalls until the host asks for a packet from
stream 3.
Or am I wrong here? If we start a transfer for stream 3 instead of 5 is
the host informed that he received a data for another stream and takes it anyway?

Sebastian
--
Phone: +49 7556 91 98 91; Fax.: +49 7556 91 98 86

Firmensitz: 88690 Uhldingen, Auf dem Berg 3
Registergericht: Amtsgericht Freiburg i. Br., HRB 700 806;
StNr. 87007/07777; Ust-Id Nr.: DE252739476
Geschäftsführer: Heinz Egger, Thomas Gleixner
--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux