diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-03-06 22:54:16 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-03-06 22:54:16 +0000 |
commit | 3b3d8f7b1186f672e16cd7e4ded2f405ec43cb1c (patch) | |
tree | 5e592d92e3030b4eb28cab7585f769dbbeab2d74 /xpp/card_fxs.c | |
parent | 07b404b68141bc981adbc1f5a00cbe90116fb9c1 (diff) |
xpp.r5512:
* Build:
- Zaptel >= 1.4.9 is migrating to storing kernel stuff in zaptel/kernel/*
- We conditionally use old/new directory scheme:
In xpp/Kbuild and xpp/utils/Makefile use ZAP_KERNEL variable, so it's
not confused with ZAPTEL_DIR (which appears in zaptel/Makefile as well).
- Fix compile warnings on 64 bit systems.
- Compile fixes for kernel-2.6.24
* UDEV:
- /etc/udev/rules.d/xpp.rules now uses XPP_INIT_DIR to find astribank_hook.
- astribank_hook: Modify to do nothing. Add some documentation.
* Autoconfiguration -- zapconf:
- Don't fail zapconf et.al. if no config file was found.
- Skip the 'IRQ Missing:' line in /proc/zaptel/nnn for wcte1xp(?).
- Add some newer Digium cards to our hardware inventory.
- Partially handle cases where the /proc/zaptel strings does not contain
info about E1/T1/J1 or NT/TE.
* Better SYNC:
- Finer tuning of PLL (New firmware).
- Change calculation algorithm of sync offset. It now copes better
with the variance in USB frame reception timing.
- Statistics:
. The view of results was moved from /proc/xpp/XBUS-*/summary to
a new /sys/bus/astribanks/devices/xbus-*/timing and enhanced.
. A new xpp_timing script shows all astribanks.
. A new write only /sys/bus/astribanks/devices/xbus-*/cls is
used to clear statistics. Eventually, clearing of XBUS related
statistics should be done here. One that was migrated is the
clearing of 'PCM [TR]X:' numbers currently appearing in
/proc/xpp/XBUS-*/summary (they should be moved too later).
- Shorten the strings representation sync_mode ("SYNC_MODE_AB" -> "AB")
adapted their use in printk and /proc so the text is clear.
- Added a command line parameter xpp.disable_pll_sync to stop all
adjustments command to AB (calculations still continue as usual).
* PRI:
- 4 port support
- set clocking master span via ztcfg, like other zaptel devices.
* FXO:
- Fix false hangups in some countries (voltage fluctuations).
- Some countries send caller-id before first ring.
Added code to handle caller-id PCM pass through according to
a new command line parameter (xpd_fxo.caller_id_style).
- No longer sends an event on zt_open. See #12160 .
* Misc:
- Adapt to zaptel-1.4.8 and above ztscan: added fields returend by
new ZT_SPANSTAT_V2 ioctl()
- Document sysfs and waitfor_xpds.
- Miscelaneous optimizations and bugfixes.
- Remove deprecated pcm_tasklet parameter. The rx_tasklet parameter has
replaced it a long time ago.
- Add RX_CMD counter to /proc/xpp/XBUS-*/summary
- Unclutter some of the usb disconnect messages.
- xpp_usb: minor preformance improvements in receive.
Expose the number of pending receive URB's in /proc/xpp/XBUS-*/xpp_usb
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@3952 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/card_fxs.c')
-rw-r--r-- | xpp/card_fxs.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/xpp/card_fxs.c b/xpp/card_fxs.c index f2251e0..8e61629 100644 --- a/xpp/card_fxs.c +++ b/xpp/card_fxs.c @@ -34,10 +34,12 @@ static const char rcsid[] = "$Id$"; DEF_PARM(int, print_dbg, 0, 0644, "Print DBG statements"); /* must be before zap_debug.h */ -DEF_PARM(uint, poll_digital_inputs, 1000, 0644, "Poll Digital Inputs"); DEF_PARM_BOOL(reversepolarity, 0, 0644, "Reverse Line Polarity"); DEF_PARM_BOOL(vmwineon, 0, 0644, "Indicate voicemail to a neon lamp"); DEF_PARM_BOOL(dtmf_detection, 0, 0644, "Do DTMF detection in hardware"); +#ifdef POLL_DIGITAL_INPUTS +DEF_PARM(uint, poll_digital_inputs, 1000, 0644, "Poll Digital Inputs"); +#endif #ifdef ZT_VMWI DEF_PARM_BOOL(vmwi_ioctl, 0, 0644, "Asterisk support VMWI notification via ioctl"); @@ -247,7 +249,7 @@ static void handle_fxs_leds(xpd_t *xpd) timer_count = xpd->timer_count; for(color = 0; color < ARRAY_SIZE(colors); color++) { for_each_line(xpd, i) { - if(IS_SET(xpd->digital_outputs, i) || IS_SET(xpd->digital_inputs, i)) + if(IS_SET(xpd->digital_outputs | xpd->digital_inputs, i)) continue; if(xpd->blink_mode || IS_BLINKING(priv, i, color)) { // Blinking int mod_value = LED_COUNTER(priv, i, color); @@ -263,9 +265,9 @@ static void handle_fxs_leds(xpd_t *xpd) do_led(xpd, i, color, 0); } } - } else if(IS_SET(priv->ledcontrol[color], i) && !IS_SET(priv->ledstate[color], i)) { + } else if(IS_SET(priv->ledcontrol[color] & ~priv->ledstate[color], i)) { do_led(xpd, i, color, 1); - } else if(!IS_SET(priv->ledcontrol[color], i) && IS_SET(priv->ledstate[color], i)) { + } else if(IS_SET(~priv->ledcontrol[color] & priv->ledstate[color], i)) { do_led(xpd, i, color, 0); } @@ -455,6 +457,9 @@ static int FXS_card_zaptel_preregistration(xpd_t *xpd, bool on) priv = xpd->priv; BUG_ON(!priv); XPD_DBG(GENERAL, xpd, "%s\n", (on)?"on":"off"); +#ifdef ZT_SPANSTAT_V2 + xpd->span.spantype = "FXS"; +#endif for_each_line(xpd, i) { struct zt_chan *cur_chan = &xpd->chans[i]; @@ -796,7 +801,7 @@ static void start_stop_vm_led(xbus_t *xbus, xpd_t *xpd, lineno_t pos) bool on; BUG_ON(!xpd); - if (IS_SET(xpd->digital_outputs | xpd->digital_inputs, pos)) + if (!vmwineon || IS_SET(xpd->digital_outputs | xpd->digital_inputs, pos)) return; priv = xpd->priv; on = IS_SET(xpd->msg_waiting, pos); @@ -836,6 +841,7 @@ static int FXS_card_close(xpd_t *xpd, lineno_t chan) return 0; } +#ifdef POLL_DIGITAL_INPUTS /* * INPUT polling is done via SLIC register 0x06 (same as LEDS): * 7 6 5 4 3 2 1 0 @@ -857,6 +863,7 @@ static void poll_inputs(xpd_t *xpd) SLIC_DIRECT_REQUEST(xpd->xbus, xpd, pos, SLIC_READ, 0x06, 0); } } +#endif static void handle_linefeed(xpd_t *xpd) { @@ -971,7 +978,7 @@ static int FXS_card_tick(xbus_t *xbus, xpd_t *xpd) BUG_ON(!xpd); priv = xpd->priv; BUG_ON(!priv); -#if POLL_DIGITAL_INPUTS +#ifdef POLL_DIGITAL_INPUTS if(poll_digital_inputs && xpd->xbus_idx == 0) { if((xpd->timer_count % poll_digital_inputs) == 0) poll_inputs(xpd); @@ -1116,6 +1123,7 @@ HANDLER_DEF(FXS, SIG_CHANGED) return 0; } +#ifdef POLL_DIGITAL_INPUTS static void process_digital_inputs(xpd_t *xpd, const reg_cmd_t *info) { int i; @@ -1142,6 +1150,7 @@ static void process_digital_inputs(xpd_t *xpd, const reg_cmd_t *info) } } } +#endif static const char dtmf_digits[] = { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '*', '#', 'A', 'B', 'C', 'D' @@ -1218,11 +1227,13 @@ static int FXS_card_register_reply(xbus_t *xbus, xpd_t *xpd, reg_cmd_t *info) regnum, REG_FIELD(info, data_low), REG_FIELD(info, data_high)); if(!SPAN_REGISTERED(xpd)) goto out; +#ifdef POLL_DIGITAL_INPUTS /* * Process digital inputs polling results */ if(xpd->xbus_idx == 0 && !indirect && regnum == 0x06) process_digital_inputs(xpd, info); +#endif if(!indirect && regnum == SLIC_REG_DTMF) { byte val = REG_FIELD(info, data_low); xpp_line_t lines = BIT(REG_FIELD(info, chipsel)); |