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

Generic methods for bus devices
[Linux 2.6 support]

Generic methods for bus devices. More...

Data Structures

struct  AsyncInfo

Functions

void bus_device_got_parent (HalDeviceStore *store, HalDevice *parent, gpointer user_data)
 Callback when the parent is found or if there is no parent..

dbus_bool_t bus_device_accept (BusDeviceHandler *self, const char *path, struct sysfs_device *device, dbus_bool_t is_probing)
 Generic accept function that accepts the device if and only if the bus name from sysfs equals the bus name in the class.

void bus_device_visit (BusDeviceHandler *self, const char *path, struct sysfs_device *device, dbus_bool_t is_probing)
 Visitor function for a bus device.

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

void bus_device_init (BusDeviceHandler *self)
 Init function for bus type.

void bus_device_shutdown (BusDeviceHandler *self)
 Shutdown function for bus type.

void bus_device_tick (BusDeviceHandler *self)
 Called regulary (every two seconds) for polling / monitoring on devices of this bus type. .

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

void bus_device_pre_process (BusDeviceHandler *self, HalDevice *d, const char *sysfs_path, struct sysfs_device *device)
 This method is called just before the device is added to the GDL.

void bus_device_got_udi (BusDeviceHandler *self, HalDevice *d, const char *udi)

Detailed Description

Generic methods for bus devices.


Function Documentation

dbus_bool_t bus_device_accept BusDeviceHandler self,
const char *  path,
struct sysfs_device *  device,
dbus_bool_t  is_probing
 

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

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

Definition at line 72 of file bus_device.c.

References BusDeviceHandler_s::sysfs_bus_name.

void bus_device_detection_done BusDeviceHandler self  ) 
 

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

Parameters:
self Pointer to class members

Definition at line 192 of file bus_device.c.

void bus_device_got_parent HalDeviceStore *  store,
HalDevice *  parent,
gpointer  user_data
[static]
 

Callback when the parent is found or if there is no parent..

This is where we get added to the GDL..

Parameters:
store Device store we searched
parent Async Return value from the find call
user_data User data from find call

Definition at line 141 of file bus_device.c.

References BusDeviceHandler_s::compute_udi, DIE, BusDeviceHandler_s::got_udi, BusDeviceHandler_s::hal_bus_name, BusDeviceHandler_s::pre_process, and rename_and_merge().

Referenced by bus_device_visit().

void bus_device_init BusDeviceHandler self  ) 
 

Init function for bus type.

Parameters:
self Pointer to class members

Definition at line 201 of file bus_device.c.

void bus_device_pre_process BusDeviceHandler self,
HalDevice *  d,
const char *  sysfs_path,
struct sysfs_device *  device
 

This method is called just before the device is added to the GDL.

This is useful for adding more information about the 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
device Libsysfs object representing device instance

Definition at line 252 of file bus_device.c.

void bus_device_removed BusDeviceHandler 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

Definition at line 234 of file bus_device.c.

void bus_device_shutdown BusDeviceHandler self  ) 
 

Shutdown function for bus type.

Parameters:
self Pointer to class members

Definition at line 210 of file bus_device.c.

void bus_device_tick BusDeviceHandler self  ) 
 

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

Parameters:
self Pointer to class members

Definition at line 221 of file bus_device.c.

void bus_device_visit BusDeviceHandler self,
const char *  path,
struct sysfs_device *  device,
dbus_bool_t  is_probing
 

Visitor function for a bus device.

This function parses the attributes present and creates a new HAL device based on this information.

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

Also set the sysfs path here, because otherwise we can't handle two identical devices per the algorithm used in a the function rename_and_merge(). The point is that we need something unique in the bus namespace

Definition at line 90 of file bus_device.c.

References bus_device_got_parent(), get_parent_sysfs_path(), BusDeviceHandler_s::hal_bus_name, HAL_LINUX_HOTPLUG_TIMEOUT, and is_probing.


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