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

bus_device.h

00001 /***************************************************************************
00002  * CVSID: $Id: bus_device.h,v 1.3 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 BUS_DEVICE_H
00027 #define BUS_DEVICE_H
00028 
00029 #include "libsysfs/libsysfs.h"
00030 
00031 /* fwd decl */
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 /* BUS_DEVICE_H */

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