Main Page | Modules | Data Structures | File List | Data Fields | Related Pages

Linux 2.6 support
[HAL daemon]

Device detection and monitoring code for version 2.6 of Linux. More...


Modules

group Block class
 Block class.

group I2C adapter class
 I2C adapter class.

group Input class
 Input class.

group Networking class
 Networking class.

group SCSI class
 SCSI class.

group V4L adapter class
 V4L class.

group Utility functions
 Utility functions.

group I2C
 I2C.

group IDE
 IDE.

group IEEE1394
 IEEE1394.

group PCI
 PCI.

group USB
 USB.


Defines

#define HOTPLUG_INPUT_MAX   128
 Maximum length of string parameter in hotplug input events.


Functions

void visit_class_device (const char *path, dbus_bool_t visit_children)
 Visitor function for any class device.

void visit_class (const char *class_name, dbus_bool_t visit_children)
 Visit all devices of a given class.

void visit_device (const char *path, dbus_bool_t visit_children)
 Visitor function for any device.

void osspec_init (DBusConnection *dbus_connection)
 Initialize the OS specific parts of the daemon.

void osspec_probe ()
 Probe all hardware present in the system and synchronize with the device list.

DBusHandlerResult handle_hotplug (DBusConnection *connection, DBusMessage *message)
 Handle a org.freedesktop.Hal.HotplugEvent message.

void handle_udev_node_created_found_device (HalDevice *d, void *data1, void *data2)
 Callback when the block device is found or if there is none..

DBusHandlerResult handle_udev_node_created (DBusConnection *connection, DBusMessage *message)
 Handle a org.freedesktop.Hal.HotplugEvent message.

DBusHandlerResult osspec_filter_function (DBusConnection *connection, DBusMessage *message, void *user_data)
 Message handler for method invocations.


Variables

char sysfs_mount_path [SYSFS_PATH_MAX]
 Mount path for sysfs.

dbus_bool_t is_probing
 This is set to #TRUE if we are probing and #FALSE otherwise.


Detailed Description

Device detection and monitoring code for version 2.6 of Linux.


Function Documentation

DBusHandlerResult handle_hotplug DBusConnection *  connection,
DBusMessage *  message
[static]
 

Handle a org.freedesktop.Hal.HotplugEvent message.

This message origins from the hal.hotplug program, tools/linux/hal_hotplug.c, and is basically just a D-BUS-ification of the hotplug event.

Parameters:
connection D-BUS connection
message Message
Returns:
What to do with the message

Todo:
Report error

FIXME when kernel 2.6 got input devices in sysfs this terrible hack can be removed

Definition at line 378 of file linux_osspec.c.

References ds_device_destroy(), ds_device_find_by_key_value_string(), ds_property_exists(), ds_property_get_bool(), ds_property_remove(), ds_property_set_bool(), HalDevice, HOTPLUG_INPUT_MAX, linux_class_block_removed(), linux_class_input_handle_hotplug_add(), parse_dec(), parse_hex(), sysfs_mount_path, HalDevice_s::udi, visit_class_device(), and visit_device().

Referenced by osspec_filter_function().

DBusHandlerResult handle_udev_node_created DBusConnection *  connection,
DBusMessage *  message
[static]
 

Handle a org.freedesktop.Hal.HotplugEvent message.

This message origins from the hal.hotplug program, tools/linux/hal_hotplug.c, and is basically just a D-BUS-ification of the hotplug event.

Parameters:
connection D-BUS connection
message Message
Returns:
What to do with the message

Definition at line 561 of file linux_osspec.c.

References ds_device_async_find_by_key_value_string(), HAL_LINUX_HOTPLUG_TIMEOUT, handle_udev_node_created_found_device(), and sysfs_mount_path.

Referenced by osspec_filter_function().

void handle_udev_node_created_found_device HalDevice d,
void *  data1,
void *  data2
[static]
 

Callback when the block device is found or if there is none..

Parameters:
d Async Return value from the find call
data1 User data, in this case the filename
data2 User data

Definition at line 604 of file linux_osspec.c.

References ds_property_set_string(), HalDevice, linux_class_block_check_if_ready_to_add(), and HalDevice_s::udi.

Referenced by handle_udev_node_created().

DBusHandlerResult osspec_filter_function DBusConnection *  connection,
DBusMessage *  message,
void *  user_data
 

Message handler for method invocations.

All invocations on any object or interface is routed through this function.

Parameters:
connection D-BUS connection
message Message
user_data User data
Returns:
What to do with the message

Definition at line 631 of file linux_osspec.c.

References handle_hotplug(), and handle_udev_node_created().

Referenced by filter_function().

void osspec_init DBusConnection *  dbus_connection  ) 
 

Initialize the OS specific parts of the daemon.

Parameters:
dbus_connection The D-BUS connection the HAL daemon got,

Definition at line 267 of file linux_osspec.c.

References DIE, linux_class_block_init(), linux_class_net_init(), linux_class_scsi_init(), linux_class_v4l_init(), linux_ide_init(), linux_pci_init(), linux_usb_init(), and sysfs_mount_path.

Referenced by main().

void visit_class const char *  class_name,
dbus_bool_t  visit_children
[static]
 

Visit all devices of a given class.

Parameters:
class_name Name of class, e.g. scsi_host or block
visit_children If children of this device should be visited set this to #TRUE. For device-probing, this should set be set to true so as to visit all devices. For hotplug events, it should be set to #FALSE as each sysfs object will generate a separate event.

Definition at line 141 of file linux_osspec.c.

References visit_class_device().

Referenced by osspec_probe().

void visit_class_device const char *  path,
dbus_bool_t  visit_children
[static]
 

Visitor function for any class device.

This function determines the class of the device and call the appropriate visit_class_device_<classtype> function if matched.

Parameters:
path Sysfs-path for class device, e.g. /sys/class/scsi_host/host7
visit_children If children of this device should be visited set this to #TRUE. For device-probing, this should set be set to true so as to visit all devices. For hotplug events, it should be set to #FALSE as each sysfs object will generate a separate event.

Definition at line 86 of file linux_osspec.c.

References DIE, visit_class_device_block(), visit_class_device_i2c_adapter(), visit_class_device_net(), visit_class_device_scsi_device(), visit_class_device_scsi_host(), and visit_class_device_v4l().

Referenced by handle_hotplug(), and visit_class().

void visit_device const char *  path,
dbus_bool_t  visit_children
[static]
 

Visitor function for any device.

This function determines the bus-type of the device and call the appropriate visit_device_<bustype> function if matched.

Parameters:
path Sysfs-path for device
visit_children If children of this device should be visited set this to #TRUE. For device-probing, this should set be set to true so as to visit all devices. For hotplug events, it should be set to #FALSE as each sysfs object will generate a separate event.

Todo:
This is a hack; is there such a thing as an ide_host?

Definition at line 176 of file linux_osspec.c.

References DIE, visit_class_device_i2c_adapter(), visit_device_i2c(), visit_device_ide(), visit_device_ide_host(), visit_device_pci(), and visit_device_usb().

Referenced by handle_hotplug(), and osspec_probe().


Generated on Thu Mar 11 21:32:27 2004 for HAL by doxygen 1.3.6-20040222