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

Linux 2.6 support
[HAL daemon]

Device detection and monitoring code using Linux 2.6 + udev. More...


Modules

group Block device class
 Block device class.

group Generic methods for bus devices
 Generic methods for bus devices.

group Generic methods for class devices
 Generic methods for class devices.

group Utility functions
 Utility functions.

group IDE
 IDE.

group IDE Host
 IDE Host.

group Input class
 Input class.

group Network class
 Network class.

group PCI
 PCI.

group PCMCIA Socket class devices
 PCMCIA Socket class devices.

group Printer class
 Printer class.

group SCSI generic class
 SCSI generic class.

group USB
 USB.

group USB interfaces
 USB interfaces.


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.

gboolean osspec_timer_handler (gpointer data)
 Timeout handler for polling.

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.

void remove_device (const char *path, const char *subsystem)
void remove_class_device (const char *path, const char *subsystem)
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..

void udev_node_created_cb (HalDeviceStore *store, HalDevice *device, gpointer user_data)
DBusHandlerResult handle_device_event (DBusConnection *connection, DBusMessage *message)
 Handle a org.freedesktop.Hal.DeviceEvent 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 using Linux 2.6 + udev.


Function Documentation

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

Handle a org.freedesktop.Hal.DeviceEvent message.

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

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

Definition at line 548 of file osspec.c.

References HAL_LINUX_HOTPLUG_TIMEOUT, and sysfs_mount_path.

Referenced by osspec_filter_function().

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

Definition at line 447 of file osspec.c.

References sysfs_mount_path, visit_class_device(), and visit_device().

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 596 of file osspec.c.

References ClassDeviceHandler_s::sysfs_class_name, and ClassDeviceHandler_s::udev_event.

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 634 of file osspec.c.

References handle_device_event(), and handle_hotplug().

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 273 of file osspec.c.

References DIE, ClassDeviceHandler_s::init, BusDeviceHandler_s::init, osspec_timer_handler(), and sysfs_mount_path.

Referenced by main().

void osspec_probe  ) 
 

Probe all hardware present in the system and synchronize with the device list.

Todo:
FIXME how to select TRUE/FALSE above (see below)

Definition at line 317 of file osspec.c.

References ClassDeviceHandler_s::detection_done, BusDeviceHandler_s::detection_done, DIE, is_probing, ClassDeviceHandler_s::sysfs_class_name, sysfs_mount_path, visit_class(), and visit_device().

Referenced by main().

gboolean osspec_timer_handler gpointer  data  )  [static]
 

Timeout handler for polling.

Parameters:
data User data when setting up timer
Returns:
TRUE iff timer should be kept

Definition at line 254 of file osspec.c.

References ClassDeviceHandler_s::tick, and BusDeviceHandler_s::tick.

Referenced by osspec_init().

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 175 of file 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 126 of file osspec.c.

References ClassDeviceHandler_s::accept, is_probing, and ClassDeviceHandler_s::visit.

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.

Definition at line 210 of file osspec.c.

References BusDeviceHandler_s::accept, is_probing, and BusDeviceHandler_s::visit.

Referenced by handle_hotplug(), and osspec_probe().


Generated on Sat Apr 24 19:57:50 2004 for HAL by doxygen 1.3.6-20040222