summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp/xbus-core.h
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-06-28 18:23:00 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-06-28 18:23:00 +0000
commit71234e254b574d31d442703e04fdbdcba653010c (patch)
tree0a657a4e9601bc59dfa5fc40880492f69779b8e1 /drivers/dahdi/xpp/xbus-core.h
parent1fa5fa9a723b314f72db9b52114eebf01111c5f0 (diff)
xpd_echo: XPP Octasic echo canceler module
* xpd_echo (card_echo.c) - a module to handle an Astribank hardware echo canceller module. * All other XPDs are now of type 'telephony_device'. Only a telephony device XPD provides a span to register. * The EC module will typically show up as XPD-40 and will always show up as Unregistered in 'dahdi_hardware -v' Signed-off-by: Oron Peled <oron.peled@xorcom.com> Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9993 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/xpp/xbus-core.h')
-rw-r--r--drivers/dahdi/xpp/xbus-core.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/dahdi/xpp/xbus-core.h b/drivers/dahdi/xpp/xbus-core.h
index 659d3d4..b781e94 100644
--- a/drivers/dahdi/xpp/xbus-core.h
+++ b/drivers/dahdi/xpp/xbus-core.h
@@ -156,6 +156,28 @@ void put_xbus(const char *msg, xbus_t *xbus);
int refcount_xbus(xbus_t *xbus);
/*
+ * Echo canceller related data
+ */
+#define ECHO_TIMESLOTS 128
+
+struct echoops {
+ int (*ec_set)(xpd_t *xpd, int pos, bool on);
+ int (*ec_get)(xpd_t *xpd, int pos);
+ int (*ec_update)(xbus_t *xbus);
+ void (*ec_dump)(xbus_t *xbus);
+};
+
+struct xbus_echo_state {
+ const struct echoops *echoops;
+ byte timeslots[ECHO_TIMESLOTS];
+ int xpd_idx;
+ struct device_attribute *da[MAX_XPDS];
+};
+#define ECHOOPS(xbus) ((xbus)->echo_state.echoops)
+#define EC_METHOD(name, xbus) (ECHOOPS(xbus)->name)
+#define CALL_EC_METHOD(name, xbus, ...) (EC_METHOD(name, (xbus))(__VA_ARGS__))
+
+/*
* An xbus is a transport layer for Xorcom Protocol commands
*/
struct xbus {
@@ -169,6 +191,7 @@ struct xbus {
int num;
struct xpd *xpds[MAX_XPDS];
+ struct xbus_echo_state echo_state;
int command_tick_counter;
int usec_nosend; /* Firmware flow control */
@@ -311,6 +334,7 @@ int xbus_xpd_unbind(xbus_t *xbus, xpd_t *xpd);
/* sysfs */
int xpd_device_register(xbus_t *xbus, xpd_t *xpd);
void xpd_device_unregister(xpd_t *xpd);
+int echocancel_xpd(xpd_t *xpd, int on);
int xpp_driver_init(void);
void xpp_driver_exit(void);