summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi.h
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-02-26 15:55:30 -0600
committerShaun Ruffell <sruffell@digium.com>2011-04-15 14:21:14 -0500
commit3080253725eb7a1ba1cec08735c1476a3fd3c1c7 (patch)
treef39e9959efe8a58287a7f4f8073c87c2cfc46d0b /drivers/dahdi/dahdi.h
parenta899994d442a262f084fc47ec80013ac5787296c (diff)
dahdi: Expose dahdi devices in sysfs.
This exposes dahdi devices in sysfs and also exposes attributes that will allow user space to control the registration order in spans. This facilitates loading drivers out of order yet keeping consistent span/channel numbering, which in turn will eventually allow the blacklist for DAHDI drivers to be removed. The default behavior, controlled with the auto_register module parameter on dahdi is to number the spans / channels in order like is currently done. So this change does not introduce any new behavior by default. Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Diffstat (limited to 'drivers/dahdi/dahdi.h')
-rw-r--r--drivers/dahdi/dahdi.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/dahdi/dahdi.h b/drivers/dahdi/dahdi.h
index 92ddbdc..b4fc23e 100644
--- a/drivers/dahdi/dahdi.h
+++ b/drivers/dahdi/dahdi.h
@@ -34,4 +34,22 @@ void span_sysfs_remove(struct dahdi_span *span);
int __init dahdi_sysfs_init(const struct file_operations *dahdi_fops);
void dahdi_sysfs_exit(void);
+void dahdi_sysfs_init_device(struct dahdi_device *ddev);
+int dahdi_sysfs_add_device(struct dahdi_device *ddev, struct device *parent);
+void dahdi_sysfs_unregister_device(struct dahdi_device *ddev);
+
+int dahdi_register_span(struct dahdi_span *span, unsigned int spanno,
+ unsigned int basechan, int prefmaster);
+int dahdi_register_device_spans(struct dahdi_device *ddev);
+
+static inline int get_span(struct dahdi_span *span)
+{
+ return try_module_get(span->ops->owner);
+}
+
+static inline void put_span(struct dahdi_span *span)
+{
+ module_put(span->ops->owner);
+}
+
#endif /* _DAHDI_H */