From 4a4d140d0bc76d50d822bf8342c0785391cacbb0 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Tue, 17 Jun 2008 17:17:05 +0000 Subject: Make the xpp drivers build with dahdi. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4370 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/xpp/Kbuild | 6 +- drivers/dahdi/xpp/card_bri.c | 106 ++++++++++++++++----------------- drivers/dahdi/xpp/card_fxo.c | 50 ++++++++-------- drivers/dahdi/xpp/card_fxs.c | 88 ++++++++++++++-------------- drivers/dahdi/xpp/card_pri.c | 132 +++++++++++++++++++++--------------------- drivers/dahdi/xpp/xbus-pcm.c | 66 ++++++++++----------- drivers/dahdi/xpp/xbus-pcm.h | 6 +- drivers/dahdi/xpp/xdefs.h | 6 +- drivers/dahdi/xpp/xpd.h | 12 ++-- drivers/dahdi/xpp/xpp_zap.c | 120 +++++++++++++++++++------------------- drivers/dahdi/xpp/xpp_zap.h | 10 ++-- drivers/dahdi/xpp/xproto.h | 4 +- drivers/dahdi/xpp/zap_debug.c | 2 +- drivers/dahdi/xpp/zap_debug.h | 126 ++++++++++++++++++++-------------------- 14 files changed, 365 insertions(+), 369 deletions(-) (limited to 'drivers/dahdi') diff --git a/drivers/dahdi/xpp/Kbuild b/drivers/dahdi/xpp/Kbuild index 376f592..f47edf0 100644 --- a/drivers/dahdi/xpp/Kbuild +++ b/drivers/dahdi/xpp/Kbuild @@ -14,13 +14,9 @@ EXTRA_CFLAGS = $(XPP_LOCAL_CFLAGS) \ -g # -ifneq (,$(shell grep -w echo_can_state_t $(ZAP_KERNEL)/dahdi.h)) -EXTRA_CFLAGS += -DZAPTEL_EC_TYPEDEF -endif - obj-m += xpp.o xpd_fxs.o xpd_fxo.o xpd_pri.o -HAS_BRISTUFF := $(shell grep '^[[:space:]]*\#[[:space:]]*define[[:space:]]\+CONFIG_ZAPATA_BRI_DCHANS\>' $(ZAP_KERNEL)/zconfig.h) +HAS_BRISTUFF := $(shell grep '^[[:space:]]*\#[[:space:]]*define[[:space:]]\+CONFIG_ZAPATA_BRI_DCHANS\>' $(ZAP_KERNEL)/dahdi_config.h) # Build only supported modules ifneq (,$(filter y m,$(CONFIG_USB))) diff --git a/drivers/dahdi/xpp/card_bri.c b/drivers/dahdi/xpp/card_bri.c index 086dbea..b737b7b 100644 --- a/drivers/dahdi/xpp/card_bri.c +++ b/drivers/dahdi/xpp/card_bri.c @@ -132,18 +132,18 @@ typedef union { #define DCHAN_LOST 15000 /* in ticks */ #define BRI_DCHAN_SIGCAP ( \ - ZT_SIG_EM | \ - ZT_SIG_CLEAR | \ - ZT_SIG_FXSLS | \ - ZT_SIG_FXSGS | \ - ZT_SIG_FXSKS | \ - ZT_SIG_FXOLS | \ - ZT_SIG_FXOGS | \ - ZT_SIG_FXOKS | \ - ZT_SIG_CAS | \ - ZT_SIG_SF \ + DAHDI_SIG_EM | \ + DAHDI_SIG_CLEAR | \ + DAHDI_SIG_FXSLS | \ + DAHDI_SIG_FXSGS | \ + DAHDI_SIG_FXSKS | \ + DAHDI_SIG_FXOLS | \ + DAHDI_SIG_FXOGS | \ + DAHDI_SIG_FXOKS | \ + DAHDI_SIG_CAS | \ + DAHDI_SIG_SF \ ) -#define BRI_BCHAN_SIGCAP (ZT_SIG_CLEAR | ZT_SIG_DACS) +#define BRI_BCHAN_SIGCAP (DAHDI_SIG_CLEAR | DAHDI_SIG_DACS) #define IS_NT(xpd) ((xpd)->direction == TO_PHONE) #define BRI_PORT(xpd) ((xpd)->addr.subunit) @@ -158,10 +158,10 @@ static int write_state_register(xpd_t *xpd, byte value); static bool bri_packet_is_valid(xpacket_t *pack); static void bri_packet_dump(const char *msg, xpacket_t *pack); static int proc_bri_info_read(char *page, char **start, off_t off, int count, int *eof, void *data); -static int bri_spanconfig(struct zt_span *span, struct zt_lineconfig *lc); -static int bri_chanconfig(struct zt_chan *chan, int sigtype); -static int bri_startup(struct zt_span *span); -static int bri_shutdown(struct zt_span *span); +static int bri_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc); +static int bri_chanconfig(struct dahdi_chan *chan, int sigtype); +static int bri_startup(struct dahdi_span *span); +static int bri_shutdown(struct dahdi_span *span); #define PROC_REGISTER_FNAME "slics" #define PROC_BRI_INFO_FNAME "bri_info" @@ -440,7 +440,7 @@ static int rx_dchan(xpd_t *xpd, reg_cmd_t *regcmd) byte *src; byte *dst; byte *dchan_buf; - struct zt_chan *dchan; + struct dahdi_chan *dchan; uint len; bool eoframe; int idx; @@ -525,14 +525,14 @@ out: static int tx_dchan(xpd_t *xpd) { struct BRI_priv_data *priv; - struct zt_chan *dchan; + struct dahdi_chan *dchan; int len; int eoframe; int ret; priv = xpd->priv; BUG_ON(!priv); - if(!SPAN_REGISTERED(xpd) || !(xpd->span.flags & ZT_FLAG_RUNNING)) + if(!SPAN_REGISTERED(xpd) || !(xpd->span.flags & DAHDI_FLAG_RUNNING)) return 0; dchan = &xpd->chans[2]; len = dchan->bytes2transmit; /* dchan's hdlc package len */ @@ -673,14 +673,14 @@ static int BRI_card_zaptel_preregistration(xpd_t *xpd, bool on) /* Nothing to do yet */ return 0; } -#ifdef ZT_SPANSTAT_V2 +#ifdef DAHDI_SPANSTAT_V2 xpd->span.spantype = "BRI"; #endif - xpd->span.linecompat = ZT_CONFIG_AMI | ZT_CONFIG_CCS; - xpd->span.deflaw = ZT_LAW_ALAW; + xpd->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_CCS; + xpd->span.deflaw = DAHDI_LAW_ALAW; BIT_SET(xpd->digital_signalling, 2); /* D-Channel */ for_each_line(xpd, i) { - struct zt_chan *cur_chan = &xpd->chans[i]; + struct dahdi_chan *cur_chan = &xpd->chans[i]; XPD_DBG(GENERAL, xpd, "setting BRI channel %d\n", i); snprintf(cur_chan->name, MAX_CHANNAME, "XPP_%s/%02d/%1d%1d/%d", @@ -690,8 +690,8 @@ static int BRI_card_zaptel_preregistration(xpd_t *xpd, bool on) cur_chan->pvt = xpd; if(i == 2) { /* D-CHAN */ cur_chan->sigcap = BRI_DCHAN_SIGCAP; - cur_chan->flags |= ZT_FLAG_BRIDCHAN; - cur_chan->flags &= ~ZT_FLAG_HDLC; + cur_chan->flags |= DAHDI_FLAG_BRIDCHAN; + cur_chan->flags &= ~DAHDI_FLAG_HDLC; /* Setup big buffers for D-Channel rx/tx */ cur_chan->readchunk = priv->dchan_rbuf; @@ -722,7 +722,7 @@ static int BRI_card_zaptel_preregistration(xpd_t *xpd, bool on) line_count += 2; } } - tmp_pcm_len = RPACKET_HEADERSIZE + sizeof(xpp_line_t) + line_count * ZT_CHUNKSIZE; + tmp_pcm_len = RPACKET_HEADERSIZE + sizeof(xpp_line_t) + line_count * DAHDI_CHUNKSIZE; } else tmp_pcm_len = 0; spin_lock_irqsave(&xpd->lock, flags); @@ -750,7 +750,7 @@ static int BRI_card_zaptel_postregistration(xpd_t *xpd, bool on) return(0); } -static int BRI_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, zt_txsig_t txsig) +static int BRI_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, dahdi_txsig_t txsig) { LINE_DBG(SIGNAL, xpd, pos, "%s\n", txsig2str(txsig)); return 0; @@ -929,7 +929,7 @@ static int BRI_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long a if(!TRANSPORT_RUNNING(xpd->xbus)) return -ENODEV; switch (cmd) { - case ZT_TONEDETECT: + case DAHDI_TONEDETECT: /* * Asterisk call all span types with this (FXS specific) * call. Silently ignore it. @@ -945,7 +945,7 @@ static int BRI_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long a static int BRI_card_close(xpd_t *xpd, lineno_t pos) { - struct zt_chan *chan = &xpd->span.chans[pos]; + struct dahdi_chan *chan = &xpd->span.chans[pos]; /* Clear D-Channel pending data */ chan->bytes2receive = 0; @@ -958,7 +958,7 @@ static int BRI_card_close(xpd_t *xpd, lineno_t pos) /* * Called only for 'span' keyword in /etc/zaptel.conf */ -static int bri_spanconfig(struct zt_span *span, struct zt_lineconfig *lc) +static int bri_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc) { xpd_t *xpd = span->pvt; const char *framingstr = ""; @@ -966,21 +966,21 @@ static int bri_spanconfig(struct zt_span *span, struct zt_lineconfig *lc) const char *crcstr = ""; /* framing first */ - if (lc->lineconfig & ZT_CONFIG_B8ZS) + if (lc->lineconfig & DAHDI_CONFIG_B8ZS) framingstr = "B8ZS"; - else if (lc->lineconfig & ZT_CONFIG_AMI) + else if (lc->lineconfig & DAHDI_CONFIG_AMI) framingstr = "AMI"; - else if (lc->lineconfig & ZT_CONFIG_HDB3) + else if (lc->lineconfig & DAHDI_CONFIG_HDB3) framingstr = "HDB3"; /* then coding */ - if (lc->lineconfig & ZT_CONFIG_ESF) + if (lc->lineconfig & DAHDI_CONFIG_ESF) codingstr = "ESF"; - else if (lc->lineconfig & ZT_CONFIG_D4) + else if (lc->lineconfig & DAHDI_CONFIG_D4) codingstr = "D4"; - else if (lc->lineconfig & ZT_CONFIG_CCS) + else if (lc->lineconfig & DAHDI_CONFIG_CCS) codingstr = "CCS"; /* E1's can enable CRC checking */ - if (lc->lineconfig & ZT_CONFIG_CRC4) + if (lc->lineconfig & DAHDI_CONFIG_CRC4) crcstr = "CRC4"; XPD_DBG(GENERAL, xpd, "[%s]: span=%d (%s) lbo=%d lineconfig=%s/%s/%s (0x%X) sync=%d\n", IS_NT(xpd)?"NT":"TE", @@ -1002,7 +1002,7 @@ static int bri_spanconfig(struct zt_span *span, struct zt_lineconfig *lc) * Called from zaptel with spinlock held on chan. Must not call back * zaptel functions. */ -static int bri_chanconfig(struct zt_chan *chan, int sigtype) +static int bri_chanconfig(struct dahdi_chan *chan, int sigtype) { DBG(GENERAL, "channel %d (%s) -> %s\n", chan->channo, chan->name, sig2str(sigtype)); // FIXME: sanity checks: @@ -1014,11 +1014,11 @@ static int bri_chanconfig(struct zt_chan *chan, int sigtype) /* * Called only for 'span' keyword in /etc/zaptel.conf */ -static int bri_startup(struct zt_span *span) +static int bri_startup(struct dahdi_span *span) { xpd_t *xpd = span->pvt; struct BRI_priv_data *priv; - struct zt_chan *dchan; + struct dahdi_chan *dchan; BUG_ON(!xpd); priv = xpd->priv; @@ -1032,15 +1032,15 @@ static int bri_startup(struct zt_span *span) CALL_XMETHOD(XPD_STATE, xpd->xbus, xpd, 1); if(SPAN_REGISTERED(xpd)) { dchan = &span->chans[2]; - span->flags |= ZT_FLAG_RUNNING; + span->flags |= DAHDI_FLAG_RUNNING; /* * Zaptel (wrongly) assume that D-Channel need HDLC decoding * and during zaptel registration override our flags. * * Don't Get Mad, Get Even: Now we override zaptel :-) */ - dchan->flags |= ZT_FLAG_BRIDCHAN; - dchan->flags &= ~ZT_FLAG_HDLC; + dchan->flags |= DAHDI_FLAG_BRIDCHAN; + dchan->flags &= ~DAHDI_FLAG_HDLC; } return 0; } @@ -1048,7 +1048,7 @@ static int bri_startup(struct zt_span *span) /* * Called only for 'span' keyword in /etc/zaptel.conf */ -static int bri_shutdown(struct zt_span *span) +static int bri_shutdown(struct dahdi_span *span) { xpd_t *xpd = span->pvt; struct BRI_priv_data *priv; @@ -1069,7 +1069,7 @@ static int bri_shutdown(struct zt_span *span) static void BRI_card_pcm_fromspan(xbus_t *xbus, xpd_t *xpd, xpp_line_t wanted_lines, xpacket_t *pack) { byte *pcm; - struct zt_chan *chans; + struct dahdi_chan *chans; unsigned long flags; int i; int subunit; @@ -1093,14 +1093,14 @@ static void BRI_card_pcm_fromspan(xbus_t *xbus, xpd_t *xpd, xpp_line_t wanted_li if(SPAN_REGISTERED(tmp_xpd)) { #ifdef DEBUG_PCMTX if(pcmtx >= 0 && pcmtx_chan == i) - memset((u_char *)pcm, pcmtx, ZT_CHUNKSIZE); + memset((u_char *)pcm, pcmtx, DAHDI_CHUNKSIZE); else #endif - memcpy((u_char *)pcm, chans[i].writechunk, ZT_CHUNKSIZE); + memcpy((u_char *)pcm, chans[i].writechunk, DAHDI_CHUNKSIZE); // fill_beep((u_char *)pcm, tmp_xpd->addr.subunit, 2); } else - memset((u_char *)pcm, 0x7F, ZT_CHUNKSIZE); - pcm += ZT_CHUNKSIZE; + memset((u_char *)pcm, 0x7F, DAHDI_CHUNKSIZE); + pcm += DAHDI_CHUNKSIZE; } } pcm_mask |= PCM_SHIFT(wanted_lines, subunit); @@ -1142,10 +1142,10 @@ static void BRI_card_pcm_tospan(xbus_t *xbus, xpd_t *xpd, xpacket_t *pack) if(IS_SET(tmp_mask, i)) { r = tmp_xpd->span.chans[i].readchunk; - // memset((u_char *)r, 0x5A, ZT_CHUNKSIZE); // DEBUG + // memset((u_char *)r, 0x5A, DAHDI_CHUNKSIZE); // DEBUG // fill_beep((u_char *)r, 1, 1); // DEBUG: BEEP - memcpy((u_char *)r, pcm, ZT_CHUNKSIZE); - pcm += ZT_CHUNKSIZE; + memcpy((u_char *)r, pcm, DAHDI_CHUNKSIZE); + pcm += DAHDI_CHUNKSIZE; } } XPD_COUNTER(tmp_xpd, PCM_READ)++; @@ -1271,7 +1271,7 @@ static void su_new_state(xpd_t *xpd, byte reg_x30) clear_bit(HFC_L1_ACTIVATING, &priv->l1_flags); set_bit(HFC_L1_ACTIVATED, &priv->l1_flags); layer1_state(xpd, 1); - update_xpd_status(xpd, ZT_ALARM_NONE); + update_xpd_status(xpd, DAHDI_ALARM_NONE); break; case ST_TE_LOST_FRAMING: /* F8 */ XPD_DBG(SIGNAL, xpd, "State ST_TE_LOST_FRAMING (F8)\n"); @@ -1302,7 +1302,7 @@ static void su_new_state(xpd_t *xpd, byte reg_x30) set_bit(HFC_L1_ACTIVATED, &priv->l1_flags); set_bri_timer(xpd, "T1", &priv->t1, HFC_TIMER_OFF); layer1_state(xpd, 1); - update_xpd_status(xpd, ZT_ALARM_NONE); + update_xpd_status(xpd, DAHDI_ALARM_NONE); break; case ST_NT_DEACTIVTING: /* G4 */ XPD_DBG(SIGNAL, xpd, "State ST_NT_DEACTIVTING (G4)\n"); diff --git a/drivers/dahdi/xpp/card_fxo.c b/drivers/dahdi/xpp/card_fxo.c index 2e48dca..9ab2bbe 100644 --- a/drivers/dahdi/xpp/card_fxo.c +++ b/drivers/dahdi/xpp/card_fxo.c @@ -42,9 +42,9 @@ static DEF_PARM(int, ring_debounce, 50, 0644, "Number of ticks to debounce a fal static DEF_PARM(int, caller_id_style, 0, 0444, "Caller-Id detection style: 0 - [BELL], 1 - [BT], 2 - [PASS]"); /* Backward compatibility plug */ -#ifndef ZT_GET_PARAMS_V1 -#define zt_alarm_channel(a,b) zt_qevent_lock(a,( (b)==ZT_ALARM_NONE )? \ - ZT_EVENT_NOALARM : ZT_EVENT_ALARM) +#ifndef DAHDI_GET_PARAMS_V1 +#define dahdi_alarm_channel(a,b) dahdi_qevent_lock(a,( (b)==DAHDI_ALARM_NONE )? \ + DAHDI_EVENT_NOALARM : DAHDI_EVENT_ALARM) #endif enum cid_style { @@ -55,9 +55,9 @@ enum cid_style { /* Signaling is opposite (fxs signalling for fxo card) */ #if 1 -#define FXO_DEFAULT_SIGCAP (ZT_SIG_FXSKS | ZT_SIG_FXSLS) +#define FXO_DEFAULT_SIGCAP (DAHDI_SIG_FXSKS | DAHDI_SIG_FXSLS) #else -#define FXO_DEFAULT_SIGCAP (ZT_SIG_SF) +#define FXO_DEFAULT_SIGCAP (DAHDI_SIG_SF) #endif enum fxo_leds { @@ -263,7 +263,7 @@ static void handle_fxo_leds(xpd_t *xpd) static void update_zap_ring(xpd_t *xpd, int pos, bool on) { - zt_rxsig_t rxsig; + dahdi_rxsig_t rxsig; BUG_ON(!xpd); if(on) { @@ -271,22 +271,22 @@ static void update_zap_ring(xpd_t *xpd, int pos, bool on) LINE_DBG(SIGNAL, xpd, pos, "Caller-ID PCM: off\n"); BIT_CLR(xpd->cid_on, pos); } - rxsig = ZT_RXSIG_RING; + rxsig = DAHDI_RXSIG_RING; } else { if(caller_id_style == CID_STYLE_BELL) { LINE_DBG(SIGNAL, xpd, pos, "Caller-ID PCM: on\n"); BIT_SET(xpd->cid_on, pos); } - rxsig = ZT_RXSIG_OFFHOOK; + rxsig = DAHDI_RXSIG_OFFHOOK; } pcm_recompute(xpd, 0); /* - * We should not spinlock before calling zt_hooksig() as + * We should not spinlock before calling dahdi_hooksig() as * it may call back into our xpp_hooksig() and cause * a nested spinlock scenario */ if(SPAN_REGISTERED(xpd)) - zt_hooksig(&xpd->chans[pos], rxsig); + dahdi_hooksig(&xpd->chans[pos], rxsig); } static void mark_ring(xpd_t *xpd, lineno_t pos, bool on, bool update_zap) @@ -506,11 +506,11 @@ static int FXO_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 +#ifdef DAHDI_SPANSTAT_V2 xpd->span.spantype = "FXO"; #endif for_each_line(xpd, i) { - struct zt_chan *cur_chan = &xpd->chans[i]; + struct dahdi_chan *cur_chan = &xpd->chans[i]; XPD_DBG(GENERAL, xpd, "setting FXO channel %d\n", i); snprintf(cur_chan->name, MAX_CHANNAME, "XPP_FXO/%02d/%1d%1d/%d", @@ -549,7 +549,7 @@ static int FXO_card_zaptel_postregistration(xpd_t *xpd, bool on) return 0; } -static int FXO_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, zt_txsig_t txsig) +static int FXO_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, dahdi_txsig_t txsig) { struct FXO_priv_data *priv; int ret = 0; @@ -560,12 +560,12 @@ static int FXO_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, zt_txsig_t txsig) BUG_ON(xpd->direction != TO_PSTN); /* XXX Enable hooksig for FXO XXX */ switch(txsig) { - case ZT_TXSIG_START: + case DAHDI_TXSIG_START: break; - case ZT_TXSIG_OFFHOOK: + case DAHDI_TXSIG_OFFHOOK: ret = do_sethook(xpd, pos, 1); break; - case ZT_TXSIG_ONHOOK: + case DAHDI_TXSIG_ONHOOK: ret = do_sethook(xpd, pos, 0); break; default: @@ -589,12 +589,12 @@ static void zap_report_battery(xpd_t *xpd, lineno_t chan) /* no-op */ break; case BATTERY_OFF: - LINE_DBG(SIGNAL, xpd, chan, "Send ZT_ALARM_RED\n"); - zt_alarm_channel(&xpd->chans[chan], ZT_ALARM_RED); + LINE_DBG(SIGNAL, xpd, chan, "Send DAHDI_ALARM_RED\n"); + dahdi_alarm_channel(&xpd->chans[chan], DAHDI_ALARM_RED); break; case BATTERY_ON: - LINE_DBG(SIGNAL, xpd, chan, "Send ZT_ALARM_NONE\n"); - zt_alarm_channel(&xpd->chans[chan], ZT_ALARM_NONE); + LINE_DBG(SIGNAL, xpd, chan, "Send DAHDI_ALARM_NONE\n"); + dahdi_alarm_channel(&xpd->chans[chan], DAHDI_ALARM_NONE); break; } } @@ -720,7 +720,7 @@ static int FXO_card_tick(xbus_t *xbus, xpd_t *xpd) } /* FIXME: based on data from from wctdm.h */ -#include +#include /* * The first register is the ACIM, the other are coefficient registers. * We define the array size explicitly to track possible inconsistencies @@ -756,13 +756,13 @@ static int FXO_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long a XPD_DBG(GENERAL, xpd, "-- Set echo registers successfully\n"); break; - case ZT_TONEDETECT: + case DAHDI_TONEDETECT: /* * Asterisk call all span types with this (FXS specific) * call. Silently ignore it. */ LINE_DBG(GENERAL, xpd, pos, - "ZT_TONEDETECT (FXO: NOTIMPLEMENTED)\n"); + "DAHDI_TONEDETECT (FXO: NOTIMPLEMENTED)\n"); return -ENOTTY; default: report_bad_ioctl(THIS_MODULE->name, xpd, pos, cmd); @@ -934,8 +934,8 @@ static void update_battery_voltage(xpd_t *xpd, byte data_low, xportno_t portno) } if(SPAN_REGISTERED(xpd)) { LINE_DBG(SIGNAL, xpd, portno, - "Send ZT_EVENT_POLARITY: %s\n", polname); - zt_qevent_lock(&xpd->chans[portno], ZT_EVENT_POLARITY); + "Send DAHDI_EVENT_POLARITY: %s\n", polname); + dahdi_qevent_lock(&xpd->chans[portno], DAHDI_EVENT_POLARITY); } } priv->polarity[portno] = pol; diff --git a/drivers/dahdi/xpp/card_fxs.c b/drivers/dahdi/xpp/card_fxs.c index eeb02c9..055f89e 100644 --- a/drivers/dahdi/xpp/card_fxs.c +++ b/drivers/dahdi/xpp/card_fxs.c @@ -41,7 +41,7 @@ static DEF_PARM_BOOL(dtmf_detection, 1, 0644, "Do DTMF detection in hardware"); static DEF_PARM(uint, poll_digital_inputs, 1000, 0644, "Poll Digital Inputs"); #endif -#ifdef ZT_VMWI +#ifdef DAHDI_VMWI static DEF_PARM_BOOL(vmwi_ioctl, 0, 0644, "Asterisk support VMWI notification via ioctl"); #else #define vmwi_ioctl 0 /* not supported */ @@ -49,9 +49,9 @@ static DEF_PARM_BOOL(vmwi_ioctl, 0, 0644, "Asterisk support VMWI notification vi /* Signaling is opposite (fxo signalling for fxs card) */ #if 1 -#define FXS_DEFAULT_SIGCAP (ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS) +#define FXS_DEFAULT_SIGCAP (DAHDI_SIG_FXOKS | DAHDI_SIG_FXOLS | DAHDI_SIG_FXOGS) #else -#define FXS_DEFAULT_SIGCAP (ZT_SIG_SF | ZT_SIG_EM) +#define FXS_DEFAULT_SIGCAP (DAHDI_SIG_SF | DAHDI_SIG_EM) #endif #define LINES_DIGI_OUT 2 @@ -477,11 +477,11 @@ 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 +#ifdef DAHDI_SPANSTAT_V2 xpd->span.spantype = "FXS"; #endif for_each_line(xpd, i) { - struct zt_chan *cur_chan = &xpd->chans[i]; + struct dahdi_chan *cur_chan = &xpd->chans[i]; XPD_DBG(GENERAL, xpd, "setting FXS channel %d\n", i); if(IS_SET(xpd->digital_outputs, i)) { @@ -637,11 +637,11 @@ static int send_ring(xpd_t *xpd, lineno_t chan, bool on) return ret; } -static int FXS_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, zt_txsig_t txsig) +static int FXS_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, dahdi_txsig_t txsig) { struct FXS_priv_data *priv; int ret = 0; - struct zt_chan *chan = NULL; + struct dahdi_chan *chan = NULL; enum fxs_state txhook; unsigned long flags; @@ -655,7 +655,7 @@ static int FXS_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, zt_txsig_t txsig) if(SPAN_REGISTERED(xpd)) chan = &xpd->span.chans[pos]; switch(txsig) { - case ZT_TXSIG_ONHOOK: + case DAHDI_TXSIG_ONHOOK: spin_lock_irqsave(&xpd->lock, flags); xpd->ringing[pos] = 0; BIT_CLR(xpd->cid_on, pos); @@ -685,19 +685,19 @@ static int FXS_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, zt_txsig_t txsig) txhook = priv->lasttxhook[pos]; if(chan) { switch(chan->sig) { - case ZT_SIG_EM: - case ZT_SIG_FXOKS: - case ZT_SIG_FXOLS: + case DAHDI_SIG_EM: + case DAHDI_SIG_FXOKS: + case DAHDI_SIG_FXOLS: txhook = priv->idletxhookstate[pos]; break; - case ZT_SIG_FXOGS: + case DAHDI_SIG_FXOGS: txhook = FXS_LINE_TIPOPEN; break; } } ret = linefeed_control(xbus, xpd, pos, txhook); break; - case ZT_TXSIG_OFFHOOK: + case DAHDI_TXSIG_OFFHOOK: if(IS_SET(xpd->digital_outputs, pos)) { LINE_NOTICE(xpd, pos, "%s -> Is digital output. Ignored\n", txsig2str(txsig)); return -EINVAL; @@ -711,7 +711,7 @@ static int FXS_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, zt_txsig_t txsig) xpd->ringing[pos] = 0; if(chan) { switch(chan->sig) { - case ZT_SIG_EM: + case DAHDI_SIG_EM: txhook = FXS_LINE_POL_ACTIVE; break; default: @@ -721,7 +721,7 @@ static int FXS_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, zt_txsig_t txsig) } ret = linefeed_control(xbus, xpd, pos, txhook); break; - case ZT_TXSIG_START: + case DAHDI_TXSIG_START: xpd->ringing[pos] = 1; BIT_CLR(xpd->cid_on, pos); BIT_CLR(priv->search_fsk_pattern, pos); @@ -733,7 +733,7 @@ static int FXS_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, zt_txsig_t txsig) } ret = send_ring(xpd, pos, 1); // RING on break; - case ZT_TXSIG_KEWL: + case DAHDI_TXSIG_KEWL: if(IS_SET(xpd->digital_outputs, pos)) { LINE_DBG(SIGNAL, xpd, pos, "%s -> Is digital output. Ignored\n", txsig2str(txsig)); return -EINVAL; @@ -774,10 +774,10 @@ static int FXS_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long a } switch (cmd) { - case ZT_ONHOOKTRANSFER: + case DAHDI_ONHOOKTRANSFER: if (get_user(val, (int __user *)arg)) return -EFAULT; - LINE_DBG(SIGNAL, xpd, pos, "ZT_ONHOOKTRANSFER (%d millis)\n", val); + LINE_DBG(SIGNAL, xpd, pos, "DAHDI_ONHOOKTRANSFER (%d millis)\n", val); if (IS_SET(xpd->digital_inputs | xpd->digital_outputs, pos)) return 0; /* Nothing to do */ BIT_CLR(xpd->cid_on, pos); @@ -790,12 +790,12 @@ static int FXS_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long a if(!IS_SET(xpd->offhook, pos)) start_stop_vm_led(xbus, xpd, pos); return 0; - case ZT_TONEDETECT: + case DAHDI_TONEDETECT: if (get_user(val, (int __user *)arg)) return -EFAULT; - LINE_DBG(SIGNAL, xpd, pos, "ZT_TONEDETECT: %s %s (dtmf_detection=%s)\n", - (val & ZT_TONEDETECT_ON) ? "ON" : "OFF", - (val & ZT_TONEDETECT_MUTE) ? "MUTE" : "NO-MUTE", + LINE_DBG(SIGNAL, xpd, pos, "DAHDI_TONEDETECT: %s %s (dtmf_detection=%s)\n", + (val & DAHDI_TONEDETECT_ON) ? "ON" : "OFF", + (val & DAHDI_TONEDETECT_MUTE) ? "MUTE" : "NO-MUTE", (dtmf_detection ? "YES" : "NO")); if(!dtmf_detection) { spin_lock_irqsave(&xpd->lock, flags); @@ -816,11 +816,11 @@ static int FXS_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long a * dtmf events. Check the requested state. */ spin_lock_irqsave(&xpd->lock, flags); - if(val & ZT_TONEDETECT_ON) { + if(val & DAHDI_TONEDETECT_ON) { if(!IS_SET(priv->want_dtmf_events, pos)) { /* Detection mode changed: Enable DTMF interrupts */ LINE_DBG(SIGNAL, xpd, pos, - "ZT_TONEDETECT: Enable Hardware DTMF\n"); + "DAHDI_TONEDETECT: Enable Hardware DTMF\n"); SLIC_DIRECT_REQUEST(xbus, xpd, pos, SLIC_WRITE, 0x17, 1); } BIT_SET(priv->want_dtmf_events, pos); @@ -828,12 +828,12 @@ static int FXS_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long a if(IS_SET(priv->want_dtmf_events, pos)) { /* Detection mode changed: Disable DTMF interrupts */ LINE_DBG(SIGNAL, xpd, pos, - "ZT_TONEDETECT: Disable Hardware DTMF\n"); + "DAHDI_TONEDETECT: Disable Hardware DTMF\n"); SLIC_DIRECT_REQUEST(xbus, xpd, pos, SLIC_WRITE, 0x17, 0); } BIT_CLR(priv->want_dtmf_events, pos); } - if(val & ZT_TONEDETECT_MUTE) { + if(val & DAHDI_TONEDETECT_MUTE) { BIT_SET(priv->want_dtmf_mute, pos); } else { BIT_CLR(priv->want_dtmf_mute, pos); @@ -842,28 +842,28 @@ static int FXS_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long a } spin_unlock_irqrestore(&xpd->lock, flags); return 0; - case ZT_SETPOLARITY: + case DAHDI_SETPOLARITY: if (get_user(val, (int __user *)arg)) return -EFAULT; /* Can't change polarity while ringing or when open */ if (priv->lasttxhook[pos] == FXS_LINE_RING || priv->lasttxhook[pos] == FXS_LINE_OPEN) { - LINE_ERR(xpd, pos, "ZT_SETPOLARITY: %s Cannot change when lasttxhook=0x%X\n", + LINE_ERR(xpd, pos, "DAHDI_SETPOLARITY: %s Cannot change when lasttxhook=0x%X\n", (val)?"ON":"OFF", priv->lasttxhook[pos]); return -EINVAL; } - LINE_DBG(SIGNAL, xpd, pos, "ZT_SETPOLARITY: %s\n", (val)?"ON":"OFF"); + LINE_DBG(SIGNAL, xpd, pos, "DAHDI_SETPOLARITY: %s\n", (val)?"ON":"OFF"); if ((val && !reversepolarity) || (!val && reversepolarity)) priv->lasttxhook[pos] |= FXS_LINE_RING; else priv->lasttxhook[pos] &= ~FXS_LINE_RING; linefeed_control(xbus, xpd, pos, priv->lasttxhook[pos]); return 0; -#ifdef ZT_VMWI - case ZT_VMWI: /* message-waiting led control */ +#ifdef DAHDI_VMWI + case DAHDI_VMWI: /* message-waiting led control */ if (get_user(val, (int __user *)arg)) return -EFAULT; if(!vmwi_ioctl) { - LINE_NOTICE(xpd, pos, "Got ZT_VMWI notification but vmwi_ioctl parameter is off. Ignoring.\n"); + LINE_NOTICE(xpd, pos, "Got DAHDI_VMWI notification but vmwi_ioctl parameter is off. Ignoring.\n"); return 0; } /* Digital inputs/outputs don't have VM leds */ @@ -895,7 +895,7 @@ static int FXS_card_open(xpd_t *xpd, lineno_t chan) LINE_DBG(SIGNAL, xpd, chan, "is onhook\n"); /* * Delegate updating zaptel to FXS_card_tick(): - * The problem is that zt_hooksig() is spinlocking the channel and + * The problem is that dahdi_hooksig() is spinlocking the channel and * we are called by zaptel with the spinlock already held on the * same channel. */ @@ -1000,7 +1000,7 @@ static void detect_vmwi(xpd_t *xpd) priv = xpd->priv; BUG_ON(!priv); for_each_line(xpd, i) { - struct zt_chan *chan = &xpd->span.chans[i]; + struct dahdi_chan *chan = &xpd->span.chans[i]; byte *writechunk = chan->writechunk; if(IS_SET(xpd->offhook | xpd->cid_on | xpd->digital_inputs | xpd->digital_outputs, i)) @@ -1010,7 +1010,7 @@ static void detect_vmwi(xpd_t *xpd) int j; LINE_DBG(GENERAL, xpd, pos, "MSG:"); - for(j = 0; j < ZT_CHUNKSIZE; j++) { + for(j = 0; j < DAHDI_CHUNKSIZE; j++) { if(debug) printk(" %02X", writechunk[j]); } @@ -1018,15 +1018,15 @@ static void detect_vmwi(xpd_t *xpd) printk("\n"); } #endif - if(unlikely(mem_equal(writechunk, FSK_COMMON_PATTERN, ZT_CHUNKSIZE))) + if(unlikely(mem_equal(writechunk, FSK_COMMON_PATTERN, DAHDI_CHUNKSIZE))) BIT_SET(priv->found_fsk_pattern, i); else if(unlikely(IS_SET(priv->found_fsk_pattern, i))) { BIT_CLR(priv->found_fsk_pattern, i); - if(unlikely(mem_equal(writechunk, FSK_ON_PATTERN, ZT_CHUNKSIZE))) { + if(unlikely(mem_equal(writechunk, FSK_ON_PATTERN, DAHDI_CHUNKSIZE))) { LINE_DBG(SIGNAL, xpd, i, "MSG WAITING ON\n"); BIT_SET(xpd->msg_waiting, i); start_stop_vm_led(xbus, xpd, i); - } else if(unlikely(mem_equal(writechunk, FSK_OFF_PATTERN, ZT_CHUNKSIZE))) { + } else if(unlikely(mem_equal(writechunk, FSK_OFF_PATTERN, DAHDI_CHUNKSIZE))) { LINE_DBG(SIGNAL, xpd, i, "MSG WAITING OFF\n"); BIT_CLR(xpd->msg_waiting, i); start_stop_vm_led(xbus, xpd, i); @@ -1034,7 +1034,7 @@ static void detect_vmwi(xpd_t *xpd) int j; LINE_NOTICE(xpd, i, "MSG WAITING Unexpected:"); - for(j = 0; j < ZT_CHUNKSIZE; j++) { + for(j = 0; j < DAHDI_CHUNKSIZE; j++) { printk(" %02X", writechunk[j]); } printk("\n"); @@ -1211,7 +1211,7 @@ static void process_dtmf(xpd_t *xpd, xpp_line_t lines, byte val) digit = dtmf_digits[val]; for_each_line(xpd, i) { if(IS_SET(lines, i)) { - int event = (is_down) ? ZT_EVENT_DTMFDOWN : ZT_EVENT_DTMFUP; + int event = (is_down) ? DAHDI_EVENT_DTMFDOWN : DAHDI_EVENT_DTMFUP; bool want_mute = IS_SET(priv->want_dtmf_mute, i); bool want_event = IS_SET(priv->want_dtmf_events, i); @@ -1236,7 +1236,7 @@ static void process_dtmf(xpd_t *xpd, xpp_line_t lines, byte val) __do_mute_dtmf(xpd, i, 0); __pcm_recompute(xpd, 0); /* XPD is locked */ if(want_event) - zt_qevent_lock(&xpd->chans[i], event | digit); + dahdi_qevent_lock(&xpd->chans[i], event | digit); break; } } @@ -1459,10 +1459,10 @@ static int __init card_fxs_startup(void) #else INFO("FEATURE: without DIGITAL INPUTS support\n"); #endif -#ifdef ZT_VMWI - INFO("FEATURE: ZT_VMWI\n"); +#ifdef DAHDI_VMWI + INFO("FEATURE: DAHDI_VMWI\n"); #else - INFO("FEATURE: NO ZT_VMWI\n"); + INFO("FEATURE: NO DAHDI_VMWI\n"); #endif #ifdef WITH_METERING INFO("FEATURE: WITH METERING Generation\n"); diff --git a/drivers/dahdi/xpp/card_pri.c b/drivers/dahdi/xpp/card_pri.c index 335b933..8b920bf 100644 --- a/drivers/dahdi/xpp/card_pri.c +++ b/drivers/dahdi/xpp/card_pri.c @@ -41,19 +41,19 @@ static DEF_PARM(uint, poll_interval, 500, 0644, "Poll channel state interval in #define PRI_LINES_BITMASK BITMASK(31) #define PRI_DCHAN_SIGCAP ( \ - ZT_SIG_EM | \ - ZT_SIG_CLEAR | \ - ZT_SIG_FXSLS | \ - ZT_SIG_FXSGS | \ - ZT_SIG_FXSKS | \ - ZT_SIG_FXOLS | \ - ZT_SIG_FXOGS | \ - ZT_SIG_FXOKS | \ - ZT_SIG_CAS | \ - ZT_SIG_DACS | \ - ZT_SIG_SF \ + DAHDI_SIG_EM | \ + DAHDI_SIG_CLEAR | \ + DAHDI_SIG_FXSLS | \ + DAHDI_SIG_FXSGS | \ + DAHDI_SIG_FXSKS | \ + DAHDI_SIG_FXOLS | \ + DAHDI_SIG_FXOGS | \ + DAHDI_SIG_FXOKS | \ + DAHDI_SIG_CAS | \ + DAHDI_SIG_DACS | \ + DAHDI_SIG_SF \ ) -#define PRI_BCHAN_SIGCAP (ZT_SIG_CLEAR | ZT_SIG_DACS) +#define PRI_BCHAN_SIGCAP (DAHDI_SIG_CLEAR | DAHDI_SIG_DACS) #define MAX_SLAVES 4 /* we have MUX of 4 clocks */ #define PRI_PORT(xpd) ((xpd)->addr.subunit) @@ -64,8 +64,8 @@ static bool pri_packet_is_valid(xpacket_t *pack); static void pri_packet_dump(const char *msg, xpacket_t *pack); static int proc_pri_info_read(char *page, char **start, off_t off, int count, int *eof, void *data); static int proc_pri_info_write(struct file *file, const char __user *buffer, unsigned long count, void *data); -static int pri_startup(struct zt_span *span); -static int pri_shutdown(struct zt_span *span); +static int pri_startup(struct dahdi_span *span); +static int pri_shutdown(struct dahdi_span *span); static int pri_lineconfig(xpd_t *xpd, int lineconfig); #define PROC_REGISTER_FNAME "slics" @@ -127,17 +127,17 @@ static int pri_linecompat(enum pri_protocol pri_protocol) [PRI_PROTO_0] = 0, [PRI_PROTO_E1] = /* coding */ - ZT_CONFIG_CCS | + DAHDI_CONFIG_CCS | // CAS | - ZT_CONFIG_CRC4 | + DAHDI_CONFIG_CRC4 | /* framing */ - ZT_CONFIG_AMI | ZT_CONFIG_HDB3, + DAHDI_CONFIG_AMI | DAHDI_CONFIG_HDB3, [PRI_PROTO_T1] = /* coding */ - // ZT_CONFIG_D4 | - ZT_CONFIG_ESF | + // DAHDI_CONFIG_D4 | + DAHDI_CONFIG_ESF | /* framing */ - ZT_CONFIG_AMI | ZT_CONFIG_B8ZS, + DAHDI_CONFIG_AMI | DAHDI_CONFIG_B8ZS, [PRI_PROTO_J1] = 0 }; @@ -418,21 +418,21 @@ static int set_pri_proto(xpd_t *xpd, enum pri_protocol set_proto) } switch(set_proto) { case PRI_PROTO_E1: - deflaw = ZT_LAW_ALAW; + deflaw = DAHDI_LAW_ALAW; dchan_num = 16; - default_lineconfig = ZT_CONFIG_CRC4 | ZT_CONFIG_HDB3; + default_lineconfig = DAHDI_CONFIG_CRC4 | DAHDI_CONFIG_HDB3; break; case PRI_PROTO_T1: - deflaw = ZT_LAW_MULAW; + deflaw = DAHDI_LAW_MULAW; dchan_num = 24; - default_lineconfig = ZT_CONFIG_ESF | ZT_CONFIG_B8ZS; + default_lineconfig = DAHDI_CONFIG_ESF | DAHDI_CONFIG_B8ZS; fmr1 |= REG_FMR1_PMOD; break; case PRI_PROTO_J1: /* * Check all assumptions */ - deflaw = ZT_LAW_MULAW; + deflaw = DAHDI_LAW_MULAW; dchan_num = 24; fmr1 |= REG_FMR1_PMOD; rc0 |= REG_RC0_SJR; @@ -446,7 +446,7 @@ static int set_pri_proto(xpd_t *xpd, enum pri_protocol set_proto) } priv->pri_protocol = set_proto; xpd->channels = pri_num_channels(set_proto); - xpd->pcm_len = RPACKET_HEADERSIZE + sizeof(xpp_line_t) + xpd->channels * ZT_CHUNKSIZE; + xpd->pcm_len = RPACKET_HEADERSIZE + sizeof(xpp_line_t) + xpd->channels * DAHDI_CHUNKSIZE; xpd->wanted_pcm_mask = BITMASK(xpd->channels); priv->deflaw = deflaw; priv->dchan_num = dchan_num; @@ -665,14 +665,14 @@ static const struct { const int flags; } valid_spanconfigs[sizeof(unsigned int)*8] = { /* These apply to T1 */ -// VALID_CONFIG(4, ZT_CONFIG_D4, "D4"), FIXME: should support - VALID_CONFIG(5, ZT_CONFIG_ESF, "ESF"), - VALID_CONFIG(6, ZT_CONFIG_AMI, "AMI"), - VALID_CONFIG(7, ZT_CONFIG_B8ZS, "B8ZS"), +// VALID_CONFIG(4, DAHDI_CONFIG_D4, "D4"), FIXME: should support + VALID_CONFIG(5, DAHDI_CONFIG_ESF, "ESF"), + VALID_CONFIG(6, DAHDI_CONFIG_AMI, "AMI"), + VALID_CONFIG(7, DAHDI_CONFIG_B8ZS, "B8ZS"), /* These apply to E1 */ - VALID_CONFIG(8, ZT_CONFIG_CCS, "CCS"), - VALID_CONFIG(9, ZT_CONFIG_HDB3, "HDB3"), - VALID_CONFIG(10, ZT_CONFIG_CRC4, "CRC4"), + VALID_CONFIG(8, DAHDI_CONFIG_CCS, "CCS"), + VALID_CONFIG(9, DAHDI_CONFIG_HDB3, "HDB3"), + VALID_CONFIG(10, DAHDI_CONFIG_CRC4, "CRC4"), }; static int pri_lineconfig(xpd_t *xpd, int lineconfig) @@ -733,36 +733,36 @@ static int pri_lineconfig(xpd_t *xpd, int lineconfig) if(priv->local_loopback) fmr2 |= REG_FMR2_E_PLB; /* framing first */ - if (lineconfig & ZT_CONFIG_B8ZS) { + if (lineconfig & DAHDI_CONFIG_B8ZS) { framingstr = "B8ZS"; fmr0 = REG_FMR0_E_XC1 | REG_FMR0_E_XC0 | REG_FMR0_E_RC1 | REG_FMR0_E_RC0; - } else if (lineconfig & ZT_CONFIG_AMI) { + } else if (lineconfig & DAHDI_CONFIG_AMI) { framingstr = "AMI"; fmr0 = REG_FMR0_E_XC1 | REG_FMR0_E_RC1; - } else if (lineconfig & ZT_CONFIG_HDB3) { + } else if (lineconfig & DAHDI_CONFIG_HDB3) { framingstr = "HDB3"; fmr0 = REG_FMR0_E_XC1 | REG_FMR0_E_XC0 | REG_FMR0_E_RC1 | REG_FMR0_E_RC0; } /* then coding */ - if (lineconfig & ZT_CONFIG_ESF) { + if (lineconfig & DAHDI_CONFIG_ESF) { codingstr = "ESF"; fmr4 |= REG_FMR4_FM1; fmr2 |= REG_FMR2_T_AXRA | REG_FMR2_T_MCSP | REG_FMR2_T_SSP; - } else if (lineconfig & ZT_CONFIG_D4) { + } else if (lineconfig & DAHDI_CONFIG_D4) { codingstr = "D4"; - } else if (lineconfig & ZT_CONFIG_CCS) { + } else if (lineconfig & DAHDI_CONFIG_CCS) { codingstr = "CCS"; /* do nothing */ } /* E1's can enable CRC checking */ - if (lineconfig & ZT_CONFIG_CRC4) { + if (lineconfig & DAHDI_CONFIG_CRC4) { crcstr = "CRC4"; fmr2 |= REG_FMR2_E_RFS1; } XPD_DBG(GENERAL, xpd, "[%s] lineconfig=%s/%s/%s %s (0x%X)\n", (priv->is_nt)?"NT":"TE", framingstr, codingstr, crcstr, - (lineconfig & ZT_CONFIG_NOTOPEN)?"YELLOW":"", + (lineconfig & DAHDI_CONFIG_NOTOPEN)?"YELLOW":"", lineconfig); if(fmr0 != 0) { XPD_DBG(GENERAL, xpd, "%s: fmr0(0x%02X) = 0x%02X\n", __FUNCTION__, REG_FMR0, fmr0); @@ -782,7 +782,7 @@ bad_lineconfig: * Called only for 'span' keyword in /etc/zaptel.conf */ -static int pri_spanconfig(struct zt_span *span, struct zt_lineconfig *lc) +static int pri_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc) { xpd_t *xpd = span->pvt; struct PRI_priv_data *priv; @@ -816,7 +816,7 @@ static int pri_spanconfig(struct zt_span *span, struct zt_lineconfig *lc) * Called from zaptel with spinlock held on chan. Must not call back * zaptel functions. */ -static int pri_chanconfig(struct zt_chan *chan, int sigtype) +static int pri_chanconfig(struct dahdi_chan *chan, int sigtype) { DBG(GENERAL, "channel %d (%s) -> %s\n", chan->channo, chan->name, sig2str(sigtype)); // FIXME: sanity checks: @@ -838,7 +838,7 @@ static xpd_t *PRI_card_new(xbus_t *xbus, int unit, int subunit, const xproto_tab return NULL; priv = xpd->priv; priv->pri_protocol = PRI_PROTO_0; /* Default, changes in set_pri_proto() */ - priv->deflaw = ZT_LAW_DEFAULT; /* Default, changes in set_pri_proto() */ + priv->deflaw = DAHDI_LAW_DEFAULT; /* Default, changes in set_pri_proto() */ xpd->type_name = type_name(priv->pri_protocol, 0); /* Default, changes in set_nt() */ if(xpd_common_init(xbus, xpd, unit, subunit, subtype, subunits) < 0) @@ -917,13 +917,13 @@ static int PRI_card_zaptel_preregistration(xpd_t *xpd, bool on) /* Nothing to do yet */ return 0; } -#ifdef ZT_SPANSTAT_V2 +#ifdef DAHDI_SPANSTAT_V2 xpd->span.spantype = pri_protocol_name(priv->pri_protocol); #endif xpd->span.linecompat = pri_linecompat(priv->pri_protocol); xpd->span.deflaw = priv->deflaw; for_each_line(xpd, i) { - struct zt_chan *cur_chan = &xpd->chans[i]; + struct dahdi_chan *cur_chan = &xpd->chans[i]; bool is_dchan = i == PRI_DCHAN_IDX(priv); XPD_DBG(GENERAL, xpd, "setting PRI channel %d (%s)\n", i, @@ -934,8 +934,8 @@ static int PRI_card_zaptel_preregistration(xpd_t *xpd, bool on) cur_chan->pvt = xpd; if(is_dchan) { /* D-CHAN */ cur_chan->sigcap = PRI_DCHAN_SIGCAP; - //FIXME: cur_chan->flags |= ZT_FLAG_PRIDCHAN; - cur_chan->flags &= ~ZT_FLAG_HDLC; + //FIXME: cur_chan->flags |= DAHDI_FLAG_PRIDCHAN; + cur_chan->flags &= ~DAHDI_FLAG_HDLC; } else cur_chan->sigcap = PRI_BCHAN_SIGCAP; } @@ -961,7 +961,7 @@ static int PRI_card_zaptel_postregistration(xpd_t *xpd, bool on) return(0); } -static int PRI_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, zt_txsig_t txsig) +static int PRI_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, dahdi_txsig_t txsig) { LINE_DBG(SIGNAL, xpd, pos, "%s\n", txsig2str(txsig)); return 0; @@ -1102,7 +1102,7 @@ static int PRI_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long a if(!TRANSPORT_RUNNING(xpd->xbus)) return -ENODEV; switch (cmd) { - case ZT_TONEDETECT: + case DAHDI_TONEDETECT: /* * Asterisk call all span types with this (FXS specific) * call. Silently ignore it. @@ -1118,7 +1118,7 @@ static int PRI_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long a static int PRI_card_close(xpd_t *xpd, lineno_t pos) { - //struct zt_chan *chan = &xpd->span.chans[pos]; + //struct dahdi_chan *chan = &xpd->span.chans[pos]; dchan_state(xpd, 0); return 0; } @@ -1126,7 +1126,7 @@ static int PRI_card_close(xpd_t *xpd, lineno_t pos) /* * Called only for 'span' keyword in /etc/zaptel.conf */ -static int pri_startup(struct zt_span *span) +static int pri_startup(struct dahdi_span *span) { xpd_t *xpd = span->pvt; struct PRI_priv_data *priv; @@ -1147,7 +1147,7 @@ static int pri_startup(struct zt_span *span) /* * Called only for 'span' keyword in /etc/zaptel.conf */ -static int pri_shutdown(struct zt_span *span) +static int pri_shutdown(struct dahdi_span *span) { xpd_t *xpd = span->pvt; struct PRI_priv_data *priv; @@ -1180,7 +1180,7 @@ static void PRI_card_pcm_fromspan(xbus_t *xbus, xpd_t *xpd, xpp_line_t lines, xp { struct PRI_priv_data *priv; byte *pcm; - struct zt_chan *chans; + struct dahdi_chan *chans; unsigned long flags; int i; int physical_chan; @@ -1219,14 +1219,14 @@ static void PRI_card_pcm_fromspan(xbus_t *xbus, xpd_t *xpd, xpp_line_t lines, xp } #ifdef DEBUG_PCMTX if(pcmtx >= 0 && pcmtx_chan == i) - memset((u_char *)pcm, pcmtx, ZT_CHUNKSIZE); + memset((u_char *)pcm, pcmtx, DAHDI_CHUNKSIZE); else #endif - memcpy((u_char *)pcm, chans[i].writechunk, ZT_CHUNKSIZE); + memcpy((u_char *)pcm, chans[i].writechunk, DAHDI_CHUNKSIZE); // fill_beep((u_char *)pcm, xpd->addr.subunit, 2); } else - memset((u_char *)pcm, 0x7F, ZT_CHUNKSIZE); - pcm += ZT_CHUNKSIZE; + memset((u_char *)pcm, 0x7F, DAHDI_CHUNKSIZE); + pcm += DAHDI_CHUNKSIZE; } physical_chan++; } @@ -1249,7 +1249,7 @@ static void PRI_card_pcm_tospan(xbus_t *xbus, xpd_t *xpd, xpacket_t *pack) { struct PRI_priv_data *priv; byte *pcm; - struct zt_chan *chans; + struct dahdi_chan *chans; xpp_line_t physical_mask; unsigned long flags; int i; @@ -1290,10 +1290,10 @@ static void PRI_card_pcm_tospan(xbus_t *xbus, xpd_t *xpd, xpacket_t *pack) } if(IS_SET(physical_mask, i)) { r = chans[logical_chan].readchunk; - // memset((u_char *)r, 0x5A, ZT_CHUNKSIZE); // DEBUG + // memset((u_char *)r, 0x5A, DAHDI_CHUNKSIZE); // DEBUG // fill_beep((u_char *)r, 1, 1); // DEBUG: BEEP - memcpy((u_char *)r, pcm, ZT_CHUNKSIZE); - pcm += ZT_CHUNKSIZE; + memcpy((u_char *)r, pcm, DAHDI_CHUNKSIZE); + pcm += DAHDI_CHUNKSIZE; } logical_chan++; } @@ -1345,11 +1345,11 @@ static void layer1_state(xpd_t *xpd, byte data_low) BUG_ON(!priv); priv->poll_noreplies = 0; if(data_low & REG_FRS0_LOS) - alarms |= ZT_ALARM_RED; + alarms |= DAHDI_ALARM_RED; if(data_low & REG_FRS0_AIS) - alarms |= ZT_ALARM_BLUE; + alarms |= DAHDI_ALARM_BLUE; if(data_low & REG_FRS0_RRA) - alarms |= ZT_ALARM_YELLOW; + alarms |= DAHDI_ALARM_YELLOW; priv->layer1_up = alarms == 0; #if 0 /* @@ -1373,7 +1373,7 @@ static void layer1_state(xpd_t *xpd, byte data_low) xpd->span.alarms, str1, alarms, str2); xpd->span.alarms = alarms; - zt_alarm_notify(&xpd->span); + dahdi_alarm_notify(&xpd->span); set_clocking(xpd); } priv->reg_frs0 = data_low; diff --git a/drivers/dahdi/xpp/xbus-pcm.c b/drivers/dahdi/xpp/xbus-pcm.c index 6155f35..8f1b294 100644 --- a/drivers/dahdi/xpp/xbus-pcm.c +++ b/drivers/dahdi/xpp/xbus-pcm.c @@ -432,7 +432,7 @@ static void global_tick(void) } #ifdef ZAPTEL_SYNC_TICK -int zaptel_sync_tick(struct zt_span *span, int is_master) +int zaptel_sync_tick(struct dahdi_span *span, int is_master) { xpd_t *xpd = span->pvt; static int redundant_ticks; /* for extra spans */ @@ -607,7 +607,7 @@ void __pcm_recompute(xpd_t *xpd, xpp_line_t pcm_mask) line_count = 1; } xpd->pcm_len = (line_count) - ? RPACKET_HEADERSIZE + sizeof(xpp_line_t) + line_count * ZT_CHUNKSIZE + ? RPACKET_HEADERSIZE + sizeof(xpp_line_t) + line_count * DAHDI_CHUNKSIZE : 0L; xpd->wanted_pcm_mask = pcm_mask; } @@ -647,14 +647,14 @@ void fill_beep(u_char *buf, int num, int duration) which = num % ARRAY_SIZE(beep); snd = &beep[which]; } - memcpy(buf, snd, ZT_CHUNKSIZE); + memcpy(buf, snd, DAHDI_CHUNKSIZE); } #ifdef XPP_EC_CHUNK /* * Taken from zaptel.c */ -static inline void xpp_ec_chunk(struct zt_chan *chan, unsigned char *rxchunk, const unsigned char *txchunk) +static inline void xpp_ec_chunk(struct dahdi_chan *chan, unsigned char *rxchunk, const unsigned char *txchunk) { int16_t rxlin; int x; @@ -664,10 +664,10 @@ static inline void xpp_ec_chunk(struct zt_chan *chan, unsigned char *rxchunk, co if (!chan->ec) return; spin_lock_irqsave(&chan->lock, flags); - for (x=0;xec, ZT_XLAW(txchunk[x], chan), rxlin); - rxchunk[x] = ZT_LIN2X((int)rxlin, chan); + for (x=0;xec, DAHDI_XLAW(txchunk[x], chan), rxlin); + rxchunk[x] = DAHDI_LIN2X((int)rxlin, chan); } spin_unlock_irqrestore(&chan->lock, flags); } @@ -676,7 +676,7 @@ static inline void xpp_ec_chunk(struct zt_chan *chan, unsigned char *rxchunk, co static void do_ec(xpd_t *xpd) { #ifdef WITH_ECHO_SUPPRESSION - struct zt_chan *chans = xpd->span.chans; + struct dahdi_chan *chans = xpd->span.chans; int i; /* FIXME: need to Echo cancel double buffered data */ @@ -691,9 +691,9 @@ static void do_ec(xpd_t *xpd) xpp_ec_chunk(&chans[i], chans[i].readchunk, xpd->ec_chunk2[i]); else #endif - zt_ec_chunk(&chans[i], chans[i].readchunk, xpd->ec_chunk2[i]); - memcpy(xpd->ec_chunk2[i], xpd->ec_chunk1[i], ZT_CHUNKSIZE); - memcpy(xpd->ec_chunk1[i], chans[i].writechunk, ZT_CHUNKSIZE); + dahdi_ec_chunk(&chans[i], chans[i].readchunk, xpd->ec_chunk2[i]); + memcpy(xpd->ec_chunk2[i], xpd->ec_chunk1[i], DAHDI_CHUNKSIZE); + memcpy(xpd->ec_chunk1[i], chans[i].writechunk, DAHDI_CHUNKSIZE); } #endif } @@ -703,24 +703,24 @@ static void do_ec(xpd_t *xpd) /* Option 1: If you're a T1 like interface, you can just provide a rbsbits function and we'll assert robbed bits for you. Be sure to - set the ZT_FLAG_RBS in this case. */ + set the DAHDI_FLAG_RBS in this case. */ /* Opt: If the span uses A/B bits, set them here */ -int (*rbsbits)(struct zt_chan *chan, int bits); +int (*rbsbits)(struct dahdi_chan *chan, int bits); /* Option 2: If you don't know about sig bits, but do have their equivalents (i.e. you can disconnect battery, detect off hook, generate ring, etc directly) then you can just specify a sethook function, and we'll call you with appropriate hook states - to set. Still set the ZT_FLAG_RBS in this case as well */ -int (*hooksig)(struct zt_chan *chan, zt_txsig_t hookstate); + to set. Still set the DAHDI_FLAG_RBS in this case as well */ +int (*hooksig)(struct dahdi_chan *chan, dahdi_txsig_t hookstate); /* Option 3: If you can't use sig bits, you can write a function which handles the individual hook states */ -int (*sethook)(struct zt_chan *chan, int hookstate); +int (*sethook)(struct dahdi_chan *chan, int hookstate); #endif -int xpp_echocan(struct zt_chan *chan, int len) +int xpp_echocan(struct dahdi_chan *chan, int len) { #ifdef XPP_EC_CHUNK if(len == 0) { /* shut down */ @@ -824,7 +824,7 @@ dropit: void generic_card_pcm_fromspan(xbus_t *xbus, xpd_t *xpd, xpp_line_t lines, xpacket_t *pack) { byte *pcm; - struct zt_chan *chans; + struct dahdi_chan *chans; unsigned long flags; int i; @@ -840,14 +840,14 @@ void generic_card_pcm_fromspan(xbus_t *xbus, xpd_t *xpd, xpp_line_t lines, xpack if(SPAN_REGISTERED(xpd)) { #ifdef DEBUG_PCMTX if(pcmtx >= 0 && pcmtx_chan == i) - memset((u_char *)pcm, pcmtx, ZT_CHUNKSIZE); + memset((u_char *)pcm, pcmtx, DAHDI_CHUNKSIZE); else #endif - memcpy((u_char *)pcm, chans[i].writechunk, ZT_CHUNKSIZE); + memcpy((u_char *)pcm, chans[i].writechunk, DAHDI_CHUNKSIZE); // fill_beep((u_char *)pcm, xpd->addr.subunit, 2); } else - memset((u_char *)pcm, 0x7F, ZT_CHUNKSIZE); - pcm += ZT_CHUNKSIZE; + memset((u_char *)pcm, 0x7F, DAHDI_CHUNKSIZE); + pcm += DAHDI_CHUNKSIZE; } } XPD_COUNTER(xpd, PCM_WRITE)++; @@ -871,20 +871,20 @@ void generic_card_pcm_tospan(xbus_t *xbus, xpd_t *xpd, xpacket_t *pack) if(!IS_SET(xpd->wanted_pcm_mask, i)) { if(IS_SET(xpd->silence_pcm, i)) { - memset((u_char *)r, 0x7F, ZT_CHUNKSIZE); // SILENCE - memset(xpd->ec_chunk2[i], 0x7F, ZT_CHUNKSIZE); - memset(xpd->ec_chunk1[i], 0x7F, ZT_CHUNKSIZE); + memset((u_char *)r, 0x7F, DAHDI_CHUNKSIZE); // SILENCE + memset(xpd->ec_chunk2[i], 0x7F, DAHDI_CHUNKSIZE); + memset(xpd->ec_chunk1[i], 0x7F, DAHDI_CHUNKSIZE); } continue; } pcm_mask &= ~xpd->mute_dtmf; if(IS_SET(pcm_mask, i)) { - // memset((u_char *)r, 0x5A, ZT_CHUNKSIZE); // DEBUG + // memset((u_char *)r, 0x5A, DAHDI_CHUNKSIZE); // DEBUG // fill_beep((u_char *)r, 1, 1); // DEBUG: BEEP - memcpy((u_char *)r, pcm, ZT_CHUNKSIZE); - pcm += ZT_CHUNKSIZE; + memcpy((u_char *)r, pcm, DAHDI_CHUNKSIZE); + pcm += DAHDI_CHUNKSIZE; } else { - memset((u_char *)r, 0x7F, ZT_CHUNKSIZE); // SILENCE + memset((u_char *)r, 0x7F, DAHDI_CHUNKSIZE); // SILENCE } } out: @@ -987,10 +987,10 @@ static void xbus_tick(xbus_t *xbus) } #endif /* - * calls to zt_transmit should be out of spinlocks, as it may call back + * calls to dahdi_transmit should be out of spinlocks, as it may call back * our hook setting methods. */ - zt_transmit(&xpd->span); + dahdi_transmit(&xpd->span); } } /* @@ -1070,7 +1070,7 @@ static void xbus_tick(xbus_t *xbus) continue; if(SPAN_REGISTERED(xpd)) { do_ec(xpd); - zt_receive(&xpd->span); + dahdi_receive(&xpd->span); } xpd->silence_pcm = 0; /* silence was injected */ xpd->timer_count = xbus->global_counter; diff --git a/drivers/dahdi/xpp/xbus-pcm.h b/drivers/dahdi/xpp/xbus-pcm.h index 3265f68..9d4e771 100644 --- a/drivers/dahdi/xpp/xbus-pcm.h +++ b/drivers/dahdi/xpp/xbus-pcm.h @@ -28,7 +28,7 @@ #include "xdefs.h" #include -#include +#include #ifdef __KERNEL__ @@ -112,9 +112,9 @@ void got_new_syncer(xbus_t *xbus, enum sync_mode mode, int drift); int xbus_command_queue_tick(xbus_t *xbus); void xbus_reset_counters(xbus_t *xbus); void elect_syncer(const char *msg); -int xpp_echocan(struct zt_chan *chan, int len); +int xpp_echocan(struct dahdi_chan *chan, int len); #ifdef ZAPTEL_SYNC_TICK -int zaptel_sync_tick(struct zt_span *span, int is_master); +int zaptel_sync_tick(struct dahdi_span *span, int is_master); #endif #ifdef XPP_EC_CHUNK diff --git a/drivers/dahdi/xpp/xdefs.h b/drivers/dahdi/xpp/xdefs.h index f928fd4..e6e69f1 100644 --- a/drivers/dahdi/xpp/xdefs.h +++ b/drivers/dahdi/xpp/xdefs.h @@ -64,9 +64,9 @@ struct list_head { struct list_head *next; struct list_head *prev; }; #define MAX_PROC_WRITE 100 /* Largest buffer we allow writing our /proc files */ #define CHANNELS_PERXPD 32 /* Depends on xpp_line_t and protocol fields */ -#define MAX_SPANNAME 20 /* From zaptel.h */ -#define MAX_SPANDESC 40 /* From zaptel.h */ -#define MAX_CHANNAME 40 /* From zaptel.h */ +#define MAX_SPANNAME 20 /* From dahdi/kernel.h */ +#define MAX_SPANDESC 40 /* From dahdi/kernel.h */ +#define MAX_CHANNAME 40 /* From dahdi/kernel.h */ #define XPD_NAMELEN 10 /* must be <= from maximal workqueue name */ #define XPD_DESCLEN 20 diff --git a/drivers/dahdi/xpp/xpd.h b/drivers/dahdi/xpp/xpd.h index 8c7c514..506a935 100644 --- a/drivers/dahdi/xpp/xpd.h +++ b/drivers/dahdi/xpp/xpd.h @@ -42,7 +42,7 @@ #endif #endif /* __KERNEL__ */ -#include +#include #ifdef __KERNEL__ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) @@ -139,8 +139,8 @@ static struct xpd_counters { */ struct xpd { char xpdname[XPD_NAMELEN]; - struct zt_span span; - struct zt_chan *chans; + struct dahdi_span span; + struct dahdi_chan *chans; int channels; xpd_type_t type; const char *type_name; @@ -167,7 +167,7 @@ struct xpd { xbus_t *xbus; /* The XBUS we are connected to */ spinlock_t lock; - atomic_t zt_registered; /* Am I fully registered with zaptel */ + atomic_t dahdi_registered; /* Am I fully registered with zaptel */ atomic_t open_counter; /* Number of open channels */ int flags; @@ -197,8 +197,8 @@ struct xpd { struct list_head xpd_list; unsigned int timer_count; /* Echo cancelation */ - u_char ec_chunk1[CHANNELS_PERXPD][ZT_CHUNKSIZE]; - u_char ec_chunk2[CHANNELS_PERXPD][ZT_CHUNKSIZE]; + u_char ec_chunk1[CHANNELS_PERXPD][DAHDI_CHUNKSIZE]; + u_char ec_chunk2[CHANNELS_PERXPD][DAHDI_CHUNKSIZE]; }; #define for_each_line(xpd,i) for((i) = 0; (i) < (xpd)->channels; (i)++) diff --git a/drivers/dahdi/xpp/xpp_zap.c b/drivers/dahdi/xpp/xpp_zap.c index 5ee7303..12ffeb8 100644 --- a/drivers/dahdi/xpp/xpp_zap.c +++ b/drivers/dahdi/xpp/xpp_zap.c @@ -38,7 +38,7 @@ #include /* for udelay */ #include #include -#include +#include #include "xbus-core.h" #include "xproto.h" #include "xpp_zap.h" @@ -49,7 +49,7 @@ static const char rcsid[] = "$Id$"; #ifdef CONFIG_PROC_FS struct proc_dir_entry *xpp_proc_toplevel = NULL; #define PROC_DIR "xpp" -#define PROC_XPD_ZTREGISTER "zt_registration" +#define PROC_XPD_ZTREGISTER "dahdi_registration" #define PROC_XPD_BLINK "blink" #define PROC_XPD_SUMMARY "summary" #endif @@ -350,9 +350,9 @@ static int xpd_read_proc(char *page, char **start, off_t off, int count, int *eo if(SPAN_REGISTERED(xpd)) { len += sprintf(page + len, "\nPCM:\n | [readchunk] | [writechunk] | W D"); for_each_line(xpd, i) { - struct zt_chan *chans = xpd->span.chans; - byte rchunk[ZT_CHUNKSIZE]; - byte wchunk[ZT_CHUNKSIZE]; + struct dahdi_chan *chans = xpd->span.chans; + byte rchunk[DAHDI_CHUNKSIZE]; + byte wchunk[DAHDI_CHUNKSIZE]; byte *rp; byte *wp; int j; @@ -365,14 +365,14 @@ static int xpd_read_proc(char *page, char **start, off_t off, int count, int *eo continue; rp = chans[i].readchunk; wp = chans[i].writechunk; - memcpy(rchunk, rp, ZT_CHUNKSIZE); - memcpy(wchunk, wp, ZT_CHUNKSIZE); + memcpy(rchunk, rp, DAHDI_CHUNKSIZE); + memcpy(wchunk, wp, DAHDI_CHUNKSIZE); len += sprintf(page + len, "\n port %2d> | ", i); - for(j = 0; j < ZT_CHUNKSIZE; j++) { + for(j = 0; j < DAHDI_CHUNKSIZE; j++) { len += sprintf(page + len, "%02X ", rchunk[j]); } len += sprintf(page + len, " | "); - for(j = 0; j < ZT_CHUNKSIZE; j++) { + for(j = 0; j < DAHDI_CHUNKSIZE; j++) { len += sprintf(page + len, "%02X ", wchunk[j]); } len += sprintf(page + len, " | %c", @@ -386,7 +386,7 @@ static int xpd_read_proc(char *page, char **start, off_t off, int count, int *eo if(SPAN_REGISTERED(xpd)) { len += sprintf(page + len, "\nSignalling:\n"); for_each_line(xpd, i) { - struct zt_chan *chan = &xpd->span.chans[i]; + struct dahdi_chan *chan = &xpd->span.chans[i]; len += sprintf(page + len, "\t%2d> sigcap=0x%04X sig=0x%04X\n", i, chan->sigcap, chan->sig); } } @@ -450,10 +450,10 @@ xpd_t *xpd_alloc(size_t privsize, const xproto_table_t *proto_table, int channel xpd->digital_outputs = 0; xpd->digital_inputs = 0; - atomic_set(&xpd->zt_registered, 0); + atomic_set(&xpd->dahdi_registered, 0); atomic_set(&xpd->open_counter, 0); - xpd->chans = kmalloc(sizeof(struct zt_chan)*xpd->channels, GFP_KERNEL); + xpd->chans = kmalloc(sizeof(struct dahdi_chan)*xpd->channels, GFP_KERNEL); if (xpd->chans == NULL) { ERR("%s: Unable to allocate channels\n", __FUNCTION__); goto err; @@ -472,8 +472,8 @@ err: /* FIXME: this should be removed once digium patch their zaptel.h * I simply wish to avoid changing zaptel.h in the xpp patches. */ -#ifndef ZT_EVENT_REMOVED -#define ZT_EVENT_REMOVED (20) +#ifndef DAHDI_EVENT_REMOVED +#define DAHDI_EVENT_REMOVED (20) #endif void xpd_disconnect(xpd_t *xpd) @@ -490,11 +490,11 @@ void xpd_disconnect(xpd_t *xpd) if(SPAN_REGISTERED(xpd)) { int i; - update_xpd_status(xpd, ZT_ALARM_NOTOPEN); + update_xpd_status(xpd, DAHDI_ALARM_NOTOPEN); /* TODO: Should this be done before releasing the spinlock? */ - XPD_DBG(DEVICES, xpd, "Queuing ZT_EVENT_REMOVED on all channels to ask user to release them\n"); + XPD_DBG(DEVICES, xpd, "Queuing DAHDI_EVENT_REMOVED on all channels to ask user to release them\n"); for (i=0; ispan.channels; i++) - zt_qevent_lock(&xpd->chans[i],ZT_EVENT_REMOVED); + dahdi_qevent_lock(&xpd->chans[i],DAHDI_EVENT_REMOVED); } out: spin_unlock_irqrestore(&xpd->lock, flags); @@ -514,14 +514,14 @@ void xpd_remove(xpd_t *xpd) void update_xpd_status(xpd_t *xpd, int alarm_flag) { - struct zt_span *span = &xpd->span; + struct dahdi_span *span = &xpd->span; if(!SPAN_REGISTERED(xpd)) { // XPD_NOTICE(xpd, "%s: XPD is not registered. Skipping.\n", __FUNCTION__); return; } switch (alarm_flag) { - case ZT_ALARM_NONE: + case DAHDI_ALARM_NONE: xpd->last_response = jiffies; break; default: @@ -531,22 +531,22 @@ void update_xpd_status(xpd_t *xpd, int alarm_flag) if(span->alarms == alarm_flag) return; span->alarms = alarm_flag; - zt_alarm_notify(span); + dahdi_alarm_notify(span); XPD_DBG(GENERAL, xpd, "Update XPD alarms: %s -> %02X\n", xpd->span.name, alarm_flag); } void update_line_status(xpd_t *xpd, int pos, bool to_offhook) { - zt_rxsig_t rxsig; + dahdi_rxsig_t rxsig; BUG_ON(!xpd); if(to_offhook) { BIT_SET(xpd->offhook, pos); - rxsig = ZT_RXSIG_OFFHOOK; + rxsig = DAHDI_RXSIG_OFFHOOK; } else { BIT_CLR(xpd->offhook, pos); BIT_CLR(xpd->cid_on, pos); - rxsig = ZT_RXSIG_ONHOOK; + rxsig = DAHDI_RXSIG_ONHOOK; /* * To prevent latest PCM to stay in buffers * indefinitely, mark this channel for a @@ -557,13 +557,13 @@ void update_line_status(xpd_t *xpd, int pos, bool to_offhook) BIT_SET(xpd->silence_pcm, pos); } /* - * We should not spinlock before calling zt_hooksig() as + * We should not spinlock before calling dahdi_hooksig() as * it may call back into our xpp_hooksig() and cause * a nested spinlock scenario */ - LINE_DBG(SIGNAL, xpd, pos, "rxsig=%s\n", (rxsig == ZT_RXSIG_ONHOOK) ? "ONHOOK" : "OFFHOOK"); + LINE_DBG(SIGNAL, xpd, pos, "rxsig=%s\n", (rxsig == DAHDI_RXSIG_ONHOOK) ? "ONHOOK" : "OFFHOOK"); if(SPAN_REGISTERED(xpd)) - zt_hooksig(&xpd->chans[pos], rxsig); + dahdi_hooksig(&xpd->chans[pos], rxsig); } #ifdef CONFIG_PROC_FS @@ -593,7 +593,7 @@ static int proc_xpd_ztregister_write(struct file *file, const char __user *buffe { xpd_t *xpd = data; char buf[MAX_PROC_WRITE]; - int zt_reg; + int dahdi_reg; int ret; BUG_ON(!xpd); @@ -602,11 +602,11 @@ static int proc_xpd_ztregister_write(struct file *file, const char __user *buffe if(copy_from_user(buf, buffer, count)) return -EFAULT; buf[count] = '\0'; - ret = sscanf(buf, "%d", &zt_reg); + ret = sscanf(buf, "%d", &dahdi_reg); if(ret != 1) return -EINVAL; - XPD_DBG(GENERAL, xpd, "%s\n", (zt_reg) ? "register" : "unregister"); - if(zt_reg) + XPD_DBG(GENERAL, xpd, "%s\n", (dahdi_reg) ? "register" : "unregister"); + if(dahdi_reg) ret = zaptel_register_xpd(xpd); else ret = zaptel_unregister_xpd(xpd); @@ -671,7 +671,7 @@ static int proc_xpd_blink_write(struct file *file, const char __user *buffer, un * Called from zaptel with spinlock held on chan. Must not call back * zaptel functions. */ -int xpp_open(struct zt_chan *chan) +int xpp_open(struct dahdi_chan *chan) { #if 0 xpd_t *xpd = chan->pvt; @@ -714,7 +714,7 @@ int xpp_open(struct zt_chan *chan) return 0; } -int xpp_close(struct zt_chan *chan) +int xpp_close(struct dahdi_chan *chan) { xpd_t *xpd = chan->pvt; xbus_t *xbus = xpd->xbus; @@ -745,7 +745,7 @@ void report_bad_ioctl(const char *msg, xpd_t *xpd, int pos, unsigned int cmd) XPD_NOTICE(xpd, " IOC_SIZE=0x%02X\n", _IOC_SIZE(cmd)); } -int xpp_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long arg) +int xpp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long arg) { xpd_t *xpd = chan->pvt; int pos = chan->chanpos - 1; @@ -767,7 +767,7 @@ int xpp_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long arg) return 0; } -static int xpp_hooksig(struct zt_chan *chan, zt_txsig_t txsig) +static int xpp_hooksig(struct dahdi_chan *chan, dahdi_txsig_t txsig) { xpd_t *xpd = chan->pvt; xbus_t *xbus; @@ -786,10 +786,10 @@ static int xpp_hooksig(struct zt_chan *chan, zt_txsig_t txsig) /* Req: Set the requested chunk size. This is the unit in which you must report results for conferencing, etc */ -int xpp_setchunksize(struct zt_span *span, int chunksize); +int xpp_setchunksize(struct dahdi_span *span, int chunksize); /* Enable maintenance modes */ -int xpp_maint(struct zt_span *span, int cmd) +int xpp_maint(struct dahdi_span *span, int cmd) { xpd_t *xpd = span->pvt; int ret = 0; @@ -799,23 +799,23 @@ int xpp_maint(struct zt_span *span, int cmd) DBG(GENERAL, "span->mainttimer=%d\n", span->mainttimer); switch(cmd) { - case ZT_MAINT_NONE: + case DAHDI_MAINT_NONE: printk("XXX Turn off local and remote loops XXX\n"); break; - case ZT_MAINT_LOCALLOOP: + case DAHDI_MAINT_LOCALLOOP: printk("XXX Turn on local loopback XXX\n"); break; - case ZT_MAINT_REMOTELOOP: + case DAHDI_MAINT_REMOTELOOP: printk("XXX Turn on remote loopback XXX\n"); break; - case ZT_MAINT_LOOPUP: + case DAHDI_MAINT_LOOPUP: printk("XXX Send loopup code XXX\n"); // CALL_XMETHOD(LOOPBACK_AX, xpd->xbus, xpd, loopback_data, ARRAY_SIZE(loopback_data)); break; - case ZT_MAINT_LOOPDOWN: + case DAHDI_MAINT_LOOPDOWN: printk("XXX Send loopdown code XXX\n"); break; - case ZT_MAINT_LOOPSTOP: + case DAHDI_MAINT_LOOPSTOP: printk("XXX Stop sending loop codes XXX\n"); break; default: @@ -824,7 +824,7 @@ int xpp_maint(struct zt_span *span, int cmd) break; } if (span->mainttimer || span->maintstat) - update_xpd_status(xpd, ZT_ALARM_LOOPBACK); + update_xpd_status(xpd, DAHDI_ALARM_LOOPBACK); return ret; } @@ -833,7 +833,7 @@ int xpp_maint(struct zt_span *span, int cmd) * If the watchdog detects no received data, it will call the * watchdog routine */ -static int xpp_watchdog(struct zt_span *span, int cause) +static int xpp_watchdog(struct dahdi_span *span, int cause) { static int rate_limit = 0; @@ -866,7 +866,7 @@ static int zaptel_unregister_xpd(xpd_t *xpd) spin_unlock_irqrestore(&xpd->lock, flags); return -EIDRM; } - update_xpd_status(xpd, ZT_ALARM_NOTOPEN); + update_xpd_status(xpd, DAHDI_ALARM_NOTOPEN); if(atomic_read(&xpd->open_counter)) { XPD_NOTICE(xpd, "Busy (open_counter=%d). Skipping.\n", atomic_read(&xpd->open_counter)); spin_unlock_irqrestore(&xpd->lock, flags); @@ -876,9 +876,9 @@ static int zaptel_unregister_xpd(xpd_t *xpd) spin_unlock_irqrestore(&xpd->lock, flags); if(xpd->card_present) xpd->xops->card_zaptel_preregistration(xpd, 0); - atomic_dec(&xpd->zt_registered); + atomic_dec(&xpd->dahdi_registered); atomic_dec(&num_registered_spans); - zt_unregister(&xpd->span); + dahdi_unregister(&xpd->span); if(xpd->card_present) xpd->xops->card_zaptel_postregistration(xpd, 0); return 0; @@ -886,7 +886,7 @@ static int zaptel_unregister_xpd(xpd_t *xpd) static int zaptel_register_xpd(xpd_t *xpd) { - struct zt_span *span; + struct dahdi_span *span; xbus_t *xbus; int cn; const xops_t *xops; @@ -901,12 +901,12 @@ static int zaptel_register_xpd(xpd_t *xpd) } cn = xpd->channels; XPD_DBG(DEVICES, xpd, "Initializing span: %d channels.\n", cn); - memset(xpd->chans, 0, sizeof(struct zt_chan)*cn); - memset(&xpd->span, 0, sizeof(struct zt_span)); + memset(xpd->chans, 0, sizeof(struct dahdi_chan)*cn); + memset(&xpd->span, 0, sizeof(struct dahdi_span)); span = &xpd->span; snprintf(span->name, MAX_SPANNAME, "%s/%s", xbus->busname, xpd->xpdname); - span->deflaw = ZT_LAW_MULAW; /* default, may be overriden by card_* drivers */ + span->deflaw = DAHDI_LAW_MULAW; /* default, may be overriden by card_* drivers */ init_waitqueue_head(&span->maintq); span->pvt = xpd; span->channels = cn; @@ -914,13 +914,13 @@ static int zaptel_register_xpd(xpd_t *xpd) span->open = xpp_open; span->close = xpp_close; - span->flags = ZT_FLAG_RBS; + span->flags = DAHDI_FLAG_RBS; span->hooksig = xpp_hooksig; /* Only with RBS bits */ span->ioctl = xpp_ioctl; span->maint = xpp_maint; -#ifdef ZT_SPANSTAT_V2 +#ifdef DAHDI_SPANSTAT_V2 /* - * This actually describe the zt_spaninfo version 3 + * This actually describe the dahdi_spaninfo version 3 * A bunch of unrelated data exported via a modified ioctl() * What a bummer... */ @@ -965,12 +965,12 @@ static int zaptel_register_xpd(xpd_t *xpd) xbus->num, xpd->addr.unit, xpd->addr.subunit, xpd->type_name); XPD_DBG(GENERAL, xpd, "Registering span '%s'\n", xpd->span.desc); xpd->xops->card_zaptel_preregistration(xpd, 1); - if(zt_register(&xpd->span, prefmaster)) { - XPD_ERR(xpd, "Failed to zt_register span\n"); + if(dahdi_register(&xpd->span, prefmaster)) { + XPD_ERR(xpd, "Failed to dahdi_register span\n"); return -ENODEV; } atomic_inc(&num_registered_spans); - atomic_inc(&xpd->zt_registered); + atomic_inc(&xpd->dahdi_registered); xpd->xops->card_zaptel_postregistration(xpd, 1); /* * Update zaptel about our state @@ -980,16 +980,16 @@ static int zaptel_register_xpd(xpd_t *xpd) * FIXME: since asterisk didn't open the channel yet, the report * is discarded anyway. OTOH, we cannot report in xpp_open or * xpp_chanconfig since zaptel call them with a spinlock on the channel - * and zt_hooksig tries to acquire the same spinlock, resulting in + * and dahdi_hooksig tries to acquire the same spinlock, resulting in * double spinlock deadlock (we are lucky that RH/Fedora kernel are * compiled with spinlock debugging).... tough. */ for_each_line(xpd, cn) { - struct zt_chan *chans = xpd->span.chans; + struct dahdi_chan *chans = xpd->span.chans; if(IS_SET(xpd->offhook, cn)) { LINE_NOTICE(xpd, cn, "Report OFFHOOK to zaptel\n"); - zt_hooksig(&chans[cn], ZT_RXSIG_OFFHOOK); + dahdi_hooksig(&chans[cn], DAHDI_RXSIG_OFFHOOK); } } #endif diff --git a/drivers/dahdi/xpp/xpp_zap.h b/drivers/dahdi/xpp/xpp_zap.h index dd56657..c6585af 100644 --- a/drivers/dahdi/xpp/xpp_zap.h +++ b/drivers/dahdi/xpp/xpp_zap.h @@ -35,10 +35,10 @@ void xpd_free(xpd_t *xpd); void xpd_remove(xpd_t *xpd); void update_xpd_status(xpd_t *xpd, int alarm_flag); void update_line_status(xpd_t *xpd, int pos, bool good); -int xpp_open(struct zt_chan *chan); -int xpp_close(struct zt_chan *chan); -int xpp_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long arg); -int xpp_maint(struct zt_span *span, int cmd); +int xpp_open(struct dahdi_chan *chan); +int xpp_close(struct dahdi_chan *chan); +int xpp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long arg); +int xpp_maint(struct dahdi_span *span, int cmd); void report_bad_ioctl(const char *msg, xpd_t *xpd, int pos, unsigned int cmd); int total_registered_spans(void); @@ -48,6 +48,6 @@ int total_registered_spans(void); extern struct proc_dir_entry *xpp_proc_toplevel; #endif -#define SPAN_REGISTERED(xpd) atomic_read(&(xpd)->zt_registered) +#define SPAN_REGISTERED(xpd) atomic_read(&(xpd)->dahdi_registered) #endif /* XPP_ZAP_H */ diff --git a/drivers/dahdi/xpp/xproto.h b/drivers/dahdi/xpp/xproto.h index 4691094..760b0a3 100644 --- a/drivers/dahdi/xpp/xproto.h +++ b/drivers/dahdi/xpp/xproto.h @@ -27,7 +27,7 @@ #ifdef __KERNEL__ #include #include -#include +#include /* * This must match the firmware protocol version @@ -225,7 +225,7 @@ struct xops { void (*card_pcm_tospan)(xbus_t *xbus, xpd_t *xpd, xpacket_t *pack); int (*card_zaptel_preregistration)(xpd_t *xpd, bool on); int (*card_zaptel_postregistration)(xpd_t *xpd, bool on); - int (*card_hooksig)(xbus_t *xbus, xpd_t *xpd, int pos, zt_txsig_t txsig); + int (*card_hooksig)(xbus_t *xbus, xpd_t *xpd, int pos, dahdi_txsig_t txsig); int (*card_ioctl)(xpd_t *xpd, int pos, unsigned int cmd, unsigned long arg); int (*card_open)(xpd_t *xpd, lineno_t pos); int (*card_close)(xpd_t *xpd, lineno_t pos); diff --git a/drivers/dahdi/xpp/zap_debug.c b/drivers/dahdi/xpp/zap_debug.c index e29e9dc..08f684e 100644 --- a/drivers/dahdi/xpp/zap_debug.c +++ b/drivers/dahdi/xpp/zap_debug.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include "zap_debug.h" #include "xdefs.h" diff --git a/drivers/dahdi/xpp/zap_debug.h b/drivers/dahdi/xpp/zap_debug.h index 79aefdf..2911828 100644 --- a/drivers/dahdi/xpp/zap_debug.h +++ b/drivers/dahdi/xpp/zap_debug.h @@ -22,7 +22,7 @@ * */ -#include /* for zt_* defs */ +#include /* for zt_* defs */ /* Debugging Macros */ @@ -92,25 +92,25 @@ void dump_poll(int debug, const char *msg, int poll); -static inline char *rxsig2str(zt_rxsig_t sig) +static inline char *rxsig2str(dahdi_rxsig_t sig) { switch(sig) { - case ZT_RXSIG_ONHOOK: return "ONHOOK"; - case ZT_RXSIG_OFFHOOK: return "OFFHOOK"; - case ZT_RXSIG_START: return "START"; - case ZT_RXSIG_RING: return "RING"; - case ZT_RXSIG_INITIAL: return "INITIAL"; + case DAHDI_RXSIG_ONHOOK: return "ONHOOK"; + case DAHDI_RXSIG_OFFHOOK: return "OFFHOOK"; + case DAHDI_RXSIG_START: return "START"; + case DAHDI_RXSIG_RING: return "RING"; + case DAHDI_RXSIG_INITIAL: return "INITIAL"; } return "Unknown rxsig"; } -static inline char *txsig2str(zt_txsig_t sig) +static inline char *txsig2str(dahdi_txsig_t sig) { switch(sig) { - case ZT_TXSIG_ONHOOK: return "TXSIG_ONHOOK"; - case ZT_TXSIG_OFFHOOK: return "TXSIG_OFFHOOK"; - case ZT_TXSIG_START: return "TXSIG_START"; - case ZT_TXSIG_KEWL: return "TXSIG_KEWL"; /* Drop battery if possible */ + case DAHDI_TXSIG_ONHOOK: return "TXSIG_ONHOOK"; + case DAHDI_TXSIG_OFFHOOK: return "TXSIG_OFFHOOK"; + case DAHDI_TXSIG_START: return "TXSIG_START"; + case DAHDI_TXSIG_KEWL: return "TXSIG_KEWL"; /* Drop battery if possible */ } return "Unknown txsig"; } @@ -118,24 +118,24 @@ static inline char *txsig2str(zt_txsig_t sig) static inline char *event2str(int event) { switch(event) { - case ZT_EVENT_NONE: return "NONE"; - case ZT_EVENT_ONHOOK: return "ONHOOK"; - case ZT_EVENT_RINGOFFHOOK: return "RINGOFFHOOK"; - case ZT_EVENT_WINKFLASH: return "WINKFLASH"; - case ZT_EVENT_ALARM: return "ALARM"; - case ZT_EVENT_NOALARM: return "NOALARM"; - case ZT_EVENT_ABORT: return "ABORT"; - case ZT_EVENT_OVERRUN: return "OVERRUN"; - case ZT_EVENT_BADFCS: return "BADFCS"; - case ZT_EVENT_DIALCOMPLETE: return "DIALCOMPLETE"; - case ZT_EVENT_RINGERON: return "RINGERON"; - case ZT_EVENT_RINGEROFF: return "RINGEROFF"; - case ZT_EVENT_HOOKCOMPLETE: return "HOOKCOMPLETE"; - case ZT_EVENT_BITSCHANGED: return "BITSCHANGED"; - case ZT_EVENT_PULSE_START: return "PULSE_START"; - case ZT_EVENT_TIMER_EXPIRED: return "TIMER_EXPIRED"; - case ZT_EVENT_TIMER_PING: return "TIMER_PING"; - case ZT_EVENT_POLARITY: return "POLARITY"; + case DAHDI_EVENT_NONE: return "NONE"; + case DAHDI_EVENT_ONHOOK: return "ONHOOK"; + case DAHDI_EVENT_RINGOFFHOOK: return "RINGOFFHOOK"; + case DAHDI_EVENT_WINKFLASH: return "WINKFLASH"; + case DAHDI_EVENT_ALARM: return "ALARM"; + case DAHDI_EVENT_NOALARM: return "NOALARM"; + case DAHDI_EVENT_ABORT: return "ABORT"; + case DAHDI_EVENT_OVERRUN: return "OVERRUN"; + case DAHDI_EVENT_BADFCS: return "BADFCS"; + case DAHDI_EVENT_DIALCOMPLETE: return "DIALCOMPLETE"; + case DAHDI_EVENT_RINGERON: return "RINGERON"; + case DAHDI_EVENT_RINGEROFF: return "RINGEROFF"; + case DAHDI_EVENT_HOOKCOMPLETE: return "HOOKCOMPLETE"; + case DAHDI_EVENT_BITSCHANGED: return "BITSCHANGED"; + case DAHDI_EVENT_PULSE_START: return "PULSE_START"; + case DAHDI_EVENT_TIMER_EXPIRED: return "TIMER_EXPIRED"; + case DAHDI_EVENT_TIMER_PING: return "TIMER_PING"; + case DAHDI_EVENT_POLARITY: return "POLARITY"; } return "Unknown event"; } @@ -143,13 +143,13 @@ static inline char *event2str(int event) static inline char *hookstate2str(int hookstate) { switch(hookstate) { - case ZT_ONHOOK: return "ZT_ONHOOK"; - case ZT_START: return "ZT_START"; - case ZT_OFFHOOK: return "ZT_OFFHOOK"; - case ZT_WINK: return "ZT_WINK"; - case ZT_FLASH: return "ZT_FLASH"; - case ZT_RING: return "ZT_RING"; - case ZT_RINGOFF: return "ZT_RINGOFF"; + case DAHDI_ONHOOK: return "DAHDI_ONHOOK"; + case DAHDI_START: return "DAHDI_START"; + case DAHDI_OFFHOOK: return "DAHDI_OFFHOOK"; + case DAHDI_WINK: return "DAHDI_WINK"; + case DAHDI_FLASH: return "DAHDI_FLASH"; + case DAHDI_RING: return "DAHDI_RING"; + case DAHDI_RINGOFF: return "DAHDI_RINGOFF"; } return "Unknown hookstate"; } @@ -158,24 +158,24 @@ static inline char *hookstate2str(int hookstate) static inline char *sig2str(int sig) { switch (sig) { - case ZT_SIG_FXSLS: return "FXSLS"; - case ZT_SIG_FXSKS: return "FXSKS"; - case ZT_SIG_FXSGS: return "FXSGS"; - case ZT_SIG_FXOLS: return "FXOLS"; - case ZT_SIG_FXOKS: return "FXOKS"; - case ZT_SIG_FXOGS: return "FXOGS"; - case ZT_SIG_EM: return "E&M"; - case ZT_SIG_EM_E1: return "E&M-E1"; - case ZT_SIG_CLEAR: return "Clear"; - case ZT_SIG_HDLCRAW: return "HDLCRAW"; - case ZT_SIG_HDLCFCS: return "HDLCFCS"; - case ZT_SIG_HDLCNET: return "HDLCNET"; - case ZT_SIG_SLAVE: return "Slave"; - case ZT_SIG_CAS: return "CAS"; - case ZT_SIG_DACS: return "DACS"; - case ZT_SIG_DACS_RBS: return "DACS+RBS"; - case ZT_SIG_SF: return "SF (ToneOnly)"; - case ZT_SIG_NONE: + case DAHDI_SIG_FXSLS: return "FXSLS"; + case DAHDI_SIG_FXSKS: return "FXSKS"; + case DAHDI_SIG_FXSGS: return "FXSGS"; + case DAHDI_SIG_FXOLS: return "FXOLS"; + case DAHDI_SIG_FXOKS: return "FXOKS"; + case DAHDI_SIG_FXOGS: return "FXOGS"; + case DAHDI_SIG_EM: return "E&M"; + case DAHDI_SIG_EM_E1: return "E&M-E1"; + case DAHDI_SIG_CLEAR: return "Clear"; + case DAHDI_SIG_HDLCRAW: return "HDLCRAW"; + case DAHDI_SIG_HDLCFCS: return "HDLCFCS"; + case DAHDI_SIG_HDLCNET: return "HDLCNET"; + case DAHDI_SIG_SLAVE: return "Slave"; + case DAHDI_SIG_CAS: return "CAS"; + case DAHDI_SIG_DACS: return "DACS"; + case DAHDI_SIG_DACS_RBS: return "DACS+RBS"; + case DAHDI_SIG_SF: return "SF (ToneOnly)"; + case DAHDI_SIG_NONE: break; } return "Unconfigured"; @@ -183,15 +183,15 @@ static inline char *sig2str(int sig) static inline char *alarmbit2str(int alarmbit) { - /* from zaptel.h */ + /* from dahdi/kernel.h */ switch(1 << alarmbit) { - case ZT_ALARM_NONE: return "NONE"; - case ZT_ALARM_RECOVER: return "RECOVER"; - case ZT_ALARM_LOOPBACK: return "LOOPBACK"; - case ZT_ALARM_YELLOW: return "YELLOW"; - case ZT_ALARM_RED: return "RED"; - case ZT_ALARM_BLUE: return "BLUE"; - case ZT_ALARM_NOTOPEN: return "NOTOPEN"; + case DAHDI_ALARM_NONE: return "NONE"; + case DAHDI_ALARM_RECOVER: return "RECOVER"; + case DAHDI_ALARM_LOOPBACK: return "LOOPBACK"; + case DAHDI_ALARM_YELLOW: return "YELLOW"; + case DAHDI_ALARM_RED: return "RED"; + case DAHDI_ALARM_BLUE: return "BLUE"; + case DAHDI_ALARM_NOTOPEN: return "NOTOPEN"; } return "UNKNOWN"; } -- cgit v1.2.3