diff options
-rw-r--r-- | wctdm.c | 4 | ||||
-rw-r--r-- | wctdm24xxp/base.c | 6 | ||||
-rw-r--r-- | zaptel.h | 20 | ||||
-rw-r--r-- | ztscan.c | 4 |
4 files changed, 23 insertions, 11 deletions
@@ -2061,6 +2061,7 @@ static int wctdm_initialize(struct wctdm *wc) static void wctdm_post_initialize(struct wctdm *wc) { int x; + /* Finalize signalling */ for (x = 0; x < NUM_CARDS; x++) { if (wc->cardflag & (1 << x)) { @@ -2068,6 +2069,8 @@ static void wctdm_post_initialize(struct wctdm *wc) wc->chans[x].sigcap = ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF | ZT_SIG_CLEAR; else wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM | ZT_SIG_CLEAR; + } else if (!(wc->chans[x].sigcap == ZT_SIG_BROKEN)) { + wc->chans[x].sigcap = 0; } } } @@ -2184,6 +2187,7 @@ static int wctdm_hardware_init(struct wctdm *wc) printk("Module %d: Installed -- MANUAL FXS\n",x); } else { printk("Module %d: FAILED FXS (%s)\n", x, fxshonormode ? fxo_modes[_opermode].name : "FCC"); + wc->chans[x].sigcap = ZT_SIG_BROKEN; } } else if (!(ret = wctdm_init_voicedaa(wc, x, 0, 0, sane))) { wc->cardflag |= (1 << x); diff --git a/wctdm24xxp/base.c b/wctdm24xxp/base.c index d2c4368..311f699 100644 --- a/wctdm24xxp/base.c +++ b/wctdm24xxp/base.c @@ -3093,8 +3093,9 @@ static int wctdm_initialize(struct wctdm *wc) static void wctdm_post_initialize(struct wctdm *wc) { int x; + /* Finalize signalling */ - for (x=0;x<wc->cards;x++) { + for (x = 0; x <wc->cards; x++) { if (wc->cardflag & (1 << x)) { if (wc->modtype[x] == MOD_TYPE_FXO) wc->chans[x].sigcap = ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF | ZT_SIG_CLEAR; @@ -3102,6 +3103,8 @@ static void wctdm_post_initialize(struct wctdm *wc) wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM | ZT_SIG_CLEAR; else if (wc->modtype[x] == MOD_TYPE_QRV) wc->chans[x].sigcap = ZT_SIG_SF | ZT_SIG_EM | ZT_SIG_CLEAR; + } else if (!(wc->chans[x].sigcap == ZT_SIG_BROKEN)) { + wc->chans[x].sigcap = 0; } } } @@ -3946,6 +3949,7 @@ retry: printk("Port %d: Installed -- MANUAL FXS\n",x + 1); } else { printk("Port %d: FAILED FXS (%s)\n", x + 1, fxshonormode ? fxo_modes[_opermode].name : "FCC"); + wc->chans[x].sigcap = ZT_SIG_BROKEN; } } else if (!(ret = wctdm_init_voicedaa(wc, x, 0, 0, sane))) { wc->cardflag |= (1 << x); @@ -110,8 +110,10 @@ #define ZT_CONFIG_NOTOPEN (1 << 16) /* Signalling types */ -#define __ZT_SIG_FXO (1 << 12) /* Never use directly */ -#define __ZT_SIG_FXS (1 << 13) /* Never use directly */ +#define ZT_SIG_BROKEN (1 << 31) /* The port is broken and/or failed initialization */ + +#define __ZT_SIG_FXO (1 << 12) /* Never use directly */ +#define __ZT_SIG_FXS (1 << 13) /* Never use directly */ #define ZT_SIG_NONE (0) /* Channel not configured */ #define ZT_SIG_FXSLS ((1 << 0) | __ZT_SIG_FXS) /* FXS, Loopstart */ @@ -126,18 +128,18 @@ /* The following are all variations on clear channel */ -#define __ZT_SIG_DACS (1 << 16) +#define __ZT_SIG_DACS (1 << 16) -#define ZT_SIG_CLEAR (1 << 7) /* Clear channel */ +#define ZT_SIG_CLEAR (1 << 7) /* Clear channel */ #define ZT_SIG_HDLCRAW ((1 << 8) | ZT_SIG_CLEAR) /* Raw unchecked HDLC */ #define ZT_SIG_HDLCFCS ((1 << 9) | ZT_SIG_HDLCRAW) /* HDLC with FCS calculation */ #define ZT_SIG_HDLCNET ((1 << 10) | ZT_SIG_HDLCFCS) /* HDLC Network */ -#define ZT_SIG_SLAVE (1 << 11) /* Slave to another channel */ -#define ZT_SIG_SF (1 << 14) /* Single Freq. tone only, no sig bits */ -#define ZT_SIG_CAS (1 << 15) /* Just get bits */ +#define ZT_SIG_SLAVE (1 << 11) /* Slave to another channel */ +#define ZT_SIG_SF (1 << 14) /* Single Freq. tone only, no sig bits */ +#define ZT_SIG_CAS (1 << 15) /* Just get bits */ #define ZT_SIG_DACS (__ZT_SIG_DACS | ZT_SIG_CLEAR) /* Cross connect */ -#define ZT_SIG_EM_E1 (1 << 17) /* E1 E&M Variation */ -#define ZT_SIG_DACS_RBS ((1 << 18) | __ZT_SIG_DACS) /* Cross connect w/ RBS */ +#define ZT_SIG_EM_E1 (1 << 17) /* E1 E&M Variation */ +#define ZT_SIG_DACS_RBS ((1 << 18) | __ZT_SIG_DACS) /* Cross connect w/ RBS */ #define ZT_SIG_HARDHDLC ((1 << 19) | ZT_SIG_CLEAR) /* tone flag values */ @@ -149,7 +149,9 @@ int main(int argc, char *argv[]) continue; }; fprintf(stdout, "port=%d,", y); - switch (params.sigcap & (__ZT_SIG_FXO | __ZT_SIG_FXS)) { + if (params.sigcap == ZT_SIG_BROKEN) + fprintf(stdout, "FXS FAILED"); + else switch (params.sigcap & (__ZT_SIG_FXO | __ZT_SIG_FXS)) { case __ZT_SIG_FXO: fprintf(stdout, "FXO"); break; |