From 021d482685b38bddbb3cf3b282363a657e072be5 Mon Sep 17 00:00:00 2001 From: markster Date: Tue, 4 Dec 2001 12:32:34 +0000 Subject: Version 0.1.4 from FTP git-svn-id: http://svn.digium.com/svn/zaptel/trunk@33 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- wcfxo.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'wcfxo.c') diff --git a/wcfxo.c b/wcfxo.c index c820248..dcbab28 100755 --- a/wcfxo.c +++ b/wcfxo.c @@ -130,6 +130,8 @@ static void wcfxo_release(struct wcfxo *wc); static int debug = 0; +static int monitor = 0; + static inline void wcfxo_transmitprep(struct wcfxo *wc, unsigned char ints) { volatile int *writechunk; @@ -148,10 +150,10 @@ static inline void wcfxo_transmitprep(struct wcfxo *wc, unsigned char ints) /* Send a sample, as a 32-bit word, and be sure to indicate that a command follows */ if (wc->flags & FLAG_INVERTSER) writechunk[x << 1] = - ~((unsigned short)(zt_mulaw[wc->chan.writechunk[x]])| 0x1) << 16; + ~((unsigned short)(ZT_MULAW(wc->chan.writechunk[x]))| 0x1) << 16; else writechunk[x << 1] = - ((unsigned short)(zt_mulaw[wc->chan.writechunk[x]])| 0x1) << 16; + ((unsigned short)(ZT_MULAW(wc->chan.writechunk[x]))| 0x1) << 16; /* We always have a command to follow our signal */ if (!wc->regs[x].flags) { @@ -225,7 +227,7 @@ static inline void wcfxo_receiveprep(struct wcfxo *wc, unsigned char ints) /* Receive into the proper register */ wc->readregs[realreg] = realval; } - wc->chan.readchunk[x] = zt_lin2mu[((short)(readchunk[(x << 1) + (1 - wc->alt)] >> 16)) + 32768]; + wc->chan.readchunk[x] = ZT_LIN2MU(((short)(readchunk[(x << 1) + (1 - wc->alt)] >> 16))); } for (x=0;xspan.open = wcfxo_open; wc->span.close = wcfxo_close; wc->span.flags = ZT_FLAG_RBS; + wc->span.deflaw = ZT_LAW_MULAW; init_waitqueue_head(&wc->span.maintq); wc->span.pvt = wc; @@ -541,9 +544,13 @@ static int wcfxo_init_daa(struct wcfxo *wc) wcfxo_setreg(wc, 0xa, 0x0); /* Enable off hook pin */ wcfxo_setreg(wc, 0x5, 0x0a); - /* Enable ISOcap and external speaker and charge pump if present */ - wcfxo_setreg(wc, 0x6, 0x80); - + if (monitor) { + /* Enable ISOcap and external speaker and charge pump if present */ + wcfxo_setreg(wc, 0x6, 0x80); + } else { + /* Enable ISOcap and charge pump if present (leave speaker disabled) */ + wcfxo_setreg(wc, 0x6, 0xe0); + } /* Wait a couple of jiffies for our writes to finish */ set_current_state(TASK_INTERRUPTIBLE); @@ -735,6 +742,7 @@ static void __exit wcfxo_cleanup(void) } MODULE_PARM(debug, "i"); +MODULE_PARM(monitor, "i"); MODULE_DESCRIPTION("Wildcard X100P Zaptel Driver"); MODULE_AUTHOR("Mark Spencer "); -- cgit v1.2.3