xpp_dahdi.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef XPP_DAHDI_H
  2. #define XPP_DAHDI_H
  3. /*
  4. * Written by Oron Peled <oron@actcom.co.il>
  5. * Copyright (C) 2004-2006, Xorcom
  6. *
  7. * All rights reserved.
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22. *
  23. */
  24. #include "xpd.h"
  25. #include "xproto.h"
  26. int dahdi_register_xpd(xpd_t *xpd);
  27. int dahdi_unregister_xpd(xpd_t *xpd);
  28. void xbus_request_removal(xbus_t *xbus);
  29. int create_xpd(xbus_t *xbus, const xproto_table_t *proto_table,
  30. int unit, int subunit, byte type, byte subtype, int subunits, int subunit_ports, byte port_dir);
  31. void xpd_post_init(xpd_t *xpd);
  32. xpd_t *xpd_alloc(xbus_t *xbus, int unit, int subunit, int subtype, int subunits, size_t privsize, const xproto_table_t *proto_table, int channels);
  33. void xpd_free(xpd_t *xpd);
  34. void xpd_remove(xpd_t *xpd);
  35. void update_xpd_status(xpd_t *xpd, int alarm_flag);
  36. void hookstate_changed(xpd_t *xpd, int pos, bool good);
  37. int xpp_open(struct dahdi_chan *chan);
  38. int xpp_close(struct dahdi_chan *chan);
  39. int xpp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long arg);
  40. int xpp_hooksig(struct dahdi_chan *chan, enum dahdi_txsig txsig);
  41. int xpp_maint(struct dahdi_span *span, int cmd);
  42. void report_bad_ioctl(const char *msg, xpd_t *xpd, int pos, unsigned int cmd);
  43. int total_registered_spans(void);
  44. void oht_pcm(xpd_t *xpd, int pos, bool pass);
  45. void mark_offhook(xpd_t *xpd, int pos, bool to_offhook);
  46. #define IS_OFFHOOK(xpd,pos) IS_SET((xpd)->offhook_state, (pos))
  47. void notify_rxsig(xpd_t *xpd, int pos, enum dahdi_rxsig rxsig);
  48. #ifdef CONFIG_PROC_FS
  49. #include <linux/proc_fs.h>
  50. extern struct proc_dir_entry *xpp_proc_toplevel;
  51. #endif
  52. #define SPAN_REGISTERED(xpd) atomic_read(&(xpd)->dahdi_registered)
  53. #endif /* XPP_DAHDI_H */