Re: [PATCH 2/2] usb/dummy_hcd: initialize max_streams early

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

 



On Mon, 7 Nov 2011, Sebastian Andrzej Siewior wrote:

> >>  {
> >> -	u32 i;
> >> -
> >> -	if (dum->gadget.speed == USB_SPEED_SUPER) {
> >> -		for (i = 0; i < DUMMY_ENDPOINTS; i++)
> >> -			dum->ep[i].ep.max_streams = 0x10;
> >> +	if (dum->gadget.speed == USB_SPEED_SUPER)
> >>  		dum->ep[0].ep.maxpacket = 9;
> >> -	} else {
> >> -		for (i = 0; i < DUMMY_ENDPOINTS; i++)
> >> -			dum->ep[i].ep.max_streams = 0;
> >
> >It might be a good idea to keep this code -- just to be safe.
> Are you talking about an #if 0 block?

No, I meant the three lines above, where max_streams is set to 0 if the 
emulated connection isn't SuperSpeed.  Leave it in and let it run.

(Another thing I just noticed: i should be declared as an "int", not a 
"u32".)

> >>  static int dummy_pullup (struct usb_gadget *_gadget, int value)
> >> @@ -955,6 +948,7 @@ static void init_dummy_udc_hw(struct dummy *dum)
> >>  		ep->halted = ep->wedged = ep->already_seen =
> >>  				ep->setup_stage = 0;
> >>  		ep->ep.maxpacket = ~0;
> >> +		ep->ep.max_streams = 0x10;
> >
> >Can we please just use a plain old "16" instead of "0x10"?  It's not 
> >like the max number of streams has some mystic binary significance.  I 
> >realize it was done this way in the original code, but that doesn't 
> >mean you have to copy it blindly.
> 
> Sure. However I'm not sure if we could change it to streams_supported. I
> saw only one real hardware so far so my view is very limited. It
> supported streams on all endpoints and the number of limited streams
> seems not to be limited.

I don't know about USB-3 hardware in general.  But 16 streams seems 
like a reasonable number to use for testing.  You could make it a sysfs 
attribute if you want, although that might be overkill.

Alan Stern

--
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