dahdi.h 1.8 KB

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