Data Structures | |
struct | driver_entry_s |
Defines | |
#define | HAL_LINUX_HOTPLUG_TIMEOUT 30000 |
Timeout in milliseconds for waiting for a sysfs device to appear as a HAL device. | |
Typedefs | |
typedef char *(* | ComputeFDI )(HalDevice *d, int append_num) |
Type for function to compute the UDI (unique device id) for a given HAL device. | |
Functions | |
double | parse_double (const char *str) |
Parse a double represented as a decimal number (base 10) in a string. | |
dbus_int32_t | parse_dec (const char *str) |
Parse an integer represented as a decimal number (base 10) in a string. | |
dbus_int32_t | parse_hex (const char *str) |
Parse an integer represented as a hexa-decimal number (base 16) in a string. | |
long int | find_num (char *pre, char *s, int base) |
Find an integer appearing right after a substring in a string. | |
double | find_double (char *pre, char *s) |
Find a floating point number appearing right after a substring in a string and return it as a double precision IEEE754 floating point number. | |
int | find_bcd2 (char *pre, char *s) |
Find a floating point number appearing right after a substring in a string and return it as a BCD encoded number with 2 digits of precision. | |
char * | find_string (char *pre, char *s) |
Find a string appearing right after a substring in a string and return it. | |
char * | read_single_line (char *filename_format,...) |
Read the first line of a file and return it. | |
const char * | get_last_element (const char *s) |
Given a path, /foo/bar/bat/foobar, return the last element, e.g. | |
char * | rename_and_merge (HalDevice *d, ComputeFDI naming_func, const char *namespace) |
This function takes a temporary device and renames it to a proper UDI using the supplied bus-specific #naming_func. | |
char * | get_parent_sysfs_path (const char *path) |
Given a sysfs-path for a device, this functions finds the sysfs path representing the parent of the given device by truncation. | |
void | find_and_set_physical_device (HalDevice *device) |
Set the physical device for a device. | |
void | drivers_add_entry (const char *driver_name, const char *device_path) |
Add an entry to the bandaid driver database. | |
const char * | drivers_lookup (const char *device_path) |
Given a device path under /sys/devices, lookup the driver. | |
void | drivers_collect (const char *bus_name) |
Collect all drivers being used on a bus. | |
Variables | |
driver_entry_s * | drivers_table_head = NULL |
Head of linked list of #driver_entry_s structs. | |
dbus_bool_t | is_probing |
This is set to #TRUE if we are probing and #FALSE otherwise. | |
char | sysfs_mount_path [SYSFS_PATH_MAX] |
Mount path for sysfs. |
|
Timeout in milliseconds for waiting for a sysfs device to appear as a HAL device. Usually used when hotplugging usb-storage since many HAL devices (usb, usbif, scsi_host, scsi_device, block*2) appear and the linux kernel gives us these add events out of order. My old PIII 650Mhz, 128MB laptop with GNOME 2.4 is slow when attaching a whole subtree of USB devices, so a value of 30 seconds is actually reasonable. It's important to note that it's not HAL that is taking the lions share of the resources; rather it's the shell-scripts in linux-hotplug... Definition at line 88 of file linux_common.h. Referenced by handle_udev_node_created(), process_input_proc_info(), visit_class_device_block(), visit_class_device_i2c_adapter(), visit_class_device_net(), visit_class_device_scsi_device(), visit_class_device_scsi_host(), visit_class_device_v4l(), visit_device_i2c(), visit_device_ide(), visit_device_ide_host(), visit_device_ieee1394(), visit_device_pci(), visit_device_usb(), and visit_device_usb_interface(). |
|
Type for function to compute the UDI (unique device id) for a given HAL device.
Definition at line 62 of file linux_common.h. Referenced by rename_and_merge(). |
|
Add an entry to the bandaid driver database.
Definition at line 557 of file linux_common.c. References DIE, and drivers_table_head. Referenced by drivers_collect(). |
|
Collect all drivers being used on a bus. This is only bandaid until sysutils fill in the driver_name in sysfs_device.
Definition at line 594 of file linux_common.c. References DIE, drivers_add_entry(), and sysfs_mount_path. Referenced by linux_i2c_init(), linux_ieee1394_init(), linux_pci_init(), and linux_usb_init(). |
|
Given a device path under /sys/devices, lookup the driver. You need to have called drivers_collect() on the bus-type before hand.
Definition at line 577 of file linux_common.c. References drivers_table_head. Referenced by visit_device_i2c(), visit_device_ieee1394(), visit_device_pci(), visit_device_usb(), and visit_device_usb_interface(). |
|
Set the physical device for a device. This function visits all parent devices and sets the property info.physical_device to the first parent device that doesn't have the info.physical_device property set.
Definition at line 505 of file linux_common.c. References ds_device_find(), ds_property_exists(), ds_property_get_string(), ds_property_set_string(), HalDevice, and HalDevice_s::udi. Referenced by visit_class_device_block_got_parent(), visit_class_device_i2c_adapter_got_parent(), visit_class_device_scsi_device_got_parent(), visit_class_device_scsi_host_got_parent(), visit_device_ide_got_parent(), and visit_device_ide_host_got_parent(). |
|
Find a floating point number appearing right after a substring in a string and return it as a BCD encoded number with 2 digits of precision. The result is undefined if the number isn't properly formatted or the substring didn't exist in the given string.
Definition at line 167 of file linux_common.c. References find_string(). Referenced by usb_proc_handle_device_info(), and usb_proc_handle_topology(). |
|
Find a floating point number appearing right after a substring in a string and return it as a double precision IEEE754 floating point number. The result is undefined if the number isn't properly formatted or the substring didn't exist in the given string.
Definition at line 141 of file linux_common.c. References DIE. |
|
Find an integer appearing right after a substring in a string. The result is LONG_MAX if the number isn't properly formatted or the substring didn't exist in the given string.
Definition at line 108 of file linux_common.c. Referenced by input_proc_handle_bits(), input_proc_handle_interface(), and usb_proc_handle_topology(). |
|
Find a string appearing right after a substring in a string and return it. The string return is statically allocated and is only valid until the next invocation of this function. The result is undefined if the substring didn't exist in the given string.
Definition at line 234 of file linux_common.c. Referenced by find_bcd2(), input_proc_handle_handlers(), input_proc_handle_name(), and input_proc_handle_phys(). |
|
Given a path, /foo/bar/bat/foobar, return the last element, e.g. foobar.
Definition at line 321 of file linux_common.c. Referenced by visit_class_device_block_got_parent(), visit_class_device_i2c_adapter(), visit_class_device_scsi_device(), visit_class_device_scsi_host(), and visit_class_device_v4l(). |
|
Given a sysfs-path for a device, this functions finds the sysfs path representing the parent of the given device by truncation.
Definition at line 477 of file linux_common.c. References DIE. Referenced by visit_class_device_block(), visit_class_device_i2c_adapter(), visit_class_device_scsi_device(), visit_class_device_scsi_host(), visit_device_i2c(), visit_device_ide(), visit_device_ide_host(), visit_device_ieee1394(), visit_device_pci(), visit_device_usb(), and visit_device_usb_interface(). |
|
Parse an integer represented as a decimal number (base 10) in a string.
Definition at line 74 of file linux_common.c. Referenced by handle_hotplug(), visit_class_device_block(), visit_class_device_net(), visit_device_usb(), and visit_device_usb_interface(). |
|
Parse a double represented as a decimal number (base 10) in a string.
Definition at line 62 of file linux_common.c. |
|
Parse an integer represented as a hexa-decimal number (base 16) in a string.
Definition at line 89 of file linux_common.c. Referenced by handle_hotplug(), visit_device_pci(), and visit_device_usb(). |
|
Read the first line of a file and return it.
Definition at line 279 of file linux_common.c. Referenced by visit_class_device_block_got_parent(). |
|
This function takes a temporary device and renames it to a proper UDI using the supplied bus-specific #naming_func. After renaming the HAL daemon will locate a .fdi file and possibly merge information into the object. This function handles the fact that identical devices (for instance two completely identical USB mice) gets their own unique device id by appending a trailing number after it. You cannot rely on the HalDevice object you gave this function, since information may have been merged into an existing HalDevice object. Use ds_device_find() to get the corresponding HalDevice object. The device _is not_ added to the GDL. You need to call ds_gdl_add() explicitly to do this.
Not a match, must be case a). Choose next computed_udi and try again! Definition at line 363 of file linux_common.c. References ComputeFDI, di_search_and_merge(), ds_device_destroy(), ds_device_find(), ds_device_matches(), ds_device_merge(), ds_device_set_udi(), ds_print(), ds_property_exists(), ds_property_get_bool(), ds_property_set_bool(), ds_property_set_string(), HalDevice, and HalDevice_s::udi. Referenced by visit_class_device_block_got_parent(), visit_class_device_i2c_adapter_got_parent(), visit_class_device_scsi_device_got_parent(), visit_class_device_scsi_host_got_parent(), visit_device_i2c_got_parent(), visit_device_ide_got_parent(), visit_device_ide_host_got_parent(), visit_device_ieee1394_got_parent(), visit_device_pci_got_parent(), visit_device_usb_got_parent(), and visit_device_usbif_got_parent(). |