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. | |
const char * | udevinfo_path (void) |
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. | |
dbus_bool_t | class_device_get_major_minor (const char *sysfs_path, int *major, int *minor) |
Utility function to retrieve major and minor number for a class device. | |
dbus_bool_t | class_device_get_device_file (const char *sysfs_path, char *dev_file, int dev_file_length) |
Get the name of the special device file given the sysfs path for a class 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 93 of file common.h. Referenced by bus_device_visit(), class_device_got_parent_device(), class_device_got_sysdevice(), class_device_visit(), and handle_device_event(). |
|
Type for function to compute the UDI (unique device id) for a given HAL device.
Definition at line 64 of file common.h. Referenced by rename_and_merge(). |
|
Get the name of the special device file given the sysfs path for a class device.
Definition at line 614 of file common.c. References sysfs_mount_path. Referenced by class_device_visit(). |
|
Utility function to retrieve major and minor number for a class device. The class device must have a dev file in the #sysfs_path directory and it must be of the form d:d.
Definition at line 585 of file common.c. Referenced by block_class_pre_process(). |
|
Add an entry to the bandaid driver database.
Definition at line 692 of file 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 730 of file common.c. References DIE, drivers_add_entry(), and sysfs_mount_path. Referenced by pci_device_init(), and usb_device_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 713 of file common.c. References drivers_table_head. |
|
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 537 of file common.c. Referenced by block_class_pre_process(). |
|
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 174 of file 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 147 of file 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 114 of file common.c. Referenced by 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 240 of file common.c. Referenced by find_bcd2(). |
|
Given a path, /foo/bar/bat/foobar, return the last element, e.g. foobar.
Definition at line 326 of file common.c. Referenced by block_class_pre_process(), and input_class_get_device_file_target(). |
|
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 509 of file common.c. References DIE. Referenced by bus_device_visit(), and class_device_visit(). |
|
Parse an integer represented as a decimal number (base 10) in a string.
Definition at line 78 of file common.c. Referenced by block_class_pre_process(), and net_class_pre_process(). |
|
Parse a double represented as a decimal number (base 10) in a string.
|
|
Parse an integer represented as a hexa-decimal number (base 16) in a string.
|
|
Read the first line of a file and return it.
Definition at line 285 of file common.c. Referenced by block_class_pre_process(). |
|
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 392 of file common.c. References ComputeFDI, di_search_and_merge(), and hal_device_print(). Referenced by bus_device_got_parent(). |