lkml.org 
[lkml]   [2011]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v12 7/8] usb: Adding SuperSpeed support to dummy_hcd
On Mon, 23 May 2011, Felipe Balbi wrote:

> > diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
> > index bf7981d..c2731d3 100644
> > --- a/drivers/usb/gadget/dummy_hcd.c
> > +++ b/drivers/usb/gadget/dummy_hcd.c
> > @@ -70,6 +70,15 @@ MODULE_DESCRIPTION (DRIVER_DESC);
> > MODULE_AUTHOR ("David Brownell");
> > MODULE_LICENSE ("GPL");
> >
> > +struct dummy_hcd_module_parameters {
> > + bool is_super_speed;
> > +};
> > +
> > +static struct dummy_hcd_module_parameters mod_data = {
> > + .is_super_speed = false
> > +};
> > +module_param_named(is_super_speed, mod_data.is_super_speed, bool, S_IRUGO);
> > +MODULE_PARM_DESC(is_super_speed, "true to simulate SuperSpeed connection");
>
> you shouldn't need this. You should always enable SuperSpeed for this
> driver.

I would say the opposite and go even farther. It's good to have a way
to force a SuperSpeed gadget to run at high speed, and it would also be
good to have a way to force a high-speed gadget to run at full speed.

A module parameter seems to be the simplest way of doing this.

> > + /*
> > + * We're connected and not reseted (reset occured now),
>
> 'reseted' isn't proper spelling :-)

Neither is "occured".

> > @@ -1371,6 +1577,10 @@ static void dummy_timer(unsigned long _dum_hcd)
> > case USB_SPEED_HIGH:
> > total = 512/*bytes*/ * 13/*packets*/ * 8/*uframes*/;
> > break;
> > + case USB_SPEED_SUPER:
> > + /* Bus speed is 500000 bytes/ms, so use a little less */
>
> isn't it 500000 bits/ms ?

SuperSpeed is 5 billion bits/s or 5 million bits/ms. The physical
layer encodes each data byte using 10 bits, therefore the bus speed is
500000 bytes/ms.

Alan Stern



\
 
 \ /
  Last update: 2011-05-23 16:21    [W:0.074 / U:3.380 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site