All of lore.kernel.org
 help / color / mirror / Atom feed
* Override endpoint attributes (was: RE: [PATCH] zd1211rw: change endpoint types of EP_REGS_OUT and EP_INT_IN from interrupt to bulk)
@ 2011-02-06 10:27 Martin Schleier
  2011-02-06 11:33 ` Jussi Kivilinna
  2011-02-06 12:07 ` Sujith
  0 siblings, 2 replies; 12+ messages in thread
From: Martin Schleier @ 2011-02-06 10:27 UTC (permalink / raw)
  To: Jussi Kivilinna
  Cc: linux-wireless, dsd, linville, kune, linux-usb, stern, gregkh

Sujith <m.sujith@...> writes:
> Jussi Kivilinna wrote:
> > +static int usb_endpoint_int_to_bulk(struct usb_device *udev, unsigned int pipe)
> > +{
> > +	struct usb_host_endpoint *ep;
> > +
> > +	ep = usb_pipe_endpoint(udev, pipe);
> > +	if (!ep)
> > +		return -EPIPE;
> > +
> > +	switch (ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
> > +	case USB_ENDPOINT_XFER_INT:
> > +		ep->desc.bmAttributes &= ~USB_ENDPOINT_XFERTYPE_MASK;
> > +		ep->desc.bmAttributes |= USB_ENDPOINT_XFER_BULK;
> > +		ep->desc.bInterval = 0;
> > +		/* passthru */

Interesting, I know that interrupt and bulk endpoints share a lot of
common logic so I can see how this should work. But is it really
possible [and more to the point: sane?!] to override the endpoint
descriptors?

I know that usb_submit_urb checks [when config_usb_debug is enabled]
if the xfertype of the submitted urb matches the one of the endpoint,
so I wonder I started to wonder if we are fooling "just" the code
here, or ourselves in the process?
 
> ath9k_htc does the same thing (see ath/ath9k/hif_usb.c).
> It does seem to be working properly but I am wondering if the
> USB subsystem has to be updated after the driver messes around with bmAttributes.
> (lsusb would still show the endpoint type as INT).
> 
> You have a usb_reset_configuration() call before changing
> the endpoint type, why is that necessary ? And would that
> reset the endpoints as well ?
Huh, has this already catched on?
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-02-09 16:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-06 10:27 Override endpoint attributes (was: RE: [PATCH] zd1211rw: change endpoint types of EP_REGS_OUT and EP_INT_IN from interrupt to bulk) Martin Schleier
2011-02-06 11:33 ` Jussi Kivilinna
2011-02-06 12:07 ` Sujith
2011-02-06 15:46   ` Alan Stern
2011-02-06 16:15     ` Sujith
2011-02-06 20:04       ` Alan Stern
2011-02-08 12:03         ` Jussi Kivilinna
2011-02-08 15:21           ` Alan Stern
2011-02-08 19:08             ` Jussi Kivilinna
2011-02-09  2:28             ` Sujith
2011-02-09 15:19               ` Alan Stern
2011-02-09 16:30                 ` Sujith

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.