platform/upstream/libusbg.git
8 years agolibusbgx: Fix wrong binding parsing.
Krzysztof Opasiak [Tue, 4 Mar 2014 19:29:50 +0000 (20:29 +0100)]
libusbgx: Fix wrong binding parsing.

usbg_parse_bindings() function has done parsing incorrectly
and in inefficent way. Changes made in this function provide
better performance and fix wrong linking issue when having
two instances of the same function.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Add internal free functions for each library structure.
Krzysztof Opasiak [Mon, 24 Feb 2014 19:29:03 +0000 (20:29 +0100)]
libusbgx: Add internal free functions for each library structure.

Library should have internal API for freing structures instead of
copy pasting same code in different places.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Refresh function attributes while each get.
Krzysztof Opasiak [Mon, 24 Feb 2014 16:18:11 +0000 (17:18 +0100)]
libusbgx: Refresh function attributes while each get.

Function attributes may be changed by kernel or other
user so they should not be cached in library structures.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Refresh config strings while each get.
Krzysztof Opasiak [Thu, 20 Feb 2014 10:35:23 +0000 (11:35 +0100)]
libusbgx: Refresh config strings while each get.

Config strings should not be cached in library.
Removing internal strings structure allowed to add
full support for multilingual strings.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Refresh config attributes while each get.
Krzysztof Opasiak [Thu, 20 Feb 2014 10:21:04 +0000 (11:21 +0100)]
libusbgx: Refresh config attributes while each get.

Config attributes may be changed by kernel or other
user so they should not be cached in library structures.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Refresh gadget strings while each get.
Krzysztof Opasiak [Wed, 19 Feb 2014 13:56:27 +0000 (14:56 +0100)]
libusbgx: Refresh gadget strings while each get.

Gadget strings should not be cached in library.
Removing internal strings structure allowed to add
full support for multilingual strings.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Refresh gadget attributes while each get.
Krzysztof Opasiak [Wed, 19 Feb 2014 13:53:19 +0000 (14:53 +0100)]
libusbgx: Refresh gadget attributes while each get.

Gadget attributes may be changed by kernel or other
user so they should not be cached in library structures.

Signed-of-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Remove unused variables to make compiler happy.
Krzysztof Opasiak [Wed, 19 Feb 2014 10:15:55 +0000 (11:15 +0100)]
libusbgx: Remove unused variables to make compiler happy.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Update examples to new API.
Krzysztof Opasiak [Fri, 14 Feb 2014 08:28:33 +0000 (09:28 +0100)]
libusbgx: Update examples to new API.

API of library has been changed, so it is necessary
to update examples of library usage.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Rename all public structures to usbg convention.
Krzysztof Opasiak [Wed, 19 Feb 2014 15:38:33 +0000 (16:38 +0100)]
libusbgx: Rename all public structures to usbg convention.

Switch form struct * to typedef usbg_* to provide convenient
API for user.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Hide definition of binding structure.
Krzysztof Opasiak [Wed, 19 Feb 2014 14:58:38 +0000 (15:58 +0100)]
libusbgx: Hide definition of binding structure.

Hide definition of binding structure to avoid direct
access to its fields. Rename it to usbg_binding.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Hide definition of function structure.
Krzysztof Opasiak [Wed, 19 Feb 2014 14:56:31 +0000 (15:56 +0100)]
libusbgx: Hide definition of function structure.

Hide definition of function structure to avoid direct
access to its fields. Rename it to usbg_function.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Hide definition of config structure.
Krzysztof Opasiak [Wed, 19 Feb 2014 19:50:12 +0000 (20:50 +0100)]
libusbgx: Hide definition of config structure.

Hide definition of config structure to avoid direct
access to its fields. Rename it to usbg_confg.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Hide definition of gadget structure.
Krzysztof Opasiak [Wed, 19 Feb 2014 14:54:06 +0000 (15:54 +0100)]
libusbgx: Hide definition of gadget structure.

Remove definition of gadget structure to avoid direct
access to its fields. Rename that structure to usbg_gadget.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Hide definition of state structure.
Krzysztof Opasiak [Wed, 12 Feb 2014 14:01:32 +0000 (15:01 +0100)]
libusbgx: Hide definition of state structure.

Hide definition of state structure to avoid direct
access to its fields. Rename it to usbg_state.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Add getter for binding name and target.
Krzysztof Opasiak [Thu, 13 Feb 2014 14:13:29 +0000 (15:13 +0100)]
libusbgx: Add getter for binding name and target.

Add usbg_get_binding_target() to avoid direct binding
structure members access. Add also usbg_get_binding_name_len()
and usbg_get_binding_name() to allow getting binding name.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Add getter for function name.
Krzysztof Opasiak [Fri, 14 Feb 2014 15:31:06 +0000 (16:31 +0100)]
libusbgx: Add getter for function name.

Add usbg_get_function_name() and usbg_get_function_name_len()
to avoid direct function structure members access.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Add functions for get/set function attributes.
Krzysztof Opasiak [Thu, 13 Feb 2014 12:47:37 +0000 (13:47 +0100)]
libusbgx: Add functions for get/set function attributes.

Add usbg_get_function_attrs() and usbg_get_function_type()
to aviod direct access to function structure members.

Add usbg_set_function_attrs() to allow set all function\
attributes with one call.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Remove function_names from header file.
Krzysztof Opasiak [Thu, 13 Feb 2014 10:34:24 +0000 (11:34 +0100)]
libusbgx: Remove function_names from header file.

function_names table is for internal usage only.
User should use function_types enum.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Add getter for config name.
Krzysztof Opasiak [Fri, 14 Feb 2014 14:57:59 +0000 (15:57 +0100)]
libusbgx: Add getter for config name.

Add usbg_get_config_name() and usbg_get_config_name_len()
to avoid direct config structure members access.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Add set/get config attrs/strings functions.
Krzysztof Opasiak [Wed, 19 Feb 2014 15:36:40 +0000 (16:36 +0100)]
libusbgx: Add set/get config attrs/strings functions.

Add usbg_set_config_attrs() function to allow setting
all attributes with one call. Add also getter for attrs
to avoid direct accessing of configuration fields.

Add usbg_set_config_strs() to be consistent with gadget
API.

Change usbg_create_config() to allow configuration creation
and attribute setting with one call.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Separate config attrs and strs form configuration.
Krzysztof Opasiak [Wed, 19 Feb 2014 13:39:35 +0000 (14:39 +0100)]
libusbgx: Separate config attrs and strs form configuration.

Configuration, its attributes and strings are all logically
independent so should be placed in separate structures.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Add getter for configfs path in state.
Krzysztof Opasiak [Fri, 14 Feb 2014 13:11:59 +0000 (14:11 +0100)]
libusbgx: Add getter for configfs path in state.

Add usbg_get_configfs_path_len() and usbg_get_configfs_path()
to avoid direct access to state structure.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Change for each macros to avoid direct access to fields.
Krzysztof Opasiak [Wed, 12 Feb 2014 13:33:32 +0000 (14:33 +0100)]
libusbgx: Change for each macros to avoid direct access to fields.

Add dedicated functions for iterating over gadgets, configs,
bindigs and functions to avoid direct access to fields of this
structures. Change definitons of usbg_for_each_* macros to use
new functions.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Add getter for gadget name and udc.
Krzysztof Opasiak [Fri, 14 Feb 2014 12:17:58 +0000 (13:17 +0100)]
libusbgx: Add getter for gadget name and udc.

Add usbg_get_gadget_name() and usbg_get_gadget_udc() to avoid
direct gadget structure members access.

Add also usbg_get_gadget_name_len() and
usbg_get_gadget_udc_len() to allow getting udc and name length.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Add getters for gadget strings and attributes.
Krzysztof Opasiak [Wed, 12 Feb 2014 12:17:55 +0000 (13:17 +0100)]
libusbgx: Add getters for gadget strings and attributes.

Add getter's to avoid direct access to gadget structure
members.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Add functions to set all strs and attrs with one call.
Krzysztof Opasiak [Fri, 14 Feb 2014 11:52:27 +0000 (12:52 +0100)]
libusbgx: Add functions to set all strs and attrs with one call.

Rename usbg_create_gadget() to usbg_create_vid_pid().
dd usbg_create_gadget() to allow gadget creation
with given attributes and strings. Add usbg_set_gadget_attrs()
which allow to set all attributes with one call. Add
usbg_set_gadget_strs() which allow to set all strings with
one call.

Gadget structure creation and initialization has been moved to
usbg_create_empty_gadget() to avoid copy-paste same code in
usbg_create_gadget_vid_pid() and usbg_create_gadget().

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Fix wrong paths while setting gadget attributes.
Krzysztof Opasiak [Mon, 17 Feb 2014 13:45:17 +0000 (14:45 +0100)]
libusbgx: Fix wrong paths while setting gadget attributes.

Add missing gadget name to path while writting gadget attributes.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Add missing set vendor/product functions.
Krzysztof Opasiak [Wed, 12 Feb 2014 10:45:03 +0000 (11:45 +0100)]
libusbgx: Add missing set vendor/product functions.

Setting idVendor and idProduct was allowed only when
creating new gadget. Add usbg_set_gadget_vendor_id() and
usbg_set_gadget_product_id() to allow set those values
on existing gadget.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Update strings only when writting US English strings.
Krzysztof Opasiak [Wed, 12 Feb 2014 10:34:01 +0000 (11:34 +0100)]
libusbgx: Update strings only when writting US English strings.

Strings in current verison of library are hardcoded to
US English. Functions which set strings are generic and
allow to set other languages, but internal library structures
should be update only when setting US English strings.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Use dedicated macro instead of copy-paste code.
Krzysztof Opasiak [Wed, 19 Feb 2014 20:16:58 +0000 (21:16 +0100)]
libusbgx: Use dedicated macro instead of copy-paste code.

Insterting in string order has been done few times.
It was almost the same piece of code copied and pasted with
some minor changes. All those pieces has been replaced with
new macro INSERT_TAILQ_STRING_ORDER which does all the job.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Separate gadget strings from gadget.
Krzysztof Opasiak [Tue, 11 Feb 2014 16:09:26 +0000 (17:09 +0100)]
libusbgx: Separate gadget strings from gadget.

Gadget strings are not logically part of gadget, so should
be separated.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Change gadget attributes size and names.
Krzysztof Opasiak [Tue, 11 Feb 2014 14:44:48 +0000 (15:44 +0100)]
libusbgx: Change gadget attributes size and names.

Rename all gadget attributes to be consistent with usb
standard and libusb. Change also field size and order
to allow direct memcpy from libusb_device_descriptor.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Separate gadget attributes from gadget.
Krzysztof Opasiak [Tue, 28 Jan 2014 06:53:47 +0000 (07:53 +0100)]
libusbgx: Separate gadget attributes from gadget.

Gadget attributes should be placed in external structure
because they are almost that same as USB device descriptor.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Replace directory names with defines.
Krzysztof Opasiak [Mon, 16 Dec 2013 08:53:24 +0000 (09:53 +0100)]
libusbgx: Replace directory names with defines.

Replace strings, functions, configs strings placed
everywhere in code with macro defintions STRINGS_DIR,
FUNCTIONS_DIR and CONFIGS_DIR.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Replace memcpy with structure assignment.
Krzysztof Opasiak [Mon, 16 Dec 2013 09:54:55 +0000 (10:54 +0100)]
libusbgx: Replace memcpy with structure assignment.

Use the assign operator for structure instead of using
memcpy with hard coded size.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Move symlink creation after memory allocation.
Krzysztof Opasiak [Mon, 16 Dec 2013 08:28:33 +0000 (09:28 +0100)]
libusbgx: Move symlink creation after memory allocation.

Move creation of symlink after memory allocation for
binding structure. Fix missing initialization of parent.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Initialize gadget attributes and strings while gadget creation.
Krzysztof Opasiak [Mon, 16 Dec 2013 10:00:26 +0000 (11:00 +0100)]
libusbgx: Initialize gadget attributes and strings while gadget creation.

Fix gadget_create_gadget function to initialize gadget attributes
and strings with default values provided by kernel.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Separate parsing gadget attributes and strings.
Krzysztof Opasiak [Mon, 16 Dec 2013 09:58:45 +0000 (10:58 +0100)]
libusbgx: Separate parsing gadget attributes and strings.

Gadget attributes and strings are logically independent,
so they should be initialized in separate functions.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Add missing config attrs parsing while new config creation.
Krzysztof Opasiak [Wed, 11 Dec 2013 13:10:13 +0000 (14:10 +0100)]
libusbgx: Add missing config attrs parsing while new config creation.

Afther creation of configuration its attributes left uninitialized.
Config attrs should be initialized with default values provided
by kernel.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Add error handling to gadget_read_string().
Krzysztof Opasiak [Mon, 16 Dec 2013 09:45:18 +0000 (10:45 +0100)]
libusbgx: Add error handling to gadget_read_string().

Add error handling when gadget_read_buf() returns NULL.
If read of string fails, the string should be set as empty.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Fix memory leak when unable to create directory.
Krzysztof Opasiak [Mon, 16 Dec 2013 09:49:38 +0000 (10:49 +0100)]
libusbgx: Fix memory leak when unable to create directory.

Free the memory allocated for gadget/config/function structure
when faild to create suitable directory.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Move directory creation before writing attributes.
Krzysztof Opasiak [Wed, 11 Dec 2013 09:42:31 +0000 (10:42 +0100)]
libusbgx: Move directory creation before writing attributes.

Change order of gadget creation and attribute writting
to fix  No such file or directory error while creating
new gadget.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Fix gadget-acm-ecm example to cleanup at exit.
Krzysztof Opasiak [Mon, 16 Dec 2013 08:14:03 +0000 (09:14 +0100)]
libusbgx: Fix gadget-acm-ecm example to cleanup at exit.

Make use of previously unused variable ret to cleanup
after successful gadget creation.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Add missing return statement in non-void functions.
Krzysztof Opasiak [Wed, 11 Dec 2013 09:35:35 +0000 (10:35 +0100)]
libusbgx: Add missing return statement in non-void functions.

Add return 0 in functions which return non-void to
suppress compiler complaint.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Surround header with include guards.
Krzysztof Opasiak [Wed, 11 Dec 2013 13:56:07 +0000 (14:56 +0100)]
libusbgx: Surround header with include guards.

Surround header with include guards to protect against
multiple inclusion.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Add inline to gadget_write_string().
Stanislaw Wadas [Wed, 6 Nov 2013 10:29:52 +0000 (11:29 +0100)]
libusbgx: Add inline to gadget_write_string().

Add inline to gadget_write_string().

Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Move mkdir functions
Stanislaw Wadas [Wed, 6 Nov 2013 10:25:03 +0000 (11:25 +0100)]
libusbgx: Move mkdir functions

Call mkdir() function after successful memory allocation
and gadget function creation.

Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Add fputs()/fgets()/fprintf() error
Stanislaw Wadas [Mon, 4 Nov 2013 12:22:15 +0000 (14:22 +0200)]
libusbgx: Add fputs()/fgets()/fprintf() error

handling

Add error handling to fputs()/fgets()/fprintf() functions.

Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agolibusbgx: Replace array lengths with defines
Stanislaw Wadas [Mon, 4 Nov 2013 12:02:53 +0000 (14:02 +0200)]
libusbgx: Replace array lengths with defines

Replace hard coded value of 256 by two constant
defines, USBG_MAX_STR_LENGTH and USBG_MAX_PATH_LENGTH
Define USBG_MAX_NAME_LENGTH for name[] array

Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
[Port from libusbg and update description]
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
8 years agoFork from libusbg project
Krzysztof Opasiak [Tue, 22 Dec 2015 18:43:44 +0000 (19:43 +0100)]
Fork from libusbg project

As libusbg project looks for a dead for over a year it
has been forked and now it is developed as:

libusbg-neXt (libusbgx)

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
10 years agolibusbg: tag v0.1.0 release v0.1.0
Matt Porter [Mon, 20 Jan 2014 05:51:41 +0000 (00:51 -0500)]
libusbg: tag v0.1.0 release

Update changelog and tag the v0.1.0 release.

Signed-off-by: Matt Porter <mporter@linaro.org>
10 years agolibusbg: use /sys/kernel/config mount point in examples
Matt Porter [Sun, 5 Jan 2014 18:11:42 +0000 (13:11 -0500)]
libusbg: use /sys/kernel/config mount point in examples

Update documentation and example source code to reflect use of the
standard /sys/kernel/config mount point for configfs.

Signed-off-by: Matt Porter <mporter@linaro.org>
10 years agolibusbg: update preferred email address
Matt Porter [Sat, 4 Jan 2014 21:10:57 +0000 (16:10 -0500)]
libusbg: update preferred email address

Update email address for myself throughout the code.

Signed-off-by: Matt Porter <mporter@linaro.org>
10 years agolibusbg: rename gadget_*() -> usbg_*(), libusbg, and usbg.h
Matt Porter [Sat, 4 Jan 2014 20:23:14 +0000 (15:23 -0500)]
libusbg: rename gadget_*() -> usbg_*(), libusbg, and usbg.h

Rename library to libusbg. Moves the API include to usbg.h and
accordingly changes all API prefixes to usbg_*().

Signed-off-by: Matt Porter <mporter@linaro.org>
10 years agoconfigure: add AM_PROG_AR
Koen Kooi [Thu, 5 Sep 2013 12:20:10 +0000 (14:20 +0200)]
configure: add AM_PROG_AR

This fixes:

| automake: warnings are treated as errors
| /build/v2012.12/build/tmp-angstrom_v2012_12-eglibc/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: warning: 'libgadget.la': linking libtool libraries using a non-POSIX
| /build/v2012.12/build/tmp-angstrom_v2012_12-eglibc/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac'
| src/Makefile.am:1:   while processing Libtool library 'libgadget.la'

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
10 years agoInitial release
Matt Porter [Wed, 28 Aug 2013 14:52:49 +0000 (10:52 -0400)]
Initial release

Signed-off-by: Matt Porter <matt.porter@linaro.org>