xpp_dahdi.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. void xpd_set_spanname(xpd_t *xpd);
  27. int xpd_dahdi_preregister(xpd_t *xpd, unsigned offset);
  28. int xpd_dahdi_postregister(xpd_t *xpd);
  29. void xpd_dahdi_preunregister(xpd_t *xpd);
  30. void xpd_dahdi_postunregister(xpd_t *xpd);
  31. int create_xpd(xbus_t *xbus, const xproto_table_t *proto_table, int unit,
  32. int subunit, __u8 type, __u8 subtype, int subunits,
  33. int subunit_ports, __u8 port_dir);
  34. xpd_t *xpd_alloc(xbus_t *xbus, int unit, int subunit, int subtype, int subunits,
  35. size_t privsize, const xproto_table_t *proto_table,
  36. int channels);
  37. void xpd_free(xpd_t *xpd);
  38. void xpd_remove(xpd_t *xpd);
  39. int phonedev_alloc_channels(xpd_t *xpd, int channels);
  40. void update_xpd_status(xpd_t *xpd, int alarm_flag);
  41. const char *xpp_echocan_name(const struct dahdi_chan *chan);
  42. int xpp_echocan_create(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp,
  43. struct dahdi_echocanparam *p,
  44. struct dahdi_echocan_state **ec);
  45. void hookstate_changed(xpd_t *xpd, int pos, bool good);
  46. int xpp_open(struct dahdi_chan *chan);
  47. int xpp_close(struct dahdi_chan *chan);
  48. int xpp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long arg);
  49. int xpp_hooksig(struct dahdi_chan *chan, enum dahdi_txsig txsig);
  50. int xpp_maint(struct dahdi_span *span, int cmd);
  51. int xpp_watchdog(struct dahdi_span *span, int cause);
  52. void xpp_span_assigned(struct dahdi_span *span);
  53. void report_bad_ioctl(const char *msg, xpd_t *xpd, int pos, unsigned int cmd);
  54. int total_registered_spans(void);
  55. void oht_pcm(xpd_t *xpd, int pos, bool pass);
  56. void mark_offhook(xpd_t *xpd, int pos, bool to_offhook);
  57. #define IS_OFFHOOK(xpd, pos) IS_SET((xpd)->phonedev.offhook_state, (pos))
  58. void notify_rxsig(xpd_t *xpd, int pos, enum dahdi_rxsig rxsig);
  59. #ifdef CONFIG_PROC_FS
  60. #include <linux/proc_fs.h>
  61. extern struct proc_dir_entry *xpp_proc_toplevel;
  62. #endif
  63. #define SPAN_REGISTERED(xpd) (atomic_read(&PHONEDEV(xpd).dahdi_registered) && \
  64. test_bit(DAHDI_FLAGBIT_REGISTERED, &PHONEDEV(xpd).span.flags))
  65. #endif /* XPP_DAHDI_H */