All of lore.kernel.org
 help / color / mirror / Atom feed
* Introducing libgadget 0.0.1
@ 2013-09-04 17:25 Matt Porter
  2013-09-11  7:42 ` Jan Engelhardt
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Porter @ 2013-09-04 17:25 UTC (permalink / raw)
  To: Linux USB List; +Cc: Linux Kernel Mailing List

With the move to configfs for creation of arbitrary USB composite gadgets,
I found myself wanting a simple C library to configure and parse gadgets
in a system. It has no other dependencies other than libc itself.

It can be found at:

	git://git.linaro.org/people/mporter/libgadget.git

Doxygen docs on API and examples at:

	http://people.linaro.org/~matt.porter/libgadget/group__libgadget.html
	http://people.linaro.org/~matt.porter/libgadget/examples.html

Output from the examples:

$ mkdir /config
$ mount -t configfs none /config
$ gadget-acm-ecm
$ show-gadgets
ID 1d6b:0104 'g1'
  UDC                   3f120000.usbotg
  bDeviceClass          0x00
  bDeviceSubClass       0x00
  bDeviceProtocol       0x00
  bMaxPacketSize0       0x40
  bcdDevice             0x0311
  bcdUSB                0x0000
  idVendor              0x1d6b
  idProduct             0x0104
  Serial Number         0123456789
  Manufacturer          Foo Inc.
  Product               Bar Gadget
  Function 'acm.usb0'
    port_num            0
  Function 'acm.usb1'
    port_num            1
  Function 'ecm.usb0'
    dev_addr            32:1b:dc:a4:bc:a2
    host_addr           82:b7:58:62:f6:31
    ifname              usb0
    qmult               5
  Configuration 'c.1'
    MaxPower            2
    bmAttributes        0x80
    configuration       CDC 2xACM+ECM
    acm.GS0 -> acm.usb0
    acm.GS1 -> acm.usb0
    ecm.usb0 -> ecm.usb0

Besides things noted in the todo list, I'm working on a gadgettool
on top of libgadget to make life easier for everyday creation of
common composite devices. e.g. gadgettool --create="g1" --function="acm"
--function="ecm" --enable

-Matt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Introducing libgadget 0.0.1
  2013-09-04 17:25 Introducing libgadget 0.0.1 Matt Porter
@ 2013-09-11  7:42 ` Jan Engelhardt
  2013-09-11 12:23   ` Matt Porter
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Engelhardt @ 2013-09-11  7:42 UTC (permalink / raw)
  To: Matt Porter; +Cc: Linux USB List, Linux Kernel Mailing List

On Wednesday 2013-09-04 19:25, Matt Porter wrote:

>With the move to configfs for creation of arbitrary USB composite gadgets,
>I found myself wanting a simple C library to configure and parse gadgets
>in a system. It has no other dependencies other than libc itself.
>
>It can be found at:
>
>	git://git.linaro.org/people/mporter/libgadget.git

Hm but there is already a libgadget (and not just one) if you query a 
particular search engine entitled Google :}

>$ mkdir /config
>$ mount -t configfs none /config

Do your tools support input of a different location?
(systemd mounts configfs at /sys/kernel/config.)

>$ gadget-acm-ecm
>$ show-gadgets
>ID 1d6b:0104 'g1'
>[...]


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Introducing libgadget 0.0.1
  2013-09-11  7:42 ` Jan Engelhardt
@ 2013-09-11 12:23   ` Matt Porter
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Porter @ 2013-09-11 12:23 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Linux USB List, Linux Kernel Mailing List

On 09/11/2013 03:42 AM, Jan Engelhardt wrote:
> On Wednesday 2013-09-04 19:25, Matt Porter wrote:
>
>> With the move to configfs for creation of arbitrary USB composite gadgets,
>> I found myself wanting a simple C library to configure and parse gadgets
>> in a system. It has no other dependencies other than libc itself.
>>
>> It can be found at:
>>
>> 	git://git.linaro.org/people/mporter/libgadget.git
>
> Hm but there is already a libgadget (and not just one) if you query a
> particular search engine entitled Google :}

Yes, looked a bit at this before and both were seemingly defunct. 
However, to avoid confusion, the 0.0.2 release is becoming libusbg.

>
>> $ mkdir /config
>> $ mount -t configfs none /config
>
> Do your tools support input of a different location?
> (systemd mounts configfs at /sys/kernel/config.)
>
>> $ gadget-acm-ecm
>> $ show-gadgets
>> ID 1d6b:0104 'g1'
>> [...]
>

Also being addressed in 0.0.2. One of my test platforms is now using a 
systemd-based rootfs so it became readily apparent. Hopefully I'll have 
that release tagged in a few days.

Thanks for taking a look!

-Matt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-11 12:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-04 17:25 Introducing libgadget 0.0.1 Matt Porter
2013-09-11  7:42 ` Jan Engelhardt
2013-09-11 12:23   ` Matt Porter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.