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

Generic methods for class devices
[Linux 2.6 support]

Generic methods for class devices. More...

Data Structures

struct  AsyncInfo

Functions

void class_device_got_device_file (HalDevice *d, gpointer user_data, gboolean prop_exists)
void class_device_final (ClassDeviceHandler *self, HalDevice *d)
dbus_bool_t class_device_accept (ClassDeviceHandler *self, const char *path, struct sysfs_class_device *class_device, dbus_bool_t is_probing)
 Generic accept function that accepts the device if and only if the class name from sysfs equals the class name in the class.

void class_device_visit (ClassDeviceHandler *self, const char *path, struct sysfs_class_device *class_device, dbus_bool_t is_probing)
 Generic visitor method for class devices.

void class_device_removed (ClassDeviceHandler *self, const char *sysfs_path, HalDevice *d)
 Called when the class device instance have been removed.

void class_device_udev_event (ClassDeviceHandler *self, HalDevice *d, char *dev_file)
 Called when a device file (e.g.

void class_device_got_parent_device (HalDeviceStore *store, HalDevice *parent, gpointer user_data)
 Callback when the parent device is found or if timeout for search occurs.

void class_device_got_sysdevice (HalDeviceStore *store, HalDevice *sysdevice, gpointer user_data)
 Callback when the sysdevice is found or if timeout for search occurs.

void class_device_init (ClassDeviceHandler *self)
 Init function for block device handling.

void class_device_detection_done (ClassDeviceHandler *self)
 This function is called when all device detection on startup is done in order to perform optional batch processing on devices.

void class_device_shutdown (ClassDeviceHandler *self)
 Shutdown function for block device handling.

void class_device_pre_process (ClassDeviceHandler *self, HalDevice *d, const char *sysfs_path, struct sysfs_class_device *class_device)
 This method is called just before the device is either merged onto the sysdevice or added to the GDL (cf.

void class_device_post_merge (ClassDeviceHandler *self, HalDevice *d)
 Called when an inferior HalDevice is merged.

void class_device_tick (ClassDeviceHandler *self)
 Called regulary (every two seconds) for polling / monitoring on devices of this class.

void class_device_get_device_file_target (ClassDeviceHandler *self, HalDevice *d, const char *sysfs_path, struct sysfs_class_device *class_device, char *dev_file_prop, int dev_file_prop_len)
 Get the name of that the property that the device file should be put in. This generic implementation just uses sysfs_class_name appended with '.device'.

void class_device_got_udi (ClassDeviceHandler *self, HalDevice *d, const char *udi)

Detailed Description

Generic methods for class devices.


Function Documentation

dbus_bool_t class_device_accept ClassDeviceHandler self,
const char *  path,
struct sysfs_class_device *  class_device,
dbus_bool_t  is_probing
 

Generic accept function that accepts the device if and only if the class name from sysfs equals the class name in the class.

Parameters:
self Pointer to class members
path Sysfs-path for device
class_device libsysfs object for class device
is_probing Set to TRUE only on initial detection

Definition at line 76 of file class_device.c.

References ClassDeviceHandler_s::sysfs_class_name.

void class_device_detection_done ClassDeviceHandler self  ) 
 

This function is called when all device detection on startup is done in order to perform optional batch processing on devices.

Does nothing.

Definition at line 458 of file class_device.c.

void class_device_get_device_file_target ClassDeviceHandler self,
HalDevice *  d,
const char *  sysfs_path,
struct sysfs_class_device *  class_device,
char *  dev_file_prop,
int  dev_file_prop_len
 

Get the name of that the property that the device file should be put in. This generic implementation just uses sysfs_class_name appended with '.device'.

Parameters:
self Pointer to class members
d The HalDevice object of the instance of this device class
sysfs_path The path in sysfs (including mount point) of the class device in sysfs
class_device Libsysfs object representing class device instance
dev_file_prop Device file property name (out)
dev_file_prop_len Maximum length of string

Definition at line 534 of file class_device.c.

References ClassDeviceHandler_s::hal_class_name.

void class_device_got_parent_device HalDeviceStore *  store,
HalDevice *  parent,
gpointer  user_data
 

Callback when the parent device is found or if timeout for search occurs.

(only applicable if self->merge_or_add==FALSE)

Parameters:
sysdevice Async Return value from the find call or NULL if timeout
data1 User data (or own device in this case)
data2 User data

Definition at line 249 of file class_device.c.

References HAL_LINUX_HOTPLUG_TIMEOUT, is_probing, and ClassDeviceHandler_s::require_device_file.

Referenced by class_device_visit().

void class_device_got_sysdevice HalDeviceStore *  store,
HalDevice *  sysdevice,
gpointer  user_data
 

Callback when the sysdevice is found or if timeout for search occurs.

(only applicable if self->merge_or_add==TRUE)

Parameters:
sysdevice Async Return value from the find call or NULL if timeout
data1 User data (or own device in this case)
data2 User data

Definition at line 296 of file class_device.c.

References HAL_LINUX_HOTPLUG_TIMEOUT, is_probing, and ClassDeviceHandler_s::require_device_file.

Referenced by class_device_visit().

void class_device_init ClassDeviceHandler self  ) 
 

Init function for block device handling.

Does nothing.

Definition at line 449 of file class_device.c.

void class_device_post_merge ClassDeviceHandler self,
HalDevice *  d
 

Called when an inferior HalDevice is merged.

This is the last step when merging in devices. This is only invoked if merge_or_add is TRUE.

Parameters:
self Pointer to the class members
d The HalDevice object recently merged

Definition at line 503 of file class_device.c.

void class_device_pre_process ClassDeviceHandler self,
HalDevice *  d,
const char *  sysfs_path,
struct sysfs_class_device *  class_device
 

This method is called just before the device is either merged onto the sysdevice or added to the GDL (cf.

merge_or_add). This is useful for extracting more information about the device through e.g. ioctl's using the device file property and also for setting info.category|capability.

Parameters:
self Pointer to class members
d The HalDevice object of the instance of this device class
sysfs_path The path in sysfs (including mount point) of the class device in sysfs
class_device Libsysfs object representing class device instance

Definition at line 486 of file class_device.c.

void class_device_removed ClassDeviceHandler self,
const char *  sysfs_path,
HalDevice *  d
 

Called when the class device instance have been removed.

Parameters:
self Pointer to class members
sysfs_path The path in sysfs (including mount point) of the class device in sysfs
d The HalDevice object of the instance of this device class

Definition at line 204 of file class_device.c.

void class_device_shutdown ClassDeviceHandler self  ) 
 

Shutdown function for block device handling.

Does nothing.

Definition at line 466 of file class_device.c.

void class_device_tick ClassDeviceHandler self  ) 
 

Called regulary (every two seconds) for polling / monitoring on devices of this class.

Parameters:
self Pointer to class members

Definition at line 515 of file class_device.c.

void class_device_udev_event ClassDeviceHandler self,
HalDevice *  d,
char *  dev_file
 

Called when a device file (e.g.

a file in /dev) have been created by udev

Parameters:
self Pointer to class members
d The HalDevice object of the instance of this device class
dev_file device file, e.g. /dev/input/event4

Definition at line 218 of file class_device.c.

void class_device_visit ClassDeviceHandler self,
const char *  path,
struct sysfs_class_device *  class_device,
dbus_bool_t  is_probing
 

Generic visitor method for class devices.

This function parses the attributes present and merges more information into the HAL device this class device points to

Parameters:
self Pointer to class members
path Sysfs-path for class device
class_device Libsysfs object for device
is_probing Whether we are probing

Definition at line 104 of file class_device.c.

References class_device_get_device_file(), class_device_got_parent_device(), class_device_got_sysdevice(), ClassDeviceHandler_s::get_device_file_target, get_parent_sysfs_path(), ClassDeviceHandler_s::hal_class_name, HAL_LINUX_HOTPLUG_TIMEOUT, is_probing, ClassDeviceHandler_s::merge_or_add, ClassDeviceHandler_s::require_device_file, ClassDeviceHandler_s::sysfs_class_name, and ClassDeviceHandler_s::udev_event.


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