Re: [PATCH 2/3] usb: gadget: configfs: Create control_config group

2018-04-20 Thread Jerry Zhang
> The purpose would be: > 1) Allow writing no descriptors (maybe also skip the strings) when this > flag is set This should be straightforward. I'd rather not skip the strings though since we can already indicate zero strings in the current struct. If we skip strings then the difference between

Re: [PATCH 2/3] usb: gadget: configfs: Create control_config group

2018-04-19 Thread Krzysztof Opasiak
On 19.04.2018 21:02, Jerry Zhang wrote: [...] As main usecase for this code is FunctionFS I think that we should consider adding some flag to FunctionFS to mark instance as only for such purpouse. I mean sth like FFS_CONTROL_ONLY which would make FunctionFS igore the descs (or allow to

Re: [PATCH 2/3] usb: gadget: configfs: Create control_config group

2018-04-19 Thread Jerry Zhang
> [...] > > > > + cfg = >control_config; > > + c = >c; > > + list_for_each_entry_safe(f, tmp, >func_list, list) { > > + if (f->req_match && f->setup) { > > + list_del(>list); > > + if (usb_add_function(>c, f)) > > +

Re: [PATCH 2/3] usb: gadget: configfs: Create control_config group

2018-04-19 Thread Krzysztof Opasiak
On 17.04.2018 03:17, Jerry Zhang wrote: [...] + cfg = >control_config; + c = >c; + list_for_each_entry_safe(f, tmp, >func_list, list) { + if (f->req_match && f->setup) { + list_del(>list); + if (usb_add_function(>c, f)) +

Re: [PATCH 2/3] usb: gadget: configfs: Create control_config group

2018-04-17 Thread Jerry Zhang
> >> @@ -1461,6 +1499,18 @@ static struct config_group *gadgets_make( > >> if (!gi->composite.gadget_driver.function) > >> goto err; > >> > >> +gi->control_config.c.label = "control_config"; > >> +/* composite requires some value, but it doesn't matter */ > >> +

Re: [PATCH 2/3] usb: gadget: configfs: Create control_config group

2018-04-17 Thread Andrzej Pietrasiewicz
Hi again, W dniu 17.04.2018 o 09:55, Andrzej Pietrasiewicz pisze: > Hi, > > W dniu 17.04.2018 o 03:17, Jerry Zhang pisze: >> Control_config is a group under gadget that acts > > > >> >> @@ -1461,6 +1499,18 @@ static struct config_group *gadgets_make( >> if

Re: [PATCH 2/3] usb: gadget: configfs: Create control_config group

2018-04-17 Thread Andrzej Pietrasiewicz
Hi, W dniu 17.04.2018 o 03:17, Jerry Zhang pisze: > Control_config is a group under gadget that acts > > @@ -1461,6 +1499,18 @@ static struct config_group *gadgets_make( > if (!gi->composite.gadget_driver.function) > goto err; > > + gi->control_config.c.label =

[PATCH 2/3] usb: gadget: configfs: Create control_config group

2018-04-16 Thread Jerry Zhang
Control_config is a group under gadget that acts as a normal config group, except it does not appear in cdev->configs. Functions can be linked into the config as normal, and those functions are bound and unbound with the rest of the gadget. Create configfs_setup(), which will first attempt