00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef BUS_DEVICE_H
00027 #define BUS_DEVICE_H
00028
00029 #include "libsysfs/libsysfs.h"
00030
00031
00032 struct BusDeviceHandler_s;
00033 typedef struct BusDeviceHandler_s BusDeviceHandler;
00034
00036 struct BusDeviceHandler_s {
00041 void (*init) (BusDeviceHandler *self);
00042
00047 void (*detection_done) (BusDeviceHandler *self);
00048
00053 void (*shutdown) (BusDeviceHandler *self);
00054
00059 void (*tick) (BusDeviceHandler *self);
00060
00073 dbus_bool_t (*accept) (BusDeviceHandler *self,
00074 const char *sysfs_path,
00075 struct sysfs_device *device,
00076 dbus_bool_t is_probing);
00077
00093 void (*visit) (BusDeviceHandler *self,
00094 const char *sysfs_path,
00095 struct sysfs_device *device,
00096 dbus_bool_t is_probing);
00097
00106 void (*removed) (BusDeviceHandler *self,
00107 const char *sysfs_path,
00108 HalDevice *d);
00109
00124 char* (*compute_udi) (HalDevice *d, int append_num);
00125
00138 void (*pre_process) (BusDeviceHandler *self,
00139 HalDevice *d,
00140 const char *sysfs_path,
00141 struct sysfs_device *device);
00142
00150 void (*got_udi) (BusDeviceHandler *self,
00151 HalDevice *d,
00152 const char *udi);
00153
00154
00156 const char *sysfs_bus_name;
00157
00159 const char *hal_bus_name;
00160 };
00161
00162 dbus_bool_t bus_device_accept (BusDeviceHandler *self, const char *path,
00163 struct sysfs_device *device,
00164 dbus_bool_t is_probing);
00165
00166 void bus_device_visit (BusDeviceHandler *self, const char *path,
00167 struct sysfs_device *device, dbus_bool_t is_probing);
00168
00169 void bus_device_detection_done (BusDeviceHandler *self);
00170
00171 void bus_device_init (BusDeviceHandler *self);
00172
00173 void bus_device_shutdown (BusDeviceHandler *self);
00174
00175 void bus_device_tick (BusDeviceHandler *self);
00176
00177 void bus_device_removed (BusDeviceHandler *self,
00178 const char *sysfs_path,
00179 HalDevice *d);
00180
00181 void bus_device_pre_process (BusDeviceHandler *self,
00182 HalDevice *d,
00183 const char *sysfs_path,
00184 struct sysfs_device *device);
00185
00186 void bus_device_got_udi (BusDeviceHandler *self,
00187 HalDevice *d,
00188 const char *udi);
00189
00190 #endif