Index: zaptel.h =================================================================== --- zaptel.h (.../1.4-orig/zaptel.h) (révision 13) +++ zaptel.h (.../sysfs/zaptel.h) (révision 20) @@ -1134,6 +1134,39 @@ int lastdetect; } sf_detect_state_t; + + +#ifdef CONFIG_ZAP_UDEV + +/* Zaptel Sysfs defines and structures */ + +/* @brief the default type for zaptel's devices +* +* This type is currently set for zaptranscode/zapctl/zaptimer/zappseudo/zapchannel +*/ +#define ZT_DEVICE_TYPE_DEFAULT 0 + +/* @brief the type for channels devices */ +#define ZT_DEVICE_TYPE_CHANNEL 1 + +/* @brief the type for spans devices */ +#define ZT_DEVICE_TYPE_SPAN 2 +/* +* @note the above defines may be needed even in user-space context +* because we may expose the device type in sysfs attributes +* or in uevent environment variables. +*/ + +#ifdef __KERNEL__ +/* @brief opaque structure to be added into spans and channels +* that represent their sysfs representation +*/ +struct zt_sysfs_device; +#endif /* __KERNEL__ */ + +#endif /* CONFIG_ZAP_UDEV */ + + struct zt_chan { #ifdef CONFIG_ZAPATA_NET /* Must be first */ @@ -1341,6 +1374,11 @@ devfs_handle_t fhandle; /* File handle in devfs for the channel */ devfs_handle_t fhandle_symlink; #endif /* CONFIG_DEVFS_FS */ + +#ifdef CONFIG_ZAP_UDEV + /* sysfs representation of this channel */ + struct zt_sysfs_device *sysfs_dev; +#endif }; /* defines for transmit signalling */ @@ -1495,7 +1533,16 @@ #ifdef CONFIG_ZAPTEL_WATCHDOG int watchcounter; int watchstate; -#endif +#endif + +#ifdef CONFIG_ZAP_UDEV + /* Opt: the span's real device (if possible to get) + * drivers should set it before calling zt_register + */ + struct device *device; + /* sysfs representation of this span */ + struct zt_sysfs_device *sysfs_dev; +#endif }; struct zt_transcoder_channel {