summaryrefslogtreecommitdiff
path: root/include/usbg
AgeCommit message (Collapse)AuthorFilesLines
2016-09-23Imported Upstream version 0.0.1upstream/0.1.0upstream_backup_before_libusbg_to_libusbgx_changetaeyoung2-60/+726
Change-Id: I8c015fe84734a1020227040699dc4bbf9a081ccd
2016-09-23Revert "Imported Upstream version 0.0.1"taeyoung2-726/+60
This reverts commit af80c789ed18bffe59ff815f0fddabbda56b9442. Change-Id: I21d25ee142e12b9111664bd7ce3b2b190a56bb88
2016-09-23Imported Upstream version 0.0.1taeyoung2-60/+726
Change-Id: I7f9821384b1c58f400c5e4935edb8b89f30d503e
2016-09-23Revert "Imported Upstream version 0.0.1"Taeyoung Kim2-726/+60
This reverts commit 1521b31edc929f9b2d2551d2548765fa953f357d. Change-Id: Id43ea1856c1d1a02b0f5667a80e5f25bb5e641e5
2016-09-23Imported Upstream version 0.0.1taeyoung2-60/+726
Change-Id: I3ef3d374cc9e58ac062a426b9113a2f90d46e60f
2014-04-03libusbg: Use config ID and label instead of config name.Krzysztof Opasiak1-11/+24
Naming convention of Config FS should not be exposed to user of library. All API functions should use configuration ID (configuration number) as unique identificator and configuration label as human readable description. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-04-03libusbg: Replace usage of function name with type and instance.Krzysztof Opasiak1-10/+19
User of library should not use directly function name but only type of the function and name of instance. Using this will separate user for naming convention on Config FS. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-03-18libusbg: Remove fixed-size buffers from usbg_config.Krzysztof Opasiak1-1/+3
Path and name length should not be placed in constant size buffer but in allocated memory. Use PATH_MAX macro from limits.h as default size for USBG_MAX_PATH_LENGTH. Handle overflows of snprintf in related funcitons. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-03-11libusbg: Add functions for getting error strings.Krzysztof Opasiak1-0/+16
Add usbg_error_name() to get error name as a string. Add usbg_strerror() to get brief error description in English. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-03-11libusbg: Return error code instead of -1.Krzysztof Opasiak1-1/+1
Change usbg_add_config_function() to return usbg_error instead of returning 0 or -1. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-03-11libusbg: Change usbg_get_function_attrs() to return error code.Krzysztof Opasiak1-2/+3
usbg_get_function_attrs() may fail due to many reasons so it should notify the user about exact reason of failure instead of returning only NULL pointer. Add also USBG_ERROR_NOT_SUPPORTED to usbg_set_function_attrs(). Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-03-11libusbg: Return error code instead of NULL pointer - config.Krzysztof Opasiak1-5/+4
Change usbg_get_config_strs() and usbg_get_config_attrs() to return usbg_error instead of NULL pointer. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-03-11libusbg: Return error code instead of NULL pointer.Krzysztof Opasiak1-6/+4
Change usbg_get_gadget_strs() and usbg_get_gadget_attrs() to return usbg_error instead of NULL pointer. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-03-11libusbg: Add return value to usbg_enable/disable_gadget().Krzysztof Opasiak1-3/+7
Enabling and disabling gadget may fail due to many reasons so those functions should notify user about it. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-03-11libusbg: Add return value to config related functions.Krzysztof Opasiak1-8/+15
Each usbg_set_config_*() may fail so it should have a return value to notify user about reason of failure. To be consistent with rest of API usbg_create_config() should also return error code to notify user about reasons of failure instead of binary information (NULL or not). Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-03-11libusbg: Add return value to usb function related functions.Krzysztof Opasiak1-7/+13
Each usbg_set_*() may fail so it should have a return value to notify user about reason of failure. To be consistent with rest of API usbg_create_function() should also return error code to notify user about reasons of failure instead of binary information (NULL or not). Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-03-11libusbg: Add return value to usbg_set_gadget_*() functions.Krzysztof Opasiak1-11/+22
Setting each of attribute may fail due to a lot of reasons so those functions should report this failure to a user. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-03-11libusbg: Add return value to gadget creation functions.Krzysztof Opasiak1-8/+13
Functions related to gadget creation should return error codes instead of pointer. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-03-11libusbg: Return usbg_error instead of char* in usbg_get_*_name().Krzysztof Opasiak1-12/+12
API should be consistent and use error codes to determine what type of error occurred instead of returning NULL only. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-03-11libusbg: Return usbg_error instead of -1 in usbg_*_len().Krzysztof Opasiak1-6/+6
Functions which provides user length of some internal strings should return usbg_error instead of -1. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-03-10libusbg: Add error handling to usbg_init() and related functions.Krzysztof Opasiak1-2/+17
Assumption that all malloc() and read()/write() finish correctly is too bold. Errors should be handled and propagated to upper layers of library and returned to user. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-03-10libusbg: Refresh config strings while each get.Krzysztof Opasiak1-1/+2
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>
2014-03-10libusbg: Refresh gadget strings while each get.Krzysztof Opasiak1-2/+4
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>
2014-02-19libusbg: Rename all public structures to usbg convention.Krzysztof Opasiak1-50/+50
Switch form struct * to typedef usbg_* to provide convenient API for user. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-02-19libusbg: Hide definition of binding structure.Krzysztof Opasiak1-20/+11
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>
2014-02-19libusbg: Hide definition of function structure.Krzysztof Opasiak1-32/+21
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>
2014-02-19libusbg: Hide definition of config structure.Krzysztof Opasiak1-32/+22
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>
2014-02-19libusbg: Hide definition of gadget structure.Krzysztof Opasiak1-53/+40
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>
2014-02-19libusbg: Hide definition of state structure.Krzysztof Opasiak1-16/+15
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>
2014-02-19libusbg: Add getter for binding name and target.Krzysztof Opasiak1-0/+23
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>
2014-02-19libusbg: Add getter for function name.Krzysztof Opasiak1-0/+16
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>
2014-02-19libusbg: Add functions for get/set function attributes.Krzysztof Opasiak1-2/+28
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>
2014-02-19libusbg: Remove function_names from header file.Krzysztof Opasiak1-17/+0
function_names table is for internal usage only. User should use function_types enum. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-02-19libusbg: Add getter for config name.Krzysztof Opasiak1-0/+16
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>
2014-02-19libusbg: Add set/get config attrs/strings functions.Krzysztof Opasiak1-1/+39
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>
2014-02-19libusbg: Separate config attrs and strs form configuration.Krzysztof Opasiak1-7/+25
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>
2014-02-19libusbg: Add getter for configfs path in state.Krzysztof Opasiak1-0/+16
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>
2014-02-19libusbg: Change for each macros to avoid direct access to fields.Krzysztof Opasiak1-4/+76
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>
2014-02-19libusbg: Add getter for gadget name and udc.Krzysztof Opasiak1-0/+34
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>
2014-02-19libusbg: Add getters for gadget strings and attributes.Krzysztof Opasiak1-0/+18
Add getter's to avoid direct access to gadget structure members. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-02-19libusbg: Add functions to set all strs and attrs with one call.Krzysztof Opasiak1-1/+31
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>
2014-02-19libsubg: Add missing set vendor/product functions.Krzysztof Opasiak1-0/+14
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>
2014-02-19libusbg: Separate gadget strings from gadget.Krzysztof Opasiak1-3/+11
Gadget strings are not logically part of gadget, so should be separated. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-02-19libusbg: Change gadget attributes size and names.Krzysztof Opasiak1-23/+30
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>
2014-02-19libusbg: Separate gadget attributes from gadget.Krzysztof Opasiak1-8/+20
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>
2014-01-28libusbg: Surround header with include guards.Krzysztof Opasiak1-0/+4
Surround header with include guards to protect against multiple inclusion. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2014-01-27libusbg: Replace array lengths with definesStanislaw Wadas1-16/+20
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>
2014-01-21libusbg: update preferred email addressMatt Porter1-1/+1
Update email address for myself throughout the code. Signed-off-by: Matt Porter <mporter@linaro.org>
2014-01-21libusbg: rename gadget_*() -> usbg_*(), libusbg, and usbg.hMatt Porter1-0/+437
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>