Debian Codegraph @

drivers/dahdi/dahdi.h

raw
1 #ifndef _DAHDI_H
2 #define _DAHDI_H
3
4 /* dahdi.h: headers intended only for the dahdi.ko module.
5 * Not to be included elsewhere
6 *
7 * Written by Tzafrir Cohen <[email protected]>
8 * Copyright (C) 2011, Xorcom
9 * Copyright (C) 2011, Digium, Inc
10 *
11 * All rights reserved.
12 *
13 */
14
15 /*
16 * See http://www.asterisk.org for more information about
17 * the Asterisk project. Please do not directly contact
18 * any of the maintainers of this project for assistance;
19 * the project provides a web site, mailing lists and IRC
20 * channels for your use.
21 *
22 * This program is free software, distributed under the terms of
23 * the GNU General Public License Version 2 as published by the
24 * Free Software Foundation. See the LICENSE file included with
25 * this program for more details.
26 */
27
28 extern int debug;
29 extern const char *const dahdi_version;
30
31 int dahdi_register_chardev(struct dahdi_chardev *dev);
32 int dahdi_unregister_chardev(struct dahdi_chardev *dev);
33 int span_sysfs_create(struct dahdi_span *span);
34 void span_sysfs_remove(struct dahdi_span *span);
35 int __init dahdi_sysfs_init(const struct file_operations *dahdi_fops);
36 void dahdi_sysfs_exit(void);
37
38 void dahdi_sysfs_init_device(struct dahdi_device *ddev);
39 int dahdi_sysfs_add_device(struct dahdi_device *ddev, struct device *parent);
40 void dahdi_sysfs_unregister_device(struct dahdi_device *ddev);
41
42 int dahdi_assign_span(struct dahdi_span *span, unsigned int spanno,
43 unsigned int basechan, int prefmaster);
44 int dahdi_unassign_span(struct dahdi_span *span);
45 int dahdi_assign_device_spans(struct dahdi_device *ddev);
46
47 static inline int get_span(struct dahdi_span *span)
48 {
49 return try_module_get(span->ops->owner);
50 }
51
52 static inline void put_span(struct dahdi_span *span)
53 {
54 module_put(span->ops->owner);
55 }
56
57 static inline int local_spanno(struct dahdi_span *span)
58 {
59 return span->offset + 1;
60 }
61
62 #endif /* _DAHDI_H */