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. | |
char * | usbif_compute_udi (HalDevice *d, int append_num) |
This function will compute the device uid based on other properties of the device. | |
char * | usb_compute_udi (HalDevice *d, int append_num) |
This function will compute the device uid based on other properties of the device. | |
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 | visit_device_usbif_got_parent (HalDevice *parent, void *data1, void *data2) |
Callback when the parent is found or if there is no parent.. | |
void | visit_device_usb_interface (const char *path, struct sysfs_device *device) |
Visitor function for interfaces on a USB device. | |
void | visit_device_usb_got_parent (HalDevice *parent, void *data1, void *data2) |
Callback when the parent is found or if there is no parent.. | |
void | visit_device_usb (const char *path, struct sysfs_device *device) |
Visitor function for USB device. | |
void | linux_usb_init () |
Init function for USB handling. | |
void | linux_usb_detection_done () |
This function is called when all device detection on startup is done in order to perform optional batch processing on devices. | |
void | linux_usb_shutdown () |
Shutdown function for USB handling. | |
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. |
|
Set capabilities from interface and/or device class. This is a function from hell, maybe some searchable data-structure would be better...
Definition at line 605 of file linux_usb.c. References ds_add_capability(), ds_property_set_string(), and HalDevice. Referenced by visit_device_usb(), and visit_device_usbif_got_parent(). |
|
This function will compute the device uid based on other properties of the device. Specifically, the following properties are required:
Other properties may also be used, specifically the usb.SerialNumber is used if available. Requirements for uid:
Definition at line 570 of file linux_usb.c. References ds_property_exists(), ds_property_get_int(), ds_property_get_string(), and HalDevice. Referenced by visit_device_usb_got_parent(). |
|
Find the names for a USB device. The pointers returned are only valid until the next invocation of this function.
Definition at line 117 of file linux_usb.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. Referenced by visit_device_usb(). |
|
Free resources used by to store the USB database.
Definition at line 261 of file linux_usb.c. References usb_ids. Referenced by linux_usb_shutdown(). |
|
Get the next line from usb.ids.
Definition at line 75 of file linux_usb.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 102 of file linux_usb.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 221 of file linux_usb.c. References usb_ids, and usb_ids_len. Referenced by linux_usb_init(). |
|
Called when an entry from /proc/bus/usb/devices have been parsed.
Definition at line 396 of file linux_usb.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 346 of file linux_usb.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. Referenced by visit_device_usb_got_parent(). |
|
Find the USB virtual root hub device for a USB bus.
Definition at line 303 of file linux_usb.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. Referenced by visit_device_usb_got_parent(). |
|
Find a child of a USB virtual root hub device for a USB bus.
Definition at line 323 of file linux_usb.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. Referenced by visit_device_usb_got_parent(). |
|
Parse the device descriptor field.
Definition at line 386 of file linux_usb.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 368 of file linux_usb.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 linux_usb.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(). |
|
This function will compute the device uid based on other properties of the device. For USB interfaces it basically is the physical USB device UDI appended with the interface number
Definition at line 523 of file linux_usb.c. References ds_property_get_int(), ds_property_get_string(), and HalDevice. Referenced by visit_device_usbif_got_parent(). |
|
Visitor function for USB device. This function parses the attributes present and creates a new HAL device based on this information.
Definition at line 835 of file linux_usb.c. References drivers_lookup(), ds_device_async_find_by_key_value_string(), ds_device_new(), ds_property_get_int(), ds_property_set_bool(), ds_property_set_int(), ds_property_set_string(), get_parent_sysfs_path(), HAL_LINUX_HOTPLUG_TIMEOUT, HalDevice, is_probing, parse_dec(), parse_hex(), usb_add_caps_from_class(), usb_ids_find(), visit_device_usb_got_parent(), and visit_device_usb_interface(). Referenced by visit_device(). |
|
Callback when the parent is found or if there is no parent.. This is where we get added to the GDL..
Definition at line 1051 of file linux_usb.c. References usb_proc_info_s::d_version_bcd, ds_device_find(), ds_gdl_add(), ds_property_get_int(), ds_property_get_string(), ds_property_set_int(), ds_property_set_string(), HalDevice, is_probing, rename_and_merge(), usb_proc_info_s::t_device, usb_proc_info_s::t_level, usb_proc_info_s::t_max_children, usb_proc_info_s::t_speed_bcd, HalDevice_s::udi, usb_compute_udi(), usb_proc_find_on_hub(), usb_proc_find_virtual_hub(), usb_proc_find_virtual_hub_child(), usb_proc_info, and usb_proc_parse(). Referenced by visit_device_usb(). |
|
Visitor function for interfaces on a USB device.
Definition at line 691 of file linux_usb.c. References drivers_lookup(), ds_device_async_find_by_key_value_string(), ds_device_new(), ds_property_set_bool(), ds_property_set_int(), ds_property_set_string(), get_parent_sysfs_path(), HAL_LINUX_HOTPLUG_TIMEOUT, HalDevice, is_probing, parse_dec(), and visit_device_usbif_got_parent(). Referenced by visit_device_usb(). |
|
Callback when the parent is found or if there is no parent.. This is where we get added to the GDL..
Definition at line 778 of file linux_usb.c. References ds_device_destroy(), ds_device_find(), ds_gdl_add(), ds_property_get_int(), ds_property_set_int(), ds_property_set_string(), HalDevice, rename_and_merge(), HalDevice_s::udi, usb_add_caps_from_class(), and usbif_compute_udi(). Referenced by visit_device_usb_interface(). |