|
| ARRAY_SIZE_SENTINEL (function_types, USBG_FUNCTION_TYPE_MAX) |
|
| ARRAY_SIZE_SENTINEL (gadget_attr_names, USBG_GADGET_ATTR_MAX) |
|
| ARRAY_SIZE_SENTINEL (gadget_str_names, USBG_GADGET_STR_MAX) |
|
| ARRAY_SIZE_SENTINEL (gadget_os_desc_names, USBG_GADGET_OS_DESC_MAX) |
|
int | usbg_lookup_function_type (const char *name) |
| Lookup function type suitable for given name. More...
|
|
const char * | usbg_get_function_type_str (usbg_function_type type) |
| Get function type as a string. More...
|
|
int | usbg_lookup_gadget_attr (const char *name) |
| Lookup attr code based on its name. More...
|
|
int | usbg_lookup_gadget_str (const char *name) |
| Lookup str code based on its name. More...
|
|
const char * | usbg_get_gadget_attr_str (usbg_gadget_attr attr) |
| Get string representing selected gadget attribute. More...
|
|
const char * | usbg_get_gadget_str_name (usbg_gadget_str str) |
| Get name of selected gadget string. More...
|
|
const char * | usbg_get_gadget_os_desc_name (usbg_gadget_os_desc_strs str) |
| Get name of selected OS Descriptor string. More...
|
|
int | usbg_init (const char *configfs_path, usbg_state **state) |
| Initialize the libusbgx library state. More...
|
|
void | usbg_cleanup (usbg_state *s) |
| Clean up the libusbgx library state. More...
|
|
const char * | usbg_get_configfs_path (usbg_state *s) |
| Get ConfigFS path. More...
|
|
int | usbg_get_configfs_path_s (usbg_state *s, char *buf, int len) |
| Get ConfigFS path into user buffer. More...
|
|
usbg_gadget * | usbg_get_gadget (usbg_state *s, const char *name) |
| Get a gadget device by name. More...
|
|
usbg_function * | usbg_get_function (usbg_gadget *g, usbg_function_type type, const char *instance) |
| Get a function by name. More...
|
|
usbg_config * | usbg_get_config (usbg_gadget *g, int id, const char *label) |
| Get a configuration by name. More...
|
|
usbg_udc * | usbg_get_udc (usbg_state *s, const char *name) |
| Get a udc by name. More...
|
|
usbg_binding * | usbg_get_binding (usbg_config *c, const char *name) |
|
usbg_binding * | usbg_get_link_binding (usbg_config *c, usbg_function *f) |
|
int | usbg_rm_binding (usbg_binding *b) |
| Remove binding between configuration and function. More...
|
|
usbg_config * | usbg_get_os_desc_binding (usbg_gadget *g) |
| Get configuration selected for OS Descriptors. More...
|
|
int | usbg_rm_config (usbg_config *c, int opts) |
| Remove configuration. More...
|
|
int | usbg_rm_function (usbg_function *f, int opts) |
| Remove existing USB function. More...
|
|
int | usbg_rm_gadget (usbg_gadget *g, int opts) |
| Remove existing USB gadget. More...
|
|
int | usbg_rm_config_strs (usbg_config *c, int lang) |
| Remove configuration strings for given language. More...
|
|
int | usbg_rm_gadget_strs (usbg_gadget *g, int lang) |
| Remove gadget strings for given language. More...
|
|
int | usbg_create_gadget_vid_pid (usbg_state *s, const char *name, uint16_t idVendor, uint16_t idProduct, usbg_gadget **g) |
| Create a new USB gadget device. More...
|
|
int | usbg_create_gadget (usbg_state *s, const char *name, const struct usbg_gadget_attrs *g_attrs, const struct usbg_gadget_strs *g_strs, usbg_gadget **g) |
| Create a new USB gadget device and set given attributes and strings. More...
|
|
int | usbg_get_gadget_attrs (usbg_gadget *g, struct usbg_gadget_attrs *g_attrs) |
| Get the USB gadget strings. More...
|
|
const char * | usbg_get_gadget_name (usbg_gadget *g) |
| Get gadget name. More...
|
|
int | usbg_get_gadget_name_s (usbg_gadget *g, char *buf, int len) |
| Get gadget name into user buffer. More...
|
|
const char * | usbg_get_udc_name (usbg_udc *u) |
| Get name of udc. More...
|
|
int | usbg_get_udc_name_s (usbg_udc *u, char *buf, int len) |
| Get udc name into user buffer. More...
|
|
int | usbg_set_gadget_attr (usbg_gadget *g, usbg_gadget_attr attr, int val) |
| Set selected attribute to value. More...
|
|
int | usbg_get_gadget_attr (usbg_gadget *g, usbg_gadget_attr attr) |
| Get value of selected attribute. More...
|
|
usbg_udc * | usbg_get_gadget_udc (usbg_gadget *g) |
| Get udc to which gadget is bound. More...
|
|
usbg_gadget * | usbg_get_udc_gadget (usbg_udc *u) |
| Get gadget which is attached to this UDC. More...
|
|
int | usbg_set_gadget_attrs (usbg_gadget *g, const struct usbg_gadget_attrs *g_attrs) |
| Set the USB gadget attributes. More...
|
|
int | usbg_set_gadget_vendor_id (usbg_gadget *g, uint16_t idVendor) |
| Set the USB gadget vendor id. More...
|
|
int | usbg_set_gadget_product_id (usbg_gadget *g, uint16_t idProduct) |
| Set the USB gadget product id. More...
|
|
int | usbg_set_gadget_device_class (usbg_gadget *g, uint8_t bDeviceClass) |
| Set the USB gadget device class code. More...
|
|
int | usbg_set_gadget_device_protocol (usbg_gadget *g, uint8_t bDeviceProtocol) |
| Set the USB gadget protocol code. More...
|
|
int | usbg_set_gadget_device_subclass (usbg_gadget *g, uint8_t bDeviceSubClass) |
| Set the USB gadget device subclass code. More...
|
|
int | usbg_set_gadget_device_max_packet (usbg_gadget *g, uint8_t bMaxPacketSize0) |
| Set the maximum packet size for a gadget. More...
|
|
int | usbg_set_gadget_device_bcd_device (usbg_gadget *g, uint16_t bcdDevice) |
| Set the gadget device BCD release number. More...
|
|
int | usbg_set_gadget_device_bcd_usb (usbg_gadget *g, uint16_t bcdUSB) |
| Set the gadget device BCD USB version. More...
|
|
int | usbg_get_gadget_strs (usbg_gadget *g, int lang, struct usbg_gadget_strs *g_strs) |
| Get the USB gadget strings. More...
|
|
int | usbg_get_gadget_strs_langs (usbg_gadget *g, int **langs) |
| Get the array of languages available in this gadget. More...
|
|
int | usbg_get_config_strs_langs (usbg_config *c, int **langs) |
| Get the array of languages available in this config. More...
|
|
int | usbg_set_gadget_str (usbg_gadget *g, usbg_gadget_str str, int lang, const char *val) |
| Set selected string. More...
|
|
int | usbg_set_gadget_strs (usbg_gadget *g, int lang, const struct usbg_gadget_strs *g_strs) |
| Set the USB gadget strings. More...
|
|
int | usbg_set_gadget_serial_number (usbg_gadget *g, int lang, const char *serno) |
| Set the serial number for a gadget. More...
|
|
int | usbg_set_gadget_manufacturer (usbg_gadget *g, int lang, const char *mnf) |
| Set the manufacturer name for a gadget. More...
|
|
int | usbg_set_gadget_product (usbg_gadget *g, int lang, const char *prd) |
| Set the product name for a gadget. More...
|
|
int | usbg_get_gadget_os_descs (usbg_gadget *g, struct usbg_gadget_os_descs *g_os_descs) |
| Get the USB gadget OS Descriptor. More...
|
|
int | usbg_set_gadget_os_descs (usbg_gadget *g, const struct usbg_gadget_os_descs *g_os_descs) |
| Set the USB gadget OS Descriptor. More...
|
|
int | usbg_create_function (usbg_gadget *g, usbg_function_type type, const char *instance, void *f_attrs, usbg_function **f) |
| Create a new USB gadget function and set its attributes. More...
|
|
int | usbg_get_interf_os_desc (usbg_function *f, const char *iname, struct usbg_function_os_desc *f_os_desc) |
| Get OS Descriptor compatibility of given function. More...
|
|
int | usbg_set_interf_os_desc (usbg_function *f, const char *iname, const struct usbg_function_os_desc *f_os_desc) |
| Set OS Descriptor compatibility of given function. More...
|
|
int | usbg_create_config (usbg_gadget *g, int id, const char *label, const struct usbg_config_attrs *c_attrs, const struct usbg_config_strs *c_strs, usbg_config **c) |
| Create a new USB gadget configuration. More...
|
|
const char * | usbg_get_config_label (usbg_config *c) |
| Get config label. More...
|
|
int | usbg_get_config_label_s (usbg_config *c, char *buf, int len) |
| Get config label into user buffer. More...
|
|
int | usbg_get_config_id (usbg_config *c) |
| Get config id. More...
|
|
const char * | usbg_get_function_instance (usbg_function *f) |
| Get function instance name. More...
|
|
int | usbg_get_function_instance_s (usbg_function *f, char *buf, int len) |
| Get function instance name into user buffer. More...
|
|
int | usbg_set_config_attrs (usbg_config *c, const struct usbg_config_attrs *c_attrs) |
| Set the USB configuration attributes. More...
|
|
int | usbg_get_config_attrs (usbg_config *c, struct usbg_config_attrs *c_attrs) |
| Get the USB configuration strings. More...
|
|
int | usbg_set_config_max_power (usbg_config *c, int bMaxPower) |
| Set the configuration maximum power. More...
|
|
int | usbg_set_config_bm_attrs (usbg_config *c, int bmAttributes) |
| Set the configuration bitmap attributes. More...
|
|
int | usbg_get_config_strs (usbg_config *c, int lang, struct usbg_config_strs *c_strs) |
| Get the USB configuration strings. More...
|
|
int | usbg_set_config_strs (usbg_config *c, int lang, const struct usbg_config_strs *c_strs) |
| Set the USB configuration strings. More...
|
|
int | usbg_set_config_string (usbg_config *c, int lang, const char *str) |
| Set the configuration string. More...
|
|
int | usbg_add_config_function (usbg_config *c, const char *name, usbg_function *f) |
| Add a function to a configuration. More...
|
|
usbg_function * | usbg_get_binding_target (usbg_binding *b) |
| Get target function of given binding. More...
|
|
const char * | usbg_get_binding_name (usbg_binding *b) |
| Get binding name. More...
|
|
int | usbg_get_binding_name_s (usbg_binding *b, char *buf, int len) |
| Get binding name into user buffer. More...
|
|
int | usbg_set_os_desc_config (usbg_gadget *g, usbg_config *c) |
| Set configuration for OS Descriptors. More...
|
|
int | usbg_enable_gadget (usbg_gadget *g, usbg_udc *udc) |
| Enable a USB gadget device. More...
|
|
int | usbg_disable_gadget (usbg_gadget *g) |
| Disable a USB gadget device. More...
|
|
usbg_function_type | usbg_get_function_type (usbg_function *f) |
| Get type of given function. More...
|
|
int | usbg_get_function_attrs (usbg_function *f, void *f_attrs) |
| Get attributes of given function. More...
|
|
void | usbg_cleanup_function_attrs (usbg_function *f, void *f_attrs) |
| Cleanup content of function attributes. More...
|
|
int | usbg_set_function_attrs (usbg_function *f, void *f_attrs) |
| Set attributes of given function. More...
|
|
usbg_gadget * | usbg_get_first_gadget (usbg_state *s) |
| Get first gadget in gadget list. More...
|
|
usbg_function * | usbg_get_first_function (usbg_gadget *g) |
| Get first function in function list. More...
|
|
usbg_config * | usbg_get_first_config (usbg_gadget *g) |
| Get first config in config list. More...
|
|
usbg_binding * | usbg_get_first_binding (usbg_config *c) |
| Get first binding in binding list. More...
|
|
usbg_udc * | usbg_get_first_udc (usbg_state *s) |
| Get first udc in udc list. More...
|
|
usbg_gadget * | usbg_get_next_gadget (usbg_gadget *g) |
| Get the next gadget on a list. More...
|
|
usbg_function * | usbg_get_next_function (usbg_function *f) |
| Get the next function on a list. More...
|
|
usbg_config * | usbg_get_next_config (usbg_config *c) |
| Get the next config on a list. More...
|
|
usbg_binding * | usbg_get_next_binding (usbg_binding *b) |
| Get the next binding on a list. More...
|
|
usbg_udc * | usbg_get_next_udc (usbg_udc *u) |
| Get the next udc on a list. More...
|
|