summaryrefslogtreecommitdiff
path: root/wcfxo.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2001-12-04 12:32:34 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2001-12-04 12:32:34 +0000
commit021d482685b38bddbb3cf3b282363a657e072be5 (patch)
tree7feb50636b392ea55e17b4a7f6d92b2174e19ddc /wcfxo.c
parentf675d5f0096402127bf2fccd0841e76f0e06d3c2 (diff)
Version 0.1.4 from FTP
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@33 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wcfxo.c')
-rwxr-xr-xwcfxo.c20
1 files changed, 14 insertions, 6 deletions
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;x<ZT_CHUNKSIZE;x++) {
/* Rotate through registers */
@@ -422,6 +424,7 @@ static int wcfxo_initialize(struct wcfxo *wc)
wc->span.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 <markster@linux-support.net>");