From: "Tanya Brokhman" <tlinder@codeaurora.org>
To: balbi@ti.com
Cc: greg@kroah.com, linux-usb@vger.kernel.org,
linux-arm-msm@vger.kernel.org, ablay@codeaurora.org,
'Maya Erez' <merez@codeaurora.org>,
'open list' <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v9 5/7] usb: Add streams support to the gadget framework
Date: Wed, 11 May 2011 16:29:44 +0300 [thread overview]
Message-ID: <000a01cc0fdf$7fa623e0$7ef26ba0$@org> (raw)
In-Reply-To: <20110509092555.GF1254@legolas.emea.dhcp.ti.com>
Hi Felipe
> > @@ -129,6 +132,22 @@ ep_matches (
> > }
> >
> > /*
> > + * Get the number of required streams from the EP companion
> > + * descriptor and see if the EP matches it
> > + */
> > + if (usb_endpoint_xfer_bulk(desc)) {
> > + if (ep_comp) {
> > + num_req_streams = ep_comp->bmAttributes & 0x1f;
> > + if (num_req_streams > ep->max_streams)
> > + return 0;
>
> We would like the gadget drivers to all with all controllers, this
> would
> likely be better to ask from controller driver for N streams but work
> if
> we get less ? Something like:
>
> struct usb_gadget_ops {
> ...
> request_stream(struct usb_gadget *g, int max_streams);
> };
>
> if (usb_endpoint_xfer_bulk(desc)) {
> if (ep_comp) {
> num_req_streams = usb_gadget_request_streams(gadget,
> ep_comp->bmAttributes & 0x1f);
>
> /* now patch ep_comp descriptor */
> ep_comp->bmAttributes = num_req_streams;
> }
> }
>
> this way, different function drivers can request for a different number
> of streams and controller driver is required to keep track of total
> number of streams, and number of "busy" streams.
>
I'm not sure I understand what you meant by the above..
When choosing this approach we thought of the following design:
Each controller knows how many streams it supports for each endpoint and
inits the ep->max_streams filed accordingly. Each gadget driver declares the
number of streams it wishes to operate with using the comp_desc and if the
endpoint can support the requested number of streams - it's allocated for
that gadget driver. If no matching endpoint is found - it's up to the gadget
driver to decide what to do next. One approach could be to try and configure
the endpoint with less streams. For example in UAS if configuring the
endpoint with streams>0 fails, we fall back to HS mode where no streams are
required.
Does this address your concerns? Perhaps this is what you meant...
> Another approach would be to require function drivers to request the
> streams during bind by themselves and only give this layer correct
> descriptors, which allow you to make those arguments const.
Actually, during bind we still don't know the connection speed so the number
of streams can't be determined at that point. For example: when UAS gadget
driver operates in HS mode the number of streams is 0, when in SS > 0. I
think this is the right place for streams configuration.
Best regards,
Tanya Brokhman
Consultant for Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
next prev parent reply other threads:[~2011-05-11 13:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-08 11:16 [PATCH v9 0/7] usb gadget: Add SuperSpeed support to the Gadget Framework Tatyana Brokhman
2011-05-08 11:16 ` [PATCH v9 1/7] usb: Add usb_endpoint_descriptor to be part of the struct usb_ep Tatyana Brokhman
2011-05-08 11:16 ` [PATCH v9 2/7] usb: Configure endpoint according to gadget speed Tatyana Brokhman
2011-05-08 11:16 ` [PATCH v9 3/7] usb: Modify existing gadget drivers to use config_ep_by_speed() instead of ep_choose Tatyana Brokhman
2011-05-08 11:16 ` [PATCH v9 4/7] usb:gadget: Add SuperSpeed support to the Gadget Framework Tatyana Brokhman
2011-05-09 9:19 ` Felipe Balbi
2011-05-11 13:00 ` Tanya Brokhman
[not found] ` <1304853414-10234-1-git-send-email-tlinder-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2011-05-08 11:16 ` [PATCH v9 5/7] usb: Add streams support to the gadget framework Tatyana Brokhman
2011-05-09 9:25 ` Felipe Balbi
2011-05-11 13:29 ` Tanya Brokhman [this message]
2011-05-11 20:54 ` Felipe Balbi
2011-05-08 11:16 ` [PATCH v9 6/7] usb:gadget: Introduce usb_generate_ss_descriptors() Tatyana Brokhman
2011-05-08 11:16 ` [PATCH v9 7/7] usb: Adding SuperSpeed support to dummy_hcd Tatyana Brokhman
2011-05-09 17:49 ` Sebastian Andrzej Siewior
2011-05-10 11:24 ` Sergei Shtylyov
2011-05-12 5:19 ` Tanya Brokhman
2011-05-12 14:45 ` Alan Stern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000a01cc0fdf$7fa623e0$7ef26ba0$@org' \
--to=tlinder@codeaurora.org \
--cc=ablay@codeaurora.org \
--cc=balbi@ti.com \
--cc=greg@kroah.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=merez@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).