Data Structures | |
struct | usb_proc_info_s |
Key information about USB devices from /proc that is not available in sysfs. More... | |
Defines | |
#define | USB_IDS_MAX_LINE_LEN 512 |
Maximum length of lines in usb.ids. | |
Typedefs | |
typedef usb_proc_info_s | usb_proc_info |
Key information about USB devices from /proc that is not available in sysfs. | |
Functions | |
void | usb_ids_line_iter_init () |
Initialize the usb.ids line iterator to the beginning of the file. | |
char * | usb_ids_line_iter_get_line (unsigned int *line_len) |
Get the next line from usb.ids. | |
dbus_bool_t | usb_ids_line_iter_has_more () |
See if there are more lines to process in usb.ids. | |
void | usb_ids_find (int vendor_id, int product_id, char **vendor_name, char **product_name) |
Find the names for a USB device. | |
dbus_bool_t | usb_ids_load (const char *path) |
Load the USB database used for mapping vendor, product, subsys_vendor and subsys_product numbers into names. | |
dbus_bool_t | usb_ids_free () |
Free resources used by to store the USB database. | |
usb_proc_info * | usb_proc_find_virtual_hub (int bus_number) |
Find the USB virtual root hub device for a USB bus. | |
usb_proc_info * | usb_proc_find_virtual_hub_child (int bus_number, int port_number) |
Find a child of a USB virtual root hub device for a USB bus. | |
usb_proc_info * | usb_proc_find_on_hub (int bus_number, int port_number, int parent_device_number) |
Find a child of a given hub device given a bus and port number. | |
void | usb_proc_handle_topology (usb_proc_info *info, char *s) |
Parse the topology field. | |
void | usb_proc_handle_device_info (usb_proc_info *info, char *s) |
Parse the device descriptor field. | |
void | usb_proc_device_done (usb_proc_info *info) |
Called when an entry from /proc/bus/usb/devices have been parsed. | |
void | usb_proc_parse_line (char *s) |
Parse a line from /proc/bus/usb/devices. | |
void | usb_proc_parse () |
Parse /proc/bus/usb/devices. | |
void | usb_add_caps_from_class (HalDevice *d, int if_class, int if_sub_class, int if_proto) |
Set capabilities from interface and/or device class. | |
void | usb_device_init () |
Init function for USB handling. | |
void | usb_device_shutdown () |
Shutdown function for USB handling. | |
dbus_bool_t | usb_device_accept (BusDeviceHandler *self, const char *path, struct sysfs_device *device, dbus_bool_t is_probing) |
Specialised accept function since both USB devices and USB interfaces share the same bus name. | |
char * | usb_device_compute_udi (HalDevice *d, int append_num) |
void | usb_merge_info_from_proc (HalDevice *d) |
void | usb_device_pre_process (BusDeviceHandler *self, HalDevice *d, const char *sysfs_path, struct sysfs_device *device) |
Variables | |
char * | usb_ids = NULL |
Pointer to where the usb.ids file is loaded. | |
unsigned int | usb_ids_len |
Length of data store at at usb_ids. | |
unsigned int | usb_ids_iter_pos |
Iterator position into usb_ids. | |
usb_proc_info * | usb_proc_head = NULL |
First element in usb proc linked list. | |
usb_proc_info * | usb_proc_cur_info = NULL |
Unique device id of the device we are working on. | |
BusDeviceHandler | usb_bus_handler |
Method specialisations for bustype usb. |
|
Set capabilities from interface and/or device class.
Definition at line 524 of file usb_bus_device.c. References hal_device_add_capability(). |
|
Specialised accept function since both USB devices and USB interfaces share the same bus name.
Definition at line 579 of file usb_bus_device.c. |
|
Find the names for a USB device. The pointers returned are only valid until the next invocation of this function.
Definition at line 122 of file usb_bus_device.c. References usb_ids_line_iter_get_line(), usb_ids_line_iter_has_more(), usb_ids_line_iter_init(), and USB_IDS_MAX_LINE_LEN. |
|
Free resources used by to store the USB database.
Definition at line 259 of file usb_bus_device.c. References usb_ids. Referenced by usb_device_shutdown(). |
|
Get the next line from usb.ids.
Definition at line 80 of file usb_bus_device.c. References usb_ids, usb_ids_iter_pos, usb_ids_len, and USB_IDS_MAX_LINE_LEN. Referenced by usb_ids_find(). |
|
See if there are more lines to process in usb.ids.
Definition at line 106 of file usb_bus_device.c. References usb_ids_iter_pos, and usb_ids_len. Referenced by usb_ids_find(). |
|
Load the USB database used for mapping vendor, product, subsys_vendor and subsys_product numbers into names.
Definition at line 220 of file usb_bus_device.c. References usb_ids, and usb_ids_len. Referenced by usb_device_init(). |
|
Called when an entry from /proc/bus/usb/devices have been parsed.
Definition at line 395 of file usb_bus_device.c. References usb_proc_info_s::next, usb_proc_head, and usb_proc_info. Referenced by usb_proc_parse(), and usb_proc_parse_line(). |
|
Find a child of a given hub device given a bus and port number.
Definition at line 343 of file usb_bus_device.c. References usb_proc_info_s::next, usb_proc_info_s::t_bus, usb_proc_info_s::t_parent, usb_proc_info_s::t_port, usb_proc_head, and usb_proc_info. |
|
Find the USB virtual root hub device for a USB bus.
Definition at line 301 of file usb_bus_device.c. References usb_proc_info_s::next, usb_proc_info_s::t_bus, usb_proc_info_s::t_level, usb_proc_head, and usb_proc_info. |
|
Find a child of a USB virtual root hub device for a USB bus.
Definition at line 321 of file usb_bus_device.c. References usb_proc_info_s::next, usb_proc_info_s::t_bus, usb_proc_info_s::t_level, usb_proc_info_s::t_port, usb_proc_head, and usb_proc_info. |
|
Parse the device descriptor field.
Definition at line 384 of file usb_bus_device.c. References usb_proc_info_s::d_version_bcd, find_bcd2(), and usb_proc_info. Referenced by usb_proc_parse_line(). |
|
Parse the topology field.
Definition at line 365 of file usb_bus_device.c. References find_bcd2(), find_num(), usb_proc_info_s::t_bus, usb_proc_info_s::t_count, usb_proc_info_s::t_device, usb_proc_info_s::t_level, usb_proc_info_s::t_max_children, usb_proc_info_s::t_parent, usb_proc_info_s::t_port, usb_proc_info_s::t_speed_bcd, and usb_proc_info. Referenced by usb_proc_parse_line(). |
|
Parse a line from /proc/bus/usb/devices.
Definition at line 408 of file usb_bus_device.c. References DIE, usb_proc_cur_info, usb_proc_device_done(), usb_proc_handle_device_info(), usb_proc_handle_topology(), and usb_proc_info. Referenced by usb_proc_parse(). |
|
Initial value: { usb_device_init, bus_device_detection_done, usb_device_shutdown, bus_device_tick, usb_device_accept, bus_device_visit, bus_device_removed, usb_device_compute_udi, usb_device_pre_process, bus_device_got_udi, "usb", "usb" }
Definition at line 942 of file usb_bus_device.c. |