lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <op.v0ewbnms3l0zgt@mnazarewicz-glaptop>
Date:	Thu, 18 Aug 2011 15:41:37 +0200
From:	"Michal Nazarewicz" <mina86@...a86.com>
To:	"Dave Young" <hidave.darkstar@...il.com>
Cc:	"Yang Rui Rui" <ruirui.r.yang@...to.com>,
	"Alan Stern" <stern@...land.harvard.edu>,
	"Sergei Shtylyov" <sshtylyov@...sta.com>,
	"Felipe Balbi" <balbi@...com>,
	"Sebastian Andrzej Siewior" <bigeasy@...utronix.de>,
	"Yang Ruirui R" <ruirui.r.yang@...toenator.com>,
	"Greg Kroah-Hartman" <gregkh@...e.de>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCHv2] usb: gadget: get rid of USB_GADGET_DUALSPEED and
 USB_GADGET_SUPERSPEED

>>> On 08/17/2011 11:33 PM, Michal Nazarewicz wrote:
>>>> --- a/drivers/usb/gadget/composite.c
>>>> +++ b/drivers/usb/gadget/composite.c
>>>> @@ -1559,12 +1559,6 @@ composite_resume(struct usb_gadget *gadget)
>>>>
>>>>  /*-------------------------------------------------------------------------*/
>>>>
>>>>  static struct usb_gadget_driver composite_driver = {
>>>> -#ifdef CONFIG_USB_GADGET_SUPERSPEED
>>>> -       .speed          = USB_SPEED_SUPER,
>>>> -#else
>>>> -       .speed          = USB_SPEED_HIGH,
>>>> -#endif
>>>> -
>>>>         .unbind         = composite_unbind,
>>>>
>>>>         .setup          = composite_setup,
>>>> @@ -1609,8 +1603,7 @@ int usb_composite_probe(struct  
>>>> usb_composite_driver
>>>> *driver,
>>>>                 driver->iProduct = driver->name;
>>>>         composite_driver.function =  (char *) driver->name;
>>>>         composite_driver.driver.name = driver->name;
>>>> -       composite_driver.speed = min((u8)composite_driver.speed,
>>>> -                                    (u8)driver->max_speed);
>>>> +       composite_driver.speed = driver->max_speed;

>> On Thu, 18 Aug 2011 05:01:11 +0200, Yang Rui Rui wrote:
>>> This does not works, many drivers will check the driver->speed, ie in
>>> musg_gadget.c

> On Thu, Aug 18, 2011 at 7:57 PM, Michal Nazarewicz wrote:
>> Uh?  Not sure what you mean here.  Note that driver above is not the  
>> same
>> structure as driver below.  composite_driver is what musb_gadget_start()
>> will get.

On Thu, 18 Aug 2011 15:24:07 +0200, Dave Young wrote:
> For example I  got -EINVAL in musb_gadget_start in case
> composite_driver.speed = USB_SPEED_SUPER

For anything other then g_ether and g_zero, the speed should be set to
USB_SPEED_HIGH.  Unless this is somehow related to what Alan said about
this code.

> the driver param is the composite_driver in composite.c, isn't it?

Yes.

>>> static int musb_gadget_start(struct usb_gadget *g,
>>>                 struct usb_gadget_driver *driver)
>>> {
>>>         struct musb             *musb = gadget_to_musb(g);
>>>         unsigned long           flags;
>>>         int                     retval = -EINVAL;
>>>
>>>         if (driver->speed != USB_SPEED_HIGH)
>>>                 goto err0;
>>> [snip]
>>>
>>>>         composite = driver;
>>>>         composite_gadget_bind = bind;

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michal "mina86" Nazarewicz    (o o)
ooo +-----<email/xmpp: mnazarewicz@...gle.com>-----ooO--(_)--Ooo--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ