summaryrefslogtreecommitdiff
path: root/tdm/xivo_tdm_api.h
diff options
context:
space:
mode:
authorGuillaume Knispel <gknispel@proformatique.com>2010-10-19 14:32:37 +0200
committerGuillaume Knispel <gknispel@proformatique.com>2010-10-19 14:32:37 +0200
commit619cb8f38b88a8f7e01e51bc39fb387e86e7b0b4 (patch)
tree0fb0d4e7b8798d2dae2f8e4f203528047ebd7b6b /tdm/xivo_tdm_api.h
parent31cbb46bedd07bf0c916a149013383b28588c705 (diff)
added a new (very very low quality way) to propagate audio
Diffstat (limited to 'tdm/xivo_tdm_api.h')
-rw-r--r--tdm/xivo_tdm_api.h30
1 files changed, 27 insertions, 3 deletions
diff --git a/tdm/xivo_tdm_api.h b/tdm/xivo_tdm_api.h
index 13e2889..cde2269 100644
--- a/tdm/xivo_tdm_api.h
+++ b/tdm/xivo_tdm_api.h
@@ -2,13 +2,28 @@
#define XIVO_TDM_API_H
/* XXX matches with ICP_HSSDRV_PORT_XHFC_MEGREZ_PROTO_XIVO_CONFIG */
-#define XHFC_MEGREZ_PROTO_XIVO_CONFIG 4
+#define XHFC_MEGREZ_PROTO_XIVO_CONFIG (4)
/* XXX matches with ICP_HSSDRV_PORT_LE89316_MEGREZ_PROTO_XIVO_CONFIG */
-#define LE89316_MEGREZ_PROTO_XIVO_CONFIG 5
+#define LE89316_MEGREZ_PROTO_XIVO_CONFIG (5)
+
+/* fixed for now: */
+#define XIVO_TDM_TS_NUM (32)
+
+
+/* for audio propagation, xivo_tdm_cb will be called every ms (hopefully...) */
+struct xivo_tdm_cb_struct {
+ u8 *rx_bufs[XIVO_TDM_TS_NUM];
+ u8 *tx_bufs[XIVO_TDM_TS_NUM];
+
+ void (*xivo_tdm_cb)(void *data);
+ void *xivo_tdm_cb_data;
+};
+
struct xivo_tdm_port;
+
/* TDM port allocation
* Returns a xivo_tdm_port pointer if available, else NULL. */
/* hardirq: no -- softirq: no -- user: yes */
@@ -27,7 +42,16 @@ int xivo_tdm_config_port(
/* hardirq: no -- softirq: no -- user: yes */
int xivo_tdm_start_chans(
struct xivo_tdm_port* xtp,
- u32 chans);
+ u32 chans,
+ struct xivo_tdm_cb_struct *cb_struct); // optional, can be null
+
+void xivo_tdm_stop_chans(
+ struct xivo_tdm_port* xtp);
+
+
+/* If cb_struct is NULL, the user has to regularly call
+ * xivo_tdm_receive(), xivo_tdm_transmit() and xivo_tdm_tick()
+ */
/* hardirq: yes -- softirq: yes -- user: yes */
void xivo_tdm_receive(