Re: [PATCH] usb:gadget:rndis:fix Missing req->context assignment

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

 



On Fri, Feb 10, 2012 at 09:54:51AM +0100, Lukasz Majewski wrote:
It is crucial to assign each req->context value to struct rndis.

The problem happens for multi function gadget (g_multi) when multiple
functions are calling common usb_composite_dev control request.

It might happen that *_setup method from one usb function will
alter some fields of this common request issued by other USB
function.
this is a bit weird, why would a function change a request which isn't
supposed to handled by it ? I mean, functions need to check the ctrl
request to be sure they should be handling it.

It's composite layer who directs requests to functions.  Functions do
not need to check the request.

Your patch shouldn't be necessary, really, because the context is
initialized when the request is allocated.

Yes, but there is only one request for EP0 which is shared between
all the functions.

what happens exactly ? Who changes the context field and why ?

The context is changed by all other functions.

In traditional gadgets, context is usually set once by the drivers and
all is grand.  In composite gadgets, however, one cannot set context
once, because there are many functions which EP0 request can be directed
towards.  Because of that, each time EP0 request is received, context
must be set to the function that handles the request.

--
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@xxxxxxxxxx>--------------ooO--(_)--Ooo--
--
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