Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-12-10 Thread Felipe Balbi
On Mon, Dec 03, 2012 at 07:27:05PM +0100, Michal Nazarewicz wrote: > > On Fri, Nov 30, 2012 at 07:40:31PM +0100, Michal Nazarewicz wrote: > >> IMO that's actually mute argument since it can be done regardless. You > >> can modprobe the module anyway. > > On Fri, Nov 30 2012, Felipe Balbi wrote: >

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-12-04 Thread Sebastian Andrzej Siewior
On 12/03/2012 07:23 PM, Michal Nazarewicz wrote: On 11/30/2012 07:39 PM, Michal Nazarewicz wrote: Yeah, but what Felipe just made me realise is that if that's the case, than it makes no sense to have the functions directory outside of the gadget. Instead we should have something like: On Mon,

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-12-03 Thread Michal Nazarewicz
> On Fri, Nov 30, 2012 at 07:40:31PM +0100, Michal Nazarewicz wrote: >> IMO that's actually mute argument since it can be done regardless. You >> can modprobe the module anyway. On Fri, Nov 30 2012, Felipe Balbi wrote: > fair enough, I just want to avoid doing any memory allocations, or HW > init

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-12-03 Thread Michal Nazarewicz
> On 11/30/2012 07:39 PM, Michal Nazarewicz wrote: >> Yeah, but what Felipe just made me realise is that if that's the case, >> than it makes no sense to have the functions directory outside of the >> gadget. Instead we should have something like: On Mon, Dec 03 2012, Sebastian Andrzej Siewior wr

Re: strings on the gadget side (was: Re: [RFC v2] usb/gadget: the start of the configfs interface)

2012-12-03 Thread Alan Stern
On Mon, 3 Dec 2012, Sebastian Andrzej Siewior wrote: > I think I can make iteven more complicated: Everything on the gadget > side uses language code 0x409 for en-us. The host-side on Linux takes > the first available language code and falls back to 0x409 if it (the > first reported) didn't work.

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-12-03 Thread Alan Stern
On Mon, 3 Dec 2012, Sebastian Andrzej Siewior wrote: > On 11/30/2012 11:07 PM, Felipe Balbi wrote: > > On Fri, Nov 30, 2012 at 08:09:38PM +0100, Sebastian Andrzej Siewior wrote: > >> On 11/30/2012 05:43 PM, Alan Stern wrote: > >>> The iProduct,... names are already defined in the USB spec, and the

strings on the gadget side (was: Re: [RFC v2] usb/gadget: the start of the configfs interface)

2012-12-03 Thread Sebastian Andrzej Siewior
On 12/03/2012 03:45 PM, Sebastian Andrzej Siewior wrote: then how about we drop the hungarian notation altogether ? Instead of sManufacturer we follow the host stack and just call it manufacturer. Likewise for all other fields ?? that would be manufacturer, product, serial. Fine by me. Anyone?

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-12-03 Thread Sebastian Andrzej Siewior
On 11/30/2012 11:07 PM, Felipe Balbi wrote: On Fri, Nov 30, 2012 at 08:09:38PM +0100, Sebastian Andrzej Siewior wrote: On 11/30/2012 05:43 PM, Alan Stern wrote: The iProduct,... names are already defined in the USB spec, and their meanings are different from the way you are using them here. Si

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-12-03 Thread Sebastian Andrzej Siewior
On 11/30/2012 07:39 PM, Michal Nazarewicz wrote: On Fri, Nov 30 2012, Sebastian Andrzej Siewior wrote: That won't work. You can only symlink an instance to one UDC. It is an instance after all. If you want two ACM ports you need two ACM folder in your functions folder: acm.ttyS0 acm.ttyS1 Ye

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-12-03 Thread Sebastian Andrzej Siewior
On 11/30/2012 05:04 PM, Felipe Balbi wrote: Hi, Hi, # echo acm.2,obex.3,msc> \ /sys/kernel/config/usb_gadget/dwc3.0/gadget0/config0/functions # echo ffs,sourcesink> \ /sys/kernel/config/usb_gadget/dwc3.0/gadget0/config1/functions what is wrong with having the functions withi

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-11-30 Thread Felipe Balbi
Hi, On Fri, Nov 30, 2012 at 07:40:31PM +0100, Michal Nazarewicz wrote: > On Fri, Nov 30 2012, Felipe Balbi wrote: > > why would you load a function before it's actually needed ? We could > > end up with users who will just load the function and never actually > > need them which will consume memor

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-11-30 Thread Felipe Balbi
Hi, On Fri, Nov 30, 2012 at 08:09:38PM +0100, Sebastian Andrzej Siewior wrote: > On 11/30/2012 05:43 PM, Alan Stern wrote: > >By the way, can you name these string attributes > > > > sSerialNumber, sProduct, and sManufacturer (etc.) > > > >instead of > > > > iSerialNumber, iProduct, and iM

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-11-30 Thread Sebastian Andrzej Siewior
On 11/30/2012 05:43 PM, Alan Stern wrote: By the way, can you name these string attributes sSerialNumber, sProduct, and sManufacturer (etc.) instead of iSerialNumber, iProduct, and iManufacturer (etc.)? Or is it too late to change? Hehe :) Why should it be too late? The iP

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-11-30 Thread Michal Nazarewicz
On Fri, Nov 30 2012, Felipe Balbi wrote: > why would you load a function before it's actually needed ? We could > end up with users who will just load the function and never actually > need them which will consume memory for no reason. IMO that's actually mute argument since it can be done regardl

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-11-30 Thread Michal Nazarewicz
On Fri, Nov 30 2012, Sebastian Andrzej Siewior wrote: > That won't work. You can only symlink an instance to one UDC. It is an > instance after all. If you want two ACM ports you need two ACM folder > in your functions folder: > > acm.ttyS0 > acm.ttyS1 Yeah, but what Felipe just made me realise i

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-11-30 Thread Alan Stern
On Fri, 30 Nov 2012, Sebastian Andrzej Siewior wrote: > /sys/kernel/config/usb_gadget/gadgets/# mkdir oha > /sys/kernel/config/usb_gadget/gadgets/oha# find > . > ./iSerialNumber > ./iProduct > ./iManufacturer > ./bcdUSB > ./idProduct > ./idVendor > ./bMaxPacketSize0 > ./bDeviceProtocol > ./bDevice

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-11-30 Thread Felipe Balbi
Hi, On Fri, Nov 30, 2012 at 04:24:43PM +0100, Sebastian Andrzej Siewior wrote: > On 11/30/2012 03:46 PM, Felipe Balbi wrote: > >Hi, > > Hi, > > >On Thu, Nov 29, 2012 at 05:43:21PM +0100, Sebastian Andrzej Siewior wrote: > >>|# modprobe dummy_hcd num=2 > >> > >>|# find /sys/kernel/config/ -ls > >

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-11-30 Thread Sebastian Andrzej Siewior
On 11/30/2012 04:11 PM, Felipe Balbi wrote: This loads function without even creating a gadget. This would allow the same function to be used in several different gadgets. why would you load a function before it's actually needed ? We could end up with users who will just load the function an

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-11-30 Thread Sebastian Andrzej Siewior
On 11/30/2012 03:46 PM, Felipe Balbi wrote: Hi, Hi, On Thu, Nov 29, 2012 at 05:43:21PM +0100, Sebastian Andrzej Siewior wrote: |# modprobe dummy_hcd num=2 |# find /sys/kernel/config/ -ls | 5570 drwxr-xr-x 3 root root0 Nov 29 17:26 /sys/kernel/config/ | 5580 d

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-11-30 Thread Felipe Balbi
Hi, On Fri, Nov 30, 2012 at 04:07:22PM +0100, Michal Nazarewicz wrote: > On Fri, Nov 30 2012, Felipe Balbi wrote: > > Hi, > > > > On Thu, Nov 29, 2012 at 05:43:21PM +0100, Sebastian Andrzej Siewior wrote: > >> |# modprobe dummy_hcd num=2 > >> > >> |# find /sys/kernel/config/ -ls > >> > >> | 55

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-11-30 Thread Michal Nazarewicz
On Fri, Nov 30 2012, Felipe Balbi wrote: > Hi, > > On Thu, Nov 29, 2012 at 05:43:21PM +0100, Sebastian Andrzej Siewior wrote: >> |# modprobe dummy_hcd num=2 >> >> |# find /sys/kernel/config/ -ls >> >> | 5570 drwxr-xr-x 3 root root0 Nov 29 17:26 >> /sys/kernel/config/ >> |

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-11-30 Thread Felipe Balbi
Hi, On Thu, Nov 29, 2012 at 05:43:21PM +0100, Sebastian Andrzej Siewior wrote: > |# modprobe dummy_hcd num=2 > > |# find /sys/kernel/config/ -ls > > | 5570 drwxr-xr-x 3 root root0 Nov 29 17:26 > /sys/kernel/config/ > | 5580 drwxr-xr-x 5 root root0

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-11-29 Thread Sebastian Andrzej Siewior
On 11/29/2012 06:26 PM, Michal Nazarewicz wrote: +#define MAX_NAME_LEN 40 +static struct config_group *function_make( + struct config_group *group, + const char *name) +{ + struct usb_function *f; + char buf[MAX_NAME_LEN]; + char *func_name; +

Re: [RFC v2] usb/gadget: the start of the configfs interface

2012-11-29 Thread Michal Nazarewicz
On Thu, Nov 29 2012, Sebastian Andrzej Siewior wrote: > |# modprobe dummy_hcd num=2 > > |# find /sys/kernel/config/ -ls > > | 5570 drwxr-xr-x 3 root root0 Nov 29 17:26 > /sys/kernel/config/ > | 5580 drwxr-xr-x 5 root root0 Nov 29 17:26 > /sys/kerne

[RFC v2] usb/gadget: the start of the configfs interface

2012-11-29 Thread Sebastian Andrzej Siewior
|# modprobe dummy_hcd num=2 |# find /sys/kernel/config/ -ls | 5570 drwxr-xr-x 3 root root0 Nov 29 17:26 /sys/kernel/config/ | 5580 drwxr-xr-x 5 root root0 Nov 29 17:26 /sys/kernel/config/usb_gadget | 5610 drwxr-xr-x 4 root root