[dahdi-commits] tzafrir: linux/trunk r4370 - /linux/trunk/drivers/dahdi/xpp/
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Tue Jun 17 12:17:06 CDT 2008
Author: tzafrir
Date: Tue Jun 17 12:17:05 2008
New Revision: 4370
URL: http://svn.digium.com/view/dahdi?view=rev&rev=4370
Log:
Make the xpp drivers build with dahdi.
Modified:
linux/trunk/drivers/dahdi/xpp/Kbuild
linux/trunk/drivers/dahdi/xpp/card_bri.c
linux/trunk/drivers/dahdi/xpp/card_fxo.c
linux/trunk/drivers/dahdi/xpp/card_fxs.c
linux/trunk/drivers/dahdi/xpp/card_pri.c
linux/trunk/drivers/dahdi/xpp/xbus-pcm.c
linux/trunk/drivers/dahdi/xpp/xbus-pcm.h
linux/trunk/drivers/dahdi/xpp/xdefs.h
linux/trunk/drivers/dahdi/xpp/xpd.h
linux/trunk/drivers/dahdi/xpp/xpp_zap.c
linux/trunk/drivers/dahdi/xpp/xpp_zap.h
linux/trunk/drivers/dahdi/xpp/xproto.h
linux/trunk/drivers/dahdi/xpp/zap_debug.c
linux/trunk/drivers/dahdi/xpp/zap_debug.h
Modified: linux/trunk/drivers/dahdi/xpp/Kbuild
URL: http://svn.digium.com/view/dahdi/linux/trunk/drivers/dahdi/xpp/Kbuild?view=diff&rev=4370&r1=4369&r2=4370
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/Kbuild (original)
+++ linux/trunk/drivers/dahdi/xpp/Kbuild Tue Jun 17 12:17:05 2008
@@ -14,13 +14,9 @@
-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)))
Modified: linux/trunk/drivers/dahdi/xpp/card_bri.c
URL: http://svn.digium.com/view/dahdi/linux/trunk/drivers/dahdi/xpp/card_bri.c?view=diff&rev=4370&r1=4369&r2=4370
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/card_bri.c (original)
+++ linux/trunk/drivers/dahdi/xpp/card_bri.c Tue Jun 17 12:17:05 2008
@@ -132,18 +132,18 @@
#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 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 @@
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 @@
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 @@
/* 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 @@
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 @@
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 @@
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 @@
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_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 @@
/*
* 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 @@
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 @@
* 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 @@
/*
* 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 @@
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 @@
/*
* 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 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 @@
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 @@
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 @@
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 @@
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");
Modified: linux/trunk/drivers/dahdi/xpp/card_fxo.c
URL: http://svn.digium.com/view/dahdi/linux/trunk/drivers/dahdi/xpp/card_fxo.c?view=diff&rev=4370&r1=4369&r2=4370
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/card_fxo.c (original)
+++ linux/trunk/drivers/dahdi/xpp/card_fxo.c Tue Jun 17 12:17:05 2008
@@ -42,9 +42,9 @@
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 @@
/* 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 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 @@
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 @@
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 @@
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 @@
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 @@
/* 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 @@
}
/* FIXME: based on data from from wctdm.h */
-#include <wctdm.h>
+#include <dahdi/wctdm_user.h>
/*
* 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 @@
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 @@
}
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;
Modified: linux/trunk/drivers/dahdi/xpp/card_fxs.c
URL: http://svn.digium.com/view/dahdi/linux/trunk/drivers/dahdi/xpp/card_fxs.c?view=diff&rev=4370&r1=4369&r2=4370
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/card_fxs.c (original)
+++ linux/trunk/drivers/dahdi/xpp/card_fxs.c Tue Jun 17 12:17:05 2008
@@ -41,7 +41,7 @@
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 @@
/* 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
}
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 @@
}
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 @@
}
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 @@
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 @@
* 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 @@
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 @@
}
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
__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 @@
#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");
Modified: linux/trunk/drivers/dahdi/xpp/card_pri.c
URL: http://svn.digium.com/view/dahdi/linux/trunk/drivers/dahdi/xpp/card_pri.c?view=diff&rev=4370&r1=4369&r2=4370
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/card_pri.c (original)
+++ linux/trunk/drivers/dahdi/xpp/card_pri.c Tue Jun 17 12:17:05 2008
@@ -41,19 +41,19 @@
#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 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 @@
[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 @@
}
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 @@
}
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 @@
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 @@
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 @@
* 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 @@
* 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 @@
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 @@
/* 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 @@
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 @@
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 @@
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_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 @@
/*
* 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 @@
/*
* 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 @@
{
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 @@
}
#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 @@
{
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 @@
}
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 @@
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 @@
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;
Modified: linux/trunk/drivers/dahdi/xpp/xbus-pcm.c
URL: http://svn.digium.com/view/dahdi/linux/trunk/drivers/dahdi/xpp/xbus-pcm.c?view=diff&rev=4370&r1=4369&r2=4370
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xbus-pcm.c (original)
+++ linux/trunk/drivers/dahdi/xpp/xbus-pcm.c Tue Jun 17 12:17:05 2008
@@ -432,7 +432,7 @@
}
#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 @@
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 @@
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 @@
if (!chan->ec)
return;
spin_lock_irqsave(&chan->lock, flags);
- for (x=0;x<ZT_CHUNKSIZE;x++) {
- rxlin = ZT_XLAW(rxchunk[x], chan);
- rxlin = xpp_echo_can_update(chan->ec, ZT_XLAW(txchunk[x], chan), rxlin);
- rxchunk[x] = ZT_LIN2X((int)rxlin, chan);
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
+ rxlin = DAHDI_XLAW(rxchunk[x], chan);
+ rxlin = xpp_echo_can_update(chan->ec, DAHDI_XLAW(txchunk[x], chan), rxlin);
+ rxchunk[x] = DAHDI_LIN2X((int)rxlin, chan);
}
spin_unlock_irqrestore(&chan->lock, flags);
}
@@ -676,7 +676,7 @@
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 @@
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);
[... 847 lines stripped ...]
More information about the dahdi-commits
mailing list