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

class_device.h

00001 /***************************************************************************
00002  * CVSID: $Id: class_device.h,v 1.5 2004/04/12 20:11:51 joe Exp $
00003  *
00004  * linux_class_generic.h : Generic methods for class devices
00005  *
00006  * Copyright (C) 2003 David Zeuthen, <david@fubar.dk>
00007  *
00008  * Licensed under the Academic Free License version 2.0
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *
00024  **************************************************************************/
00025 
00026 #ifndef CLASS_DEVICE_H
00027 #define CLASS_DEVICE_H
00028 
00029 #include "libsysfs/libsysfs.h"
00030 
00031 /* fwd decl */
00032 struct ClassDeviceHandler_s;
00033 typedef struct ClassDeviceHandler_s ClassDeviceHandler;
00034 
00036 struct ClassDeviceHandler_s {
00041     void (*init) (ClassDeviceHandler* self);
00042 
00047     void (*detection_done) (ClassDeviceHandler* self);
00048 
00053     void (*shutdown) (ClassDeviceHandler* self);
00054 
00059     void (*tick) (ClassDeviceHandler* self);
00060 
00073     dbus_bool_t (*accept) (ClassDeviceHandler *self,
00074                    const char *sysfs_path,
00075                    struct sysfs_class_device *class_device,
00076                    dbus_bool_t is_probing);
00077 
00103     void (*visit) (ClassDeviceHandler* self,
00104                const char *sysfs_path,
00105                struct sysfs_class_device *class_device,
00106                dbus_bool_t is_probing);
00107 
00116     void (*removed) (ClassDeviceHandler* self, 
00117              const char *sysfs_path, 
00118              HalDevice *d);
00119 
00128     void (*udev_event) (ClassDeviceHandler* self,
00129                 HalDevice *d, char *dev_file);
00130 
00144     void (*get_device_file_target) (ClassDeviceHandler* self,
00145                     HalDevice *d, 
00146                     const char *sysfs_path,
00147                     struct sysfs_class_device *class_device,
00148                     char* dev_file_prop,
00149                     int dev_file_prop_len);
00150 
00167     void (*pre_process) (ClassDeviceHandler* self,
00168                  HalDevice *d,
00169                  const char *sysfs_path,
00170                  struct sysfs_class_device *class_device);  
00171 
00180     void (*post_merge) (ClassDeviceHandler *self,
00181                 HalDevice *d);
00182 
00191     void (*got_udi) (ClassDeviceHandler *self, 
00192              HalDevice *d, 
00193              const char *udi);
00194 
00212     char* (*compute_udi) (HalDevice *d, int append_num);
00213 
00214 
00217     const char *sysfs_class_name;
00218 
00221     const char* hal_class_name;
00222 
00231     dbus_bool_t require_device_file;
00232 
00236     dbus_bool_t merge_or_add;
00237 };
00238 
00239 dbus_bool_t class_device_accept (ClassDeviceHandler *self,
00240                  const char *path,
00241                  struct sysfs_class_device *class_device,
00242                  dbus_bool_t is_probing);
00243 
00244 void class_device_visit (ClassDeviceHandler *self,
00245              const char *path,
00246              struct sysfs_class_device *class_device,
00247              dbus_bool_t is_probing);
00248 
00249 void class_device_removed (ClassDeviceHandler* self, 
00250                const char *sysfs_path, 
00251                HalDevice *d);
00252 
00253 void class_device_udev_event (ClassDeviceHandler *self,
00254                   HalDevice *d, char *dev_file);
00255 
00256 void class_device_init (ClassDeviceHandler *self);
00257 
00258 void class_device_detection_done (ClassDeviceHandler *self);
00259 
00260 void class_device_shutdown (ClassDeviceHandler *self);
00261 
00262 void class_device_pre_process (ClassDeviceHandler *self,
00263                    HalDevice *d,
00264                    const char *sysfs_path,
00265                    struct sysfs_class_device *class_device);
00266 
00267 void class_device_post_merge (ClassDeviceHandler *self,
00268                   HalDevice *d);
00269 
00270 void class_device_got_udi (ClassDeviceHandler *self,
00271                HalDevice *d,
00272                const char *udi);
00273 
00274 
00275 void class_device_tick (ClassDeviceHandler *self);
00276 
00277 void class_device_get_device_file_target (ClassDeviceHandler *self,
00278                       HalDevice *d,
00279                       const char *sysfs_path,
00280                       struct sysfs_class_device *class_device,
00281                       char* dev_file_prop,
00282                       int dev_file_prop_len);
00283 
00284 void class_device_got_sysdevice (HalDeviceStore *store, 
00285                  HalDevice *sysdevice, 
00286                  gpointer user_data);
00287 
00288 void class_device_got_parent_device (HalDeviceStore *store, 
00289                      HalDevice *parent, 
00290                      gpointer user_data);
00291 
00292 
00293 #endif /* CLASS_DEVICE_H */

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