diff options
author | Russ Meyerriecks <rmeyerreicks@digium.com> | 2010-02-22 16:18:45 +0000 |
---|---|---|
committer | Russ Meyerriecks <rmeyerreicks@digium.com> | 2010-02-22 16:18:45 +0000 |
commit | a0e532fc44b63d9996b16ca7329d9a98e04e3362 (patch) | |
tree | a1bab9d8538cf26f8661e4a2602cc5f2102ce82e /drivers/dahdi/wcte12xp/base.c | |
parent | c6190b93918fa1bc174d7fdfb87cc6e9425eddb5 (diff) |
Branch merge from the maintenance modes project
* Added logic for both the single and dual/quad span cards for supporting
local loopback (virtual loopback plug), network loopback, network payload
loopback, loopup, and loopback transmitting.
* Added logic for the dual/quad span driver to support exporting the
performance and error counters including :
- errored seconds
- framing errors
- coding violations
- bipolar violations
- crc4 errors
- ebit errors
- fas errors
* Moved the error and performance counters into a substructure for all drivers
taking advantage of dahdi_span bpvcount.
* Modified the DAHDI_SPANSTAT ioctl interface, so I moved the old interface
to DAHDI_SPANSTAT_V1. The new interface comes with a nice, new shiny packed
struct dahdi_spaninfo.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8061 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wcte12xp/base.c')
-rw-r--r-- | drivers/dahdi/wcte12xp/base.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c index 79ded20..dfba2dd 100644 --- a/drivers/dahdi/wcte12xp/base.c +++ b/drivers/dahdi/wcte12xp/base.c @@ -1099,6 +1099,7 @@ static inline void t1_check_sigbits(struct t1 *wc) static int t1xxp_maint(struct dahdi_span *span, int cmd) { struct t1 *wc = span->pvt; + int reg = 0; if (wc->spantype == TYPE_E1) { switch (cmd) { @@ -1128,24 +1129,34 @@ static int t1xxp_maint(struct dahdi_span *span, int cmd) } else { switch (cmd) { case DAHDI_MAINT_NONE: - t1_info(wc, "XXX Turn off local and remote " - "loops T1 XXX\n"); + /* Turn off local loop */ + reg = t1_getreg(wc, LIM0); + t1_setreg(wc, LIM0, reg & ~LIM0_LL); + + /* Turn off remote loop & jitter attenuator */ + reg = t1_getreg(wc, LIM1); + t1_setreg(wc, LIM1, reg & ~(LIM1_RL | LIM1_JATT)); break; case DAHDI_MAINT_LOCALLOOP: - t1_info(wc, "XXX Turn on local loop and no remote " - "loop XXX\n"); + reg = t1_getreg(wc, LIM0); + t1_setreg(wc, LIM0, reg | LIM0_LL); break; - case DAHDI_MAINT_REMOTELOOP: - t1_info(wc, "XXX Turn on remote loopup XXX\n"); + case DAHDI_MAINT_NETWORKLINELOOP: + reg = t1_getreg(wc, LIM1); + t1_setreg(wc, LIM1, reg | LIM1_RL); + break; + case DAHDI_MAINT_NETWORKPAYLOADLOOP: + reg = t1_getreg(wc, LIM1); + t1_setreg(wc, LIM1, reg | (LIM1_RL | LIM1_JATT)); break; case DAHDI_MAINT_LOOPUP: - t1_setreg(wc, 0x21, 0x50); /* FMR5: Nothing but RBS mode */ + t1_setreg(wc, 0x21, 0x50); break; case DAHDI_MAINT_LOOPDOWN: - t1_setreg(wc, 0x21, 0x60); /* FMR5: Nothing but RBS mode */ + t1_setreg(wc, 0x21, 0x60); break; case DAHDI_MAINT_LOOPSTOP: - t1_setreg(wc, 0x21, 0x40); /* FMR5: Nothing but RBS mode */ + t1_setreg(wc, 0x21, 0x40); break; default: t1_info(wc, "Unknown T1 maint command: %d\n", cmd); |