diff options
author | Guillaume Knispel <gknispel@proformatique.com> | 2010-10-19 15:37:29 +0200 |
---|---|---|
committer | Guillaume Knispel <gknispel@proformatique.com> | 2010-10-19 15:37:29 +0200 |
commit | 766eed6827e37844d9fb9af88a19419750538a73 (patch) | |
tree | a33c584b0015f99fc8df5b4370552c6787ae9e66 /xivovp | |
parent | 619cb8f38b88a8f7e01e51bc39fb387e86e7b0b4 (diff) |
trying to get a better sound
Diffstat (limited to 'xivovp')
-rw-r--r-- | xivovp/base.c | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/xivovp/base.c b/xivovp/base.c index da69740..96f5d55 100644 --- a/xivovp/base.c +++ b/xivovp/base.c @@ -84,13 +84,23 @@ static struct xivovp { struct xivo_tdm_port *tdm_port; } xivovp; -static void xivovp_transmit_and_receive(void *data) +static void xivovp_receive_and_transmit(void *data) { (void) data; + xivo_tdm_receive(xivovp.tdm_port, FXS_TIMESLOT, + xivovp.chans[FXS_LINE]->readchunk); + xivo_tdm_receive(xivovp.tdm_port, FXO_TIMESLOT, + xivovp.chans[FXO_LINE]->readchunk); + dahdi_receive(&xivovp.span); dahdi_transmit(&xivovp.span); dahdi_ec_span(&xivovp.span); + + xivo_tdm_transmit(xivovp.tdm_port, FXS_TIMESLOT, + xivovp.chans[FXS_LINE]->writechunk); + xivo_tdm_transmit(xivovp.tdm_port, FXO_TIMESLOT, + xivovp.chans[FXO_LINE]->writechunk); } /* Shouldn't there be something better there? TOTHINK */ @@ -644,10 +654,13 @@ vp_init(void) return rc; } +/* process context */ +static void +xivovp_port0_started_cb(void *data); + static int test_evb_ve890_init(void) { - struct xivo_tdm_cb_struct cb_struct; // 264 bytes int rc; printk(KERN_INFO DRV_NAME ": entering %s\n", __func__); @@ -672,15 +685,11 @@ test_evb_ve890_init(void) goto err_dahdi_init; } - memset(&cb_struct, 0, sizeof cb_struct); - cb_struct.rx_bufs[FXS_TIMESLOT] = xivovp.chans[FXS_LINE]->readchunk; - cb_struct.tx_bufs[FXS_TIMESLOT] = xivovp.chans[FXS_LINE]->writechunk; - cb_struct.rx_bufs[FXO_TIMESLOT] = xivovp.chans[FXO_LINE]->readchunk; - cb_struct.tx_bufs[FXO_TIMESLOT] = xivovp.chans[FXO_LINE]->writechunk; - cb_struct.xivo_tdm_cb = xivovp_transmit_and_receive; - cb_struct.xivo_tdm_cb_data = NULL; - /* XXX */ (void) xivo_tdm_start_chans( - xivovp.tdm_port, TS_MASK, &cb_struct); + /* UGLY EVIL HACK */ + xivo_tdm_register_port0_started( + xivovp.tdm_port, + xivovp_port0_started_cb, + NULL); mod_timer(&xivovp.vp_tick_timer, jiffies + VP_TICK_JIFFIES); @@ -696,6 +705,21 @@ test_evb_ve890_init(void) return rc; } +/* process context */ +static void +xivovp_port0_started_cb(void *data) +{ + struct xivo_tdm_tick_cb_struct tick_cb = { + .tick = xivovp_receive_and_transmit, + .tick_data = NULL, + }; + + printk(KERN_ERR "%s\n", __func__); + + /* XXX */ (void) xivo_tdm_start_chans( + xivovp.tdm_port, TS_MASK, &tick_cb); +} + static void test_evb_ve890_exit(void) { |