summaryrefslogtreecommitdiff
path: root/drivers/dahdi
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2008-05-21 16:44:40 +0000
committerKevin P. Fleming <kpfleming@digium.com>2008-05-21 16:44:40 +0000
commit66d8715a0fbf6eae202c27853ba616bcf754d0c7 (patch)
tree335a9397e48be117e3396f0d317aa3570ec502b7 /drivers/dahdi
parent0a64510aaa673ebafc3fdf4143f6e8e24252d9ef (diff)
replace ZT_ with DAHDI_, zt_ with dahdi_
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4320 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi')
-rw-r--r--drivers/dahdi/adt_lec.c2
-rw-r--r--drivers/dahdi/arith.h24
-rw-r--r--drivers/dahdi/dahdi-base.c2904
-rw-r--r--drivers/dahdi/dahdi_dummy.c28
-rw-r--r--drivers/dahdi/dahdi_dummy.h4
-rw-r--r--drivers/dahdi/dahdi_dynamic.c164
-rw-r--r--drivers/dahdi/dahdi_dynamic_eth.c18
-rw-r--r--drivers/dahdi/dahdi_dynamic_loc.c14
-rw-r--r--drivers/dahdi/dahdi_transcode.c154
-rw-r--r--drivers/dahdi/digits.h16
-rw-r--r--drivers/dahdi/hpec/hpec_dahdi.h10
-rw-r--r--drivers/dahdi/hpec/hpec_user.h4
-rw-r--r--drivers/dahdi/kb1ec.h2
-rw-r--r--drivers/dahdi/mg2ec.h2
-rw-r--r--drivers/dahdi/pciradio.c196
-rw-r--r--drivers/dahdi/sec-2.h2
-rw-r--r--drivers/dahdi/sec.h2
-rw-r--r--drivers/dahdi/tor2.c262
-rw-r--r--drivers/dahdi/wcfxo.c112
-rw-r--r--drivers/dahdi/wct1xxp.c224
-rw-r--r--drivers/dahdi/wct4xxp/base.c382
-rw-r--r--drivers/dahdi/wct4xxp/wct4xxp.h2
-rw-r--r--drivers/dahdi/wctc4xxp/base.c192
-rw-r--r--drivers/dahdi/wctc4xxp/codec_test.c26
-rw-r--r--drivers/dahdi/wctdm.c156
-rw-r--r--drivers/dahdi/wctdm.h8
-rw-r--r--drivers/dahdi/wctdm24xxp/base.c200
-rw-r--r--drivers/dahdi/wctdm24xxp/wctdm24xxp.h6
-rw-r--r--drivers/dahdi/wcte11xp.c238
-rw-r--r--drivers/dahdi/wcte12xp/base.c214
-rw-r--r--drivers/dahdi/wcte12xp/vpmadt032.c10
-rw-r--r--drivers/dahdi/wcte12xp/vpmadt032.h2
-rw-r--r--drivers/dahdi/wcte12xp/wcte12xp.h10
33 files changed, 2795 insertions, 2795 deletions
diff --git a/drivers/dahdi/adt_lec.c b/drivers/dahdi/adt_lec.c
index d191e2b..541cce9 100644
--- a/drivers/dahdi/adt_lec.c
+++ b/drivers/dahdi/adt_lec.c
@@ -33,7 +33,7 @@ static inline void adt_lec_init_defaults(struct adt_lec_params *params, __u32 ta
params->tap_length = tap_length;
}
-static int adt_lec_parse_params(struct adt_lec_params *params, struct zt_echocanparams *ecp, struct zt_echocanparam *p)
+static int adt_lec_parse_params(struct adt_lec_params *params, struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p)
{
unsigned int x;
char *c;
diff --git a/drivers/dahdi/arith.h b/drivers/dahdi/arith.h
index 3059db5..760dcc8 100644
--- a/drivers/dahdi/arith.h
+++ b/drivers/dahdi/arith.h
@@ -7,7 +7,7 @@
*/
#ifdef CONFIG_ZAPTEL_MMX
-#ifdef ZT_CHUNKSIZE
+#ifdef DAHDI_CHUNKSIZE
static inline void __ACSS(volatile short *dst, const short *src)
{
__asm__ __volatile__ (
@@ -49,24 +49,24 @@ static inline void __SCSS(volatile short *dst, const short *src)
}
-#if (ZT_CHUNKSIZE == 8)
+#if (DAHDI_CHUNKSIZE == 8)
#define ACSS(a,b) __ACSS(a,b)
#define SCSS(a,b) __SCSS(a,b)
-#elif (ZT_CHUNKSIZE > 8)
+#elif (DAHDI_CHUNKSIZE > 8)
static inline void ACSS(volatile short *dst, const short *src)
{
int x;
- for (x=0;x<ZT_CHUNKSIZE;x+=8)
+ for (x=0;x<DAHDI_CHUNKSIZE;x+=8)
__ACSS(dst + x, src + x);
}
static inline void SCSS(volatile short *dst, const short *src)
{
int x;
- for (x=0;x<ZT_CHUNKSIZE;x+=8)
+ for (x=0;x<DAHDI_CHUNKSIZE;x+=8)
__SCSS(dst + x, src + x);
}
#else
-#error No MMX for ZT_CHUNKSIZE < 8
+#error No MMX for DAHDI_CHUNKSIZE < 8
#endif
#endif
static inline int CONVOLVE(const int *coeffs, const short *hist, int len)
@@ -258,7 +258,7 @@ static inline short MAX16(const short *y, int len, int *pos)
#else
-#ifdef ZT_CHUNKSIZE
+#ifdef DAHDI_CHUNKSIZE
static inline void ACSS(short *dst, short *src)
{
int x;
@@ -266,12 +266,12 @@ static inline void ACSS(short *dst, short *src)
/* Add src to dst with saturation, storing in dst */
#ifdef BFIN
- for (x = 0; x < ZT_CHUNKSIZE; x++)
+ for (x = 0; x < DAHDI_CHUNKSIZE; x++)
dst[x] = __builtin_bfin_add_fr1x16(dst[x], src[x]);
#else
int sum;
- for (x = 0; x < ZT_CHUNKSIZE; x++) {
+ for (x = 0; x < DAHDI_CHUNKSIZE; x++) {
sum = dst[x] + src[x];
if (sum > 32767)
sum = 32767;
@@ -288,12 +288,12 @@ static inline void SCSS(short *dst, short *src)
/* Subtract src from dst with saturation, storing in dst */
#ifdef BFIN
- for (x = 0; x < ZT_CHUNKSIZE; x++)
+ for (x = 0; x < DAHDI_CHUNKSIZE; x++)
dst[x] = __builtin_bfin_sub_fr1x16(dst[x], src[x]);
#else
int sum;
- for (x = 0; x < ZT_CHUNKSIZE; x++) {
+ for (x = 0; x < DAHDI_CHUNKSIZE; x++) {
sum = dst[x] - src[x];
if (sum > 32767)
sum = 32767;
@@ -304,7 +304,7 @@ static inline void SCSS(short *dst, short *src)
#endif
}
-#endif /* ZT_CHUNKSIZE */
+#endif /* DAHDI_CHUNKSIZE */
static inline int CONVOLVE(const int *coeffs, const short *hist, int len)
{
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 0408c29..2d22e90 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -92,8 +92,8 @@
#include <asm/i387.h>
#endif
-#define hdlc_to_ztchan(h) (((struct zt_hdlc *)(h))->chan)
-#define dev_to_ztchan(h) (((struct zt_hdlc *)(dev_to_hdlc(h)->priv))->chan)
+#define hdlc_to_ztchan(h) (((struct dahdi_hdlc *)(h))->chan)
+#define dev_to_ztchan(h) (((struct dahdi_hdlc *)(dev_to_hdlc(h)->priv))->chan)
#ifdef LINUX26
#define ztchan_to_dev(h) ((h)->hdlcnetdev->netdev)
#else
@@ -104,7 +104,7 @@
#define UNIT(file) MINOR(file->f_dentry->d_inode->i_rdev)
/* names of tx level settings */
-static char *zt_txlevelnames[] = {
+static char *dahdi_txlevelnames[] = {
"0 db (CSU)/0-133 feet (DSX-1)",
"133-266 feet (DSX-1)",
"266-399 feet (DSX-1)",
@@ -115,41 +115,41 @@ static char *zt_txlevelnames[] = {
"-22.5db (CSU)"
} ;
-EXPORT_SYMBOL(zt_transcode_fops);
-EXPORT_SYMBOL(zt_init_tone_state);
-EXPORT_SYMBOL(zt_mf_tone);
-EXPORT_SYMBOL(zt_register);
-EXPORT_SYMBOL(zt_unregister);
-EXPORT_SYMBOL(__zt_mulaw);
-EXPORT_SYMBOL(__zt_alaw);
+EXPORT_SYMBOL(dahdi_transcode_fops);
+EXPORT_SYMBOL(dahdi_init_tone_state);
+EXPORT_SYMBOL(dahdi_mf_tone);
+EXPORT_SYMBOL(dahdi_register);
+EXPORT_SYMBOL(dahdi_unregister);
+EXPORT_SYMBOL(__dahdi_mulaw);
+EXPORT_SYMBOL(__dahdi_alaw);
#ifdef CONFIG_CALC_XLAW
-EXPORT_SYMBOL(__zt_lineartoulaw);
-EXPORT_SYMBOL(__zt_lineartoalaw);
+EXPORT_SYMBOL(__dahdi_lineartoulaw);
+EXPORT_SYMBOL(__dahdi_lineartoalaw);
#else
-EXPORT_SYMBOL(__zt_lin2mu);
-EXPORT_SYMBOL(__zt_lin2a);
+EXPORT_SYMBOL(__dahdi_lin2mu);
+EXPORT_SYMBOL(__dahdi_lin2a);
#endif
-EXPORT_SYMBOL(zt_lboname);
-EXPORT_SYMBOL(zt_transmit);
-EXPORT_SYMBOL(zt_receive);
-EXPORT_SYMBOL(zt_rbsbits);
-EXPORT_SYMBOL(zt_qevent_nolock);
-EXPORT_SYMBOL(zt_qevent_lock);
-EXPORT_SYMBOL(zt_hooksig);
-EXPORT_SYMBOL(zt_alarm_notify);
-EXPORT_SYMBOL(zt_set_dynamic_ioctl);
-EXPORT_SYMBOL(zt_ec_chunk);
-EXPORT_SYMBOL(zt_ec_span);
-EXPORT_SYMBOL(zt_hdlc_abort);
-EXPORT_SYMBOL(zt_hdlc_finish);
-EXPORT_SYMBOL(zt_hdlc_getbuf);
-EXPORT_SYMBOL(zt_hdlc_putbuf);
-EXPORT_SYMBOL(zt_alarm_channel);
-EXPORT_SYMBOL(zt_register_chardev);
-EXPORT_SYMBOL(zt_unregister_chardev);
+EXPORT_SYMBOL(dahdi_lboname);
+EXPORT_SYMBOL(dahdi_transmit);
+EXPORT_SYMBOL(dahdi_receive);
+EXPORT_SYMBOL(dahdi_rbsbits);
+EXPORT_SYMBOL(dahdi_qevent_nolock);
+EXPORT_SYMBOL(dahdi_qevent_lock);
+EXPORT_SYMBOL(dahdi_hooksig);
+EXPORT_SYMBOL(dahdi_alarm_notify);
+EXPORT_SYMBOL(dahdi_set_dynamic_ioctl);
+EXPORT_SYMBOL(dahdi_ec_chunk);
+EXPORT_SYMBOL(dahdi_ec_span);
+EXPORT_SYMBOL(dahdi_hdlc_abort);
+EXPORT_SYMBOL(dahdi_hdlc_finish);
+EXPORT_SYMBOL(dahdi_hdlc_getbuf);
+EXPORT_SYMBOL(dahdi_hdlc_putbuf);
+EXPORT_SYMBOL(dahdi_alarm_channel);
+EXPORT_SYMBOL(dahdi_register_chardev);
+EXPORT_SYMBOL(dahdi_unregister_chardev);
#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry *proc_entries[ZT_MAX_SPANS];
+static struct proc_dir_entry *proc_entries[DAHDI_MAX_SPANS];
#endif
/* Here are a couple important little additions for devfs */
@@ -231,36 +231,36 @@ __u16 fcstab[256] =
static int debug;
/* states for transmit signalling */
-typedef enum {ZT_TXSTATE_ONHOOK,ZT_TXSTATE_OFFHOOK,ZT_TXSTATE_START,
- ZT_TXSTATE_PREWINK,ZT_TXSTATE_WINK,ZT_TXSTATE_PREFLASH,
- ZT_TXSTATE_FLASH,ZT_TXSTATE_DEBOUNCE,ZT_TXSTATE_AFTERSTART,
- ZT_TXSTATE_RINGON,ZT_TXSTATE_RINGOFF,ZT_TXSTATE_KEWL,
- ZT_TXSTATE_AFTERKEWL,ZT_TXSTATE_PULSEBREAK,ZT_TXSTATE_PULSEMAKE,
- ZT_TXSTATE_PULSEAFTER
- } ZT_TXSTATE_t;
+typedef enum {DAHDI_TXSTATE_ONHOOK,DAHDI_TXSTATE_OFFHOOK,DAHDI_TXSTATE_START,
+ DAHDI_TXSTATE_PREWINK,DAHDI_TXSTATE_WINK,DAHDI_TXSTATE_PREFLASH,
+ DAHDI_TXSTATE_FLASH,DAHDI_TXSTATE_DEBOUNCE,DAHDI_TXSTATE_AFTERSTART,
+ DAHDI_TXSTATE_RINGON,DAHDI_TXSTATE_RINGOFF,DAHDI_TXSTATE_KEWL,
+ DAHDI_TXSTATE_AFTERKEWL,DAHDI_TXSTATE_PULSEBREAK,DAHDI_TXSTATE_PULSEMAKE,
+ DAHDI_TXSTATE_PULSEAFTER
+ } DAHDI_TXSTATE_t;
-typedef short sumtype[ZT_MAX_CHUNKSIZE];
+typedef short sumtype[DAHDI_MAX_CHUNKSIZE];
-static sumtype sums[(ZT_MAX_CONF + 1) * 3];
+static sumtype sums[(DAHDI_MAX_CONF + 1) * 3];
/* Translate conference aliases into actual conferences
and vice-versa */
-static short confalias[ZT_MAX_CONF + 1];
-static short confrev[ZT_MAX_CONF + 1];
+static short confalias[DAHDI_MAX_CONF + 1];
+static short confrev[DAHDI_MAX_CONF + 1];
static sumtype *conf_sums_next;
static sumtype *conf_sums;
static sumtype *conf_sums_prev;
-static struct zt_span *master;
-static struct file_operations zt_fops;
-struct file_operations *zt_transcode_fops = NULL;
+static struct dahdi_span *master;
+static struct file_operations dahdi_fops;
+struct file_operations *dahdi_transcode_fops = NULL;
static struct
{
int src; /* source conf number */
int dst; /* dst conf number */
-} conf_links[ZT_MAX_CONF + 1];
+} conf_links[DAHDI_MAX_CONF + 1];
/* There are three sets of conference sum accumulators. One for the current
@@ -309,13 +309,13 @@ of the next sample chunk's data (next time around the world).
#include "digits.h"
-static struct zt_dialparams global_dialparams = {
+static struct dahdi_dialparams global_dialparams = {
.dtmf_tonelen = DEFAULT_DTMF_LENGTH,
.mfv1_tonelen = DEFAULT_MFR1_LENGTH,
.mfr2_tonelen = DEFAULT_MFR2_LENGTH,
};
-static int zt_chan_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data, int unit);
+static int dahdi_chan_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data, int unit);
#if defined(CONFIG_ZAPTEL_MMX) || defined(ECHO_CAN_FP)
/* XXX kernel_fpu_begin() is NOT exported properly (in 2.4), so we have to make
@@ -334,7 +334,7 @@ static inline void __save_init_fpu( struct task_struct *tsk )
tsk->flags &= ~PF_USEDFPU;
}
-static inline void zt_kernel_fpu_begin(void)
+static inline void dahdi_kernel_fpu_begin(void)
{
struct task_struct *tsk = current;
if (tsk->flags & PF_USEDFPU) {
@@ -344,16 +344,16 @@ static inline void zt_kernel_fpu_begin(void)
clts();
}
#else
-#define zt_kernel_fpu_begin kernel_fpu_begin
+#define dahdi_kernel_fpu_begin kernel_fpu_begin
#endif /* LINUX26 */
#endif
-static struct zt_timer {
+static struct dahdi_timer {
int ms; /* Countdown */
int pos; /* Position */
int ping; /* Whether we've been ping'd */
int tripped; /* Whether we're tripped */
- struct zt_timer *next; /* Linked list */
+ struct dahdi_timer *next; /* Linked list */
wait_queue_head_t sel;
} *zaptimers = NULL;
@@ -365,26 +365,26 @@ static spinlock_t zaptimerlock = SPIN_LOCK_UNLOCKED;
static spinlock_t bigzaplock = SPIN_LOCK_UNLOCKED;
#endif
-struct zt_zone {
+struct dahdi_zone {
atomic_t refcount;
char name[40]; /* Informational, only */
- int ringcadence[ZT_MAX_CADENCE];
- struct zt_tone *tones[ZT_TONE_MAX];
+ int ringcadence[DAHDI_MAX_CADENCE];
+ struct dahdi_tone *tones[DAHDI_TONE_MAX];
/* Each of these is a circular list
- of zt_tones to generate what we
+ of dahdi_tones to generate what we
want. Use NULL if the tone is
unavailable */
- struct zt_tone dtmf[16]; /* DTMF tones for this zone, with desired length */
- struct zt_tone dtmf_continuous[16]; /* DTMF tones for this zone, continuous play */
- struct zt_tone mfr1[15]; /* MFR1 tones for this zone, with desired length */
- struct zt_tone mfr2_fwd[15]; /* MFR2 FWD tones for this zone, with desired length */
- struct zt_tone mfr2_rev[15]; /* MFR2 REV tones for this zone, with desired length */
- struct zt_tone mfr2_fwd_continuous[16]; /* MFR2 FWD tones for this zone, continuous play */
- struct zt_tone mfr2_rev_continuous[16]; /* MFR2 REV tones for this zone, continuous play */
+ struct dahdi_tone dtmf[16]; /* DTMF tones for this zone, with desired length */
+ struct dahdi_tone dtmf_continuous[16]; /* DTMF tones for this zone, continuous play */
+ struct dahdi_tone mfr1[15]; /* MFR1 tones for this zone, with desired length */
+ struct dahdi_tone mfr2_fwd[15]; /* MFR2 FWD tones for this zone, with desired length */
+ struct dahdi_tone mfr2_rev[15]; /* MFR2 REV tones for this zone, with desired length */
+ struct dahdi_tone mfr2_fwd_continuous[16]; /* MFR2 FWD tones for this zone, continuous play */
+ struct dahdi_tone mfr2_rev_continuous[16]; /* MFR2 REV tones for this zone, continuous play */
};
-static struct zt_span *spans[ZT_MAX_SPANS];
-static struct zt_chan *chans[ZT_MAX_CHANNELS];
+static struct dahdi_span *spans[DAHDI_MAX_SPANS];
+static struct dahdi_chan *chans[DAHDI_MAX_CHANNELS];
static int maxspans = 0;
static int maxchans = 0;
@@ -393,13 +393,13 @@ static int maxlinks = 0;
static int default_zone = -1;
-short __zt_mulaw[256];
-short __zt_alaw[256];
+short __dahdi_mulaw[256];
+short __dahdi_alaw[256];
#ifndef CONFIG_CALC_XLAW
-u_char __zt_lin2mu[16384];
+u_char __dahdi_lin2mu[16384];
-u_char __zt_lin2a[16384];
+u_char __dahdi_lin2a[16384];
#endif
static u_char defgain[256];
@@ -412,7 +412,7 @@ static rwlock_t zone_lock = RW_LOCK_UNLOCKED;
static rwlock_t chan_lock = RW_LOCK_UNLOCKED;
#endif
-static struct zt_zone *tone_zones[ZT_TONE_ZONE_MAX];
+static struct dahdi_zone *tone_zones[DAHDI_TONE_ZONE_MAX];
#define NUM_SIGS 10
@@ -436,37 +436,37 @@ static inline void rotate_sums(void)
{
/* Rotate where we sum and so forth */
static int pos = 0;
- conf_sums_prev = sums + (ZT_MAX_CONF + 1) * pos;
- conf_sums = sums + (ZT_MAX_CONF + 1) * ((pos + 1) % 3);
- conf_sums_next = sums + (ZT_MAX_CONF + 1) * ((pos + 2) % 3);
+ conf_sums_prev = sums + (DAHDI_MAX_CONF + 1) * pos;
+ conf_sums = sums + (DAHDI_MAX_CONF + 1) * ((pos + 1) % 3);
+ conf_sums_next = sums + (DAHDI_MAX_CONF + 1) * ((pos + 2) % 3);
pos = (pos + 1) % 3;
memset(conf_sums_next, 0, maxconfs * sizeof(sumtype));
}
/* return quiescent (idle) signalling states, for the various signalling types */
-static int zt_q_sig(struct zt_chan *chan)
+static int dahdi_q_sig(struct dahdi_chan *chan)
{
int x;
static unsigned int in_sig[NUM_SIGS][2] = {
- { ZT_SIG_NONE, 0},
- { ZT_SIG_EM, 0 | (ZT_ABIT << 8)},
- { ZT_SIG_FXSLS,ZT_BBIT | (ZT_BBIT << 8)},
- { ZT_SIG_FXSGS,ZT_ABIT | ZT_BBIT | ((ZT_ABIT | ZT_BBIT) << 8)},
- { ZT_SIG_FXSKS,ZT_BBIT | ZT_BBIT | ((ZT_ABIT | ZT_BBIT) << 8)},
- { ZT_SIG_FXOLS,0 | (ZT_ABIT << 8)},
- { ZT_SIG_FXOGS,ZT_BBIT | ((ZT_ABIT | ZT_BBIT) << 8)},
- { ZT_SIG_FXOKS,0 | (ZT_ABIT << 8)},
- { ZT_SIG_SF, 0},
- { ZT_SIG_EM_E1, ZT_DBIT | ((ZT_ABIT | ZT_DBIT) << 8) },
+ { DAHDI_SIG_NONE, 0},
+ { DAHDI_SIG_EM, 0 | (DAHDI_ABIT << 8)},
+ { DAHDI_SIG_FXSLS,DAHDI_BBIT | (DAHDI_BBIT << 8)},
+ { DAHDI_SIG_FXSGS,DAHDI_ABIT | DAHDI_BBIT | ((DAHDI_ABIT | DAHDI_BBIT) << 8)},
+ { DAHDI_SIG_FXSKS,DAHDI_BBIT | DAHDI_BBIT | ((DAHDI_ABIT | DAHDI_BBIT) << 8)},
+ { DAHDI_SIG_FXOLS,0 | (DAHDI_ABIT << 8)},
+ { DAHDI_SIG_FXOGS,DAHDI_BBIT | ((DAHDI_ABIT | DAHDI_BBIT) << 8)},
+ { DAHDI_SIG_FXOKS,0 | (DAHDI_ABIT << 8)},
+ { DAHDI_SIG_SF, 0},
+ { DAHDI_SIG_EM_E1, DAHDI_DBIT | ((DAHDI_ABIT | DAHDI_DBIT) << 8) },
} ;
/* must have span to begin with */
if (!chan->span) return(-1);
/* if RBS does not apply, return error */
- if (!(chan->span->flags & ZT_FLAG_RBS) ||
+ if (!(chan->span->flags & DAHDI_FLAG_RBS) ||
!chan->span->rbsbits) return(-1);
- if (chan->sig == ZT_SIG_CAS)
+ if (chan->sig == DAHDI_SIG_CAS)
return chan->idlebits;
for (x=0;x<NUM_SIGS;x++) {
if (in_sig[x][0] == chan->sig) return(in_sig[x][1]);
@@ -477,45 +477,45 @@ static unsigned int in_sig[NUM_SIGS][2] = {
static char *sigstr(int sig)
{
switch (sig) {
- case ZT_SIG_FXSLS:
+ case DAHDI_SIG_FXSLS:
return "FXSLS";
- case ZT_SIG_FXSKS:
+ case DAHDI_SIG_FXSKS:
return "FXSKS";
- case ZT_SIG_FXSGS:
+ case DAHDI_SIG_FXSGS:
return "FXSGS";
- case ZT_SIG_FXOLS:
+ case DAHDI_SIG_FXOLS:
return "FXOLS";
- case ZT_SIG_FXOKS:
+ case DAHDI_SIG_FXOKS:
return "FXOKS";
- case ZT_SIG_FXOGS:
+ case DAHDI_SIG_FXOGS:
return "FXOGS";
- case ZT_SIG_EM:
+ case DAHDI_SIG_EM:
return "E&M";
- case ZT_SIG_EM_E1:
+ case DAHDI_SIG_EM_E1:
return "E&M-E1";
- case ZT_SIG_CLEAR:
+ case DAHDI_SIG_CLEAR:
return "Clear";
- case ZT_SIG_HDLCRAW:
+ case DAHDI_SIG_HDLCRAW:
return "HDLCRAW";
- case ZT_SIG_HDLCFCS:
+ case DAHDI_SIG_HDLCFCS:
return "HDLCFCS";
- case ZT_SIG_HDLCNET:
+ case DAHDI_SIG_HDLCNET:
return "HDLCNET";
- case ZT_SIG_HARDHDLC:
+ case DAHDI_SIG_HARDHDLC:
return "Hardware-assisted HDLC";
- case ZT_SIG_MTP2:
+ case DAHDI_SIG_MTP2:
return "MTP2";
- case ZT_SIG_SLAVE:
+ case DAHDI_SIG_SLAVE:
return "Slave";
- case ZT_SIG_CAS:
+ case DAHDI_SIG_CAS:
return "CAS";
- case ZT_SIG_DACS:
+ case DAHDI_SIG_DACS:
return "DACS";
- case ZT_SIG_DACS_RBS:
+ case DAHDI_SIG_DACS_RBS:
return "DACS+RBS";
- case ZT_SIG_SF:
+ case DAHDI_SIG_SF:
return "SF (ToneOnly)";
- case ZT_SIG_NONE:
+ case DAHDI_SIG_NONE:
default:
return "Unconfigured";
}
@@ -527,17 +527,17 @@ static inline int fill_alarm_string(char *buf, int count, int alarms)
int len = 0;
if (alarms > 0) {
- if (alarms & ZT_ALARM_BLUE)
+ if (alarms & DAHDI_ALARM_BLUE)
len += snprintf(buf + len, count - len, "BLUE ");
- if (alarms & ZT_ALARM_YELLOW)
+ if (alarms & DAHDI_ALARM_YELLOW)
len += snprintf(buf + len, count - len, "YELLOW ");
- if (alarms & ZT_ALARM_RED)
+ if (alarms & DAHDI_ALARM_RED)
len += snprintf(buf + len, count - len, "RED ");
- if (alarms & ZT_ALARM_LOOPBACK)
+ if (alarms & DAHDI_ALARM_LOOPBACK)
len += snprintf(buf + len, count - len, "LOOP ");
- if (alarms & ZT_ALARM_RECOVER)
+ if (alarms & DAHDI_ALARM_RECOVER)
len += snprintf(buf + len, count - len, "RECOVERING ");
- if (alarms & ZT_ALARM_NOTOPEN)
+ if (alarms & DAHDI_ALARM_NOTOPEN)
len += snprintf(buf + len, count - len, "NOTOPEN ");
}
if(len > 0) {
@@ -571,21 +571,21 @@ static int zaptel_proc_read(char *page, char **start, off_t off, int count, int
if (spans[span]->lineconfig) {
/* framing first */
- if (spans[span]->lineconfig & ZT_CONFIG_B8ZS)
+ if (spans[span]->lineconfig & DAHDI_CONFIG_B8ZS)
len += sprintf(page + len, " B8ZS/");
- else if (spans[span]->lineconfig & ZT_CONFIG_AMI)
+ else if (spans[span]->lineconfig & DAHDI_CONFIG_AMI)
len += sprintf(page + len, " AMI/");
- else if (spans[span]->lineconfig & ZT_CONFIG_HDB3)
+ else if (spans[span]->lineconfig & DAHDI_CONFIG_HDB3)
len += sprintf(page + len, " HDB3/");
/* then coding */
- if (spans[span]->lineconfig & ZT_CONFIG_ESF)
+ if (spans[span]->lineconfig & DAHDI_CONFIG_ESF)
len += sprintf(page + len, "ESF");
- else if (spans[span]->lineconfig & ZT_CONFIG_D4)
+ else if (spans[span]->lineconfig & DAHDI_CONFIG_D4)
len += sprintf(page + len, "D4");
- else if (spans[span]->lineconfig & ZT_CONFIG_CCS)
+ else if (spans[span]->lineconfig & DAHDI_CONFIG_CCS)
len += sprintf(page + len, "CCS");
/* E1's can enable CRC checking */
- if (spans[span]->lineconfig & ZT_CONFIG_CRC4)
+ if (spans[span]->lineconfig & DAHDI_CONFIG_CRC4)
len += sprintf(page + len, "/CRC4");
}
@@ -611,13 +611,13 @@ static int zaptel_proc_read(char *page, char **start, off_t off, int count, int
len += sprintf(page + len, "\n");
- for (x=1;x<ZT_MAX_CHANNELS;x++) {
+ for (x=1;x<DAHDI_MAX_CHANNELS;x++) {
if (chans[x]) {
if (chans[x]->span && (chans[x]->span->spanno == span)) {
if (chans[x]->name)
len += sprintf(page + len, "\t%4d %s ", x, chans[x]->name);
if (chans[x]->sig) {
- if (chans[x]->sig == ZT_SIG_SLAVE)
+ if (chans[x]->sig == DAHDI_SIG_SLAVE)
len += sprintf(page + len, "%s ", sigstr(chans[x]->master->sig));
else {
len += sprintf(page + len, "%s ", sigstr(chans[x]->sig));
@@ -625,7 +625,7 @@ static int zaptel_proc_read(char *page, char **start, off_t off, int count, int
len += sprintf(page + len, "Master ");
}
}
- if ((chans[x]->flags & ZT_FLAG_OPEN)) {
+ if ((chans[x]->flags & DAHDI_FLAG_OPEN)) {
len += sprintf(page + len, "(In use) ");
}
#ifdef OPTIMIZE_CHANMUTE
@@ -655,11 +655,11 @@ static int zaptel_proc_read(char *page, char **start, off_t off, int count, int
}
#endif
-static int zt_first_empty_alias(void)
+static int dahdi_first_empty_alias(void)
{
/* Find the first conference which has no alias pointing to it */
int x;
- for (x=1;x<ZT_MAX_CONF;x++) {
+ for (x=1;x<DAHDI_MAX_CONF;x++) {
if (!confrev[x])
return x;
}
@@ -669,7 +669,7 @@ static int zt_first_empty_alias(void)
static void recalc_maxconfs(void)
{
int x;
- for (x=ZT_MAX_CONF-1;x>0;x--) {
+ for (x=DAHDI_MAX_CONF-1;x>0;x--) {
if (confrev[x]) {
maxconfs = x+1;
return;
@@ -681,7 +681,7 @@ static void recalc_maxconfs(void)
static void recalc_maxlinks(void)
{
int x;
- for (x=ZT_MAX_CONF-1;x>0;x--) {
+ for (x=DAHDI_MAX_CONF-1;x>0;x--) {
if (conf_links[x].src || conf_links[x].dst) {
maxlinks = x+1;
return;
@@ -690,18 +690,18 @@ static void recalc_maxlinks(void)
maxlinks = 0;
}
-static int zt_first_empty_conference(void)
+static int dahdi_first_empty_conference(void)
{
/* Find the first conference which has no alias */
int x;
- for (x=ZT_MAX_CONF-1;x>0;x--) {
+ for (x=DAHDI_MAX_CONF-1;x>0;x--) {
if (!confalias[x])
return x;
}
return -1;
}
-static int zt_get_conf_alias(int x)
+static int dahdi_get_conf_alias(int x)
{
int a;
if (confalias[x]) {
@@ -709,7 +709,7 @@ static int zt_get_conf_alias(int x)
}
/* Allocate an alias */
- a = zt_first_empty_alias();
+ a = dahdi_first_empty_alias();
confalias[x] = a;
confrev[a] = x;
@@ -718,7 +718,7 @@ static int zt_get_conf_alias(int x)
return a;
}
-static void zt_check_conf(int x)
+static void dahdi_check_conf(int x)
{
int y;
@@ -729,11 +729,11 @@ static void zt_check_conf(int x)
return;
for (y=0;y<maxchans;y++) {
if (chans[y] && (chans[y]->confna == x) &&
- ((chans[y]->confmode & ZT_CONF_MODE_MASK) == ZT_CONF_CONF ||
- (chans[y]->confmode & ZT_CONF_MODE_MASK) == ZT_CONF_CONFANN ||
- (chans[y]->confmode & ZT_CONF_MODE_MASK) == ZT_CONF_CONFMON ||
- (chans[y]->confmode & ZT_CONF_MODE_MASK) == ZT_CONF_CONFANNMON ||
- (chans[y]->confmode & ZT_CONF_MODE_MASK) == ZT_CONF_REALANDPSEUDO))
+ ((chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONF ||
+ (chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONFANN ||
+ (chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONFMON ||
+ (chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONFANNMON ||
+ (chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_REALANDPSEUDO))
return;
}
/* If we get here, nobody is in the conference anymore. Clear it out
@@ -746,32 +746,32 @@ static void zt_check_conf(int x)
}
/* enqueue an event on a channel */
-static void __qevent(struct zt_chan *chan, int event)
+static void __qevent(struct dahdi_chan *chan, int event)
{
/* if full, ignore */
- if ((chan->eventoutidx == 0) && (chan->eventinidx == (ZT_MAX_EVENTSIZE - 1)))
+ if ((chan->eventoutidx == 0) && (chan->eventinidx == (DAHDI_MAX_EVENTSIZE - 1)))
return;
/* if full, ignore */
if (chan->eventinidx == (chan->eventoutidx - 1)) return;
/* save the event */
chan->eventbuf[chan->eventinidx++] = event;
/* wrap the index, if necessary */
- if (chan->eventinidx >= ZT_MAX_EVENTSIZE) chan->eventinidx = 0;
+ if (chan->eventinidx >= DAHDI_MAX_EVENTSIZE) chan->eventinidx = 0;
/* wake em all up */
- if (chan->iomask & ZT_IOMUX_SIGEVENT) wake_up_interruptible(&chan->eventbufq);
+ if (chan->iomask & DAHDI_IOMUX_SIGEVENT) wake_up_interruptible(&chan->eventbufq);
wake_up_interruptible(&chan->readbufq);
wake_up_interruptible(&chan->writebufq);
wake_up_interruptible(&chan->sel);
return;
}
-void zt_qevent_nolock(struct zt_chan *chan, int event)
+void dahdi_qevent_nolock(struct dahdi_chan *chan, int event)
{
__qevent(chan, event);
}
-void zt_qevent_lock(struct zt_chan *chan, int event)
+void dahdi_qevent_lock(struct dahdi_chan *chan, int event)
{
unsigned long flags;
spin_lock_irqsave(&chan->lock, flags);
@@ -794,7 +794,7 @@ static int schluffen(wait_queue_head_t *q)
return(0);
}
-static inline void calc_fcs(struct zt_chan *ss, int inwritebuf)
+static inline void calc_fcs(struct dahdi_chan *ss, int inwritebuf)
{
int x;
unsigned int fcs=PPP_INITFCS;
@@ -811,7 +811,7 @@ static inline void calc_fcs(struct zt_chan *ss, int inwritebuf)
data[len-1] = (fcs >> 8) & 0xff;
}
-static int zt_reallocbufs(struct zt_chan *ss, int j, int numbufs)
+static int dahdi_reallocbufs(struct dahdi_chan *ss, int j, int numbufs)
{
unsigned char *newbuf, *oldbuf;
unsigned long flags;
@@ -819,8 +819,8 @@ static int zt_reallocbufs(struct zt_chan *ss, int j, int numbufs)
/* Check numbufs */
if (numbufs < 2)
numbufs = 2;
- if (numbufs > ZT_MAX_NUM_BUFS)
- numbufs = ZT_MAX_NUM_BUFS;
+ if (numbufs > DAHDI_MAX_NUM_BUFS)
+ numbufs = DAHDI_MAX_NUM_BUFS;
/* We need to allocate our buffers now */
if (j) {
newbuf = kmalloc(j * 2 * numbufs, GFP_KERNEL);
@@ -865,12 +865,12 @@ static int zt_reallocbufs(struct zt_chan *ss, int j, int numbufs)
ss->outreadbuf = -1;
ss->outwritebuf = -1;
ss->numbufs = numbufs;
- if (ss->txbufpolicy == ZT_POLICY_WHEN_FULL)
+ if (ss->txbufpolicy == DAHDI_POLICY_WHEN_FULL)
ss->txdisable = 1;
else
ss->txdisable = 0;
- if (ss->rxbufpolicy == ZT_POLICY_WHEN_FULL)
+ if (ss->rxbufpolicy == DAHDI_POLICY_WHEN_FULL)
ss->rxdisable = 1;
else
ss->rxdisable = 0;
@@ -881,24 +881,24 @@ static int zt_reallocbufs(struct zt_chan *ss, int j, int numbufs)
return 0;
}
-static int zt_hangup(struct zt_chan *chan);
-static void zt_set_law(struct zt_chan *chan, int law);
+static int dahdi_hangup(struct dahdi_chan *chan);
+static void dahdi_set_law(struct dahdi_chan *chan, int law);
-/* Pull a ZT_CHUNKSIZE piece off the queue. Returns
+/* Pull a DAHDI_CHUNKSIZE piece off the queue. Returns
0 on success or -1 on failure. If failed, provides
silence */
-static int __buf_pull(struct confq *q, u_char *data, struct zt_chan *c, char *label)
+static int __buf_pull(struct confq *q, u_char *data, struct dahdi_chan *c, char *label)
{
int oldoutbuf = q->outbuf;
/* Ain't nuffin to read */
if (q->outbuf < 0) {
if (data)
- memset(data, ZT_LIN2X(0,c), ZT_CHUNKSIZE);
+ memset(data, DAHDI_LIN2X(0,c), DAHDI_CHUNKSIZE);
return -1;
}
if (data)
- memcpy(data, q->buf[q->outbuf], ZT_CHUNKSIZE);
- q->outbuf = (q->outbuf + 1) % ZT_CB_SIZE;
+ memcpy(data, q->buf[q->outbuf], DAHDI_CHUNKSIZE);
+ q->outbuf = (q->outbuf + 1) % DAHDI_CB_SIZE;
/* Won't be nuffin next time */
if (q->outbuf == q->inbuf) {
@@ -939,20 +939,20 @@ static u_char *__buf_cpush(struct confq *q)
return NULL;
pos = q->outbuf - 1;
if (pos < 0)
- pos += ZT_CB_SIZE;
+ pos += DAHDI_CB_SIZE;
return q->buf[pos];
}
-static void __buf_munge(struct zt_chan *chan, u_char *old, u_char *new)
+static void __buf_munge(struct dahdi_chan *chan, u_char *old, u_char *new)
{
/* Run a weighted average of the old and new, in order to
mask a missing sample */
int x;
int val;
- for (x=0;x<ZT_CHUNKSIZE;x++) {
- val = x * ZT_XLAW(new[x], chan) + (ZT_CHUNKSIZE - x - 1) * ZT_XLAW(old[x], chan);
- val = val / (ZT_CHUNKSIZE - 1);
- old[x] = ZT_LIN2X(val, chan);
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
+ val = x * DAHDI_XLAW(new[x], chan) + (DAHDI_CHUNKSIZE - x - 1) * DAHDI_XLAW(old[x], chan);
+ val = val / (DAHDI_CHUNKSIZE - 1);
+ old[x] = DAHDI_LIN2X(val, chan);
}
}
#endif
@@ -966,10 +966,10 @@ static int __buf_push(struct confq *q, u_char *data, char *label)
}
if (data)
/* Copy in the data */
- memcpy(q->buf[q->inbuf], data, ZT_CHUNKSIZE);
+ memcpy(q->buf[q->inbuf], data, DAHDI_CHUNKSIZE);
/* Advance the inbuf pointer */
- q->inbuf = (q->inbuf + 1) % ZT_CB_SIZE;
+ q->inbuf = (q->inbuf + 1) % DAHDI_CB_SIZE;
if (q->inbuf == q->outbuf) {
/* No space anymore... */
@@ -983,25 +983,25 @@ static int __buf_push(struct confq *q, u_char *data, char *label)
return 0;
}
-static void reset_conf(struct zt_chan *chan)
+static void reset_conf(struct dahdi_chan *chan)
{
int x;
/* Empty out buffers and reset to initialization */
- for (x=0;x<ZT_CB_SIZE;x++)
- chan->confin.buf[x] = chan->confin.buffer + ZT_CHUNKSIZE * x;
+ for (x=0;x<DAHDI_CB_SIZE;x++)
+ chan->confin.buf[x] = chan->confin.buffer + DAHDI_CHUNKSIZE * x;
chan->confin.inbuf = 0;
chan->confin.outbuf = -1;
- for (x=0;x<ZT_CB_SIZE;x++)
- chan->confout.buf[x] = chan->confout.buffer + ZT_CHUNKSIZE * x;
+ for (x=0;x<DAHDI_CB_SIZE;x++)
+ chan->confout.buf[x] = chan->confout.buffer + DAHDI_CHUNKSIZE * x;
chan->confout.inbuf = 0;
chan->confout.outbuf = -1;
}
-static inline int hw_echocancel_off(struct zt_chan *chan)
+static inline int hw_echocancel_off(struct dahdi_chan *chan)
{
- struct zt_echocanparams ecp;
+ struct dahdi_echocanparams ecp;
int ret = -ENODEV;
if (chan->span) {
@@ -1015,7 +1015,7 @@ static inline int hw_echocancel_off(struct zt_chan *chan)
return ret;
}
-static void close_channel(struct zt_chan *chan)
+static void close_channel(struct dahdi_chan *chan)
{
unsigned long flags;
void *rxgain = NULL;
@@ -1027,8 +1027,8 @@ static void close_channel(struct zt_chan *chan)
#endif
/* XXX Buffers should be send out before reallocation!!! XXX */
- if (!(chan->flags & ZT_FLAG_NOSTDTXRX))
- zt_reallocbufs(chan, 0, 0);
+ if (!(chan->flags & DAHDI_FLAG_NOSTDTXRX))
+ dahdi_reallocbufs(chan, 0, 0);
spin_lock_irqsave(&chan->lock, flags);
#ifdef CONFIG_ZAPATA_PPP
ppp = chan->ppp;
@@ -1044,7 +1044,7 @@ static void close_channel(struct zt_chan *chan)
chan->curzone = NULL;
chan->cadencepos = 0;
chan->pdialcount = 0;
- zt_hangup(chan);
+ dahdi_hangup(chan);
chan->itimerset = chan->itimer = 0;
chan->pulsecount = 0;
chan->pulsetimer = 0;
@@ -1064,13 +1064,13 @@ static void close_channel(struct zt_chan *chan)
oldconf = chan->confna;
/* initialize conference variables */
chan->_confn = 0;
- if ((chan->sig & __ZT_SIG_DACS) != __ZT_SIG_DACS) {
+ if ((chan->sig & __DAHDI_SIG_DACS) != __DAHDI_SIG_DACS) {
chan->confna = 0;
chan->confmode = 0;
}
chan->confmute = 0;
/* release conference resource, if any to release */
- if (oldconf) zt_check_conf(oldconf);
+ if (oldconf) dahdi_check_conf(oldconf);
chan->gotgs = 0;
reset_conf(chan);
@@ -1081,9 +1081,9 @@ static void close_channel(struct zt_chan *chan)
chan->txgain = defgain;
chan->gainalloc = 0;
chan->eventinidx = chan->eventoutidx = 0;
- chan->flags &= ~(ZT_FLAG_LOOPED | ZT_FLAG_LINEAR | ZT_FLAG_PPP | ZT_FLAG_SIGFREEZE);
+ chan->flags &= ~(DAHDI_FLAG_LOOPED | DAHDI_FLAG_LINEAR | DAHDI_FLAG_PPP | DAHDI_FLAG_SIGFREEZE);
- zt_set_law(chan,0);
+ dahdi_set_law(chan,0);
memset(chan->conflast, 0, sizeof(chan->conflast));
memset(chan->conflast1, 0, sizeof(chan->conflast1));
@@ -1116,9 +1116,9 @@ static void close_channel(struct zt_chan *chan)
static int free_tone_zone(int num)
{
- struct zt_zone *z;
+ struct dahdi_zone *z;
- if ((num >= ZT_TONE_ZONE_MAX) || (num < 0))
+ if ((num >= DAHDI_TONE_ZONE_MAX) || (num < 0))
return -EINVAL;
write_lock(&zone_lock);
@@ -1142,11 +1142,11 @@ static int free_tone_zone(int num)
}
}
-static int zt_register_tone_zone(int num, struct zt_zone *zone)
+static int dahdi_register_tone_zone(int num, struct dahdi_zone *zone)
{
int res = 0;
- if ((num >= ZT_TONE_ZONE_MAX) || (num < 0))
+ if ((num >= DAHDI_TONE_ZONE_MAX) || (num < 0))
return -EINVAL;
write_lock(&zone_lock);
@@ -1164,7 +1164,7 @@ static int zt_register_tone_zone(int num, struct zt_zone *zone)
return res;
}
-static int start_tone(struct zt_chan *chan, int tone)
+static int start_tone(struct dahdi_chan *chan, int tone)
{
int res = -EINVAL;
@@ -1187,7 +1187,7 @@ static int start_tone(struct zt_chan *chan, int tone)
}
/* Note that no tone zone exists at the moment */
res = -ENODATA;
- } else if ((tone >= 0 && tone <= ZT_TONE_MAX)) {
+ } else if ((tone >= 0 && tone <= DAHDI_TONE_MAX)) {
/* Have a tone zone */
if (chan->curzone->tones[tone]) {
chan->curtone = chan->curzone->tones[tone];
@@ -1196,10 +1196,10 @@ static int start_tone(struct zt_chan *chan, int tone)
res = -ENOSYS;
}
} else if (chan->digitmode == DIGIT_MODE_DTMF) {
- if ((tone >= ZT_TONE_DTMF_BASE) && (tone <= ZT_TONE_DTMF_MAX)) {
+ if ((tone >= DAHDI_TONE_DTMF_BASE) && (tone <= DAHDI_TONE_DTMF_MAX)) {
chan->dialing = 1;
res = 0;
- tone -= ZT_TONE_DTMF_BASE;
+ tone -= DAHDI_TONE_DTMF_BASE;
if (chan->curzone) {
/* Have a tone zone */
if (chan->curzone->dtmf_continuous[tone].tonesamples) {
@@ -1217,9 +1217,9 @@ static int start_tone(struct zt_chan *chan, int tone)
res = -EINVAL;
}
} else if (chan->digitmode == DIGIT_MODE_MFR2_FWD) {
- if ((tone >= ZT_TONE_MFR2_FWD_BASE) && (tone <= ZT_TONE_MFR2_FWD_MAX)) {
+ if ((tone >= DAHDI_TONE_MFR2_FWD_BASE) && (tone <= DAHDI_TONE_MFR2_FWD_MAX)) {
res = 0;
- tone -= ZT_TONE_MFR2_FWD_BASE;
+ tone -= DAHDI_TONE_MFR2_FWD_BASE;
if (chan->curzone) {
/* Have a tone zone */
if (chan->curzone->mfr2_fwd_continuous[tone].tonesamples) {
@@ -1237,9 +1237,9 @@ static int start_tone(struct zt_chan *chan, int tone)
res = -EINVAL;
}
} else if (chan->digitmode == DIGIT_MODE_MFR2_REV) {
- if ((tone >= ZT_TONE_MFR2_REV_BASE) && (tone <= ZT_TONE_MFR2_REV_MAX)) {
+ if ((tone >= DAHDI_TONE_MFR2_REV_BASE) && (tone <= DAHDI_TONE_MFR2_REV_MAX)) {
res = 0;
- tone -= ZT_TONE_MFR2_REV_BASE;
+ tone -= DAHDI_TONE_MFR2_REV_BASE;
if (chan->curzone) {
/* Have a tone zone */
if (chan->curzone->mfr2_rev_continuous[tone].tonesamples) {
@@ -1262,15 +1262,15 @@ static int start_tone(struct zt_chan *chan, int tone)
}
if (chan->curtone)
- zt_init_tone_state(&chan->ts, chan->curtone);
+ dahdi_init_tone_state(&chan->ts, chan->curtone);
return res;
}
-static int set_tone_zone(struct zt_chan *chan, int zone)
+static int set_tone_zone(struct dahdi_chan *chan, int zone)
{
int res = 0;
- struct zt_zone *z;
+ struct dahdi_zone *z;
unsigned long flags;
/* Do not call with the channel locked. */
@@ -1278,7 +1278,7 @@ static int set_tone_zone(struct zt_chan *chan, int zone)
if (zone == -1)
zone = default_zone;
- if ((zone >= ZT_TONE_ZONE_MAX) || (zone < 0))
+ if ((zone >= DAHDI_TONE_ZONE_MAX) || (zone < 0))
return -EINVAL;
read_lock(&zone_lock);
@@ -1302,34 +1302,34 @@ static int set_tone_zone(struct zt_chan *chan, int zone)
return res;
}
-static void zt_set_law(struct zt_chan *chan, int law)
+static void dahdi_set_law(struct dahdi_chan *chan, int law)
{
if (!law) {
if (chan->deflaw)
law = chan->deflaw;
else
if (chan->span) law = chan->span->deflaw;
- else law = ZT_LAW_MULAW;
+ else law = DAHDI_LAW_MULAW;
}
- if (law == ZT_LAW_ALAW) {
- chan->xlaw = __zt_alaw;
+ if (law == DAHDI_LAW_ALAW) {
+ chan->xlaw = __dahdi_alaw;
#ifdef CONFIG_CALC_XLAW
- chan->lineartoxlaw = __zt_lineartoalaw;
+ chan->lineartoxlaw = __dahdi_lineartoalaw;
#else
- chan->lin2x = __zt_lin2a;
+ chan->lin2x = __dahdi_lin2a;
#endif
} else {
- chan->xlaw = __zt_mulaw;
+ chan->xlaw = __dahdi_mulaw;
#ifdef CONFIG_CALC_XLAW
- chan->lineartoxlaw = __zt_lineartoulaw;
+ chan->lineartoxlaw = __dahdi_lineartoulaw;
#else
- chan->lin2x = __zt_lin2mu;
+ chan->lin2x = __dahdi_lin2mu;
#endif
}
}
#ifdef CONFIG_DEVFS_FS
-static devfs_handle_t register_devfs_channel(struct zt_chan *chan, devfs_handle_t dir)
+static devfs_handle_t register_devfs_channel(struct dahdi_chan *chan, devfs_handle_t dir)
{
char path[100];
char link[100];
@@ -1344,7 +1344,7 @@ static devfs_handle_t register_devfs_channel(struct zt_chan *chan, devfs_handle_
unsigned int flags = DEVFS_FL_AUTO_OWNER;
sprintf(path, "%d", chan->chanpos);
- chan_dev = devfs_register(dir, path, flags, ZT_MAJOR, chan->channo, mode, &zt_fops, NULL);
+ chan_dev = devfs_register(dir, path, flags, DAHDI_MAJOR, chan->channo, mode, &dahdi_fops, NULL);
if (!chan_dev) {
printk("zaptel: Something really bad happened. Unable to register devfs entry\n");
return NULL;
@@ -1373,14 +1373,14 @@ static devfs_handle_t register_devfs_channel(struct zt_chan *chan, devfs_handle_
}
#endif /* CONFIG_DEVFS_FS */
-static int zt_chan_reg(struct zt_chan *chan)
+static int dahdi_chan_reg(struct dahdi_chan *chan)
{
int x;
int res=0;
unsigned long flags;
write_lock_irqsave(&chan_lock, flags);
- for (x=1;x<ZT_MAX_CHANNELS;x++) {
+ for (x=1;x<DAHDI_MAX_CHANNELS;x++) {
if (!chans[x]) {
spin_lock_init(&chan->lock);
chans[x] = chan;
@@ -1393,26 +1393,26 @@ static int zt_chan_reg(struct zt_chan *chan)
chan->readchunk = chan->sreadchunk;
if (!chan->writechunk)
chan->writechunk = chan->swritechunk;
- zt_set_law(chan, 0);
+ dahdi_set_law(chan, 0);
close_channel(chan);
/* set this AFTER running close_channel() so that
HDLC channels wont cause hangage */
- chan->flags |= ZT_FLAG_REGISTERED;
+ chan->flags |= DAHDI_FLAG_REGISTERED;
res = 0;
break;
}
}
write_unlock_irqrestore(&chan_lock, flags);
- if (x >= ZT_MAX_CHANNELS)
+ if (x >= DAHDI_MAX_CHANNELS)
printk(KERN_ERR "No more channels available\n");
return res;
}
-char *zt_lboname(int x)
+char *dahdi_lboname(int x)
{
if ((x < 0) || ( x > 7))
return "Unknown";
- return zt_txlevelnames[x];
+ return dahdi_txlevelnames[x];
}
#if defined(CONFIG_ZAPATA_NET) || defined(CONFIG_ZAPATA_PPP)
@@ -1420,14 +1420,14 @@ char *zt_lboname(int x)
#ifdef CONFIG_ZAPATA_NET
#ifdef NEW_HDLC_INTERFACE
-static int zt_net_open(struct net_device *dev)
+static int dahdi_net_open(struct net_device *dev)
{
#ifdef LINUX26
int res = hdlc_open(dev);
- struct zt_chan *ms = dev_to_ztchan(dev);
+ struct dahdi_chan *ms = dev_to_ztchan(dev);
#else
hdlc_device *hdlc = dev_to_hdlc(dev);
- struct zt_chan *ms = hdlc_to_ztchan(hdlc);
+ struct dahdi_chan *ms = hdlc_to_ztchan(hdlc);
int res = hdlc_open(hdlc);
#endif
@@ -1435,27 +1435,27 @@ static int zt_net_open(struct net_device *dev)
if (res) /* this is necessary to avoid kernel panic when UNSPEC link encap, proven --byg */
return res;
#else
-static int zt_net_open(hdlc_device *hdlc)
+static int dahdi_net_open(hdlc_device *hdlc)
{
- struct zt_chan *ms = hdlc_to_ztchan(hdlc);
+ struct dahdi_chan *ms = hdlc_to_ztchan(hdlc);
int res;
#endif
if (!ms) {
- printk("zt_net_open: nothing??\n");
+ printk("dahdi_net_open: nothing??\n");
return -EINVAL;
}
- if (ms->flags & ZT_FLAG_OPEN) {
+ if (ms->flags & DAHDI_FLAG_OPEN) {
printk("%s is already open!\n", ms->name);
return -EBUSY;
}
- if (!(ms->flags & ZT_FLAG_NETDEV)) {
+ if (!(ms->flags & DAHDI_FLAG_NETDEV)) {
printk("%s is not a net device!\n", ms->name);
return -EINVAL;
}
- ms->txbufpolicy = ZT_POLICY_IMMEDIATE;
- ms->rxbufpolicy = ZT_POLICY_IMMEDIATE;
+ ms->txbufpolicy = DAHDI_POLICY_IMMEDIATE;
+ ms->rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
- res = zt_reallocbufs(ms, ZT_DEFAULT_MTU_MRU, ZT_DEFAULT_NUM_BUFS);
+ res = dahdi_reallocbufs(ms, DAHDI_DEFAULT_MTU_MRU, DAHDI_DEFAULT_NUM_BUFS);
if (res)
return res;
@@ -1475,7 +1475,7 @@ static int zt_net_open(hdlc_device *hdlc)
}
#ifdef LINUX26
-static int zt_register_hdlc_device(struct net_device *dev, const char *dev_name)
+static int dahdi_register_hdlc_device(struct net_device *dev, const char *dev_name)
{
int result;
@@ -1495,41 +1495,41 @@ static int zt_register_hdlc_device(struct net_device *dev, const char *dev_name)
#endif
#ifdef NEW_HDLC_INTERFACE
-static int zt_net_stop(struct net_device *dev)
+static int dahdi_net_stop(struct net_device *dev)
{
#ifdef LINUX26
hdlc_device *h = dev_to_hdlc(dev);
- struct zt_hdlc *hdlc = h->priv;
+ struct dahdi_hdlc *hdlc = h->priv;
#else
hdlc_device *hdlc = dev_to_hdlc(dev);
#endif
#else
-static void zt_net_close(hdlc_device *hdlc)
+static void dahdi_net_close(hdlc_device *hdlc)
{
#endif
- struct zt_chan *ms = hdlc_to_ztchan(hdlc);
+ struct dahdi_chan *ms = hdlc_to_ztchan(hdlc);
if (!ms) {
#ifdef NEW_HDLC_INTERFACE
- printk("zt_net_stop: nothing??\n");
+ printk("dahdi_net_stop: nothing??\n");
return 0;
#else
- printk("zt_net_close: nothing??\n");
+ printk("dahdi_net_close: nothing??\n");
return;
#endif
}
- if (!(ms->flags & ZT_FLAG_NETDEV)) {
+ if (!(ms->flags & DAHDI_FLAG_NETDEV)) {
#ifdef NEW_HDLC_INTERFACE
- printk("zt_net_stop: %s is not a net device!\n", ms->name);
+ printk("dahdi_net_stop: %s is not a net device!\n", ms->name);
return 0;
#else
- printk("zt_net_close: %s is not a net device!\n", ms->name);
+ printk("dahdi_net_close: %s is not a net device!\n", ms->name);
return;
#endif
}
/* Not much to do here. Just deallocate the buffers */
netif_stop_queue(ztchan_to_dev(ms));
- zt_reallocbufs(ms, 0, 0);
+ dahdi_reallocbufs(ms, 0, 0);
#ifdef LINUX26
hdlc_close(dev);
#else
@@ -1552,10 +1552,10 @@ static void zt_net_close(hdlc_device *hdlc)
just copy sources from dscc4 to be sure and ready for further mastering,
NOOP right now (i.e. really a stub) --byg */
#ifdef LINUX26
-static int zt_net_attach(struct net_device *dev, unsigned short encoding,
+static int dahdi_net_attach(struct net_device *dev, unsigned short encoding,
unsigned short parity)
#else
-static int zt_net_attach(hdlc_device *hdlc, unsigned short encoding,
+static int dahdi_net_attach(hdlc_device *hdlc, unsigned short encoding,
unsigned short parity)
#endif
{
@@ -1582,33 +1582,33 @@ static int zt_net_attach(hdlc_device *hdlc, unsigned short encoding,
}
#endif
-static struct zt_hdlc *zt_hdlc_alloc(void)
+static struct dahdi_hdlc *dahdi_hdlc_alloc(void)
{
- struct zt_hdlc *tmp;
- tmp = kmalloc(sizeof(struct zt_hdlc), GFP_KERNEL);
+ struct dahdi_hdlc *tmp;
+ tmp = kmalloc(sizeof(struct dahdi_hdlc), GFP_KERNEL);
if (tmp) {
- memset(tmp, 0, sizeof(struct zt_hdlc));
+ memset(tmp, 0, sizeof(struct dahdi_hdlc));
}
return tmp;
}
#ifdef NEW_HDLC_INTERFACE
-static int zt_xmit(struct sk_buff *skb, struct net_device *dev)
+static int dahdi_xmit(struct sk_buff *skb, struct net_device *dev)
{
/* FIXME: this construction seems to be not very optimal for me but I could find nothing better at the moment (Friday, 10PM :( ) --byg */
-/* struct zt_chan *ss = hdlc_to_ztchan(list_entry(dev, struct zt_hdlc, netdev.netdev));*/
+/* struct dahdi_chan *ss = hdlc_to_ztchan(list_entry(dev, struct dahdi_hdlc, netdev.netdev));*/
#ifdef LINUX26
- struct zt_chan *ss = dev_to_ztchan(dev);
+ struct dahdi_chan *ss = dev_to_ztchan(dev);
struct net_device_stats *stats = hdlc_stats(dev);
#else
- struct zt_chan *ss = (list_entry(dev, struct zt_hdlc, netdev.netdev)->chan);
+ struct dahdi_chan *ss = (list_entry(dev, struct dahdi_hdlc, netdev.netdev)->chan);
struct net_device_stats *stats = &ss->hdlcnetdev->netdev.stats;
#endif
#else
-static int zt_xmit(hdlc_device *hdlc, struct sk_buff *skb)
+static int dahdi_xmit(hdlc_device *hdlc, struct sk_buff *skb)
{
- struct zt_chan *ss = hdlc_to_ztchan(hdlc);
+ struct dahdi_chan *ss = hdlc_to_ztchan(hdlc);
struct net_device *dev = &ss->hdlcnetdev->netdev.netdev;
struct net_device_stats *stats = &ss->hdlcnetdev->netdev.stats;
#endif
@@ -1620,7 +1620,7 @@ static int zt_xmit(hdlc_device *hdlc, struct sk_buff *skb)
/* See if we have any buffers */
spin_lock_irqsave(&ss->lock, flags);
if (skb->len > ss->blocksize - 2) {
- printk(KERN_ERR "zt_xmit(%s): skb is too large (%d > %d)\n", dev->name, skb->len, ss->blocksize -2);
+ printk(KERN_ERR "dahdi_xmit(%s): skb is too large (%d > %d)\n", dev->name, skb->len, ss->blocksize -2);
stats->tx_dropped++;
retval = 0;
} else if (ss->inwritebuf >= 0) {
@@ -1672,12 +1672,12 @@ static int zt_xmit(hdlc_device *hdlc, struct sk_buff *skb)
}
#ifdef NEW_HDLC_INTERFACE
-static int zt_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+static int dahdi_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
return hdlc_ioctl(dev, ifr, cmd);
}
#else
-static int zt_net_ioctl(hdlc_device *hdlc, struct ifreq *ifr, int cmd)
+static int dahdi_net_ioctl(hdlc_device *hdlc, struct ifreq *ifr, int cmd)
{
return -EIO;
}
@@ -1687,7 +1687,7 @@ static int zt_net_ioctl(hdlc_device *hdlc, struct ifreq *ifr, int cmd)
#ifdef CONFIG_ZAPATA_PPP
-static int zt_ppp_xmit(struct ppp_channel *ppp, struct sk_buff *skb)
+static int dahdi_ppp_xmit(struct ppp_channel *ppp, struct sk_buff *skb)
{
/*
@@ -1695,7 +1695,7 @@ static int zt_ppp_xmit(struct ppp_channel *ppp, struct sk_buff *skb)
* we handle or drop it, return 1. Always free if we return
* 1 and never if we return 0
*/
- struct zt_chan *ss = ppp->private;
+ struct dahdi_chan *ss = ppp->private;
int x,oldbuf;
unsigned int fcs;
unsigned char *data;
@@ -1704,11 +1704,11 @@ static int zt_ppp_xmit(struct ppp_channel *ppp, struct sk_buff *skb)
/* See if we have any buffers */
spin_lock_irqsave(&ss->lock, flags);
- if (!(ss->flags & ZT_FLAG_OPEN)) {
+ if (!(ss->flags & DAHDI_FLAG_OPEN)) {
printk("Can't transmit on closed channel\n");
retval = 1;
} else if (skb->len > ss->blocksize - 4) {
- printk(KERN_ERR "zt_ppp_xmit(%s): skb is too large (%d > %d)\n", ss->name, skb->len, ss->blocksize -2);
+ printk(KERN_ERR "dahdi_ppp_xmit(%s): skb is too large (%d > %d)\n", ss->name, skb->len, ss->blocksize -2);
retval = 1;
} else if (ss->inwritebuf >= 0) {
/* We have a place to put this packet */
@@ -1776,25 +1776,25 @@ static int zt_ppp_xmit(struct ppp_channel *ppp, struct sk_buff *skb)
return retval;
}
-static int zt_ppp_ioctl(struct ppp_channel *ppp, unsigned int cmd, unsigned long flags)
+static int dahdi_ppp_ioctl(struct ppp_channel *ppp, unsigned int cmd, unsigned long flags)
{
return -EIO;
}
static struct ppp_channel_ops ztppp_ops =
{
- start_xmit: zt_ppp_xmit,
- ioctl: zt_ppp_ioctl,
+ start_xmit: dahdi_ppp_xmit,
+ ioctl: dahdi_ppp_ioctl,
};
#endif
-static void zt_chan_unreg(struct zt_chan *chan)
+static void dahdi_chan_unreg(struct dahdi_chan *chan)
{
int x;
unsigned long flags;
#ifdef CONFIG_ZAPATA_NET
- if (chan->flags & ZT_FLAG_NETDEV) {
+ if (chan->flags & DAHDI_FLAG_NETDEV) {
#ifdef LINUX26
unregister_hdlc_device(chan->hdlcnetdev->netdev);
free_netdev(chan->hdlcnetdev->netdev);
@@ -1806,9 +1806,9 @@ static void zt_chan_unreg(struct zt_chan *chan)
}
#endif
write_lock_irqsave(&chan_lock, flags);
- if (chan->flags & ZT_FLAG_REGISTERED) {
+ if (chan->flags & DAHDI_FLAG_REGISTERED) {
chans[chan->channo] = NULL;
- chan->flags &= ~ZT_FLAG_REGISTERED;
+ chan->flags &= ~DAHDI_FLAG_REGISTERED;
}
#ifdef CONFIG_ZAPATA_PPP
if (chan->ppp) {
@@ -1816,7 +1816,7 @@ static void zt_chan_unreg(struct zt_chan *chan)
}
#endif
maxchans = 0;
- for (x=1;x<ZT_MAX_CHANNELS;x++)
+ for (x=1;x<DAHDI_MAX_CHANNELS;x++)
if (chans[x]) {
maxchans = x + 1;
/* Remove anyone pointing to us as master
@@ -1825,17 +1825,17 @@ static void zt_chan_unreg(struct zt_chan *chan)
chans[x]->master = chans[x];
}
if ((chans[x]->confna == chan->channo) &&
- ((chans[x]->confmode & ZT_CONF_MODE_MASK) == ZT_CONF_MONITOR ||
- (chans[x]->confmode & ZT_CONF_MODE_MASK) == ZT_CONF_MONITORTX ||
- (chans[x]->confmode & ZT_CONF_MODE_MASK) == ZT_CONF_MONITORBOTH ||
- (chans[x]->confmode & ZT_CONF_MODE_MASK) == ZT_CONF_MONITOR_RX_PREECHO ||
- (chans[x]->confmode & ZT_CONF_MODE_MASK) == ZT_CONF_MONITOR_TX_PREECHO ||
- (chans[x]->confmode & ZT_CONF_MODE_MASK) == ZT_CONF_MONITORBOTH_PREECHO ||
- (chans[x]->confmode & ZT_CONF_MODE_MASK) == ZT_CONF_DIGITALMON)) {
+ ((chans[x]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_MONITOR ||
+ (chans[x]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_MONITORTX ||
+ (chans[x]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_MONITORBOTH ||
+ (chans[x]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_MONITOR_RX_PREECHO ||
+ (chans[x]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_MONITOR_TX_PREECHO ||
+ (chans[x]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_MONITORBOTH_PREECHO ||
+ (chans[x]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_DIGITALMON)) {
/* Take them out of conference with us */
/* release conference resource if any */
if (chans[x]->confna) {
- zt_check_conf(chans[x]->confna);
+ dahdi_check_conf(chans[x]->confna);
if (chans[x]->span && chans[x]->span->dacs)
chans[x]->span->dacs(chans[x], NULL);
}
@@ -1848,9 +1848,9 @@ static void zt_chan_unreg(struct zt_chan *chan)
write_unlock_irqrestore(&chan_lock, flags);
}
-static ssize_t zt_chan_read(struct file *file, char *usrbuf, size_t count, int unit)
+static ssize_t dahdi_chan_read(struct file *file, char *usrbuf, size_t count, int unit)
{
- struct zt_chan *chan = chans[unit];
+ struct dahdi_chan *chan = chans[unit];
int amnt;
int res, rv;
int oldbuf,x;
@@ -1885,14 +1885,14 @@ static ssize_t zt_chan_read(struct file *file, char *usrbuf, size_t count, int u
int x;
if (amnt > chan->readn[res])
myamnt = chan->readn[res];
- printk("zt_chan_read(unit: %d, inwritebuf: %d, outwritebuf: %d amnt: %d\n",
+ printk("dahdi_chan_read(unit: %d, inwritebuf: %d, outwritebuf: %d amnt: %d\n",
unit, chan->inwritebuf, chan->outwritebuf, myamnt);
printk("\t("); for (x = 0; x < myamnt; x++) printk((x ? " %02x" : "%02x"), (unsigned char)usrbuf[x]);
printk(")\n");
}
#endif
/* end addition */
- if (chan->flags & ZT_FLAG_LINEAR) {
+ if (chan->flags & DAHDI_FLAG_LINEAR) {
if (amnt > (chan->readn[res] << 1))
amnt = chan->readn[res] << 1;
if (amnt) {
@@ -1907,7 +1907,7 @@ static ssize_t zt_chan_read(struct file *file, char *usrbuf, size_t count, int u
if (pass > 128)
pass = 128;
for (x=0;x<pass;x++)
- lindata[x] = ZT_XLAW(chan->readbuf[res][x + pos], chan);
+ lindata[x] = DAHDI_XLAW(chan->readbuf[res][x + pos], chan);
if (copy_to_user(usrbuf + (pos << 1), lindata, pass << 1))
return -EFAULT;
left -= pass;
@@ -1930,7 +1930,7 @@ static ssize_t zt_chan_read(struct file *file, char *usrbuf, size_t count, int u
if (chan->outreadbuf == chan->inreadbuf) {
/* Out of stuff */
chan->outreadbuf = -1;
- if (chan->rxbufpolicy == ZT_POLICY_WHEN_FULL)
+ if (chan->rxbufpolicy == DAHDI_POLICY_WHEN_FULL)
chan->rxdisable = 1;
}
if (chan->inreadbuf < 0) {
@@ -1942,10 +1942,10 @@ static ssize_t zt_chan_read(struct file *file, char *usrbuf, size_t count, int u
return amnt;
}
-static ssize_t zt_chan_write(struct file *file, const char *usrbuf, size_t count, int unit)
+static ssize_t dahdi_chan_write(struct file *file, const char *usrbuf, size_t count, int unit)
{
unsigned long flags;
- struct zt_chan *chan = chans[unit];
+ struct dahdi_chan *chan = chans[unit];
int res, amnt, oldbuf, rv,x;
/* Make sure count never exceeds 65k, and make sure it's unsigned */
count &= 0xffff;
@@ -1955,7 +1955,7 @@ static ssize_t zt_chan_write(struct file *file, const char *usrbuf, size_t count
return -EINVAL;
for(;;) {
spin_lock_irqsave(&chan->lock, flags);
- if ((chan->curtone || chan->pdialcount) && !(chan->flags & ZT_FLAG_PSEUDO)) {
+ if ((chan->curtone || chan->pdialcount) && !(chan->flags & DAHDI_FLAG_PSEUDO)) {
chan->curtone = NULL;
chan->tonep = 0;
chan->dialing = 0;
@@ -1979,7 +1979,7 @@ static ssize_t zt_chan_write(struct file *file, const char *usrbuf, size_t count
}
amnt = count;
- if (chan->flags & ZT_FLAG_LINEAR) {
+ if (chan->flags & DAHDI_FLAG_LINEAR) {
if (amnt > (chan->blocksize << 1))
amnt = chan->blocksize << 1;
} else {
@@ -1988,13 +1988,13 @@ static ssize_t zt_chan_write(struct file *file, const char *usrbuf, size_t count
}
#ifdef CONFIG_ZAPATA_DEBUG
- printk("zt_chan_write(unit: %d, res: %d, outwritebuf: %d amnt: %d\n",
+ printk("dahdi_chan_write(unit: %d, res: %d, outwritebuf: %d amnt: %d\n",
unit, chan->res, chan->outwritebuf, amnt);
#endif
#if 0
if ((unit == 24) || (unit == 48) || (unit == 16) || (unit == 47)) {
int x;
- printk("zt_chan_write/in(unit: %d, res: %d, outwritebuf: %d amnt: %d, txdisable: %d)\n",
+ printk("dahdi_chan_write/in(unit: %d, res: %d, outwritebuf: %d amnt: %d, txdisable: %d)\n",
unit, res, chan->outwritebuf, amnt, chan->txdisable);
printk("\t("); for (x = 0; x < amnt; x++) printk((x ? " %02x" : "%02x"), (unsigned char)usrbuf[x]);
printk(")\n");
@@ -2002,7 +2002,7 @@ static ssize_t zt_chan_write(struct file *file, const char *usrbuf, size_t count
#endif
if (amnt) {
- if (chan->flags & ZT_FLAG_LINEAR) {
+ if (chan->flags & DAHDI_FLAG_LINEAR) {
/* There seems to be a max stack size, so we have
to do this in smaller pieces */
short lindata[128];
@@ -2017,7 +2017,7 @@ static ssize_t zt_chan_write(struct file *file, const char *usrbuf, size_t count
return -EFAULT;
left -= pass;
for (x=0;x<pass;x++)
- chan->writebuf[res][x + pos] = ZT_LIN2X(lindata[x], chan);
+ chan->writebuf[res][x + pos] = DAHDI_LIN2X(lindata[x], chan);
pos += pass;
}
chan->writen[res] = amnt >> 1;
@@ -2027,7 +2027,7 @@ static ssize_t zt_chan_write(struct file *file, const char *usrbuf, size_t count
chan->writen[res] = amnt;
}
chan->writeidx[res] = 0;
- if (chan->flags & ZT_FLAG_FCS)
+ if (chan->flags & DAHDI_FLAG_FCS)
calc_fcs(chan, res);
oldbuf = res;
spin_lock_irqsave(&chan->lock, flags);
@@ -2045,13 +2045,13 @@ static ssize_t zt_chan_write(struct file *file, const char *usrbuf, size_t count
}
spin_unlock_irqrestore(&chan->lock, flags);
- if (chan->flags & ZT_FLAG_NOSTDTXRX && chan->span->hdlc_hard_xmit)
+ if (chan->flags & DAHDI_FLAG_NOSTDTXRX && chan->span->hdlc_hard_xmit)
chan->span->hdlc_hard_xmit(chan);
}
return amnt;
}
-static int zt_ctl_open(struct inode *inode, struct file *file)
+static int dahdi_ctl_open(struct inode *inode, struct file *file)
{
/* Nothing to do, really */
#ifndef LINUX26
@@ -2060,7 +2060,7 @@ static int zt_ctl_open(struct inode *inode, struct file *file)
return 0;
}
-static int zt_chan_open(struct inode *inode, struct file *file)
+static int dahdi_chan_open(struct inode *inode, struct file *file)
{
/* Nothing to do here for now either */
#ifndef LINUX26
@@ -2069,7 +2069,7 @@ static int zt_chan_open(struct inode *inode, struct file *file)
return 0;
}
-static int zt_ctl_release(struct inode *inode, struct file *file)
+static int dahdi_ctl_release(struct inode *inode, struct file *file)
{
/* Nothing to do */
#ifndef LINUX26
@@ -2078,7 +2078,7 @@ static int zt_ctl_release(struct inode *inode, struct file *file)
return 0;
}
-static int zt_chan_release(struct inode *inode, struct file *file)
+static int dahdi_chan_release(struct inode *inode, struct file *file)
{
/* Nothing to do for now */
#ifndef LINUX26
@@ -2087,7 +2087,7 @@ static int zt_chan_release(struct inode *inode, struct file *file)
return 0;
}
-static void set_txtone(struct zt_chan *ss,int fac, int init_v2, int init_v3)
+static void set_txtone(struct dahdi_chan *ss,int fac, int init_v2, int init_v3)
{
if (fac == 0)
{
@@ -2102,69 +2102,69 @@ static void set_txtone(struct zt_chan *ss,int fac, int init_v2, int init_v3)
return;
}
-static void zt_rbs_sethook(struct zt_chan *chan, int txsig, int txstate, int timeout)
+static void dahdi_rbs_sethook(struct dahdi_chan *chan, int txsig, int txstate, int timeout)
{
static int outs[NUM_SIGS][5] = {
-/* We set the idle case of the ZT_SIG_NONE to this pattern to make idle E1 CAS
+/* We set the idle case of the DAHDI_SIG_NONE to this pattern to make idle E1 CAS
channels happy. Should not matter with T1, since on an un-configured channel,
who cares what the sig bits are as long as they are stable */
- { ZT_SIG_NONE, ZT_ABIT | ZT_CBIT | ZT_DBIT, 0, 0, 0 }, /* no signalling */
- { ZT_SIG_EM, 0, ZT_ABIT | ZT_BBIT | ZT_CBIT | ZT_DBIT,
- ZT_ABIT | ZT_BBIT | ZT_CBIT | ZT_DBIT, 0 }, /* E and M */
- { ZT_SIG_FXSLS, ZT_BBIT | ZT_DBIT,
- ZT_ABIT | ZT_BBIT | ZT_CBIT | ZT_DBIT,
- ZT_ABIT | ZT_BBIT | ZT_CBIT | ZT_DBIT, 0 }, /* FXS Loopstart */
- { ZT_SIG_FXSGS, ZT_BBIT | ZT_DBIT,
+ { DAHDI_SIG_NONE, DAHDI_ABIT | DAHDI_CBIT | DAHDI_DBIT, 0, 0, 0 }, /* no signalling */
+ { DAHDI_SIG_EM, 0, DAHDI_ABIT | DAHDI_BBIT | DAHDI_CBIT | DAHDI_DBIT,
+ DAHDI_ABIT | DAHDI_BBIT | DAHDI_CBIT | DAHDI_DBIT, 0 }, /* E and M */
+ { DAHDI_SIG_FXSLS, DAHDI_BBIT | DAHDI_DBIT,
+ DAHDI_ABIT | DAHDI_BBIT | DAHDI_CBIT | DAHDI_DBIT,
+ DAHDI_ABIT | DAHDI_BBIT | DAHDI_CBIT | DAHDI_DBIT, 0 }, /* FXS Loopstart */
+ { DAHDI_SIG_FXSGS, DAHDI_BBIT | DAHDI_DBIT,
#ifdef CONFIG_CAC_GROUNDSTART
- ZT_ABIT | ZT_BBIT | ZT_CBIT | ZT_DBIT, 0, 0 }, /* FXS Groundstart (CAC-style) */
+ DAHDI_ABIT | DAHDI_BBIT | DAHDI_CBIT | DAHDI_DBIT, 0, 0 }, /* FXS Groundstart (CAC-style) */
#else
- ZT_ABIT | ZT_BBIT | ZT_CBIT | ZT_DBIT, ZT_ABIT | ZT_CBIT, 0 }, /* FXS Groundstart (normal) */
+ DAHDI_ABIT | DAHDI_BBIT | DAHDI_CBIT | DAHDI_DBIT, DAHDI_ABIT | DAHDI_CBIT, 0 }, /* FXS Groundstart (normal) */
#endif
- { ZT_SIG_FXSKS, ZT_BBIT | ZT_DBIT,
- ZT_ABIT | ZT_BBIT | ZT_CBIT | ZT_DBIT,
- ZT_ABIT | ZT_BBIT | ZT_CBIT | ZT_DBIT, 0 }, /* FXS Kewlstart */
- { ZT_SIG_FXOLS, ZT_BBIT | ZT_DBIT, ZT_BBIT | ZT_DBIT, 0, 0 }, /* FXO Loopstart */
- { ZT_SIG_FXOGS, ZT_ABIT | ZT_BBIT | ZT_CBIT | ZT_DBIT,
- ZT_BBIT | ZT_DBIT, 0, 0 }, /* FXO Groundstart */
- { ZT_SIG_FXOKS, ZT_BBIT | ZT_DBIT, ZT_BBIT | ZT_DBIT, 0,
- ZT_ABIT | ZT_BBIT | ZT_CBIT | ZT_DBIT }, /* FXO Kewlstart */
- { ZT_SIG_SF, ZT_BBIT | ZT_CBIT | ZT_DBIT,
- ZT_ABIT | ZT_BBIT | ZT_CBIT | ZT_DBIT,
- ZT_ABIT | ZT_BBIT | ZT_CBIT | ZT_DBIT,
- ZT_BBIT | ZT_CBIT | ZT_DBIT }, /* no signalling */
- { ZT_SIG_EM_E1, ZT_DBIT, ZT_ABIT | ZT_BBIT | ZT_DBIT,
- ZT_ABIT | ZT_BBIT | ZT_DBIT, ZT_DBIT }, /* E and M E1 */
+ { DAHDI_SIG_FXSKS, DAHDI_BBIT | DAHDI_DBIT,
+ DAHDI_ABIT | DAHDI_BBIT | DAHDI_CBIT | DAHDI_DBIT,
+ DAHDI_ABIT | DAHDI_BBIT | DAHDI_CBIT | DAHDI_DBIT, 0 }, /* FXS Kewlstart */
+ { DAHDI_SIG_FXOLS, DAHDI_BBIT | DAHDI_DBIT, DAHDI_BBIT | DAHDI_DBIT, 0, 0 }, /* FXO Loopstart */
+ { DAHDI_SIG_FXOGS, DAHDI_ABIT | DAHDI_BBIT | DAHDI_CBIT | DAHDI_DBIT,
+ DAHDI_BBIT | DAHDI_DBIT, 0, 0 }, /* FXO Groundstart */
+ { DAHDI_SIG_FXOKS, DAHDI_BBIT | DAHDI_DBIT, DAHDI_BBIT | DAHDI_DBIT, 0,
+ DAHDI_ABIT | DAHDI_BBIT | DAHDI_CBIT | DAHDI_DBIT }, /* FXO Kewlstart */
+ { DAHDI_SIG_SF, DAHDI_BBIT | DAHDI_CBIT | DAHDI_DBIT,
+ DAHDI_ABIT | DAHDI_BBIT | DAHDI_CBIT | DAHDI_DBIT,
+ DAHDI_ABIT | DAHDI_BBIT | DAHDI_CBIT | DAHDI_DBIT,
+ DAHDI_BBIT | DAHDI_CBIT | DAHDI_DBIT }, /* no signalling */
+ { DAHDI_SIG_EM_E1, DAHDI_DBIT, DAHDI_ABIT | DAHDI_BBIT | DAHDI_DBIT,
+ DAHDI_ABIT | DAHDI_BBIT | DAHDI_DBIT, DAHDI_DBIT }, /* E and M E1 */
} ;
int x;
/* if no span, return doing nothing */
if (!chan->span) return;
- if (!chan->span->flags & ZT_FLAG_RBS) {
- printk("zt_rbs: Tried to set RBS hook state on non-RBS channel %s\n", chan->name);
+ if (!chan->span->flags & DAHDI_FLAG_RBS) {
+ printk("dahdi_rbs: Tried to set RBS hook state on non-RBS channel %s\n", chan->name);
return;
}
if ((txsig > 3) || (txsig < 0)) {
- printk("zt_rbs: Tried to set RBS hook state %d (> 3) on channel %s\n", txsig, chan->name);
+ printk("dahdi_rbs: Tried to set RBS hook state %d (> 3) on channel %s\n", txsig, chan->name);
return;
}
if (!chan->span->rbsbits && !chan->span->hooksig) {
- printk("zt_rbs: Tried to set RBS hook state %d on channel %s while span %s lacks rbsbits or hooksig function\n",
+ printk("dahdi_rbs: Tried to set RBS hook state %d on channel %s while span %s lacks rbsbits or hooksig function\n",
txsig, chan->name, chan->span->name);
return;
}
/* Don't do anything for RBS */
- if (chan->sig == ZT_SIG_DACS_RBS)
+ if (chan->sig == DAHDI_SIG_DACS_RBS)
return;
chan->txstate = txstate;
/* if tone signalling */
- if (chan->sig == ZT_SIG_SF)
+ if (chan->sig == DAHDI_SIG_SF)
{
chan->txhooksig = txsig;
if (chan->txtone) /* if set to make tone for tx */
{
- if ((txsig && !(chan->toneflags & ZT_REVERSE_TXTONE)) ||
- ((!txsig) && (chan->toneflags & ZT_REVERSE_TXTONE)))
+ if ((txsig && !(chan->toneflags & DAHDI_REVERSE_TXTONE)) ||
+ ((!txsig) && (chan->toneflags & DAHDI_REVERSE_TXTONE)))
{
set_txtone(chan,chan->txtone,chan->tx_v2,chan->tx_v3);
}
@@ -2173,7 +2173,7 @@ who cares what the sig bits are as long as they are stable */
set_txtone(chan,0,0,0);
}
}
- chan->otimer = timeout * ZT_CHUNKSIZE; /* Otimer is timer in samples */
+ chan->otimer = timeout * DAHDI_CHUNKSIZE; /* Otimer is timer in samples */
return;
}
if (chan->span->hooksig) {
@@ -2181,7 +2181,7 @@ who cares what the sig bits are as long as they are stable */
chan->txhooksig = txsig;
chan->span->hooksig(chan, txsig);
}
- chan->otimer = timeout * ZT_CHUNKSIZE; /* Otimer is timer in samples */
+ chan->otimer = timeout * DAHDI_CHUNKSIZE; /* Otimer is timer in samples */
return;
} else {
for (x=0;x<NUM_SIGS;x++) {
@@ -2192,15 +2192,15 @@ who cares what the sig bits are as long as they are stable */
chan->txhooksig = txsig;
chan->txsig = outs[x][txsig+1];
chan->span->rbsbits(chan, chan->txsig);
- chan->otimer = timeout * ZT_CHUNKSIZE; /* Otimer is timer in samples */
+ chan->otimer = timeout * DAHDI_CHUNKSIZE; /* Otimer is timer in samples */
return;
}
}
}
- printk("zt_rbs: Don't know RBS signalling type %d on channel %s\n", chan->sig, chan->name);
+ printk("dahdi_rbs: Don't know RBS signalling type %d on channel %s\n", chan->sig, chan->name);
}
-static int zt_cas_setbits(struct zt_chan *chan, int bits)
+static int dahdi_cas_setbits(struct dahdi_chan *chan, int bits)
{
/* if no span, return as error */
if (!chan->span) return -1;
@@ -2213,7 +2213,7 @@ static int zt_cas_setbits(struct zt_chan *chan, int bits)
return 0;
}
-static int zt_hangup(struct zt_chan *chan)
+static int dahdi_hangup(struct dahdi_chan *chan)
{
int x,res=0;
@@ -2221,37 +2221,37 @@ static int zt_hangup(struct zt_chan *chan)
if (!chan->span)
return 0;
/* Can't hang up a clear channel */
- if (chan->flags & (ZT_FLAG_CLEAR | ZT_FLAG_NOSTDTXRX))
+ if (chan->flags & (DAHDI_FLAG_CLEAR | DAHDI_FLAG_NOSTDTXRX))
return -EINVAL;
chan->kewlonhook = 0;
- if ((chan->sig == ZT_SIG_FXSLS) || (chan->sig == ZT_SIG_FXSKS) ||
- (chan->sig == ZT_SIG_FXSGS)) chan->ringdebtimer = RING_DEBOUNCE_TIME;
+ if ((chan->sig == DAHDI_SIG_FXSLS) || (chan->sig == DAHDI_SIG_FXSKS) ||
+ (chan->sig == DAHDI_SIG_FXSGS)) chan->ringdebtimer = RING_DEBOUNCE_TIME;
- if (chan->span->flags & ZT_FLAG_RBS) {
- if (chan->sig == ZT_SIG_CAS) {
- zt_cas_setbits(chan, chan->idlebits);
- } else if ((chan->sig == ZT_SIG_FXOKS) && (chan->txstate != ZT_TXSTATE_ONHOOK)
+ if (chan->span->flags & DAHDI_FLAG_RBS) {
+ if (chan->sig == DAHDI_SIG_CAS) {
+ dahdi_cas_setbits(chan, chan->idlebits);
+ } else if ((chan->sig == DAHDI_SIG_FXOKS) && (chan->txstate != DAHDI_TXSTATE_ONHOOK)
/* if other party is already on-hook we shouldn't do any battery drop */
- && !((chan->rxhooksig == ZT_RXSIG_ONHOOK) && (chan->itimer <= 0))) {
+ && !((chan->rxhooksig == DAHDI_RXSIG_ONHOOK) && (chan->itimer <= 0))) {
/* Do RBS signalling on the channel's behalf */
- zt_rbs_sethook(chan, ZT_TXSIG_KEWL, ZT_TXSTATE_KEWL, ZT_KEWLTIME);
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_KEWL, DAHDI_TXSTATE_KEWL, DAHDI_KEWLTIME);
} else
- zt_rbs_sethook(chan, ZT_TXSIG_ONHOOK, ZT_TXSTATE_ONHOOK, 0);
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_ONHOOK, DAHDI_TXSTATE_ONHOOK, 0);
} else {
/* Let the driver hang up the line if it wants to */
if (chan->span->sethook) {
- if (chan->txhooksig != ZT_ONHOOK) {
- chan->txhooksig = ZT_ONHOOK;
- res = chan->span->sethook(chan, ZT_ONHOOK);
+ if (chan->txhooksig != DAHDI_ONHOOK) {
+ chan->txhooksig = DAHDI_ONHOOK;
+ res = chan->span->sethook(chan, DAHDI_ONHOOK);
} else
res = 0;
}
}
/* if not registered yet, just return here */
- if (!(chan->flags & ZT_FLAG_REGISTERED)) return res;
+ if (!(chan->flags & DAHDI_FLAG_REGISTERED)) return res;
/* Mark all buffers as empty */
for (x = 0;x < chan->numbufs;x++) {
chan->writen[x] =
@@ -2277,19 +2277,19 @@ static int zt_hangup(struct zt_chan *chan)
return res;
}
-static int initialize_channel(struct zt_chan *chan)
+static int initialize_channel(struct dahdi_chan *chan)
{
int res;
unsigned long flags;
void *rxgain=NULL;
struct echo_can_state *ec=NULL;
- if ((res = zt_reallocbufs(chan, ZT_DEFAULT_BLOCKSIZE, ZT_DEFAULT_NUM_BUFS)))
+ if ((res = dahdi_reallocbufs(chan, DAHDI_DEFAULT_BLOCKSIZE, DAHDI_DEFAULT_NUM_BUFS)))
return res;
spin_lock_irqsave(&chan->lock, flags);
- chan->rxbufpolicy = ZT_POLICY_IMMEDIATE;
- chan->txbufpolicy = ZT_POLICY_IMMEDIATE;
+ chan->rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
+ chan->txbufpolicy = DAHDI_POLICY_IMMEDIATE;
/* Free up the echo canceller if there is one */
ec = chan->ec;
@@ -2315,21 +2315,21 @@ static int initialize_channel(struct zt_chan *chan)
chan->infcs = PPP_INITFCS;
/* Timings for RBS */
- chan->prewinktime = ZT_DEFAULT_PREWINKTIME;
- chan->preflashtime = ZT_DEFAULT_PREFLASHTIME;
- chan->winktime = ZT_DEFAULT_WINKTIME;
- chan->flashtime = ZT_DEFAULT_FLASHTIME;
+ chan->prewinktime = DAHDI_DEFAULT_PREWINKTIME;
+ chan->preflashtime = DAHDI_DEFAULT_PREFLASHTIME;
+ chan->winktime = DAHDI_DEFAULT_WINKTIME;
+ chan->flashtime = DAHDI_DEFAULT_FLASHTIME;
- if (chan->sig & __ZT_SIG_FXO)
- chan->starttime = ZT_DEFAULT_RINGTIME;
+ if (chan->sig & __DAHDI_SIG_FXO)
+ chan->starttime = DAHDI_DEFAULT_RINGTIME;
else
- chan->starttime = ZT_DEFAULT_STARTTIME;
- chan->rxwinktime = ZT_DEFAULT_RXWINKTIME;
- chan->rxflashtime = ZT_DEFAULT_RXFLASHTIME;
- chan->debouncetime = ZT_DEFAULT_DEBOUNCETIME;
- chan->pulsemaketime = ZT_DEFAULT_PULSEMAKETIME;
- chan->pulsebreaktime = ZT_DEFAULT_PULSEBREAKTIME;
- chan->pulseaftertime = ZT_DEFAULT_PULSEAFTERTIME;
+ chan->starttime = DAHDI_DEFAULT_STARTTIME;
+ chan->rxwinktime = DAHDI_DEFAULT_RXWINKTIME;
+ chan->rxflashtime = DAHDI_DEFAULT_RXFLASHTIME;
+ chan->debouncetime = DAHDI_DEFAULT_DEBOUNCETIME;
+ chan->pulsemaketime = DAHDI_DEFAULT_PULSEMAKETIME;
+ chan->pulsebreaktime = DAHDI_DEFAULT_PULSEBREAKTIME;
+ chan->pulseaftertime = DAHDI_DEFAULT_PULSEAFTERTIME;
/* Initialize RBS timers */
chan->itimerset = chan->itimer = chan->otimer = 0;
@@ -2347,8 +2347,8 @@ static int initialize_channel(struct zt_chan *chan)
/* I/O Mask, etc */
chan->iomask = 0;
/* release conference resource if any */
- if (chan->confna) zt_check_conf(chan->confna);
- if ((chan->sig & __ZT_SIG_DACS) != __ZT_SIG_DACS) {
+ if (chan->confna) dahdi_check_conf(chan->confna);
+ if ((chan->sig & __DAHDI_SIG_DACS) != __DAHDI_SIG_DACS) {
chan->confna = 0;
chan->confmode = 0;
if (chan->span && chan->span->dacs)
@@ -2369,17 +2369,17 @@ static int initialize_channel(struct zt_chan *chan)
chan->txgain = defgain;
chan->gainalloc = 0;
chan->eventinidx = chan->eventoutidx = 0;
- zt_set_law(chan,0);
- zt_hangup(chan);
+ dahdi_set_law(chan,0);
+ dahdi_hangup(chan);
/* Make sure that the audio flag is cleared on a clear channel */
- if ((chan->sig & ZT_SIG_CLEAR) || (chan->sig & ZT_SIG_HARDHDLC))
- chan->flags &= ~ZT_FLAG_AUDIO;
+ if ((chan->sig & DAHDI_SIG_CLEAR) || (chan->sig & DAHDI_SIG_HARDHDLC))
+ chan->flags &= ~DAHDI_FLAG_AUDIO;
- if ((chan->sig == ZT_SIG_CLEAR) || (chan->sig == ZT_SIG_HARDHDLC))
- chan->flags &= ~(ZT_FLAG_PPP | ZT_FLAG_FCS | ZT_FLAG_HDLC);
+ if ((chan->sig == DAHDI_SIG_CLEAR) || (chan->sig == DAHDI_SIG_HARDHDLC))
+ chan->flags &= ~(DAHDI_FLAG_PPP | DAHDI_FLAG_FCS | DAHDI_FLAG_HDLC);
- chan->flags &= ~ZT_FLAG_LINEAR;
+ chan->flags &= ~DAHDI_FLAG_LINEAR;
if (chan->curzone) {
/* Take cadence from tone zone */
memcpy(chan->ringcadence, chan->curzone->ringcadence, sizeof(chan->ringcadence));
@@ -2387,7 +2387,7 @@ static int initialize_channel(struct zt_chan *chan)
/* Do a default */
memset(chan->ringcadence, 0, sizeof(chan->ringcadence));
chan->ringcadence[0] = chan->starttime;
- chan->ringcadence[1] = ZT_RINGOFFTIME;
+ chan->ringcadence[1] = DAHDI_RINGOFFTIME;
}
spin_unlock_irqrestore(&chan->lock, flags);
@@ -2402,15 +2402,15 @@ static int initialize_channel(struct zt_chan *chan)
return 0;
}
-static int zt_timing_open(struct inode *inode, struct file *file)
+static int dahdi_timing_open(struct inode *inode, struct file *file)
{
- struct zt_timer *t;
+ struct dahdi_timer *t;
unsigned long flags;
- t = kmalloc(sizeof(struct zt_timer), GFP_KERNEL);
+ t = kmalloc(sizeof(struct dahdi_timer), GFP_KERNEL);
if (!t)
return -ENOMEM;
/* Allocate a new timer */
- memset(t, 0, sizeof(struct zt_timer));
+ memset(t, 0, sizeof(struct dahdi_timer));
init_waitqueue_head(&t->sel);
file->private_data = t;
#ifndef LINUX26
@@ -2423,9 +2423,9 @@ static int zt_timing_open(struct inode *inode, struct file *file)
return 0;
}
-static int zt_timer_release(struct inode *inode, struct file *file)
+static int dahdi_timer_release(struct inode *inode, struct file *file)
{
- struct zt_timer *t, *cur, *prev;
+ struct dahdi_timer *t, *cur, *prev;
unsigned long flags;
t = file->private_data;
if (t) {
@@ -2457,29 +2457,29 @@ static int zt_timer_release(struct inode *inode, struct file *file)
return 0;
}
-static int zt_specchan_open(struct inode *inode, struct file *file, int unit, int inc)
+static int dahdi_specchan_open(struct inode *inode, struct file *file, int unit, int inc)
{
int res = 0;
if (chans[unit] && chans[unit]->sig) {
/* Make sure we're not already open, a net device, or a slave device */
- if (chans[unit]->flags & ZT_FLAG_NETDEV)
+ if (chans[unit]->flags & DAHDI_FLAG_NETDEV)
res = -EBUSY;
else if (chans[unit]->master != chans[unit])
res = -EBUSY;
- else if ((chans[unit]->sig & __ZT_SIG_DACS) == __ZT_SIG_DACS)
+ else if ((chans[unit]->sig & __DAHDI_SIG_DACS) == __DAHDI_SIG_DACS)
res = -EBUSY;
- else if (!test_and_set_bit(ZT_FLAGBIT_OPEN, &chans[unit]->flags)) {
+ else if (!test_and_set_bit(DAHDI_FLAGBIT_OPEN, &chans[unit]->flags)) {
unsigned long flags;
res = initialize_channel(chans[unit]);
if (res) {
/* Reallocbufs must have failed */
- clear_bit(ZT_FLAGBIT_OPEN, &chans[unit]->flags);
+ clear_bit(DAHDI_FLAGBIT_OPEN, &chans[unit]->flags);
return res;
}
spin_lock_irqsave(&chans[unit]->lock, flags);
- if (chans[unit]->flags & ZT_FLAG_PSEUDO)
- chans[unit]->flags |= ZT_FLAG_AUDIO;
+ if (chans[unit]->flags & DAHDI_FLAG_PSEUDO)
+ chans[unit]->flags |= DAHDI_FLAG_AUDIO;
if (chans[unit]->span && chans[unit]->span->open) {
res = chans[unit]->span->open(chans[unit]);
}
@@ -2493,7 +2493,7 @@ static int zt_specchan_open(struct inode *inode, struct file *file, int unit, in
} else {
spin_unlock_irqrestore(&chans[unit]->lock, flags);
close_channel(chans[unit]);
- clear_bit(ZT_FLAGBIT_OPEN, &chans[unit]->flags);
+ clear_bit(DAHDI_FLAGBIT_OPEN, &chans[unit]->flags);
}
} else
res = -EBUSY;
@@ -2502,7 +2502,7 @@ static int zt_specchan_open(struct inode *inode, struct file *file, int unit, in
return res;
}
-static int zt_specchan_release(struct inode *node, struct file *file, int unit)
+static int dahdi_specchan_release(struct inode *node, struct file *file, int unit)
{
int res=0;
unsigned long flags;
@@ -2516,7 +2516,7 @@ static int zt_specchan_release(struct inode *node, struct file *file, int unit)
close_channel(chans[unit]);
if (chans[unit]->span && chans[unit]->span->close)
res = chans[unit]->span->close(chans[unit]);
- clear_bit(ZT_FLAGBIT_OPEN, &chans[unit]->flags);
+ clear_bit(DAHDI_FLAGBIT_OPEN, &chans[unit]->flags);
} else
res = -ENXIO;
#ifndef LINUX26
@@ -2525,22 +2525,22 @@ static int zt_specchan_release(struct inode *node, struct file *file, int unit)
return res;
}
-static struct zt_chan *zt_alloc_pseudo(void)
+static struct dahdi_chan *dahdi_alloc_pseudo(void)
{
- struct zt_chan *pseudo;
+ struct dahdi_chan *pseudo;
unsigned long flags;
/* Don't allow /dev/zap/pseudo to open if there are no spans */
if (maxspans < 1)
return NULL;
- pseudo = kmalloc(sizeof(struct zt_chan), GFP_KERNEL);
+ pseudo = kmalloc(sizeof(struct dahdi_chan), GFP_KERNEL);
if (!pseudo)
return NULL;
- memset(pseudo, 0, sizeof(struct zt_chan));
- pseudo->sig = ZT_SIG_CLEAR;
- pseudo->sigcap = ZT_SIG_CLEAR;
- pseudo->flags = ZT_FLAG_PSEUDO | ZT_FLAG_AUDIO;
+ memset(pseudo, 0, sizeof(struct dahdi_chan));
+ pseudo->sig = DAHDI_SIG_CLEAR;
+ pseudo->sigcap = DAHDI_SIG_CLEAR;
+ pseudo->flags = DAHDI_FLAG_PSEUDO | DAHDI_FLAG_AUDIO;
spin_lock_irqsave(&bigzaplock, flags);
- if (zt_chan_reg(pseudo)) {
+ if (dahdi_chan_reg(pseudo)) {
kfree(pseudo);
pseudo = NULL;
} else
@@ -2549,41 +2549,41 @@ static struct zt_chan *zt_alloc_pseudo(void)
return pseudo;
}
-static void zt_free_pseudo(struct zt_chan *pseudo)
+static void dahdi_free_pseudo(struct dahdi_chan *pseudo)
{
unsigned long flags;
if (pseudo) {
spin_lock_irqsave(&bigzaplock, flags);
- zt_chan_unreg(pseudo);
+ dahdi_chan_unreg(pseudo);
spin_unlock_irqrestore(&bigzaplock, flags);
kfree(pseudo);
}
}
-static int zt_open(struct inode *inode, struct file *file)
+static int dahdi_open(struct inode *inode, struct file *file)
{
int unit = UNIT(file);
int ret = -ENXIO;
- struct zt_chan *chan;
+ struct dahdi_chan *chan;
/* Minor 0: Special "control" descriptor */
if (!unit)
- return zt_ctl_open(inode, file);
+ return dahdi_ctl_open(inode, file);
if (unit == 250) {
- if (!zt_transcode_fops)
+ if (!dahdi_transcode_fops)
request_module("dahdi_transcode");
- if (zt_transcode_fops && zt_transcode_fops->open) {
+ if (dahdi_transcode_fops && dahdi_transcode_fops->open) {
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- if (zt_transcode_fops->owner) {
- __MOD_INC_USE_COUNT (zt_transcode_fops->owner);
+ if (dahdi_transcode_fops->owner) {
+ __MOD_INC_USE_COUNT (dahdi_transcode_fops->owner);
#else
- if (try_module_get(zt_transcode_fops->owner)) {
+ if (try_module_get(dahdi_transcode_fops->owner)) {
#endif
- ret = zt_transcode_fops->open(inode, file);
+ ret = dahdi_transcode_fops->open(inode, file);
if (ret)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- __MOD_DEC_USE_COUNT (zt_transcode_fops->owner);
+ __MOD_DEC_USE_COUNT (dahdi_transcode_fops->owner);
#else
- module_put(zt_transcode_fops->owner);
+ module_put(dahdi_transcode_fops->owner);
#endif
}
return ret;
@@ -2592,44 +2592,44 @@ static int zt_open(struct inode *inode, struct file *file)
}
if (unit == 253) {
if (maxspans) {
- return zt_timing_open(inode, file);
+ return dahdi_timing_open(inode, file);
} else {
return -ENXIO;
}
}
if (unit == 254)
- return zt_chan_open(inode, file);
+ return dahdi_chan_open(inode, file);
if (unit == 255) {
if (maxspans) {
- chan = zt_alloc_pseudo();
+ chan = dahdi_alloc_pseudo();
if (chan) {
file->private_data = chan;
- return zt_specchan_open(inode, file, chan->channo, 1);
+ return dahdi_specchan_open(inode, file, chan->channo, 1);
} else {
return -ENXIO;
}
} else
return -ENXIO;
}
- return zt_specchan_open(inode, file, unit, 1);
+ return dahdi_specchan_open(inode, file, unit, 1);
}
#if 0
-static int zt_open(struct inode *inode, struct file *file)
+static int dahdi_open(struct inode *inode, struct file *file)
{
int res;
unsigned long flags;
spin_lock_irqsave(&bigzaplock, flags);
- res = __zt_open(inode, file);
+ res = __dahdi_open(inode, file);
spin_unlock_irqrestore(&bigzaplock, flags);
return res;
}
#endif
-static ssize_t zt_read(struct file *file, char *usrbuf, size_t count, loff_t *ppos)
+static ssize_t dahdi_read(struct file *file, char *usrbuf, size_t count, loff_t *ppos)
{
int unit = UNIT(file);
- struct zt_chan *chan;
+ struct dahdi_chan *chan;
/* Can't read from control */
if (!unit) {
@@ -2643,7 +2643,7 @@ static ssize_t zt_read(struct file *file, char *usrbuf, size_t count, loff_t *pp
chan = file->private_data;
if (!chan)
return -EINVAL;
- return zt_chan_read(file, usrbuf, count, chan->channo);
+ return dahdi_chan_read(file, usrbuf, count, chan->channo);
}
if (unit == 255) {
@@ -2652,18 +2652,18 @@ static ssize_t zt_read(struct file *file, char *usrbuf, size_t count, loff_t *pp
printk("No pseudo channel structure to read?\n");
return -EINVAL;
}
- return zt_chan_read(file, usrbuf, count, chan->channo);
+ return dahdi_chan_read(file, usrbuf, count, chan->channo);
}
if (count < 0)
return -EINVAL;
- return zt_chan_read(file, usrbuf, count, unit);
+ return dahdi_chan_read(file, usrbuf, count, unit);
}
-static ssize_t zt_write(struct file *file, const char *usrbuf, size_t count, loff_t *ppos)
+static ssize_t dahdi_write(struct file *file, const char *usrbuf, size_t count, loff_t *ppos)
{
int unit = UNIT(file);
- struct zt_chan *chan;
+ struct dahdi_chan *chan;
/* Can't read from control */
if (!unit)
return -EINVAL;
@@ -2675,7 +2675,7 @@ static ssize_t zt_write(struct file *file, const char *usrbuf, size_t count, lof
chan = file->private_data;
if (!chan)
return -EINVAL;
- return zt_chan_write(file, usrbuf, count, chan->channo);
+ return dahdi_chan_write(file, usrbuf, count, chan->channo);
}
if (unit == 255) {
chan = file->private_data;
@@ -2683,15 +2683,15 @@ static ssize_t zt_write(struct file *file, const char *usrbuf, size_t count, lof
printk("No pseudo channel structure to read?\n");
return -EINVAL;
}
- return zt_chan_write(file, usrbuf, count, chan->channo);
+ return dahdi_chan_write(file, usrbuf, count, chan->channo);
}
- return zt_chan_write(file, usrbuf, count, unit);
+ return dahdi_chan_write(file, usrbuf, count, unit);
}
-static int zt_set_default_zone(int defzone)
+static int dahdi_set_default_zone(int defzone)
{
- if ((defzone < 0) || (defzone >= ZT_TONE_ZONE_MAX))
+ if ((defzone < 0) || (defzone >= DAHDI_TONE_ZONE_MAX))
return -EINVAL;
write_lock(&zone_lock);
if (!tone_zones[defzone]) {
@@ -2719,19 +2719,19 @@ static int zt_set_default_zone(int defzone)
*/
static int ioctl_load_zone(unsigned long data)
{
- struct zt_tone *samples[MAX_TONES] = { NULL, };
+ struct dahdi_tone *samples[MAX_TONES] = { NULL, };
short next[MAX_TONES] = { 0, };
- struct zt_tone_def_header th;
- struct zt_tone_def td;
- struct zt_zone *z;
- struct zt_tone *t;
+ struct dahdi_tone_def_header th;
+ struct dahdi_tone_def td;
+ struct dahdi_zone *z;
+ struct dahdi_tone *t;
void *slab, *ptr;
int x;
size_t space;
size_t size;
int res;
- if (copy_from_user(&th, (struct zt_tone_def_header *) data, sizeof(th)))
+ if (copy_from_user(&th, (struct dahdi_tone_def_header *) data, sizeof(th)))
return -EFAULT;
data += sizeof(th);
@@ -2756,7 +2756,7 @@ static int ioctl_load_zone(unsigned long data)
zap_copy_string(z->name, th.name, sizeof(z->name));
- for (x = 0; x < ZT_MAX_CADENCE; x++)
+ for (x = 0; x < DAHDI_MAX_CADENCE; x++)
z->ringcadence[x] = th.ringcadence[x];
atomic_set(&z->refcount, 0);
@@ -2776,14 +2776,14 @@ static int ioctl_load_zone(unsigned long data)
return -EINVAL;
}
- if (copy_from_user(&td, (struct zt_tone_def *) data, sizeof(td))) {
+ if (copy_from_user(&td, (struct dahdi_tone_def *) data, sizeof(td))) {
kfree(slab);
return -EFAULT;
}
data += sizeof(td);
- if ((td.tone >= 0) && (td.tone < ZT_TONE_MAX)) {
+ if ((td.tone >= 0) && (td.tone < DAHDI_TONE_MAX)) {
tone_type = REGULAR_TONE;
t = samples[x] = ptr;
@@ -2800,25 +2800,25 @@ static int ioctl_load_zone(unsigned long data)
kfree(slab);
return -EINVAL;
}
- } else if ((td.tone >= ZT_TONE_DTMF_BASE) &&
- (td.tone <= ZT_TONE_DTMF_MAX)) {
+ } else if ((td.tone >= DAHDI_TONE_DTMF_BASE) &&
+ (td.tone <= DAHDI_TONE_DTMF_MAX)) {
tone_type = DTMF_TONE;
- td.tone -= ZT_TONE_DTMF_BASE;
+ td.tone -= DAHDI_TONE_DTMF_BASE;
t = &z->dtmf[td.tone];
- } else if ((td.tone >= ZT_TONE_MFR1_BASE) &&
- (td.tone <= ZT_TONE_MFR1_MAX)) {
+ } else if ((td.tone >= DAHDI_TONE_MFR1_BASE) &&
+ (td.tone <= DAHDI_TONE_MFR1_MAX)) {
tone_type = MFR1_TONE;
- td.tone -= ZT_TONE_MFR1_BASE;
+ td.tone -= DAHDI_TONE_MFR1_BASE;
t = &z->mfr1[td.tone];
- } else if ((td.tone >= ZT_TONE_MFR2_FWD_BASE) &&
- (td.tone <= ZT_TONE_MFR2_FWD_MAX)) {
+ } else if ((td.tone >= DAHDI_TONE_MFR2_FWD_BASE) &&
+ (td.tone <= DAHDI_TONE_MFR2_FWD_MAX)) {
tone_type = MFR2_FWD_TONE;
- td.tone -= ZT_TONE_MFR2_FWD_BASE;
+ td.tone -= DAHDI_TONE_MFR2_FWD_BASE;
t = &z->mfr2_fwd[td.tone];
- } else if ((td.tone >= ZT_TONE_MFR2_REV_BASE) &&
- (td.tone <= ZT_TONE_MFR2_REV_MAX)) {
+ } else if ((td.tone >= DAHDI_TONE_MFR2_REV_BASE) &&
+ (td.tone <= DAHDI_TONE_MFR2_REV_MAX)) {
tone_type = MFR2_REV_TONE;
- td.tone -= ZT_TONE_MFR2_REV_BASE;
+ td.tone -= DAHDI_TONE_MFR2_REV_BASE;
t = &z->mfr2_rev[td.tone];
} else {
printk("Invalid tone (%d) defined\n", td.tone);
@@ -2847,14 +2847,14 @@ static int ioctl_load_zone(unsigned long data)
z->dtmf_continuous[td.tone].next = &z->dtmf_continuous[td.tone];
break;
case MFR1_TONE:
- switch (td.tone + ZT_TONE_MFR1_BASE) {
- case ZT_TONE_MFR1_KP:
- case ZT_TONE_MFR1_ST:
- case ZT_TONE_MFR1_STP:
- case ZT_TONE_MFR1_ST2P:
- case ZT_TONE_MFR1_ST3P:
+ switch (td.tone + DAHDI_TONE_MFR1_BASE) {
+ case DAHDI_TONE_MFR1_KP:
+ case DAHDI_TONE_MFR1_ST:
+ case DAHDI_TONE_MFR1_STP:
+ case DAHDI_TONE_MFR1_ST2P:
+ case DAHDI_TONE_MFR1_ST3P:
/* signaling control tones are always 100ms */
- t->tonesamples = 100 * ZT_CHUNKSIZE;
+ t->tonesamples = 100 * DAHDI_CHUNKSIZE;
break;
default:
t->tonesamples = global_dialparams.mfv1_tonelen;
@@ -2882,18 +2882,18 @@ static int ioctl_load_zone(unsigned long data)
samples[x]->next = samples[next[x]];
}
- if ((res = zt_register_tone_zone(th.zone, z))) {
+ if ((res = dahdi_register_tone_zone(th.zone, z))) {
kfree(slab);
} else {
if ( -1 == default_zone ) {
- zt_set_default_zone(th.zone);
+ dahdi_set_default_zone(th.zone);
}
}
return res;
}
-void zt_init_tone_state(struct zt_tone_state *ts, struct zt_tone *zt)
+void dahdi_init_tone_state(struct dahdi_tone_state *ts, struct dahdi_tone *zt)
{
ts->v1_1 = 0;
ts->v2_1 = zt->init_v2_1;
@@ -2904,7 +2904,7 @@ void zt_init_tone_state(struct zt_tone_state *ts, struct zt_tone *zt)
ts->modulate = zt->modulate;
}
-struct zt_tone *zt_mf_tone(const struct zt_chan *chan, char digit, int digitmode)
+struct dahdi_tone *dahdi_mf_tone(const struct dahdi_chan *chan, char digit, int digitmode)
{
unsigned int tone_index;
@@ -2931,25 +2931,25 @@ struct zt_tone *zt_mf_tone(const struct zt_chan *chan, char digit, int digitmode
case '7':
case '8':
case '9':
- tone_index = ZT_TONE_DTMF_0 + (digit - '0');
+ tone_index = DAHDI_TONE_DTMF_0 + (digit - '0');
break;
case '*':
- tone_index = ZT_TONE_DTMF_s;
+ tone_index = DAHDI_TONE_DTMF_s;
break;
case '#':
- tone_index = ZT_TONE_DTMF_p;
+ tone_index = DAHDI_TONE_DTMF_p;
break;
case 'A':
case 'B':
case 'C':
case 'D':
- tone_index = ZT_TONE_DTMF_A + (digit - 'A');
+ tone_index = DAHDI_TONE_DTMF_A + (digit - 'A');
case 'W':
return &tone_pause;
default:
return NULL;
}
- return &chan->curzone->dtmf[tone_index - ZT_TONE_DTMF_BASE];
+ return &chan->curzone->dtmf[tone_index - DAHDI_TONE_DTMF_BASE];
case DIGIT_MODE_MFR1:
switch (digit) {
case '0':
@@ -2962,29 +2962,29 @@ struct zt_tone *zt_mf_tone(const struct zt_chan *chan, char digit, int digitmode
case '7':
case '8':
case '9':
- tone_index = ZT_TONE_MFR1_0 + (digit - '0');
+ tone_index = DAHDI_TONE_MFR1_0 + (digit - '0');
break;
case '*':
- tone_index = ZT_TONE_MFR1_KP;
+ tone_index = DAHDI_TONE_MFR1_KP;
break;
case '#':
- tone_index = ZT_TONE_MFR1_ST;
+ tone_index = DAHDI_TONE_MFR1_ST;
break;
case 'A':
- tone_index = ZT_TONE_MFR1_STP;
+ tone_index = DAHDI_TONE_MFR1_STP;
break;
case 'B':
- tone_index = ZT_TONE_MFR1_ST2P;
+ tone_index = DAHDI_TONE_MFR1_ST2P;
break;
case 'C':
- tone_index = ZT_TONE_MFR1_ST3P;
+ tone_index = DAHDI_TONE_MFR1_ST3P;
break;
case 'W':
return &tone_pause;
default:
return NULL;
}
- return &chan->curzone->mfr1[tone_index - ZT_TONE_MFR1_BASE];
+ return &chan->curzone->mfr1[tone_index - DAHDI_TONE_MFR1_BASE];
case DIGIT_MODE_MFR2_FWD:
switch (digit) {
case '1':
@@ -2996,7 +2996,7 @@ struct zt_tone *zt_mf_tone(const struct zt_chan *chan, char digit, int digitmode
case '7':
case '8':
case '9':
- tone_index = ZT_TONE_MFR2_FWD_1 + (digit - '1');
+ tone_index = DAHDI_TONE_MFR2_FWD_1 + (digit - '1');
break;
case 'A':
case 'B':
@@ -3004,14 +3004,14 @@ struct zt_tone *zt_mf_tone(const struct zt_chan *chan, char digit, int digitmode
case 'D':
case 'E':
case 'F':
- tone_index = ZT_TONE_MFR2_FWD_10 + (digit - 'A');
+ tone_index = DAHDI_TONE_MFR2_FWD_10 + (digit - 'A');
break;
case 'W':
return &tone_pause;
default:
return NULL;
}
- return &chan->curzone->mfr2_fwd[tone_index - ZT_TONE_MFR2_FWD_BASE];
+ return &chan->curzone->mfr2_fwd[tone_index - DAHDI_TONE_MFR2_FWD_BASE];
case DIGIT_MODE_MFR2_REV:
switch (digit) {
case '1':
@@ -3023,7 +3023,7 @@ struct zt_tone *zt_mf_tone(const struct zt_chan *chan, char digit, int digitmode
case '7':
case '8':
case '9':
- tone_index = ZT_TONE_MFR2_REV_1 + (digit - '1');
+ tone_index = DAHDI_TONE_MFR2_REV_1 + (digit - '1');
break;
case 'A':
case 'B':
@@ -3031,20 +3031,20 @@ struct zt_tone *zt_mf_tone(const struct zt_chan *chan, char digit, int digitmode
case 'D':
case 'E':
case 'F':
- tone_index = ZT_TONE_MFR2_REV_10 + (digit - 'A');
+ tone_index = DAHDI_TONE_MFR2_REV_10 + (digit - 'A');
break;
case 'W':
return &tone_pause;
default:
return NULL;
}
- return &chan->curzone->mfr2_rev[tone_index - ZT_TONE_MFR2_REV_BASE];
+ return &chan->curzone->mfr2_rev[tone_index - DAHDI_TONE_MFR2_REV_BASE];
default:
return NULL;
}
}
-static void __do_dtmf(struct zt_chan *chan)
+static void __do_dtmf(struct dahdi_chan *chan)
{
char c;
@@ -3074,17 +3074,17 @@ static void __do_dtmf(struct zt_chan *chan)
break;
default:
if ((c != 'W') && (chan->digitmode == DIGIT_MODE_PULSE)) {
- if ((c >= '0') && (c <= '9') && (chan->txhooksig == ZT_TXSIG_OFFHOOK)) {
+ if ((c >= '0') && (c <= '9') && (chan->txhooksig == DAHDI_TXSIG_OFFHOOK)) {
chan->pdialcount = (c == '0') ? 10 : c - '0';
- zt_rbs_sethook(chan, ZT_TXSIG_ONHOOK, ZT_TXSTATE_PULSEBREAK,
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_ONHOOK, DAHDI_TXSTATE_PULSEBREAK,
chan->pulsebreaktime);
return;
}
} else {
- chan->curtone = zt_mf_tone(chan, c, chan->digitmode);
+ chan->curtone = dahdi_mf_tone(chan, c, chan->digitmode);
chan->tonep = 0;
if (chan->curtone) {
- zt_init_tone_state(&chan->ts, chan->curtone);
+ dahdi_init_tone_state(&chan->ts, chan->curtone);
return;
}
}
@@ -3093,85 +3093,85 @@ static void __do_dtmf(struct zt_chan *chan)
/* Notify userspace process if there is nothing left */
chan->dialing = 0;
- __qevent(chan, ZT_EVENT_DIALCOMPLETE);
+ __qevent(chan, DAHDI_EVENT_DIALCOMPLETE);
}
-static int zt_release(struct inode *inode, struct file *file)
+static int dahdi_release(struct inode *inode, struct file *file)
{
int unit = UNIT(file);
int res;
- struct zt_chan *chan;
+ struct dahdi_chan *chan;
if (!unit)
- return zt_ctl_release(inode, file);
+ return dahdi_ctl_release(inode, file);
if (unit == 253) {
- return zt_timer_release(inode, file);
+ return dahdi_timer_release(inode, file);
}
if (unit == 250) {
- res = zt_transcode_fops->release(inode, file);
+ res = dahdi_transcode_fops->release(inode, file);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- if (zt_transcode_fops->owner)
- __MOD_DEC_USE_COUNT (zt_transcode_fops->owner);
+ if (dahdi_transcode_fops->owner)
+ __MOD_DEC_USE_COUNT (dahdi_transcode_fops->owner);
#else
- module_put(zt_transcode_fops->owner);
+ module_put(dahdi_transcode_fops->owner);
#endif
return res;
}
if (unit == 254) {
chan = file->private_data;
if (!chan)
- return zt_chan_release(inode, file);
+ return dahdi_chan_release(inode, file);
else
- return zt_specchan_release(inode, file, chan->channo);
+ return dahdi_specchan_release(inode, file, chan->channo);
}
if (unit == 255) {
chan = file->private_data;
if (chan) {
- res = zt_specchan_release(inode, file, chan->channo);
- zt_free_pseudo(chan);
+ res = dahdi_specchan_release(inode, file, chan->channo);
+ dahdi_free_pseudo(chan);
} else {
printk("Pseudo release and no private data??\n");
res = 0;
}
return res;
}
- return zt_specchan_release(inode, file, unit);
+ return dahdi_specchan_release(inode, file, unit);
}
#if 0
-static int zt_release(struct inode *inode, struct file *file)
+static int dahdi_release(struct inode *inode, struct file *file)
{
/* Lock the big zap lock when handling a release */
unsigned long flags;
int res;
spin_lock_irqsave(&bigzaplock, flags);
- res = __zt_release(inode, file);
+ res = __dahdi_release(inode, file);
spin_unlock_irqrestore(&bigzaplock, flags);
return res;
}
#endif
-void zt_alarm_channel(struct zt_chan *chan, int alarms)
+void dahdi_alarm_channel(struct dahdi_chan *chan, int alarms)
{
unsigned long flags;
spin_lock_irqsave(&chan->lock, flags);
if (chan->chan_alarms != alarms) {
chan->chan_alarms = alarms;
- zt_qevent_nolock(chan, alarms ? ZT_EVENT_ALARM : ZT_EVENT_NOALARM);
+ dahdi_qevent_nolock(chan, alarms ? DAHDI_EVENT_ALARM : DAHDI_EVENT_NOALARM);
}
spin_unlock_irqrestore(&chan->lock, flags);
}
-void zt_alarm_notify(struct zt_span *span)
+void dahdi_alarm_notify(struct dahdi_span *span)
{
int x;
- span->alarms &= ~ZT_ALARM_LOOPBACK;
+ span->alarms &= ~DAHDI_ALARM_LOOPBACK;
/* Determine maint status */
if (span->maintstat || span->mainttimer)
- span->alarms |= ZT_ALARM_LOOPBACK;
+ span->alarms |= DAHDI_ALARM_LOOPBACK;
/* DON'T CHANGE THIS AGAIN. THIS WAS DONE FOR A REASON.
The expression (a != b) does *NOT* do the same thing
as ((!a) != (!b)) */
@@ -3179,10 +3179,10 @@ void zt_alarm_notify(struct zt_span *span)
if ((!span->alarms) != (!span->lastalarms)) {
span->lastalarms = span->alarms;
for (x = 0; x < span->channels; x++)
- zt_alarm_channel(&span->chans[x], span->alarms);
+ dahdi_alarm_channel(&span->chans[x], span->alarms);
/* Switch to other master if current master in alarm */
for (x=1; x<maxspans; x++) {
- if (spans[x] && !spans[x]->alarms && (spans[x]->flags & ZT_FLAG_RUNNING)) {
+ if (spans[x] && !spans[x]->alarms && (spans[x]->flags & DAHDI_FLAG_RUNNING)) {
if(master != spans[x])
printk("Zaptel: Master changed to %s\n", spans[x]->name);
master = spans[x];
@@ -3193,7 +3193,7 @@ void zt_alarm_notify(struct zt_span *span)
}
#define VALID_SPAN(j) do { \
- if ((j >= ZT_MAX_SPANS) || (j < 1)) \
+ if ((j >= DAHDI_MAX_SPANS) || (j < 1)) \
return -EINVAL; \
if (!spans[j]) \
return -ENXIO; \
@@ -3207,18 +3207,18 @@ void zt_alarm_notify(struct zt_span *span)
} while(0)
#define VALID_CHANNEL(j) do { \
- if ((j >= ZT_MAX_CHANNELS) || (j < 1)) \
+ if ((j >= DAHDI_MAX_CHANNELS) || (j < 1)) \
return -EINVAL; \
if (!chans[j]) \
return -ENXIO; \
} while(0)
-static int zt_timer_ioctl(struct inode *node, struct file *file, unsigned int cmd, unsigned long data, struct zt_timer *timer)
+static int dahdi_timer_ioctl(struct inode *node, struct file *file, unsigned int cmd, unsigned long data, struct dahdi_timer *timer)
{
int j;
unsigned long flags;
switch(cmd) {
- case ZT_TIMERCONFIG:
+ case DAHDI_TIMERCONFIG:
get_user(j, (int *)data);
if (j < 0)
j = 0;
@@ -3226,7 +3226,7 @@ static int zt_timer_ioctl(struct inode *node, struct file *file, unsigned int cm
timer->ms = timer->pos = j;
spin_unlock_irqrestore(&zaptimerlock, flags);
break;
- case ZT_TIMERACK:
+ case DAHDI_TIMERACK:
get_user(j, (int *)data);
spin_lock_irqsave(&zaptimerlock, flags);
if ((j < 1) || (j > timer->tripped))
@@ -3234,24 +3234,24 @@ static int zt_timer_ioctl(struct inode *node, struct file *file, unsigned int cm
timer->tripped -= j;
spin_unlock_irqrestore(&zaptimerlock, flags);
break;
- case ZT_GETEVENT: /* Get event on queue */
- j = ZT_EVENT_NONE;
+ case DAHDI_GETEVENT: /* Get event on queue */
+ j = DAHDI_EVENT_NONE;
spin_lock_irqsave(&zaptimerlock, flags);
/* set up for no event */
if (timer->tripped)
- j = ZT_EVENT_TIMER_EXPIRED;
+ j = DAHDI_EVENT_TIMER_EXPIRED;
if (timer->ping)
- j = ZT_EVENT_TIMER_PING;
+ j = DAHDI_EVENT_TIMER_PING;
spin_unlock_irqrestore(&zaptimerlock, flags);
put_user(j,(int *)data);
break;
- case ZT_TIMERPING:
+ case DAHDI_TIMERPING:
spin_lock_irqsave(&zaptimerlock, flags);
timer->ping = 1;
wake_up_interruptible(&timer->sel);
spin_unlock_irqrestore(&zaptimerlock, flags);
break;
- case ZT_TIMERPONG:
+ case DAHDI_TIMERPONG:
spin_lock_irqsave(&zaptimerlock, flags);
timer->ping = 0;
spin_unlock_irqrestore(&zaptimerlock, flags);
@@ -3262,34 +3262,34 @@ static int zt_timer_ioctl(struct inode *node, struct file *file, unsigned int cm
return 0;
}
-static int zt_common_ioctl(struct inode *node, struct file *file, unsigned int cmd, unsigned long data, int unit)
+static int dahdi_common_ioctl(struct inode *node, struct file *file, unsigned int cmd, unsigned long data, int unit)
{
union {
- struct zt_gains gain;
- struct zt_spaninfo spaninfo;
- struct zt_params param;
+ struct dahdi_gains gain;
+ struct dahdi_spaninfo spaninfo;
+ struct dahdi_params param;
} stack;
- struct zt_chan *chan;
+ struct dahdi_chan *chan;
unsigned long flags;
unsigned char *txgain, *rxgain;
- struct zt_chan *mychan;
+ struct dahdi_chan *mychan;
int i,j;
int return_master = 0;
size_t size_to_copy;
switch(cmd) {
/* get channel parameters */
- case ZT_GET_PARAMS_V1:
- case ZT_GET_PARAMS:
- size_to_copy = (cmd == ZT_GET_PARAMS_V1) ? sizeof(struct zt_params_v1) :
- sizeof(struct zt_params);
- if (copy_from_user(&stack.param, (struct zt_params *) data, size_to_copy))
+ case DAHDI_GET_PARAMS_V1:
+ case DAHDI_GET_PARAMS:
+ size_to_copy = (cmd == DAHDI_GET_PARAMS_V1) ? sizeof(struct dahdi_params_v1) :
+ sizeof(struct dahdi_params);
+ if (copy_from_user(&stack.param, (struct dahdi_params *) data, size_to_copy))
return -EFAULT;
/* check to see if the caller wants to receive our master channel number */
- if (stack.param.channo & ZT_GET_PARAMS_RETURN_MASTER) {
+ if (stack.param.channo & DAHDI_GET_PARAMS_RETURN_MASTER) {
return_master = 1;
- stack.param.channo &= ~ZT_GET_PARAMS_RETURN_MASTER;
+ stack.param.channo &= ~DAHDI_GET_PARAMS_RETURN_MASTER;
}
/* Pick the right channo's */
@@ -3304,18 +3304,18 @@ static int zt_common_ioctl(struct inode *node, struct file *file, unsigned int c
stack.param.sigtype = chan->sig; /* get signalling type */
/* return non-zero if rx not in idle state */
if (chan->span) {
- j = zt_q_sig(chan);
+ j = dahdi_q_sig(chan);
if (j >= 0) { /* if returned with success */
stack.param.rxisoffhook = ((chan->rxsig & (j >> 8)) != (j & 0xff));
} else {
- stack.param.rxisoffhook = ((chan->rxhooksig != ZT_RXSIG_ONHOOK) &&
- (chan->rxhooksig != ZT_RXSIG_INITIAL));
+ stack.param.rxisoffhook = ((chan->rxhooksig != DAHDI_RXSIG_ONHOOK) &&
+ (chan->rxhooksig != DAHDI_RXSIG_INITIAL));
}
- } else if ((chan->txstate == ZT_TXSTATE_KEWL) || (chan->txstate == ZT_TXSTATE_AFTERKEWL))
+ } else if ((chan->txstate == DAHDI_TXSTATE_KEWL) || (chan->txstate == DAHDI_TXSTATE_AFTERKEWL))
stack.param.rxisoffhook = 1;
else
stack.param.rxisoffhook = 0;
- if (chan->span && chan->span->rbsbits && !(chan->sig & ZT_SIG_CLEAR)) {
+ if (chan->span && chan->span->rbsbits && !(chan->sig & DAHDI_SIG_CLEAR)) {
stack.param.rxbits = chan->rxsig;
stack.param.txbits = chan->txsig;
stack.param.idlebits = chan->idlebits;
@@ -3325,7 +3325,7 @@ static int zt_common_ioctl(struct inode *node, struct file *file, unsigned int c
stack.param.idlebits = 0;
}
if (chan->span && (chan->span->rbsbits || chan->span->hooksig) &&
- !(chan->sig & ZT_SIG_CLEAR)) {
+ !(chan->sig & DAHDI_SIG_CLEAR)) {
stack.param.rxhooksig = chan->rxhooksig;
stack.param.txhooksig = chan->txhooksig;
} else {
@@ -3356,23 +3356,23 @@ static int zt_common_ioctl(struct inode *node, struct file *file, unsigned int c
stack.param.chanpos = chan->chanpos;
stack.param.sigcap = chan->sigcap;
/* Return current law */
- if (chan->xlaw == __zt_alaw)
- stack.param.curlaw = ZT_LAW_ALAW;
+ if (chan->xlaw == __dahdi_alaw)
+ stack.param.curlaw = DAHDI_LAW_ALAW;
else
- stack.param.curlaw = ZT_LAW_MULAW;
+ stack.param.curlaw = DAHDI_LAW_MULAW;
- if (copy_to_user((struct zt_params *) data, &stack.param, size_to_copy))
+ if (copy_to_user((struct dahdi_params *) data, &stack.param, size_to_copy))
return -EFAULT;
break;
/* set channel parameters */
- case ZT_SET_PARAMS_V1:
- case ZT_SET_PARAMS:
- /* The difference between zt_params and zt_params_v1 is just the
+ case DAHDI_SET_PARAMS_V1:
+ case DAHDI_SET_PARAMS:
+ /* The difference between dahdi_params and dahdi_params_v1 is just the
* last field, which is read-only anyway. Thus we just read the
* size of the older struct.
*/
- if (copy_from_user(&stack.param, (struct zt_params *) data, sizeof(struct zt_params_v1)))
+ if (copy_from_user(&stack.param, (struct dahdi_params *) data, sizeof(struct dahdi_params_v1)))
return -EFAULT;
stack.param.chan_alarms = 0; /* be explicit about the above */
@@ -3402,33 +3402,33 @@ static int zt_common_ioctl(struct inode *node, struct file *file, unsigned int c
chan->pulsebreaktime = stack.param.pulsebreaktime;
chan->pulseaftertime = stack.param.pulseaftertime;
break;
- case ZT_GETGAINS: /* get gain stuff */
- if (copy_from_user(&stack.gain,(struct zt_gains *) data,sizeof(stack.gain)))
+ case DAHDI_GETGAINS: /* get gain stuff */
+ if (copy_from_user(&stack.gain,(struct dahdi_gains *) data,sizeof(stack.gain)))
return -EFAULT;
i = stack.gain.chan; /* get channel no */
/* if zero, use current channel no */
if (!i) i = unit;
/* make sure channel number makes sense */
- if ((i < 0) || (i > ZT_MAX_CHANNELS) || !chans[i]) return(-EINVAL);
+ if ((i < 0) || (i > DAHDI_MAX_CHANNELS) || !chans[i]) return(-EINVAL);
- if (!(chans[i]->flags & ZT_FLAG_AUDIO)) return (-EINVAL);
+ if (!(chans[i]->flags & DAHDI_FLAG_AUDIO)) return (-EINVAL);
stack.gain.chan = i; /* put the span # in here */
for (j=0;j<256;j++) {
stack.gain.txgain[j] = chans[i]->txgain[j];
stack.gain.rxgain[j] = chans[i]->rxgain[j];
}
- if (copy_to_user((struct zt_gains *) data,&stack.gain,sizeof(stack.gain)))
+ if (copy_to_user((struct dahdi_gains *) data,&stack.gain,sizeof(stack.gain)))
return -EFAULT;
break;
- case ZT_SETGAINS: /* set gain stuff */
- if (copy_from_user(&stack.gain,(struct zt_gains *) data,sizeof(stack.gain)))
+ case DAHDI_SETGAINS: /* set gain stuff */
+ if (copy_from_user(&stack.gain,(struct dahdi_gains *) data,sizeof(stack.gain)))
return -EFAULT;
i = stack.gain.chan; /* get channel no */
/* if zero, use current channel no */
if (!i) i = unit;
/* make sure channel number makes sense */
- if ((i < 0) || (i > ZT_MAX_CHANNELS) || !chans[i]) return(-EINVAL);
- if (!(chans[i]->flags & ZT_FLAG_AUDIO)) return (-EINVAL);
+ if ((i < 0) || (i > DAHDI_MAX_CHANNELS) || !chans[i]) return(-EINVAL);
+ if (!(chans[i]->flags & DAHDI_FLAG_AUDIO)) return (-EINVAL);
rxgain = kmalloc(512, GFP_KERNEL);
if (!rxgain)
@@ -3463,16 +3463,16 @@ static int zt_common_ioctl(struct inode *node, struct file *file, unsigned int c
chans[i]->txgain = txgain;
spin_unlock_irqrestore(&chans[i]->lock, flags);
}
- if (copy_to_user((struct zt_gains *) data,&stack.gain,sizeof(stack.gain)))
+ if (copy_to_user((struct dahdi_gains *) data,&stack.gain,sizeof(stack.gain)))
return -EFAULT;
break;
- case ZT_SPANSTAT_V1:
- case ZT_SPANSTAT_V2:
- case ZT_SPANSTAT:
- size_to_copy = (cmd == ZT_SPANSTAT_V1) ? sizeof(struct zt_spaninfo_v1) :
- (cmd == ZT_SPANSTAT_V2) ? sizeof(struct zt_spaninfo_v2) :
- sizeof(struct zt_spaninfo);
- if (copy_from_user(&stack.spaninfo, (struct zt_spaninfo *) data, size_to_copy))
+ case DAHDI_SPANSTAT_V1:
+ case DAHDI_SPANSTAT_V2:
+ case DAHDI_SPANSTAT:
+ size_to_copy = (cmd == DAHDI_SPANSTAT_V1) ? sizeof(struct dahdi_spaninfo_v1) :
+ (cmd == DAHDI_SPANSTAT_V2) ? sizeof(struct dahdi_spaninfo_v2) :
+ sizeof(struct dahdi_spaninfo);
+ if (copy_from_user(&stack.spaninfo, (struct dahdi_spaninfo *) data, size_to_copy))
return -EFAULT;
i = stack.spaninfo.spanno; /* get specified span number */
if ((i < 0) || (i >= maxspans)) return(-EINVAL); /* if bad span no */
@@ -3510,7 +3510,7 @@ static int zt_common_ioctl(struct inode *node, struct file *file, unsigned int c
/* version 3 fields */
stack.spaninfo.irq = spans[i]->irq;
stack.spaninfo.linecompat = spans[i]->linecompat;
- zap_copy_string(stack.spaninfo.lboname, zt_lboname(spans[i]->lbo), sizeof(stack.spaninfo.lboname));
+ zap_copy_string(stack.spaninfo.lboname, dahdi_lboname(spans[i]->lbo), sizeof(stack.spaninfo.lboname));
if (spans[i]->manufacturer)
zap_copy_string(stack.spaninfo.manufacturer, spans[i]->manufacturer,
sizeof(stack.spaninfo.manufacturer));
@@ -3520,10 +3520,10 @@ static int zt_common_ioctl(struct inode *node, struct file *file, unsigned int c
if (spans[i]->spantype)
zap_copy_string(stack.spaninfo.spantype, spans[i]->spantype, sizeof(stack.spaninfo.spantype));
- if (copy_to_user((struct zt_spaninfo *) data, &stack.spaninfo, size_to_copy))
+ if (copy_to_user((struct dahdi_spaninfo *) data, &stack.spaninfo, size_to_copy))
return -EFAULT;
break;
- case ZT_CHANDIAG:
+ case DAHDI_CHANDIAG:
get_user(j, (int *)data); /* get channel number from user */
/* make sure its a valid channel number */
if ((j < 1) || (j >= maxchans))
@@ -3586,17 +3586,17 @@ static int zt_common_ioctl(struct inode *node, struct file *file, unsigned int c
return 0;
}
-static int (*zt_dynamic_ioctl)(unsigned int cmd, unsigned long data);
+static int (*dahdi_dynamic_ioctl)(unsigned int cmd, unsigned long data);
-void zt_set_dynamic_ioctl(int (*func)(unsigned int cmd, unsigned long data))
+void dahdi_set_dynamic_ioctl(int (*func)(unsigned int cmd, unsigned long data))
{
- zt_dynamic_ioctl = func;
+ dahdi_dynamic_ioctl = func;
}
-static void recalc_slaves(struct zt_chan *chan)
+static void recalc_slaves(struct dahdi_chan *chan)
{
int x;
- struct zt_chan *last = chan;
+ struct dahdi_chan *last = chan;
/* Makes no sense if you don't have a span */
if (!chan->span)
@@ -3623,31 +3623,31 @@ static void recalc_slaves(struct zt_chan *chan)
#endif
}
-static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data)
+static int dahdi_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data)
{
/* I/O CTL's for control interface */
int i,j;
int sigcap;
int res = 0;
int x,y;
- struct zt_chan *newmaster;
+ struct dahdi_chan *newmaster;
unsigned long flags;
int rv;
switch(cmd) {
- case ZT_INDIRECT:
+ case DAHDI_INDIRECT:
{
- struct zt_indirect_data ind;
+ struct dahdi_indirect_data ind;
- if (copy_from_user(&ind, (struct zt_indirect_data *)data, sizeof(ind)))
+ if (copy_from_user(&ind, (struct dahdi_indirect_data *)data, sizeof(ind)))
return -EFAULT;
VALID_CHANNEL(ind.chan);
- return zt_chan_ioctl(inode, file, ind.op, (unsigned long) ind.data, ind.chan);
+ return dahdi_chan_ioctl(inode, file, ind.op, (unsigned long) ind.data, ind.chan);
}
- case ZT_SPANCONFIG:
+ case DAHDI_SPANCONFIG:
{
- struct zt_lineconfig lc;
+ struct dahdi_lineconfig lc;
- if (copy_from_user(&lc, (struct zt_lineconfig *)data, sizeof(lc)))
+ if (copy_from_user(&lc, (struct dahdi_lineconfig *)data, sizeof(lc)))
return -EFAULT;
VALID_SPAN(lc.span);
if ((lc.lineconfig & 0x07f0 & spans[lc.span]->linecompat) != (lc.lineconfig & 0x07f0))
@@ -3662,49 +3662,49 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
}
return 0;
}
- case ZT_STARTUP:
+ case DAHDI_STARTUP:
CHECK_VALID_SPAN(j);
- if (spans[j]->flags & ZT_FLAG_RUNNING)
+ if (spans[j]->flags & DAHDI_FLAG_RUNNING)
return 0;
if (spans[j]->startup)
res = spans[j]->startup(spans[j]);
if (!res) {
/* Mark as running and hangup any channels */
- spans[j]->flags |= ZT_FLAG_RUNNING;
+ spans[j]->flags |= DAHDI_FLAG_RUNNING;
for (x=0;x<spans[j]->channels;x++) {
- y = zt_q_sig(&spans[j]->chans[x]) & 0xff;
+ y = dahdi_q_sig(&spans[j]->chans[x]) & 0xff;
if (y >= 0) spans[j]->chans[x].rxsig = (unsigned char)y;
spin_lock_irqsave(&spans[j]->chans[x].lock, flags);
- zt_hangup(&spans[j]->chans[x]);
+ dahdi_hangup(&spans[j]->chans[x]);
spin_unlock_irqrestore(&spans[j]->chans[x].lock, flags);
- spans[j]->chans[x].rxhooksig = ZT_RXSIG_INITIAL;
+ spans[j]->chans[x].rxhooksig = DAHDI_RXSIG_INITIAL;
}
}
return 0;
- case ZT_SHUTDOWN:
+ case DAHDI_SHUTDOWN:
CHECK_VALID_SPAN(j);
if (spans[j]->shutdown)
res = spans[j]->shutdown(spans[j]);
- spans[j]->flags &= ~ZT_FLAG_RUNNING;
+ spans[j]->flags &= ~DAHDI_FLAG_RUNNING;
return 0;
- case ZT_CHANCONFIG:
+ case DAHDI_CHANCONFIG:
{
- struct zt_chanconfig ch;
+ struct dahdi_chanconfig ch;
- if (copy_from_user(&ch, (struct zt_chanconfig *)data, sizeof(ch)))
+ if (copy_from_user(&ch, (struct dahdi_chanconfig *)data, sizeof(ch)))
return -EFAULT;
VALID_CHANNEL(ch.chan);
- if (ch.sigtype == ZT_SIG_SLAVE) {
+ if (ch.sigtype == DAHDI_SIG_SLAVE) {
/* We have to use the master's sigtype */
- if ((ch.master < 1) || (ch.master >= ZT_MAX_CHANNELS))
+ if ((ch.master < 1) || (ch.master >= DAHDI_MAX_CHANNELS))
return -EINVAL;
if (!chans[ch.master])
return -EINVAL;
ch.sigtype = chans[ch.master]->sig;
newmaster = chans[ch.master];
- } else if ((ch.sigtype & __ZT_SIG_DACS) == __ZT_SIG_DACS) {
+ } else if ((ch.sigtype & __DAHDI_SIG_DACS) == __DAHDI_SIG_DACS) {
newmaster = chans[ch.chan];
- if ((ch.idlebits < 1) || (ch.idlebits >= ZT_MAX_CHANNELS))
+ if ((ch.idlebits < 1) || (ch.idlebits >= DAHDI_MAX_CHANNELS))
return -EINVAL;
if (!chans[ch.idlebits])
return -EINVAL;
@@ -3713,7 +3713,7 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
}
spin_lock_irqsave(&chans[ch.chan]->lock, flags);
#ifdef CONFIG_ZAPATA_NET
- if (chans[ch.chan]->flags & ZT_FLAG_NETDEV) {
+ if (chans[ch.chan]->flags & DAHDI_FLAG_NETDEV) {
if (ztchan_to_dev(chans[ch.chan])->flags & IFF_UP) {
spin_unlock_irqrestore(&chans[ch.chan]->lock, flags);
printk(KERN_WARNING "Can't switch HDLC net mode on channel %s, since current interface is up\n", chans[ch.chan]->name);
@@ -3729,10 +3729,10 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
#endif
kfree(chans[ch.chan]->hdlcnetdev);
chans[ch.chan]->hdlcnetdev = NULL;
- chans[ch.chan]->flags &= ~ZT_FLAG_NETDEV;
+ chans[ch.chan]->flags &= ~DAHDI_FLAG_NETDEV;
}
#else
- if (ch.sigtype == ZT_SIG_HDLCNET) {
+ if (ch.sigtype == DAHDI_SIG_HDLCNET) {
spin_unlock_irqrestore(&chans[ch.chan]->lock, flags);
printk(KERN_WARNING "Zaptel networking not supported by this build.\n");
return -ENOSYS;
@@ -3741,8 +3741,8 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
sigcap = chans[ch.chan]->sigcap;
/* If they support clear channel, then they support the HDLC and such through
us. */
- if (sigcap & ZT_SIG_CLEAR)
- sigcap |= (ZT_SIG_HDLCRAW | ZT_SIG_HDLCFCS | ZT_SIG_HDLCNET | ZT_SIG_DACS);
+ if (sigcap & DAHDI_SIG_CLEAR)
+ sigcap |= (DAHDI_SIG_HDLCRAW | DAHDI_SIG_HDLCFCS | DAHDI_SIG_HDLCNET | DAHDI_SIG_DACS);
if ((sigcap & ch.sigtype) != ch.sigtype)
res = -EINVAL;
@@ -3756,36 +3756,36 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
}
if (!res) {
chans[ch.chan]->sig = ch.sigtype;
- if (chans[ch.chan]->sig == ZT_SIG_CAS)
+ if (chans[ch.chan]->sig == DAHDI_SIG_CAS)
chans[ch.chan]->idlebits = ch.idlebits;
else
chans[ch.chan]->idlebits = 0;
- if ((ch.sigtype & ZT_SIG_CLEAR) == ZT_SIG_CLEAR) {
+ if ((ch.sigtype & DAHDI_SIG_CLEAR) == DAHDI_SIG_CLEAR) {
/* Set clear channel flag if appropriate */
- chans[ch.chan]->flags &= ~ZT_FLAG_AUDIO;
- chans[ch.chan]->flags |= ZT_FLAG_CLEAR;
+ chans[ch.chan]->flags &= ~DAHDI_FLAG_AUDIO;
+ chans[ch.chan]->flags |= DAHDI_FLAG_CLEAR;
} else {
/* Set audio flag and not clear channel otherwise */
- chans[ch.chan]->flags |= ZT_FLAG_AUDIO;
- chans[ch.chan]->flags &= ~ZT_FLAG_CLEAR;
+ chans[ch.chan]->flags |= DAHDI_FLAG_AUDIO;
+ chans[ch.chan]->flags &= ~DAHDI_FLAG_CLEAR;
}
- if ((ch.sigtype & ZT_SIG_HDLCRAW) == ZT_SIG_HDLCRAW) {
+ if ((ch.sigtype & DAHDI_SIG_HDLCRAW) == DAHDI_SIG_HDLCRAW) {
/* Set the HDLC flag */
- chans[ch.chan]->flags |= ZT_FLAG_HDLC;
+ chans[ch.chan]->flags |= DAHDI_FLAG_HDLC;
} else {
/* Clear the HDLC flag */
- chans[ch.chan]->flags &= ~ZT_FLAG_HDLC;
+ chans[ch.chan]->flags &= ~DAHDI_FLAG_HDLC;
}
- if ((ch.sigtype & ZT_SIG_HDLCFCS) == ZT_SIG_HDLCFCS) {
+ if ((ch.sigtype & DAHDI_SIG_HDLCFCS) == DAHDI_SIG_HDLCFCS) {
/* Set FCS to be calculated if appropriate */
- chans[ch.chan]->flags |= ZT_FLAG_FCS;
+ chans[ch.chan]->flags |= DAHDI_FLAG_FCS;
} else {
/* Clear FCS flag */
- chans[ch.chan]->flags &= ~ZT_FLAG_FCS;
+ chans[ch.chan]->flags &= ~DAHDI_FLAG_FCS;
}
- if ((ch.sigtype & __ZT_SIG_DACS) == __ZT_SIG_DACS) {
+ if ((ch.sigtype & __DAHDI_SIG_DACS) == __DAHDI_SIG_DACS) {
/* Setup conference properly */
- chans[ch.chan]->confmode = ZT_CONF_DIGITALMON;
+ chans[ch.chan]->confmode = DAHDI_CONF_DIGITALMON;
chans[ch.chan]->confna = ch.idlebits;
if (chans[ch.chan]->span &&
chans[ch.chan]->span->dacs &&
@@ -3800,23 +3800,23 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
if (newmaster != chans[ch.chan]) {
recalc_slaves(chans[ch.chan]->master);
}
- if ((ch.sigtype & ZT_SIG_HARDHDLC) == ZT_SIG_HARDHDLC) {
- chans[ch.chan]->flags &= ~ZT_FLAG_FCS;
- chans[ch.chan]->flags &= ~ZT_FLAG_HDLC;
- chans[ch.chan]->flags |= ZT_FLAG_NOSTDTXRX;
+ if ((ch.sigtype & DAHDI_SIG_HARDHDLC) == DAHDI_SIG_HARDHDLC) {
+ chans[ch.chan]->flags &= ~DAHDI_FLAG_FCS;
+ chans[ch.chan]->flags &= ~DAHDI_FLAG_HDLC;
+ chans[ch.chan]->flags |= DAHDI_FLAG_NOSTDTXRX;
} else
- chans[ch.chan]->flags &= ~ZT_FLAG_NOSTDTXRX;
+ chans[ch.chan]->flags &= ~DAHDI_FLAG_NOSTDTXRX;
- if ((ch.sigtype & ZT_SIG_MTP2) == ZT_SIG_MTP2)
- chans[ch.chan]->flags |= ZT_FLAG_MTP2;
+ if ((ch.sigtype & DAHDI_SIG_MTP2) == DAHDI_SIG_MTP2)
+ chans[ch.chan]->flags |= DAHDI_FLAG_MTP2;
else
- chans[ch.chan]->flags &= ~ZT_FLAG_MTP2;
+ chans[ch.chan]->flags &= ~DAHDI_FLAG_MTP2;
}
#ifdef CONFIG_ZAPATA_NET
if (!res &&
(newmaster == chans[ch.chan]) &&
- (chans[ch.chan]->sig == ZT_SIG_HDLCNET)) {
- chans[ch.chan]->hdlcnetdev = zt_hdlc_alloc();
+ (chans[ch.chan]->sig == DAHDI_SIG_HDLCNET)) {
+ chans[ch.chan]->hdlcnetdev = dahdi_hdlc_alloc();
if (chans[ch.chan]->hdlcnetdev) {
/* struct hdlc_device *hdlc = chans[ch.chan]->hdlcnetdev;
struct net_device *d = hdlc_to_dev(hdlc); mmm...get it right later --byg */
@@ -3829,14 +3829,14 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
#endif
chans[ch.chan]->hdlcnetdev->netdev->irq = chans[ch.chan]->span->irq;
chans[ch.chan]->hdlcnetdev->netdev->tx_queue_len = 50;
- chans[ch.chan]->hdlcnetdev->netdev->do_ioctl = zt_net_ioctl;
- chans[ch.chan]->hdlcnetdev->netdev->open = zt_net_open;
- chans[ch.chan]->hdlcnetdev->netdev->stop = zt_net_stop;
- dev_to_hdlc(chans[ch.chan]->hdlcnetdev->netdev)->attach = zt_net_attach;
- dev_to_hdlc(chans[ch.chan]->hdlcnetdev->netdev)->xmit = zt_xmit;
+ chans[ch.chan]->hdlcnetdev->netdev->do_ioctl = dahdi_net_ioctl;
+ chans[ch.chan]->hdlcnetdev->netdev->open = dahdi_net_open;
+ chans[ch.chan]->hdlcnetdev->netdev->stop = dahdi_net_stop;
+ dev_to_hdlc(chans[ch.chan]->hdlcnetdev->netdev)->attach = dahdi_net_attach;
+ dev_to_hdlc(chans[ch.chan]->hdlcnetdev->netdev)->xmit = dahdi_xmit;
spin_unlock_irqrestore(&chans[ch.chan]->lock, flags);
/* Briefly restore interrupts while we register the device */
- res = zt_register_hdlc_device(chans[ch.chan]->hdlcnetdev->netdev, ch.netdev_name);
+ res = dahdi_register_hdlc_device(chans[ch.chan]->hdlcnetdev->netdev, ch.netdev_name);
spin_lock_irqsave(&chans[ch.chan]->lock, flags);
} else {
printk("Unable to allocate hdlc: *shrug*\n");
@@ -3845,49 +3845,49 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
#else /* LINUX26 */
chans[ch.chan]->hdlcnetdev->chan = chans[ch.chan];
#ifndef HDLC_MAINTAINERS_ARE_MORE_STUPID_THAN_I_THOUGHT
- chans[ch.chan]->hdlcnetdev->netdev.ioctl = zt_net_ioctl;
+ chans[ch.chan]->hdlcnetdev->netdev.ioctl = dahdi_net_ioctl;
#endif
- chans[ch.chan]->hdlcnetdev->netdev.netdev.do_ioctl = zt_net_ioctl;
+ chans[ch.chan]->hdlcnetdev->netdev.netdev.do_ioctl = dahdi_net_ioctl;
#ifdef NEW_HDLC_INTERFACE
- chans[ch.chan]->hdlcnetdev->netdev.netdev.open = zt_net_open;
- chans[ch.chan]->hdlcnetdev->netdev.netdev.stop = zt_net_stop;
- chans[ch.chan]->hdlcnetdev->netdev.xmit = zt_xmit;
- chans[ch.chan]->hdlcnetdev->netdev.attach = zt_net_attach;
+ chans[ch.chan]->hdlcnetdev->netdev.netdev.open = dahdi_net_open;
+ chans[ch.chan]->hdlcnetdev->netdev.netdev.stop = dahdi_net_stop;
+ chans[ch.chan]->hdlcnetdev->netdev.xmit = dahdi_xmit;
+ chans[ch.chan]->hdlcnetdev->netdev.attach = dahdi_net_attach;
#else
- chans[ch.chan]->hdlcnetdev->netdev.open = zt_net_open;
- chans[ch.chan]->hdlcnetdev->netdev.close = zt_net_close;
+ chans[ch.chan]->hdlcnetdev->netdev.open = dahdi_net_open;
+ chans[ch.chan]->hdlcnetdev->netdev.close = dahdi_net_close;
chans[ch.chan]->hdlcnetdev->netdev.set_mode = NULL;
- chans[ch.chan]->hdlcnetdev->netdev.xmit = zt_xmit;
+ chans[ch.chan]->hdlcnetdev->netdev.xmit = dahdi_xmit;
#endif /* NEW_HDLC_INTERFACE */
chans[ch.chan]->hdlcnetdev->netdev.netdev.irq = chans[ch.chan]->span->irq;
chans[ch.chan]->hdlcnetdev->netdev.netdev.tx_queue_len = 50;
res = register_hdlc_device(&chans[ch.chan]->hdlcnetdev->netdev);
#endif /* LINUX26 */
if (!res)
- chans[ch.chan]->flags |= ZT_FLAG_NETDEV;
+ chans[ch.chan]->flags |= DAHDI_FLAG_NETDEV;
} else {
printk("Unable to allocate netdev: out of memory\n");
res = -1;
}
}
#endif
- if ((chans[ch.chan]->sig == ZT_SIG_HDLCNET) &&
+ if ((chans[ch.chan]->sig == DAHDI_SIG_HDLCNET) &&
(chans[ch.chan] == newmaster) &&
- !(chans[ch.chan]->flags & ZT_FLAG_NETDEV))
+ !(chans[ch.chan]->flags & DAHDI_FLAG_NETDEV))
printk("Unable to register HDLC device for channel %s\n", chans[ch.chan]->name);
if (!res) {
/* Setup default law */
chans[ch.chan]->deflaw = ch.deflaw;
/* Copy back any modified settings */
spin_unlock_irqrestore(&chans[ch.chan]->lock, flags);
- if (copy_to_user((struct zt_chanconfig *)data, &ch, sizeof(ch)))
+ if (copy_to_user((struct dahdi_chanconfig *)data, &ch, sizeof(ch)))
return -EFAULT;
spin_lock_irqsave(&chans[ch.chan]->lock, flags);
/* And hangup */
- zt_hangup(chans[ch.chan]);
- y = zt_q_sig(chans[ch.chan]) & 0xff;
+ dahdi_hangup(chans[ch.chan]);
+ y = dahdi_q_sig(chans[ch.chan]) & 0xff;
if (y >= 0) chans[ch.chan]->rxsig = (unsigned char)y;
- chans[ch.chan]->rxhooksig = ZT_RXSIG_INITIAL;
+ chans[ch.chan]->rxhooksig = DAHDI_RXSIG_INITIAL;
}
#ifdef CONFIG_ZAPATA_DEBUG
printk("Configured channel %s, flags %04x, sig %04x\n", chans[ch.chan]->name, chans[ch.chan]->flags, chans[ch.chan]->sig);
@@ -3895,14 +3895,14 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
spin_unlock_irqrestore(&chans[ch.chan]->lock, flags);
return res;
}
- case ZT_SFCONFIG:
+ case DAHDI_SFCONFIG:
{
- struct zt_sfconfig sf;
+ struct dahdi_sfconfig sf;
- if (copy_from_user(&sf, (struct zt_chanconfig *)data, sizeof(sf)))
+ if (copy_from_user(&sf, (struct dahdi_chanconfig *)data, sizeof(sf)))
return -EFAULT;
VALID_CHANNEL(sf.chan);
- if (chans[sf.chan]->sig != ZT_SIG_SF) return -EINVAL;
+ if (chans[sf.chan]->sig != DAHDI_SIG_SF) return -EINVAL;
spin_lock_irqsave(&chans[sf.chan]->lock, flags);
chans[sf.chan]->rxp1 = sf.rxp1;
chans[sf.chan]->rxp2 = sf.rxp2;
@@ -3913,8 +3913,8 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
chans[sf.chan]->toneflags = sf.toneflag;
if (sf.txtone) /* if set to make tone for tx */
{
- if ((chans[sf.chan]->txhooksig && !(sf.toneflag & ZT_REVERSE_TXTONE)) ||
- ((!chans[sf.chan]->txhooksig) && (sf.toneflag & ZT_REVERSE_TXTONE)))
+ if ((chans[sf.chan]->txhooksig && !(sf.toneflag & DAHDI_REVERSE_TXTONE)) ||
+ ((!chans[sf.chan]->txhooksig) && (sf.toneflag & DAHDI_REVERSE_TXTONE)))
{
set_txtone(chans[sf.chan],sf.txtone,sf.tx_v2,sf.tx_v3);
}
@@ -3926,20 +3926,20 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
spin_unlock_irqrestore(&chans[sf.chan]->lock, flags);
return res;
}
- case ZT_DEFAULTZONE:
+ case DAHDI_DEFAULTZONE:
if (get_user(j,(int *)data))
return -EFAULT;
- return zt_set_default_zone(j);
- case ZT_LOADZONE:
+ return dahdi_set_default_zone(j);
+ case DAHDI_LOADZONE:
return ioctl_load_zone(data);
- case ZT_FREEZONE:
+ case DAHDI_FREEZONE:
get_user(j, (int *) data);
return free_tone_zone(j);
- case ZT_SET_DIALPARAMS:
+ case DAHDI_SET_DIALPARAMS:
{
- struct zt_dialparams tdp;
+ struct dahdi_dialparams tdp;
- if (copy_from_user(&tdp, (struct zt_dialparams *) data, sizeof(tdp)))
+ if (copy_from_user(&tdp, (struct dahdi_dialparams *) data, sizeof(tdp)))
return -EFAULT;
if ((tdp.dtmf_tonelen <= 4000) || (tdp.dtmf_tonelen >= 10)) {
@@ -3955,64 +3955,64 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
/* update the lengths in all currently loaded zones */
write_lock(&zone_lock);
for (j = 0; j < sizeof(tone_zones) / sizeof(tone_zones[0]); j++) {
- struct zt_zone *z = tone_zones[j];
+ struct dahdi_zone *z = tone_zones[j];
if (!z)
continue;
for (i = 0; i < sizeof(z->dtmf) / sizeof(z->dtmf[0]); i++) {
- z->dtmf[i].tonesamples = global_dialparams.dtmf_tonelen * ZT_CHUNKSIZE;
+ z->dtmf[i].tonesamples = global_dialparams.dtmf_tonelen * DAHDI_CHUNKSIZE;
}
/* for MFR1, we only adjust the length of the digits */
- for (i = ZT_TONE_MFR1_0; i <= ZT_TONE_MFR1_9; i++) {
- z->mfr1[i - ZT_TONE_MFR1_BASE].tonesamples = global_dialparams.mfv1_tonelen * ZT_CHUNKSIZE;
+ for (i = DAHDI_TONE_MFR1_0; i <= DAHDI_TONE_MFR1_9; i++) {
+ z->mfr1[i - DAHDI_TONE_MFR1_BASE].tonesamples = global_dialparams.mfv1_tonelen * DAHDI_CHUNKSIZE;
}
for (i = 0; i < sizeof(z->mfr2_fwd) / sizeof(z->mfr2_fwd[0]); i++) {
- z->mfr2_fwd[i].tonesamples = global_dialparams.mfr2_tonelen * ZT_CHUNKSIZE;
+ z->mfr2_fwd[i].tonesamples = global_dialparams.mfr2_tonelen * DAHDI_CHUNKSIZE;
}
for (i = 0; i < sizeof(z->mfr2_rev) / sizeof(z->mfr2_rev[0]); i++) {
- z->mfr2_rev[i].tonesamples = global_dialparams.mfr2_tonelen * ZT_CHUNKSIZE;
+ z->mfr2_rev[i].tonesamples = global_dialparams.mfr2_tonelen * DAHDI_CHUNKSIZE;
}
}
write_unlock(&zone_lock);
- dtmf_silence.tonesamples = global_dialparams.dtmf_tonelen * ZT_CHUNKSIZE;
- mfr1_silence.tonesamples = global_dialparams.mfv1_tonelen * ZT_CHUNKSIZE;
- mfr2_silence.tonesamples = global_dialparams.mfr2_tonelen * ZT_CHUNKSIZE;
+ dtmf_silence.tonesamples = global_dialparams.dtmf_tonelen * DAHDI_CHUNKSIZE;
+ mfr1_silence.tonesamples = global_dialparams.mfv1_tonelen * DAHDI_CHUNKSIZE;
+ mfr2_silence.tonesamples = global_dialparams.mfr2_tonelen * DAHDI_CHUNKSIZE;
break;
}
- case ZT_GET_DIALPARAMS:
+ case DAHDI_GET_DIALPARAMS:
{
- struct zt_dialparams tdp;
+ struct dahdi_dialparams tdp;
tdp = global_dialparams;
- if (copy_to_user((struct zt_dialparams *) data, &tdp, sizeof(tdp)))
+ if (copy_to_user((struct dahdi_dialparams *) data, &tdp, sizeof(tdp)))
return -EFAULT;
break;
}
- case ZT_GETVERSION:
+ case DAHDI_GETVERSION:
{
- struct zt_versioninfo vi;
+ struct dahdi_versioninfo vi;
memset(&vi, 0, sizeof(vi));
zap_copy_string(vi.version, ZAPTEL_VERSION, sizeof(vi.version));
echo_can_identify(vi.echo_canceller, sizeof(vi.echo_canceller) - 1);
- if (copy_to_user((struct zt_versioninfo *) data, &vi, sizeof(vi)))
+ if (copy_to_user((struct dahdi_versioninfo *) data, &vi, sizeof(vi)))
return -EFAULT;
break;
}
- case ZT_MAINT: /* do maintenance stuff */
+ case DAHDI_MAINT: /* do maintenance stuff */
{
- struct zt_maintinfo maint;
+ struct dahdi_maintinfo maint;
/* get struct from user */
- if (copy_from_user(&maint,(struct zt_maintinfo *) data, sizeof(maint)))
+ if (copy_from_user(&maint,(struct dahdi_maintinfo *) data, sizeof(maint)))
return -EFAULT;
/* must be valid span number */
- if ((maint.spanno < 1) || (maint.spanno > ZT_MAX_SPANS) || (!spans[maint.spanno]))
+ if ((maint.spanno < 1) || (maint.spanno > DAHDI_MAX_SPANS) || (!spans[maint.spanno]))
return -EINVAL;
if (!spans[maint.spanno]->maint)
return -ENOSYS;
@@ -4022,9 +4022,9 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
/* set maint mode */
spans[maint.spanno]->maintstat = maint.command;
switch(maint.command) {
- case ZT_MAINT_NONE:
- case ZT_MAINT_LOCALLOOP:
- case ZT_MAINT_REMOTELOOP:
+ case DAHDI_MAINT_NONE:
+ case DAHDI_MAINT_LOCALLOOP:
+ case DAHDI_MAINT_REMOTELOOP:
/* if same, ignore it */
if (i == maint.command) break;
rv = spans[maint.spanno]->maint(spans[maint.spanno], maint.command);
@@ -4032,9 +4032,9 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
if (rv) return rv;
spin_lock_irqsave(&spans[maint.spanno]->lock, flags);
break;
- case ZT_MAINT_LOOPUP:
- case ZT_MAINT_LOOPDOWN:
- spans[maint.spanno]->mainttimer = ZT_LOOPCODE_TIME * ZT_CHUNKSIZE;
+ case DAHDI_MAINT_LOOPUP:
+ case DAHDI_MAINT_LOOPDOWN:
+ spans[maint.spanno]->mainttimer = DAHDI_LOOPCODE_TIME * DAHDI_CHUNKSIZE;
rv = spans[maint.spanno]->maint(spans[maint.spanno], maint.command);
spin_unlock_irqrestore(&spans[maint.spanno]->lock, flags);
if (rv) return rv;
@@ -4045,34 +4045,34 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
default:
printk("zaptel: Unknown maintenance event: %d\n", maint.command);
}
- zt_alarm_notify(spans[maint.spanno]); /* process alarm-related events */
+ dahdi_alarm_notify(spans[maint.spanno]); /* process alarm-related events */
spin_unlock_irqrestore(&spans[maint.spanno]->lock, flags);
break;
}
- case ZT_DYNAMIC_CREATE:
- case ZT_DYNAMIC_DESTROY:
- if (zt_dynamic_ioctl)
- return zt_dynamic_ioctl(cmd, data);
+ case DAHDI_DYNAMIC_CREATE:
+ case DAHDI_DYNAMIC_DESTROY:
+ if (dahdi_dynamic_ioctl)
+ return dahdi_dynamic_ioctl(cmd, data);
else {
request_module("dahdi_dynamic");
- if (zt_dynamic_ioctl)
- return zt_dynamic_ioctl(cmd, data);
+ if (dahdi_dynamic_ioctl)
+ return dahdi_dynamic_ioctl(cmd, data);
}
return -ENOSYS;
#if defined(ECHO_CAN_HPEC)
- case ZT_EC_LICENSE_CHALLENGE:
- case ZT_EC_LICENSE_RESPONSE:
+ case DAHDI_EC_LICENSE_CHALLENGE:
+ case DAHDI_EC_LICENSE_RESPONSE:
return hpec_license_ioctl(cmd, data);
#endif /* defined(ECHO_CAN_HPEC) */
default:
- return zt_common_ioctl(inode, file, cmd, data, 0);
+ return dahdi_common_ioctl(inode, file, cmd, data, 0);
}
return 0;
}
-static int ioctl_zt_dial(struct zt_chan *chan, unsigned long data)
+static int ioctl_dahdi_dial(struct dahdi_chan *chan, unsigned long data)
{
- struct zt_dialoperation *tdo;
+ struct dahdi_dialoperation *tdo;
unsigned long flags;
char *s;
int rv;
@@ -4082,11 +4082,11 @@ static int ioctl_zt_dial(struct zt_chan *chan, unsigned long data)
if (!tdo)
return -ENOMEM;
- if (copy_from_user(tdo, (struct zt_dialoperation *)data, sizeof(*tdo)))
+ if (copy_from_user(tdo, (struct dahdi_dialoperation *)data, sizeof(*tdo)))
return -EFAULT;
rv = 0;
/* Force proper NULL termination and uppercase entry */
- tdo->dialstr[ZT_MAX_DTMF_BUF - 1] = '\0';
+ tdo->dialstr[DAHDI_MAX_DTMF_BUF - 1] = '\0';
for (s = tdo->dialstr; *s; s++)
*s = toupper(*s);
spin_lock_irqsave(&chan->lock, flags);
@@ -4097,24 +4097,24 @@ static int ioctl_zt_dial(struct zt_chan *chan, unsigned long data)
return -ENODATA;
}
switch (tdo->op) {
- case ZT_DIAL_OP_CANCEL:
+ case DAHDI_DIAL_OP_CANCEL:
chan->curtone = NULL;
chan->dialing = 0;
chan->txdialbuf[0] = '\0';
chan->tonep = 0;
chan->pdialcount = 0;
break;
- case ZT_DIAL_OP_REPLACE:
+ case DAHDI_DIAL_OP_REPLACE:
strcpy(chan->txdialbuf, tdo->dialstr);
chan->dialing = 1;
__do_dtmf(chan);
break;
- case ZT_DIAL_OP_APPEND:
- if (strlen(tdo->dialstr) + strlen(chan->txdialbuf) >= (ZT_MAX_DTMF_BUF - 1)) {
+ case DAHDI_DIAL_OP_APPEND:
+ if (strlen(tdo->dialstr) + strlen(chan->txdialbuf) >= (DAHDI_MAX_DTMF_BUF - 1)) {
rv = -EBUSY;
break;
}
- zap_copy_string(chan->txdialbuf + strlen(chan->txdialbuf), tdo->dialstr, ZT_MAX_DTMF_BUF - strlen(chan->txdialbuf));
+ zap_copy_string(chan->txdialbuf + strlen(chan->txdialbuf), tdo->dialstr, DAHDI_MAX_DTMF_BUF - strlen(chan->txdialbuf));
if (!chan->dialing) {
chan->dialing = 1;
__do_dtmf(chan);
@@ -4127,13 +4127,13 @@ static int ioctl_zt_dial(struct zt_chan *chan, unsigned long data)
return rv;
}
-static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data, int unit)
+static int dahdi_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data, int unit)
{
- struct zt_chan *chan = chans[unit];
+ struct dahdi_chan *chan = chans[unit];
union {
- struct zt_bufferinfo bi;
- struct zt_confinfo conf;
- struct zt_ring_cadence cad;
+ struct dahdi_bufferinfo bi;
+ struct dahdi_confinfo conf;
+ struct dahdi_ring_cadence cad;
} stack;
unsigned long flags, flagso;
int i, j, k, rv;
@@ -4142,16 +4142,16 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
if (!chan)
return -EINVAL;
switch(cmd) {
- case ZT_DIALING:
+ case DAHDI_DIALING:
spin_lock_irqsave(&chan->lock, flags);
j = chan->dialing;
spin_unlock_irqrestore(&chan->lock, flags);
if (copy_to_user((int *)data,&j,sizeof(int)))
return -EFAULT;
return 0;
- case ZT_DIAL:
- return ioctl_zt_dial(chan, data);
- case ZT_GET_BUFINFO:
+ case DAHDI_DIAL:
+ return ioctl_dahdi_dial(chan, data);
+ case DAHDI_GET_BUFINFO:
stack.bi.rxbufpolicy = chan->rxbufpolicy;
stack.bi.txbufpolicy = chan->txbufpolicy;
stack.bi.numbufs = chan->numbufs;
@@ -4159,41 +4159,41 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
/* XXX FIXME! XXX */
stack.bi.readbufs = -1;
stack.bi.writebufs = -1;
- if (copy_to_user((struct zt_bufferinfo *)data, &stack.bi, sizeof(stack.bi)))
+ if (copy_to_user((struct dahdi_bufferinfo *)data, &stack.bi, sizeof(stack.bi)))
return -EFAULT;
break;
- case ZT_SET_BUFINFO:
- if (copy_from_user(&stack.bi, (struct zt_bufferinfo *)data, sizeof(stack.bi)))
+ case DAHDI_SET_BUFINFO:
+ if (copy_from_user(&stack.bi, (struct dahdi_bufferinfo *)data, sizeof(stack.bi)))
return -EFAULT;
- if (stack.bi.bufsize > ZT_MAX_BLOCKSIZE)
+ if (stack.bi.bufsize > DAHDI_MAX_BLOCKSIZE)
return -EINVAL;
if (stack.bi.bufsize < 16)
return -EINVAL;
- if (stack.bi.bufsize * stack.bi.numbufs > ZT_MAX_BUF_SPACE)
+ if (stack.bi.bufsize * stack.bi.numbufs > DAHDI_MAX_BUF_SPACE)
return -EINVAL;
chan->rxbufpolicy = stack.bi.rxbufpolicy & 0x1;
chan->txbufpolicy = stack.bi.txbufpolicy & 0x1;
- if ((rv = zt_reallocbufs(chan, stack.bi.bufsize, stack.bi.numbufs)))
+ if ((rv = dahdi_reallocbufs(chan, stack.bi.bufsize, stack.bi.numbufs)))
return (rv);
break;
- case ZT_GET_BLOCKSIZE: /* get blocksize */
+ case DAHDI_GET_BLOCKSIZE: /* get blocksize */
put_user(chan->blocksize,(int *)data); /* return block size */
break;
- case ZT_SET_BLOCKSIZE: /* set blocksize */
+ case DAHDI_SET_BLOCKSIZE: /* set blocksize */
get_user(j,(int *)data);
/* cannot be larger than max amount */
- if (j > ZT_MAX_BLOCKSIZE) return(-EINVAL);
+ if (j > DAHDI_MAX_BLOCKSIZE) return(-EINVAL);
/* cannot be less then 16 */
if (j < 16) return(-EINVAL);
/* allocate a single kernel buffer which we then
sub divide into four pieces */
- if ((rv = zt_reallocbufs(chan, j, chan->numbufs)))
+ if ((rv = dahdi_reallocbufs(chan, j, chan->numbufs)))
return (rv);
break;
- case ZT_FLUSH: /* flush input buffer, output buffer, and/or event queue */
+ case DAHDI_FLUSH: /* flush input buffer, output buffer, and/or event queue */
get_user(i,(int *)data); /* get param */
spin_lock_irqsave(&chan->lock, flags);
- if (i & ZT_FLUSH_READ) /* if for read (input) */
+ if (i & DAHDI_FLUSH_READ) /* if for read (input) */
{
/* initialize read buffers and pointers */
chan->inreadbuf = 0;
@@ -4206,7 +4206,7 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
wake_up_interruptible(&chan->readbufq); /* wake_up_interruptible waiting on read */
wake_up_interruptible(&chan->sel); /* wake_up_interruptible waiting on select */
}
- if (i & ZT_FLUSH_WRITE) /* if for write (output) */
+ if (i & DAHDI_FLUSH_WRITE) /* if for write (output) */
{
/* initialize write buffers and pointers */
chan->outwritebuf = -1;
@@ -4220,17 +4220,17 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
wake_up_interruptible(&chan->sel); /* wake_up_interruptible waiting on select */
/* if IO MUX wait on write empty, well, this
certainly *did* empty the write */
- if (chan->iomask & ZT_IOMUX_WRITEEMPTY)
+ if (chan->iomask & DAHDI_IOMUX_WRITEEMPTY)
wake_up_interruptible(&chan->eventbufq); /* wake_up_interruptible waiting on IOMUX */
}
- if (i & ZT_FLUSH_EVENT) /* if for events */
+ if (i & DAHDI_FLUSH_EVENT) /* if for events */
{
/* initialize the event pointers */
chan->eventinidx = chan->eventoutidx = 0;
}
spin_unlock_irqrestore(&chan->lock, flags);
break;
- case ZT_SYNC: /* wait for no tx */
+ case DAHDI_SYNC: /* wait for no tx */
for(;;) /* loop forever */
{
spin_lock_irqsave(&chan->lock, flags);
@@ -4242,7 +4242,7 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
if (rv) return(rv);
}
break;
- case ZT_IOMUX: /* wait for something to happen */
+ case DAHDI_IOMUX: /* wait for something to happen */
get_user(chan->iomask,(int*)data); /* save mask */
if (!chan->iomask) return(-EINVAL); /* cant wait for nothing */
for(;;) /* loop forever */
@@ -4251,36 +4251,36 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
ret = 0; /* start with empty return value */
spin_lock_irqsave(&chan->lock, flags);
/* if looking for read */
- if (chan->iomask & ZT_IOMUX_READ)
+ if (chan->iomask & DAHDI_IOMUX_READ)
{
/* if read available */
if ((chan->outreadbuf > -1) && !chan->rxdisable)
- ret |= ZT_IOMUX_READ;
+ ret |= DAHDI_IOMUX_READ;
}
/* if looking for write avail */
- if (chan->iomask & ZT_IOMUX_WRITE)
+ if (chan->iomask & DAHDI_IOMUX_WRITE)
{
if (chan->inwritebuf > -1)
- ret |= ZT_IOMUX_WRITE;
+ ret |= DAHDI_IOMUX_WRITE;
}
/* if looking for write empty */
- if (chan->iomask & ZT_IOMUX_WRITEEMPTY)
+ if (chan->iomask & DAHDI_IOMUX_WRITEEMPTY)
{
/* if everything empty -- be sure the transmitter is enabled */
chan->txdisable = 0;
if (chan->outwritebuf < 0)
- ret |= ZT_IOMUX_WRITEEMPTY;
+ ret |= DAHDI_IOMUX_WRITEEMPTY;
}
/* if looking for signalling event */
- if (chan->iomask & ZT_IOMUX_SIGEVENT)
+ if (chan->iomask & DAHDI_IOMUX_SIGEVENT)
{
/* if event */
if (chan->eventinidx != chan->eventoutidx)
- ret |= ZT_IOMUX_SIGEVENT;
+ ret |= DAHDI_IOMUX_SIGEVENT;
}
spin_unlock_irqrestore(&chan->lock, flags);
/* if something to return, or not to wait */
- if (ret || (chan->iomask & ZT_IOMUX_NOWAIT))
+ if (ret || (chan->iomask & DAHDI_IOMUX_NOWAIT))
{
/* set return value */
put_user(ret,(int *)data);
@@ -4292,9 +4292,9 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
/* clear IO MUX mask */
chan->iomask = 0;
break;
- case ZT_GETEVENT: /* Get event on queue */
+ case DAHDI_GETEVENT: /* Get event on queue */
/* set up for no event */
- j = ZT_EVENT_NONE;
+ j = DAHDI_EVENT_NONE;
spin_lock_irqsave(&chan->lock, flags);
/* if some event in queue */
if (chan->eventinidx != chan->eventoutidx)
@@ -4302,77 +4302,77 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
j = chan->eventbuf[chan->eventoutidx++];
/* get the data, bump index */
/* if index overflow, set to beginning */
- if (chan->eventoutidx >= ZT_MAX_EVENTSIZE)
+ if (chan->eventoutidx >= DAHDI_MAX_EVENTSIZE)
chan->eventoutidx = 0;
}
spin_unlock_irqrestore(&chan->lock, flags);
put_user(j,(int *)data);
break;
- case ZT_CONFMUTE: /* set confmute flag */
+ case DAHDI_CONFMUTE: /* set confmute flag */
get_user(j,(int *)data); /* get conf # */
- if (!(chan->flags & ZT_FLAG_AUDIO)) return (-EINVAL);
+ if (!(chan->flags & DAHDI_FLAG_AUDIO)) return (-EINVAL);
spin_lock_irqsave(&bigzaplock, flags);
chan->confmute = j;
spin_unlock_irqrestore(&bigzaplock, flags);
break;
- case ZT_GETCONFMUTE: /* get confmute flag */
- if (!(chan->flags & ZT_FLAG_AUDIO)) return (-EINVAL);
+ case DAHDI_GETCONFMUTE: /* get confmute flag */
+ if (!(chan->flags & DAHDI_FLAG_AUDIO)) return (-EINVAL);
j = chan->confmute;
put_user(j,(int *)data); /* get conf # */
rv = 0;
break;
- case ZT_SETTONEZONE:
+ case DAHDI_SETTONEZONE:
get_user(j, (int *) data);
rv = set_tone_zone(chan, j);
return rv;
- case ZT_GETTONEZONE:
+ case DAHDI_GETTONEZONE:
spin_lock_irqsave(&chan->lock, flags);
if (chan->curzone)
j = chan->tonezone;
spin_unlock_irqrestore(&chan->lock, flags);
put_user(j, (int *) data);
break;
- case ZT_SENDTONE:
+ case DAHDI_SENDTONE:
get_user(j,(int *)data);
spin_lock_irqsave(&chan->lock, flags);
rv = start_tone(chan, j);
spin_unlock_irqrestore(&chan->lock, flags);
return rv;
- case ZT_GETCONF: /* get conf stuff */
- if (copy_from_user(&stack.conf,(struct zt_confinfo *) data,sizeof(stack.conf)))
+ case DAHDI_GETCONF: /* get conf stuff */
+ if (copy_from_user(&stack.conf,(struct dahdi_confinfo *) data,sizeof(stack.conf)))
return -EFAULT;
i = stack.conf.chan; /* get channel no */
/* if zero, use current channel no */
if (!i) i = chan->channo;
/* make sure channel number makes sense */
- if ((i < 0) || (i > ZT_MAX_CONF) || (!chans[i])) return(-EINVAL);
- if (!(chans[i]->flags & ZT_FLAG_AUDIO)) return (-EINVAL);
+ if ((i < 0) || (i > DAHDI_MAX_CONF) || (!chans[i])) return(-EINVAL);
+ if (!(chans[i]->flags & DAHDI_FLAG_AUDIO)) return (-EINVAL);
stack.conf.chan = i; /* get channel number */
stack.conf.confno = chans[i]->confna; /* get conference number */
stack.conf.confmode = chans[i]->confmode; /* get conference mode */
- if (copy_to_user((struct zt_confinfo *) data,&stack.conf,sizeof(stack.conf)))
+ if (copy_to_user((struct dahdi_confinfo *) data,&stack.conf,sizeof(stack.conf)))
return -EFAULT;
break;
- case ZT_SETCONF: /* set conf stuff */
- if (copy_from_user(&stack.conf,(struct zt_confinfo *) data,sizeof(stack.conf)))
+ case DAHDI_SETCONF: /* set conf stuff */
+ if (copy_from_user(&stack.conf,(struct dahdi_confinfo *) data,sizeof(stack.conf)))
return -EFAULT;
i = stack.conf.chan; /* get channel no */
/* if zero, use current channel no */
if (!i) i = chan->channo;
/* make sure channel number makes sense */
- if ((i < 1) || (i > ZT_MAX_CHANNELS) || (!chans[i])) return(-EINVAL);
- if (!(chans[i]->flags & ZT_FLAG_AUDIO)) return (-EINVAL);
- if ((stack.conf.confmode & ZT_CONF_MODE_MASK) == ZT_CONF_MONITOR ||
- (stack.conf.confmode & ZT_CONF_MODE_MASK) == ZT_CONF_MONITORTX ||
- (stack.conf.confmode & ZT_CONF_MODE_MASK) == ZT_CONF_MONITORBOTH ||
- (stack.conf.confmode & ZT_CONF_MODE_MASK) == ZT_CONF_MONITOR_RX_PREECHO ||
- (stack.conf.confmode & ZT_CONF_MODE_MASK) == ZT_CONF_MONITOR_TX_PREECHO ||
- (stack.conf.confmode & ZT_CONF_MODE_MASK) == ZT_CONF_MONITORBOTH_PREECHO) {
+ if ((i < 1) || (i > DAHDI_MAX_CHANNELS) || (!chans[i])) return(-EINVAL);
+ if (!(chans[i]->flags & DAHDI_FLAG_AUDIO)) return (-EINVAL);
+ if ((stack.conf.confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_MONITOR ||
+ (stack.conf.confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_MONITORTX ||
+ (stack.conf.confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_MONITORBOTH ||
+ (stack.conf.confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_MONITOR_RX_PREECHO ||
+ (stack.conf.confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_MONITOR_TX_PREECHO ||
+ (stack.conf.confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_MONITORBOTH_PREECHO) {
/* Monitor mode -- it's a channel */
- if ((stack.conf.confno < 0) || (stack.conf.confno >= ZT_MAX_CHANNELS) || !chans[stack.conf.confno]) return(-EINVAL);
+ if ((stack.conf.confno < 0) || (stack.conf.confno >= DAHDI_MAX_CHANNELS) || !chans[stack.conf.confno]) return(-EINVAL);
} else {
/* make sure conf number makes sense, too */
- if ((stack.conf.confno < -1) || (stack.conf.confno > ZT_MAX_CONF)) return(-EINVAL);
+ if ((stack.conf.confno < -1) || (stack.conf.confno > DAHDI_MAX_CONF)) return(-EINVAL);
}
/* if taking off of any conf, must have 0 mode */
@@ -4383,7 +4383,7 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
spin_lock_irqsave(&bigzaplock, flagso);
spin_lock_irqsave(&chan->lock, flags);
if (stack.conf.confno == -1)
- stack.conf.confno = zt_first_empty_conference();
+ stack.conf.confno = dahdi_first_empty_conference();
if ((stack.conf.confno < 1) && (stack.conf.confmode)) {
/* No more empty conferences */
spin_unlock_irqrestore(&chan->lock, flags);
@@ -4392,18 +4392,18 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
}
/* if changing confs, clear last added info */
if (stack.conf.confno != chans[i]->confna) {
- memset(chans[i]->conflast, 0, ZT_MAX_CHUNKSIZE);
- memset(chans[i]->conflast1, 0, ZT_MAX_CHUNKSIZE);
- memset(chans[i]->conflast2, 0, ZT_MAX_CHUNKSIZE);
+ memset(chans[i]->conflast, 0, DAHDI_MAX_CHUNKSIZE);
+ memset(chans[i]->conflast1, 0, DAHDI_MAX_CHUNKSIZE);
+ memset(chans[i]->conflast2, 0, DAHDI_MAX_CHUNKSIZE);
}
j = chans[i]->confna; /* save old conference number */
chans[i]->confna = stack.conf.confno; /* set conference number */
chans[i]->confmode = stack.conf.confmode; /* set conference mode */
chans[i]->_confn = 0; /* Clear confn */
- zt_check_conf(j);
- zt_check_conf(stack.conf.confno);
+ dahdi_check_conf(j);
+ dahdi_check_conf(stack.conf.confno);
if (chans[i]->span && chans[i]->span->dacs) {
- if (((stack.conf.confmode & ZT_CONF_MODE_MASK) == ZT_CONF_DIGITALMON) &&
+ if (((stack.conf.confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_DIGITALMON) &&
chans[stack.conf.confno]->span &&
chans[stack.conf.confno]->span->dacs == chans[i]->span->dacs &&
chans[i]->txgain == defgain &&
@@ -4417,20 +4417,20 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
}
/* if we are going onto a conf */
if (stack.conf.confno &&
- ((stack.conf.confmode & ZT_CONF_MODE_MASK) == ZT_CONF_CONF ||
- (stack.conf.confmode & ZT_CONF_MODE_MASK) == ZT_CONF_CONFANN ||
- (stack.conf.confmode & ZT_CONF_MODE_MASK) == ZT_CONF_CONFMON ||
- (stack.conf.confmode & ZT_CONF_MODE_MASK) == ZT_CONF_CONFANNMON ||
- (stack.conf.confmode & ZT_CONF_MODE_MASK) == ZT_CONF_REALANDPSEUDO)) {
+ ((stack.conf.confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONF ||
+ (stack.conf.confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONFANN ||
+ (stack.conf.confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONFMON ||
+ (stack.conf.confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONFANNMON ||
+ (stack.conf.confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_REALANDPSEUDO)) {
/* Get alias */
- chans[i]->_confn = zt_get_conf_alias(stack.conf.confno);
+ chans[i]->_confn = dahdi_get_conf_alias(stack.conf.confno);
}
if (chans[stack.conf.confno]) {
- if ((stack.conf.confmode & ZT_CONF_MODE_MASK) == ZT_CONF_MONITOR_RX_PREECHO ||
- (stack.conf.confmode & ZT_CONF_MODE_MASK) == ZT_CONF_MONITOR_TX_PREECHO ||
- (stack.conf.confmode & ZT_CONF_MODE_MASK) == ZT_CONF_MONITORBOTH_PREECHO)
- chans[stack.conf.confno]->readchunkpreec = kmalloc(sizeof(*chans[stack.conf.confno]->readchunkpreec) * ZT_CHUNKSIZE, GFP_ATOMIC);
+ if ((stack.conf.confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_MONITOR_RX_PREECHO ||
+ (stack.conf.confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_MONITOR_TX_PREECHO ||
+ (stack.conf.confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_MONITORBOTH_PREECHO)
+ chans[stack.conf.confno]->readchunkpreec = kmalloc(sizeof(*chans[stack.conf.confno]->readchunkpreec) * DAHDI_CHUNKSIZE, GFP_ATOMIC);
else {
if (chans[stack.conf.confno]->readchunkpreec) {
kfree(chans[stack.conf.confno]->readchunkpreec);
@@ -4441,16 +4441,16 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
spin_unlock_irqrestore(&chan->lock, flags);
spin_unlock_irqrestore(&bigzaplock, flagso);
- if (copy_to_user((struct zt_confinfo *) data,&stack.conf,sizeof(stack.conf)))
+ if (copy_to_user((struct dahdi_confinfo *) data,&stack.conf,sizeof(stack.conf)))
return -EFAULT;
break;
- case ZT_CONFLINK: /* do conf link stuff */
- if (!(chan->flags & ZT_FLAG_AUDIO)) return (-EINVAL);
- if (copy_from_user(&stack.conf,(struct zt_confinfo *) data,sizeof(stack.conf)))
+ case DAHDI_CONFLINK: /* do conf link stuff */
+ if (!(chan->flags & DAHDI_FLAG_AUDIO)) return (-EINVAL);
+ if (copy_from_user(&stack.conf,(struct dahdi_confinfo *) data,sizeof(stack.conf)))
return -EFAULT;
/* check sanity of arguments */
- if ((stack.conf.chan < 0) || (stack.conf.chan > ZT_MAX_CONF)) return(-EINVAL);
- if ((stack.conf.confno < 0) || (stack.conf.confno > ZT_MAX_CONF)) return(-EINVAL);
+ if ((stack.conf.chan < 0) || (stack.conf.chan > DAHDI_MAX_CONF)) return(-EINVAL);
+ if ((stack.conf.confno < 0) || (stack.conf.confno > DAHDI_MAX_CONF)) return(-EINVAL);
/* cant listen to self!! */
if (stack.conf.chan && (stack.conf.chan == stack.conf.confno)) return(-EINVAL);
spin_lock_irqsave(&bigzaplock, flagso);
@@ -4467,13 +4467,13 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
}
rv = 0; /* clear return value */
/* look for already existant specified combination */
- for(i = 1; i <= ZT_MAX_CONF; i++)
+ for(i = 1; i <= DAHDI_MAX_CONF; i++)
{
/* if found, exit */
if ((conf_links[i].src == stack.conf.chan) &&
(conf_links[i].dst == stack.conf.confno)) break;
}
- if (i <= ZT_MAX_CONF) /* if found */
+ if (i <= DAHDI_MAX_CONF) /* if found */
{
if (!stack.conf.confmode) /* if to remove link */
{
@@ -4489,14 +4489,14 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
if (stack.conf.confmode) /* if to add link */
{
/* look for empty location */
- for(i = 1; i <= ZT_MAX_CONF; i++)
+ for(i = 1; i <= DAHDI_MAX_CONF; i++)
{
/* if empty, exit loop */
if ((!conf_links[i].src) &&
(!conf_links[i].dst)) break;
}
/* if empty spot found */
- if (i <= ZT_MAX_CONF)
+ if (i <= DAHDI_MAX_CONF)
{
conf_links[i].src = stack.conf.chan;
conf_links[i].dst = stack.conf.confno;
@@ -4515,14 +4515,14 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
spin_unlock_irqrestore(&chan->lock, flags);
spin_unlock_irqrestore(&bigzaplock, flagso);
return(rv);
- case ZT_CONFDIAG: /* output diagnostic info to console */
- if (!(chan->flags & ZT_FLAG_AUDIO)) return (-EINVAL);
+ case DAHDI_CONFDIAG: /* output diagnostic info to console */
+ if (!(chan->flags & DAHDI_FLAG_AUDIO)) return (-EINVAL);
get_user(j,(int *)data); /* get conf # */
/* loop thru the interesting ones */
- for(i = ((j) ? j : 1); i <= ((j) ? j : ZT_MAX_CONF); i++)
+ for(i = ((j) ? j : 1); i <= ((j) ? j : DAHDI_MAX_CONF); i++)
{
c = 0;
- for(k = 1; k < ZT_MAX_CHANNELS; k++)
+ for(k = 1; k < DAHDI_MAX_CHANNELS; k++)
{
/* skip if no pointer */
if (!chans[k]) continue;
@@ -4534,7 +4534,7 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
k,chans[k]->confmode);
}
rv = 0;
- for(k = 1; k <= ZT_MAX_CONF; k++)
+ for(k = 1; k <= DAHDI_MAX_CONF; k++)
{
if (conf_links[k].dst == i)
{
@@ -4548,35 +4548,35 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
if (c) printk("\n");
}
break;
- case ZT_CHANNO: /* get channel number of stream */
+ case DAHDI_CHANNO: /* get channel number of stream */
put_user(unit,(int *)data); /* return unit/channel number */
break;
- case ZT_SETLAW:
+ case DAHDI_SETLAW:
get_user(j, (int *)data);
- if ((j < 0) || (j > ZT_LAW_ALAW))
+ if ((j < 0) || (j > DAHDI_LAW_ALAW))
return -EINVAL;
- zt_set_law(chan, j);
+ dahdi_set_law(chan, j);
break;
- case ZT_SETLINEAR:
+ case DAHDI_SETLINEAR:
get_user(j, (int *)data);
/* Makes no sense on non-audio channels */
- if (!(chan->flags & ZT_FLAG_AUDIO))
+ if (!(chan->flags & DAHDI_FLAG_AUDIO))
return -EINVAL;
if (j)
- chan->flags |= ZT_FLAG_LINEAR;
+ chan->flags |= DAHDI_FLAG_LINEAR;
else
- chan->flags &= ~ZT_FLAG_LINEAR;
+ chan->flags &= ~DAHDI_FLAG_LINEAR;
break;
- case ZT_SETCADENCE:
+ case DAHDI_SETCADENCE:
if (data) {
/* Use specific ring cadence */
- if (copy_from_user(&stack.cad, (struct zt_ring_cadence *)data, sizeof(stack.cad)))
+ if (copy_from_user(&stack.cad, (struct dahdi_ring_cadence *)data, sizeof(stack.cad)))
return -EFAULT;
memcpy(chan->ringcadence, &stack.cad, sizeof(chan->ringcadence));
chan->firstcadencepos = 0;
/* Looking for negative ringing time indicating where to loop back into ringcadence */
- for (i=0; i<ZT_MAX_CADENCE; i+=2 ) {
+ for (i=0; i<DAHDI_MAX_CADENCE; i+=2 ) {
if (chan->ringcadence[i]<0) {
chan->ringcadence[i] *= -1;
chan->firstcadencepos = i;
@@ -4589,7 +4589,7 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
if (chan->curzone) {
memcpy(chan->ringcadence, chan->curzone->ringcadence, sizeof(chan->ringcadence));
/* Looking for negative ringing time indicating where to loop back into ringcadence */
- for (i=0; i<ZT_MAX_CADENCE; i+=2 ) {
+ for (i=0; i<DAHDI_MAX_CADENCE; i+=2 ) {
if (chan->ringcadence[i]<0) {
chan->ringcadence[i] *= -1;
chan->firstcadencepos = i;
@@ -4599,13 +4599,13 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
} else {
memset(chan->ringcadence, 0, sizeof(chan->ringcadence));
chan->ringcadence[0] = chan->starttime;
- chan->ringcadence[1] = ZT_RINGOFFTIME;
+ chan->ringcadence[1] = DAHDI_RINGOFFTIME;
}
}
break;
default:
/* Check for common ioctl's and private ones */
- rv = zt_common_ioctl(inode, file, cmd, data, unit);
+ rv = dahdi_common_ioctl(inode, file, cmd, data, unit);
/* if no span, just return with value */
if (!chan->span) return rv;
if ((rv == -ENOTTY) && chan->span->ioctl)
@@ -4625,7 +4625,7 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
*/
static void do_ppp_calls(unsigned long data)
{
- struct zt_chan *chan = (struct zt_chan *) data;
+ struct dahdi_chan *chan = (struct dahdi_chan *) data;
struct sk_buff *skb;
if (!chan->ppp)
@@ -4643,14 +4643,14 @@ static void do_ppp_calls(unsigned long data)
}
#endif
-static int ioctl_echocancel(struct zt_chan *chan, struct zt_echocanparams *ecp, void *data)
+static int ioctl_echocancel(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp, void *data)
{
struct echo_can_state *ec = NULL, *tec;
- struct zt_echocanparam *params;
+ struct dahdi_echocanparam *params;
int ret;
unsigned long flags;
- if (ecp->param_count > ZT_MAX_ECHOCANPARAMS)
+ if (ecp->param_count > DAHDI_MAX_ECHOCANPARAMS)
return -E2BIG;
if (ecp->tap_length == 0) {
@@ -4676,14 +4676,14 @@ static int ioctl_echocancel(struct zt_chan *chan, struct zt_echocanparams *ecp,
!chan->span->echocan_with_params)
return -EINVAL;
- params = kmalloc(sizeof(params[0]) * ZT_MAX_ECHOCANPARAMS, GFP_KERNEL);
+ params = kmalloc(sizeof(params[0]) * DAHDI_MAX_ECHOCANPARAMS, GFP_KERNEL);
if (!params)
return -ENOMEM;
/* enable mode, need the params */
- if (copy_from_user(params, (struct zt_echocanparam *) data, sizeof(params[0]) * ecp->param_count)) {
+ if (copy_from_user(params, (struct dahdi_echocanparam *) data, sizeof(params[0]) * ecp->param_count)) {
ret = -EFAULT;
goto exit_with_free;
}
@@ -4739,9 +4739,9 @@ exit_with_free:
return ret;
}
-static int zt_chan_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data, int unit)
+static int dahdi_chan_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data, int unit)
{
- struct zt_chan *chan = chans[unit];
+ struct dahdi_chan *chan = chans[unit];
unsigned long flags;
int j, rv;
int ret;
@@ -4753,40 +4753,40 @@ static int zt_chan_ioctl(struct inode *inode, struct file *file, unsigned int cm
return -ENOSYS;
switch(cmd) {
- case ZT_SIGFREEZE:
+ case DAHDI_SIGFREEZE:
get_user(j, (int *)data);
spin_lock_irqsave(&chan->lock, flags);
if (j) {
- chan->flags |= ZT_FLAG_SIGFREEZE;
+ chan->flags |= DAHDI_FLAG_SIGFREEZE;
} else {
- chan->flags &= ~ZT_FLAG_SIGFREEZE;
+ chan->flags &= ~DAHDI_FLAG_SIGFREEZE;
}
spin_unlock_irqrestore(&chan->lock, flags);
break;
- case ZT_GETSIGFREEZE:
+ case DAHDI_GETSIGFREEZE:
spin_lock_irqsave(&chan->lock, flags);
- if (chan->flags & ZT_FLAG_SIGFREEZE)
+ if (chan->flags & DAHDI_FLAG_SIGFREEZE)
j = 1;
else
j = 0;
spin_unlock_irqrestore(&chan->lock, flags);
put_user(j, (int *)data);
break;
- case ZT_AUDIOMODE:
+ case DAHDI_AUDIOMODE:
/* Only literal clear channels can be put in */
- if (chan->sig != ZT_SIG_CLEAR) return (-EINVAL);
+ if (chan->sig != DAHDI_SIG_CLEAR) return (-EINVAL);
get_user(j, (int *)data);
if (j) {
spin_lock_irqsave(&chan->lock, flags);
- chan->flags |= ZT_FLAG_AUDIO;
- chan->flags &= ~(ZT_FLAG_HDLC | ZT_FLAG_FCS);
+ chan->flags |= DAHDI_FLAG_AUDIO;
+ chan->flags &= ~(DAHDI_FLAG_HDLC | DAHDI_FLAG_FCS);
spin_unlock_irqrestore(&chan->lock, flags);
} else {
/* Coming out of audio mode, also clear all
conferencing and gain related info as well
as echo canceller */
spin_lock_irqsave(&chan->lock, flags);
- chan->flags &= ~ZT_FLAG_AUDIO;
+ chan->flags &= ~DAHDI_FLAG_AUDIO;
/* save old conf number, if any */
oldconf = chan->confna;
/* initialize conference variables */
@@ -4820,12 +4820,12 @@ static int zt_chan_ioctl(struct inode *inode, struct file *file, unsigned int cm
kfree(rxgain);
if (ec)
echo_can_free(ec);
- if (oldconf) zt_check_conf(oldconf);
+ if (oldconf) dahdi_check_conf(oldconf);
}
break;
- case ZT_HDLCPPP:
+ case DAHDI_HDLCPPP:
#ifdef CONFIG_ZAPATA_PPP
- if (chan->sig != ZT_SIG_CLEAR) return (-EINVAL);
+ if (chan->sig != DAHDI_SIG_CLEAR) return (-EINVAL);
get_user(j, (int *)data);
if (j) {
if (!chan->ppp) {
@@ -4835,13 +4835,13 @@ static int zt_chan_ioctl(struct inode *inode, struct file *file, unsigned int cm
memset(chan->ppp, 0, sizeof(struct ppp_channel));
chan->ppp->private = chan;
chan->ppp->ops = &ztppp_ops;
- chan->ppp->mtu = ZT_DEFAULT_MTU_MRU;
+ chan->ppp->mtu = DAHDI_DEFAULT_MTU_MRU;
chan->ppp->hdrlen = 0;
skb_queue_head_init(&chan->ppp_rq);
chan->do_ppp_wakeup = 0;
tasklet_init(&chan->ppp_calls, do_ppp_calls,
(unsigned long)chan);
- if ((ret = zt_reallocbufs(chan, ZT_DEFAULT_MTU_MRU, ZT_DEFAULT_NUM_BUFS))) {
+ if ((ret = dahdi_reallocbufs(chan, DAHDI_DEFAULT_MTU_MRU, DAHDI_DEFAULT_NUM_BUFS))) {
kfree(chan->ppp);
chan->ppp = NULL;
return ret;
@@ -4864,8 +4864,8 @@ static int zt_chan_ioctl(struct inode *inode, struct file *file, unsigned int cm
chan->rxgain = defgain;
chan->txgain = defgain;
chan->gainalloc = 0;
- chan->flags &= ~ZT_FLAG_AUDIO;
- chan->flags |= (ZT_FLAG_PPP | ZT_FLAG_HDLC | ZT_FLAG_FCS);
+ chan->flags &= ~DAHDI_FLAG_AUDIO;
+ chan->flags |= (DAHDI_FLAG_PPP | DAHDI_FLAG_HDLC | DAHDI_FLAG_FCS);
hw_echocancel_off(chan);
if (tec)
@@ -4874,7 +4874,7 @@ static int zt_chan_ioctl(struct inode *inode, struct file *file, unsigned int cm
return -ENOMEM;
}
} else {
- chan->flags &= ~(ZT_FLAG_PPP | ZT_FLAG_HDLC | ZT_FLAG_FCS);
+ chan->flags &= ~(DAHDI_FLAG_PPP | DAHDI_FLAG_HDLC | DAHDI_FLAG_FCS);
if (chan->ppp) {
struct ppp_channel *ppp = chan->ppp;
chan->ppp = NULL;
@@ -4889,44 +4889,44 @@ static int zt_chan_ioctl(struct inode *inode, struct file *file, unsigned int cm
return -ENOSYS;
#endif
break;
- case ZT_HDLCRAWMODE:
- if (chan->sig != ZT_SIG_CLEAR) return (-EINVAL);
+ case DAHDI_HDLCRAWMODE:
+ if (chan->sig != DAHDI_SIG_CLEAR) return (-EINVAL);
get_user(j, (int *)data);
- chan->flags &= ~(ZT_FLAG_AUDIO | ZT_FLAG_HDLC | ZT_FLAG_FCS);
+ chan->flags &= ~(DAHDI_FLAG_AUDIO | DAHDI_FLAG_HDLC | DAHDI_FLAG_FCS);
if (j) {
- chan->flags |= ZT_FLAG_HDLC;
+ chan->flags |= DAHDI_FLAG_HDLC;
fasthdlc_init(&chan->rxhdlc);
fasthdlc_init(&chan->txhdlc);
}
break;
- case ZT_HDLCFCSMODE:
- if (chan->sig != ZT_SIG_CLEAR) return (-EINVAL);
+ case DAHDI_HDLCFCSMODE:
+ if (chan->sig != DAHDI_SIG_CLEAR) return (-EINVAL);
get_user(j, (int *)data);
- chan->flags &= ~(ZT_FLAG_AUDIO | ZT_FLAG_HDLC | ZT_FLAG_FCS);
+ chan->flags &= ~(DAHDI_FLAG_AUDIO | DAHDI_FLAG_HDLC | DAHDI_FLAG_FCS);
if (j) {
- chan->flags |= ZT_FLAG_HDLC | ZT_FLAG_FCS;
+ chan->flags |= DAHDI_FLAG_HDLC | DAHDI_FLAG_FCS;
fasthdlc_init(&chan->rxhdlc);
fasthdlc_init(&chan->txhdlc);
}
break;
- case ZT_ECHOCANCEL_PARAMS:
+ case DAHDI_ECHOCANCEL_PARAMS:
{
- struct zt_echocanparams ecp;
+ struct dahdi_echocanparams ecp;
- if (!(chan->flags & ZT_FLAG_AUDIO))
+ if (!(chan->flags & DAHDI_FLAG_AUDIO))
return -EINVAL;
- if (copy_from_user(&ecp, (struct zt_echocanparams *) data, sizeof(ecp)))
+ if (copy_from_user(&ecp, (struct dahdi_echocanparams *) data, sizeof(ecp)))
return -EFAULT;
data += sizeof(ecp);
if ((ret = ioctl_echocancel(chan, &ecp, (void *) data)))
return ret;
break;
}
- case ZT_ECHOCANCEL:
+ case DAHDI_ECHOCANCEL:
{
- struct zt_echocanparams ecp;
+ struct dahdi_echocanparams ecp;
- if (!(chan->flags & ZT_FLAG_AUDIO))
+ if (!(chan->flags & DAHDI_FLAG_AUDIO))
return -EINVAL;
get_user(j, (int *) data);
ecp.tap_length = j;
@@ -4935,9 +4935,9 @@ static int zt_chan_ioctl(struct inode *inode, struct file *file, unsigned int cm
return ret;
break;
}
- case ZT_ECHOTRAIN:
+ case DAHDI_ECHOTRAIN:
get_user(j, (int *)data); /* get pre-training time from user */
- if ((j < 0) || (j >= ZT_MAX_PRETRAINING))
+ if ((j < 0) || (j >= DAHDI_MAX_PRETRAINING))
return -EINVAL;
j <<= 3;
if (chan->ec) {
@@ -4947,32 +4947,32 @@ static int zt_chan_ioctl(struct inode *inode, struct file *file, unsigned int cm
} else
return -EINVAL;
break;
- case ZT_SETTXBITS:
- if (chan->sig != ZT_SIG_CAS)
+ case DAHDI_SETTXBITS:
+ if (chan->sig != DAHDI_SIG_CAS)
return -EINVAL;
get_user(j,(int *)data);
- zt_cas_setbits(chan, j);
+ dahdi_cas_setbits(chan, j);
rv = 0;
break;
- case ZT_GETRXBITS:
+ case DAHDI_GETRXBITS:
put_user(chan->rxsig, (int *)data);
rv = 0;
break;
- case ZT_LOOPBACK:
+ case DAHDI_LOOPBACK:
get_user(j, (int *)data);
spin_lock_irqsave(&chan->lock, flags);
if (j)
- chan->flags |= ZT_FLAG_LOOPED;
+ chan->flags |= DAHDI_FLAG_LOOPED;
else
- chan->flags &= ~ZT_FLAG_LOOPED;
+ chan->flags &= ~DAHDI_FLAG_LOOPED;
spin_unlock_irqrestore(&chan->lock, flags);
rv = 0;
break;
- case ZT_HOOK:
+ case DAHDI_HOOK:
get_user(j,(int *)data);
- if (chan->flags & ZT_FLAG_CLEAR)
+ if (chan->flags & DAHDI_FLAG_CLEAR)
return -EINVAL;
- if (chan->sig == ZT_SIG_CAS)
+ if (chan->sig == DAHDI_SIG_CAS)
return -EINVAL;
/* if no span, just do nothing */
if (!chan->span) return(0);
@@ -4984,42 +4984,42 @@ static int zt_chan_ioctl(struct inode *inode, struct file *file, unsigned int cm
chan->tonep = 0;
chan->pdialcount = 0;
spin_unlock_irqrestore(&chan->lock, flags);
- if (chan->span->flags & ZT_FLAG_RBS) {
+ if (chan->span->flags & DAHDI_FLAG_RBS) {
switch (j) {
- case ZT_ONHOOK:
+ case DAHDI_ONHOOK:
spin_lock_irqsave(&chan->lock, flags);
- zt_hangup(chan);
+ dahdi_hangup(chan);
spin_unlock_irqrestore(&chan->lock, flags);
break;
- case ZT_OFFHOOK:
+ case DAHDI_OFFHOOK:
spin_lock_irqsave(&chan->lock, flags);
- if ((chan->txstate == ZT_TXSTATE_KEWL) ||
- (chan->txstate == ZT_TXSTATE_AFTERKEWL)) {
+ if ((chan->txstate == DAHDI_TXSTATE_KEWL) ||
+ (chan->txstate == DAHDI_TXSTATE_AFTERKEWL)) {
spin_unlock_irqrestore(&chan->lock, flags);
return -EBUSY;
}
- zt_rbs_sethook(chan, ZT_TXSIG_OFFHOOK, ZT_TXSTATE_DEBOUNCE, chan->debouncetime);
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_OFFHOOK, DAHDI_TXSTATE_DEBOUNCE, chan->debouncetime);
spin_unlock_irqrestore(&chan->lock, flags);
break;
- case ZT_RING:
- case ZT_START:
+ case DAHDI_RING:
+ case DAHDI_START:
spin_lock_irqsave(&chan->lock, flags);
if (!chan->curzone) {
spin_unlock_irqrestore(&chan->lock, flags);
printk(KERN_WARNING "zaptel: Cannot start tone until a tone zone is loaded.\n");
return -ENODATA;
}
- if (chan->txstate != ZT_TXSTATE_ONHOOK) {
+ if (chan->txstate != DAHDI_TXSTATE_ONHOOK) {
spin_unlock_irqrestore(&chan->lock, flags);
return -EBUSY;
}
- if (chan->sig & __ZT_SIG_FXO) {
+ if (chan->sig & __DAHDI_SIG_FXO) {
ret = 0;
chan->cadencepos = 0;
ret = chan->ringcadence[0];
- zt_rbs_sethook(chan, ZT_TXSIG_START, ZT_TXSTATE_RINGON, ret);
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_START, DAHDI_TXSTATE_RINGON, ret);
} else
- zt_rbs_sethook(chan, ZT_TXSIG_START, ZT_TXSTATE_START, chan->starttime);
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_START, DAHDI_TXSTATE_START, chan->starttime);
spin_unlock_irqrestore(&chan->lock, flags);
if (file->f_flags & O_NONBLOCK)
return -EINPROGRESS;
@@ -5029,35 +5029,35 @@ static int zt_chan_ioctl(struct inode *inode, struct file *file, unsigned int cm
#endif
rv = 0;
break;
- case ZT_WINK:
+ case DAHDI_WINK:
spin_lock_irqsave(&chan->lock, flags);
- if (chan->txstate != ZT_TXSTATE_ONHOOK) {
+ if (chan->txstate != DAHDI_TXSTATE_ONHOOK) {
spin_unlock_irqrestore(&chan->lock, flags);
return -EBUSY;
}
- zt_rbs_sethook(chan, ZT_TXSIG_ONHOOK, ZT_TXSTATE_PREWINK, chan->prewinktime);
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_ONHOOK, DAHDI_TXSTATE_PREWINK, chan->prewinktime);
spin_unlock_irqrestore(&chan->lock, flags);
if (file->f_flags & O_NONBLOCK)
return -EINPROGRESS;
rv = schluffen(&chan->txstateq);
if (rv) return rv;
break;
- case ZT_FLASH:
+ case DAHDI_FLASH:
spin_lock_irqsave(&chan->lock, flags);
- if (chan->txstate != ZT_TXSTATE_OFFHOOK) {
+ if (chan->txstate != DAHDI_TXSTATE_OFFHOOK) {
spin_unlock_irqrestore(&chan->lock, flags);
return -EBUSY;
}
- zt_rbs_sethook(chan, ZT_TXSIG_OFFHOOK, ZT_TXSTATE_PREFLASH, chan->preflashtime);
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_OFFHOOK, DAHDI_TXSTATE_PREFLASH, chan->preflashtime);
spin_unlock_irqrestore(&chan->lock, flags);
if (file->f_flags & O_NONBLOCK)
return -EINPROGRESS;
rv = schluffen(&chan->txstateq);
if (rv) return rv;
break;
- case ZT_RINGOFF:
+ case DAHDI_RINGOFF:
spin_lock_irqsave(&chan->lock, flags);
- zt_rbs_sethook(chan, ZT_TXSIG_ONHOOK, ZT_TXSTATE_ONHOOK, 0);
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_ONHOOK, DAHDI_TXSTATE_ONHOOK, 0);
spin_unlock_irqrestore(&chan->lock, flags);
break;
default:
@@ -5073,27 +5073,27 @@ static int zt_chan_ioctl(struct inode *inode, struct file *file, unsigned int cm
break;
#ifdef CONFIG_ZAPATA_PPP
case PPPIOCGCHAN:
- if (chan->flags & ZT_FLAG_PPP)
+ if (chan->flags & DAHDI_FLAG_PPP)
return put_user(ppp_channel_index(chan->ppp), (int *)data) ? -EFAULT : 0;
else
return -EINVAL;
break;
case PPPIOCGUNIT:
- if (chan->flags & ZT_FLAG_PPP)
+ if (chan->flags & DAHDI_FLAG_PPP)
return put_user(ppp_unit_number(chan->ppp), (int *)data) ? -EFAULT : 0;
else
return -EINVAL;
break;
#endif
default:
- return zt_chanandpseudo_ioctl(inode, file, cmd, data, unit);
+ return dahdi_chanandpseudo_ioctl(inode, file, cmd, data, unit);
}
return 0;
}
-static int zt_prechan_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data, int unit)
+static int dahdi_prechan_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data, int unit)
{
- struct zt_chan *chan = file->private_data;
+ struct dahdi_chan *chan = file->private_data;
int channo;
int res;
@@ -5101,13 +5101,13 @@ static int zt_prechan_ioctl(struct inode *inode, struct file *file, unsigned int
printk("Huh? Prechan already has private data??\n");
}
switch(cmd) {
- case ZT_SPECIFY:
+ case DAHDI_SPECIFY:
get_user(channo,(int *)data);
if (channo < 1)
return -EINVAL;
- if (channo > ZT_MAX_CHANNELS)
+ if (channo > DAHDI_MAX_CHANNELS)
return -EINVAL;
- res = zt_specchan_open(inode, file, channo, 0);
+ res = dahdi_specchan_open(inode, file, channo, 0);
if (!res) {
/* Setup the pointer for future stuff */
chan = chans[channo];
@@ -5122,31 +5122,31 @@ static int zt_prechan_ioctl(struct inode *inode, struct file *file, unsigned int
return 0;
}
-static int zt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data)
+static int dahdi_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data)
{
int unit = UNIT(file);
- struct zt_chan *chan;
- struct zt_timer *timer;
+ struct dahdi_chan *chan;
+ struct dahdi_timer *timer;
if (!unit)
- return zt_ctl_ioctl(inode, file, cmd, data);
+ return dahdi_ctl_ioctl(inode, file, cmd, data);
if (unit == 250)
- return zt_transcode_fops->ioctl(inode, file, cmd, data);
+ return dahdi_transcode_fops->ioctl(inode, file, cmd, data);
if (unit == 253) {
timer = file->private_data;
if (timer)
- return zt_timer_ioctl(inode, file, cmd, data, timer);
+ return dahdi_timer_ioctl(inode, file, cmd, data, timer);
else
return -EINVAL;
}
if (unit == 254) {
chan = file->private_data;
if (chan)
- return zt_chan_ioctl(inode, file, cmd, data, chan->channo);
+ return dahdi_chan_ioctl(inode, file, cmd, data, chan->channo);
else
- return zt_prechan_ioctl(inode, file, cmd, data, unit);
+ return dahdi_prechan_ioctl(inode, file, cmd, data, unit);
}
if (unit == 255) {
chan = file->private_data;
@@ -5154,12 +5154,12 @@ static int zt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
printk("No pseudo channel structure to read?\n");
return -EINVAL;
}
- return zt_chanandpseudo_ioctl(inode, file, cmd, data, chan->channo);
+ return dahdi_chanandpseudo_ioctl(inode, file, cmd, data, chan->channo);
}
- return zt_chan_ioctl(inode, file, cmd, data, unit);
+ return dahdi_chan_ioctl(inode, file, cmd, data, unit);
}
-int zt_register(struct zt_span *span, int prefmaster)
+int dahdi_register(struct dahdi_span *span, int prefmaster)
{
int x;
@@ -5168,7 +5168,7 @@ int zt_register(struct zt_span *span, int prefmaster)
#endif
if (!span)
return -EINVAL;
- if (span->flags & ZT_FLAG_REGISTERED) {
+ if (span->flags & DAHDI_FLAG_REGISTERED) {
printk(KERN_ERR "Span %s already appears to be registered\n", span->name);
return -EBUSY;
}
@@ -5177,10 +5177,10 @@ int zt_register(struct zt_span *span, int prefmaster)
printk(KERN_ERR "Span %s already in list\n", span->name);
return -EBUSY;
}
- for (x=1;x<ZT_MAX_SPANS;x++)
+ for (x=1;x<DAHDI_MAX_SPANS;x++)
if (!spans[x])
break;
- if (x < ZT_MAX_SPANS) {
+ if (x < DAHDI_MAX_SPANS) {
spans[x] = span;
if (maxspans < x + 1)
maxspans = x + 1;
@@ -5188,12 +5188,12 @@ int zt_register(struct zt_span *span, int prefmaster)
printk(KERN_ERR "Too many zapata spans registered\n");
return -EBUSY;
}
- span->flags |= ZT_FLAG_REGISTERED;
+ span->flags |= DAHDI_FLAG_REGISTERED;
span->spanno = x;
spin_lock_init(&span->lock);
if (!span->deflaw) {
printk("zaptel: Span %s didn't specify default law. Assuming mulaw, please fix driver!\n", span->name);
- span->deflaw = ZT_LAW_MULAW;
+ span->deflaw = DAHDI_LAW_MULAW;
}
if (span->echocan && span->echocan_with_params) {
@@ -5203,7 +5203,7 @@ int zt_register(struct zt_span *span, int prefmaster)
for (x=0;x<span->channels;x++) {
span->chans[x].span = span;
- zt_chan_reg(&span->chans[x]);
+ dahdi_chan_reg(&span->chans[x]);
}
#ifdef CONFIG_PROC_FS
@@ -5217,7 +5217,7 @@ int zt_register(struct zt_span *span, int prefmaster)
sprintf(span_name, "span%d", span->spanno);
span->dhandle = devfs_mk_dir(zaptel_devfs_dir, span_name, NULL);
for (x = 0; x < span->channels; x++) {
- struct zt_chan *chan = &span->chans[x];
+ struct dahdi_chan *chan = &span->chans[x];
chan->fhandle = register_devfs_channel(chan, chan->span->dhandle); /* Register our stuff with devfs */
}
}
@@ -5228,7 +5228,7 @@ int zt_register(struct zt_span *span, int prefmaster)
char chan_name[50];
if (span->chans[x].channo < 250) {
sprintf(chan_name, "zap%d", span->chans[x].channo);
- CLASS_DEV_CREATE(zap_class, MKDEV(ZT_MAJOR, span->chans[x].channo), NULL, chan_name);
+ CLASS_DEV_CREATE(zap_class, MKDEV(DAHDI_MAJOR, span->chans[x].channo), NULL, chan_name);
}
}
#endif /* CONFIG_ZAP_UDEV */
@@ -5243,22 +5243,22 @@ int zt_register(struct zt_span *span, int prefmaster)
return 0;
}
-int zt_unregister(struct zt_span *span)
+int dahdi_unregister(struct dahdi_span *span)
{
int x;
int new_maxspans;
- static struct zt_span *new_master;
+ static struct dahdi_span *new_master;
#ifdef CONFIG_PROC_FS
char tempfile[17];
#endif /* CONFIG_PROC_FS */
- if (!(span->flags & ZT_FLAG_REGISTERED)) {
+ if (!(span->flags & DAHDI_FLAG_REGISTERED)) {
printk(KERN_ERR "Span %s does not appear to be registered\n", span->name);
return -1;
}
/* Shutdown the span if it's running */
- if (span->flags & ZT_FLAG_RUNNING)
+ if (span->flags & DAHDI_FLAG_RUNNING)
if (span->shutdown)
span->shutdown(span);
@@ -5283,20 +5283,20 @@ int zt_unregister(struct zt_span *span)
#ifdef CONFIG_ZAP_UDEV
for (x = 0; x < span->channels; x++) {
if (span->chans[x].channo < 250)
- class_device_destroy(zap_class, MKDEV(ZT_MAJOR, span->chans[x].channo));
+ class_device_destroy(zap_class, MKDEV(DAHDI_MAJOR, span->chans[x].channo));
}
#endif /* CONFIG_ZAP_UDEV */
spans[span->spanno] = NULL;
span->spanno = 0;
- span->flags &= ~ZT_FLAG_REGISTERED;
+ span->flags &= ~DAHDI_FLAG_REGISTERED;
for (x=0;x<span->channels;x++)
- zt_chan_unreg(&span->chans[x]);
+ dahdi_chan_unreg(&span->chans[x]);
new_maxspans = 0;
new_master = master; /* FIXME: locking */
if (master == span)
new_master = NULL;
- for (x=1;x<ZT_MAX_SPANS;x++) {
+ for (x=1;x<DAHDI_MAX_SPANS;x++) {
if (spans[x]) {
new_maxspans = x+1;
if (!new_master)
@@ -5343,7 +5343,7 @@ unsigned char
#else
static unsigned char __init
#endif
-__zt_lineartoulaw(short sample)
+__dahdi_lineartoulaw(short sample)
{
static int exp_lut[256] = {0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
@@ -5388,7 +5388,7 @@ unsigned char
#else
static inline unsigned char __init
#endif
-__zt_lineartoalaw (short linear)
+__dahdi_lineartoalaw (short linear)
{
int mask;
int seg;
@@ -5435,7 +5435,7 @@ static inline short int __init alaw2linear (uint8_t alaw)
return (short int) ((alaw & 0x80) ? i : -i);
}
/*- End of function --------------------------------------------------------*/
-static void __init zt_conv_init(void)
+static void __init dahdi_conv_init(void)
{
int i;
@@ -5453,8 +5453,8 @@ static void __init zt_conv_init(void)
y = f * (1 << (e + 3));
y += etab[e];
if (mu & 0x80) y = -y;
- __zt_mulaw[i] = y;
- __zt_alaw[i] = alaw2linear(i);
+ __dahdi_mulaw[i] = y;
+ __dahdi_alaw[i] = alaw2linear(i);
/* Default (0.0 db) gain table */
defgain[i] = i;
}
@@ -5462,27 +5462,27 @@ static void __init zt_conv_init(void)
/* set up the reverse (mu-law) conversion table */
for(i = -32768; i < 32768; i += 4)
{
- __zt_lin2mu[((unsigned short)(short)i) >> 2] = __zt_lineartoulaw(i);
- __zt_lin2a[((unsigned short)(short)i) >> 2] = __zt_lineartoalaw(i);
+ __dahdi_lin2mu[((unsigned short)(short)i) >> 2] = __dahdi_lineartoulaw(i);
+ __dahdi_lin2a[((unsigned short)(short)i) >> 2] = __dahdi_lineartoalaw(i);
}
#endif
}
-static inline void __zt_process_getaudio_chunk(struct zt_chan *ss, unsigned char *txb)
+static inline void __dahdi_process_getaudio_chunk(struct dahdi_chan *ss, unsigned char *txb)
{
/* We transmit data from our master channel */
/* Called with ss->lock held */
- struct zt_chan *ms = ss->master;
+ struct dahdi_chan *ms = ss->master;
/* Linear representation */
- short getlin[ZT_CHUNKSIZE], k[ZT_CHUNKSIZE];
+ short getlin[DAHDI_CHUNKSIZE], k[DAHDI_CHUNKSIZE];
int x;
/* Okay, now we've got something to transmit */
- for (x=0;x<ZT_CHUNKSIZE;x++)
- getlin[x] = ZT_XLAW(txb[x], ms);
+ for (x=0;x<DAHDI_CHUNKSIZE;x++)
+ getlin[x] = DAHDI_XLAW(txb[x], ms);
#ifndef NO_ECHOCAN_DISABLE
if (ms->ec) {
- for (x=0;x<ZT_CHUNKSIZE;x++) {
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
/* Check for echo cancel disabling tone */
if (echo_can_disable_detector_update(&ms->txecdis, getlin[x])) {
printk("zaptel Disabled echo canceller because of tone (tx) on channel %d\n", ss->channo);
@@ -5492,84 +5492,84 @@ static inline void __zt_process_getaudio_chunk(struct zt_chan *ss, unsigned char
ms->echotimer = 0;
echo_can_free(ms->ec);
ms->ec = NULL;
- __qevent(ss, ZT_EVENT_EC_DISABLED);
+ __qevent(ss, DAHDI_EVENT_EC_DISABLED);
break;
}
}
}
#endif
- if ((!ms->confmute && !ms->dialing) || (ms->flags & ZT_FLAG_PSEUDO)) {
+ if ((!ms->confmute && !ms->dialing) || (ms->flags & DAHDI_FLAG_PSEUDO)) {
/* Handle conferencing on non-clear channel and non-HDLC channels */
- switch(ms->confmode & ZT_CONF_MODE_MASK) {
- case ZT_CONF_NORMAL:
+ switch(ms->confmode & DAHDI_CONF_MODE_MASK) {
+ case DAHDI_CONF_NORMAL:
/* Do nuffin */
break;
- case ZT_CONF_MONITOR: /* Monitor a channel's rx mode */
+ case DAHDI_CONF_MONITOR: /* Monitor a channel's rx mode */
/* if a pseudo-channel, ignore */
- if (ms->flags & ZT_FLAG_PSEUDO) break;
+ if (ms->flags & DAHDI_FLAG_PSEUDO) break;
/* Add monitored channel */
- if (chans[ms->confna]->flags & ZT_FLAG_PSEUDO) {
+ if (chans[ms->confna]->flags & DAHDI_FLAG_PSEUDO) {
ACSS(getlin, chans[ms->confna]->getlin);
} else {
ACSS(getlin, chans[ms->confna]->putlin);
}
- for (x=0;x<ZT_CHUNKSIZE;x++)
- txb[x] = ZT_LIN2X(getlin[x], ms);
+ for (x=0;x<DAHDI_CHUNKSIZE;x++)
+ txb[x] = DAHDI_LIN2X(getlin[x], ms);
break;
- case ZT_CONF_MONITORTX: /* Monitor a channel's tx mode */
+ case DAHDI_CONF_MONITORTX: /* Monitor a channel's tx mode */
/* if a pseudo-channel, ignore */
- if (ms->flags & ZT_FLAG_PSEUDO) break;
+ if (ms->flags & DAHDI_FLAG_PSEUDO) break;
/* Add monitored channel */
- if (chans[ms->confna]->flags & ZT_FLAG_PSEUDO) {
+ if (chans[ms->confna]->flags & DAHDI_FLAG_PSEUDO) {
ACSS(getlin, chans[ms->confna]->putlin);
} else {
ACSS(getlin, chans[ms->confna]->getlin);
}
- for (x=0;x<ZT_CHUNKSIZE;x++)
- txb[x] = ZT_LIN2X(getlin[x], ms);
+ for (x=0;x<DAHDI_CHUNKSIZE;x++)
+ txb[x] = DAHDI_LIN2X(getlin[x], ms);
break;
- case ZT_CONF_MONITORBOTH: /* monitor a channel's rx and tx mode */
+ case DAHDI_CONF_MONITORBOTH: /* monitor a channel's rx and tx mode */
/* if a pseudo-channel, ignore */
- if (ms->flags & ZT_FLAG_PSEUDO) break;
+ if (ms->flags & DAHDI_FLAG_PSEUDO) break;
ACSS(getlin, chans[ms->confna]->putlin);
ACSS(getlin, chans[ms->confna]->getlin);
- for (x=0;x<ZT_CHUNKSIZE;x++)
- txb[x] = ZT_LIN2X(getlin[x], ms);
+ for (x=0;x<DAHDI_CHUNKSIZE;x++)
+ txb[x] = DAHDI_LIN2X(getlin[x], ms);
break;
- case ZT_CONF_MONITOR_RX_PREECHO: /* Monitor a channel's rx mode */
+ case DAHDI_CONF_MONITOR_RX_PREECHO: /* Monitor a channel's rx mode */
/* if a pseudo-channel, ignore */
- if (ms->flags & ZT_FLAG_PSEUDO)
+ if (ms->flags & DAHDI_FLAG_PSEUDO)
break;
if (!chans[ms->confna]->readchunkpreec)
break;
/* Add monitored channel */
- ACSS(getlin, chans[ms->confna]->flags & ZT_FLAG_PSEUDO ?
+ ACSS(getlin, chans[ms->confna]->flags & DAHDI_FLAG_PSEUDO ?
chans[ms->confna]->readchunkpreec : chans[ms->confna]->putlin);
- for (x = 0; x < ZT_CHUNKSIZE; x++)
- txb[x] = ZT_LIN2X(getlin[x], ms);
+ for (x = 0; x < DAHDI_CHUNKSIZE; x++)
+ txb[x] = DAHDI_LIN2X(getlin[x], ms);
break;
- case ZT_CONF_MONITOR_TX_PREECHO: /* Monitor a channel's tx mode */
+ case DAHDI_CONF_MONITOR_TX_PREECHO: /* Monitor a channel's tx mode */
/* if a pseudo-channel, ignore */
- if (ms->flags & ZT_FLAG_PSEUDO)
+ if (ms->flags & DAHDI_FLAG_PSEUDO)
break;
if (!chans[ms->confna]->readchunkpreec)
break;
/* Add monitored channel */
- ACSS(getlin, chans[ms->confna]->flags & ZT_FLAG_PSEUDO ?
+ ACSS(getlin, chans[ms->confna]->flags & DAHDI_FLAG_PSEUDO ?
chans[ms->confna]->putlin : chans[ms->confna]->readchunkpreec);
- for (x = 0; x < ZT_CHUNKSIZE; x++)
- txb[x] = ZT_LIN2X(getlin[x], ms);
+ for (x = 0; x < DAHDI_CHUNKSIZE; x++)
+ txb[x] = DAHDI_LIN2X(getlin[x], ms);
break;
- case ZT_CONF_MONITORBOTH_PREECHO: /* monitor a channel's rx and tx mode */
+ case DAHDI_CONF_MONITORBOTH_PREECHO: /* monitor a channel's rx and tx mode */
/* if a pseudo-channel, ignore */
- if (ms->flags & ZT_FLAG_PSEUDO)
+ if (ms->flags & DAHDI_FLAG_PSEUDO)
break;
if (!chans[ms->confna]->readchunkpreec)
@@ -5578,144 +5578,144 @@ static inline void __zt_process_getaudio_chunk(struct zt_chan *ss, unsigned char
ACSS(getlin, chans[ms->confna]->putlin);
ACSS(getlin, chans[ms->confna]->readchunkpreec);
- for (x = 0; x < ZT_CHUNKSIZE; x++)
- txb[x] = ZT_LIN2X(getlin[x], ms);
+ for (x = 0; x < DAHDI_CHUNKSIZE; x++)
+ txb[x] = DAHDI_LIN2X(getlin[x], ms);
break;
- case ZT_CONF_REALANDPSEUDO:
+ case DAHDI_CONF_REALANDPSEUDO:
/* This strange mode takes the transmit buffer and
puts it on the conference, minus its last sample,
then outputs from the conference minus the
real channel's last sample. */
/* if to talk on conf */
- if (ms->confmode & ZT_CONF_PSEUDO_TALKER) {
+ if (ms->confmode & DAHDI_CONF_PSEUDO_TALKER) {
/* Store temp value */
- memcpy(k, getlin, ZT_CHUNKSIZE * sizeof(short));
+ memcpy(k, getlin, DAHDI_CHUNKSIZE * sizeof(short));
/* Add conf value */
ACSS(k, conf_sums_next[ms->_confn]);
/* save last one */
- memcpy(ms->conflast2, ms->conflast1, ZT_CHUNKSIZE * sizeof(short));
- memcpy(ms->conflast1, k, ZT_CHUNKSIZE * sizeof(short));
+ memcpy(ms->conflast2, ms->conflast1, DAHDI_CHUNKSIZE * sizeof(short));
+ memcpy(ms->conflast1, k, DAHDI_CHUNKSIZE * sizeof(short));
/* get amount actually added */
SCSS(ms->conflast1, conf_sums_next[ms->_confn]);
/* Really add in new value */
ACSS(conf_sums_next[ms->_confn], ms->conflast1);
} else {
- memset(ms->conflast1, 0, ZT_CHUNKSIZE * sizeof(short));
- memset(ms->conflast2, 0, ZT_CHUNKSIZE * sizeof(short));
+ memset(ms->conflast1, 0, DAHDI_CHUNKSIZE * sizeof(short));
+ memset(ms->conflast2, 0, DAHDI_CHUNKSIZE * sizeof(short));
}
- memset(getlin, 0, ZT_CHUNKSIZE * sizeof(short));
- txb[0] = ZT_LIN2X(0, ms);
- memset(txb + 1, txb[0], ZT_CHUNKSIZE - 1);
+ memset(getlin, 0, DAHDI_CHUNKSIZE * sizeof(short));
+ txb[0] = DAHDI_LIN2X(0, ms);
+ memset(txb + 1, txb[0], DAHDI_CHUNKSIZE - 1);
/* fall through to normal conf mode */
- case ZT_CONF_CONF: /* Normal conference mode */
- if (ms->flags & ZT_FLAG_PSEUDO) /* if pseudo-channel */
+ case DAHDI_CONF_CONF: /* Normal conference mode */
+ if (ms->flags & DAHDI_FLAG_PSEUDO) /* if pseudo-channel */
{
/* if to talk on conf */
- if (ms->confmode & ZT_CONF_TALKER) {
+ if (ms->confmode & DAHDI_CONF_TALKER) {
/* Store temp value */
- memcpy(k, getlin, ZT_CHUNKSIZE * sizeof(short));
+ memcpy(k, getlin, DAHDI_CHUNKSIZE * sizeof(short));
/* Add conf value */
ACSS(k, conf_sums[ms->_confn]);
/* get amount actually added */
- memcpy(ms->conflast, k, ZT_CHUNKSIZE * sizeof(short));
+ memcpy(ms->conflast, k, DAHDI_CHUNKSIZE * sizeof(short));
SCSS(ms->conflast, conf_sums[ms->_confn]);
/* Really add in new value */
ACSS(conf_sums[ms->_confn], ms->conflast);
- memcpy(ms->getlin, getlin, ZT_CHUNKSIZE * sizeof(short));
+ memcpy(ms->getlin, getlin, DAHDI_CHUNKSIZE * sizeof(short));
} else {
- memset(ms->conflast, 0, ZT_CHUNKSIZE * sizeof(short));
- memcpy(getlin, ms->getlin, ZT_CHUNKSIZE * sizeof(short));
+ memset(ms->conflast, 0, DAHDI_CHUNKSIZE * sizeof(short));
+ memcpy(getlin, ms->getlin, DAHDI_CHUNKSIZE * sizeof(short));
}
- txb[0] = ZT_LIN2X(0, ms);
- memset(txb + 1, txb[0], ZT_CHUNKSIZE - 1);
+ txb[0] = DAHDI_LIN2X(0, ms);
+ memset(txb + 1, txb[0], DAHDI_CHUNKSIZE - 1);
break;
}
/* fall through */
- case ZT_CONF_CONFMON: /* Conference monitor mode */
- if (ms->confmode & ZT_CONF_LISTENER) {
+ case DAHDI_CONF_CONFMON: /* Conference monitor mode */
+ if (ms->confmode & DAHDI_CONF_LISTENER) {
/* Subtract out last sample written to conf */
SCSS(getlin, ms->conflast);
/* Add in conference */
ACSS(getlin, conf_sums[ms->_confn]);
}
- for (x=0;x<ZT_CHUNKSIZE;x++)
- txb[x] = ZT_LIN2X(getlin[x], ms);
+ for (x=0;x<DAHDI_CHUNKSIZE;x++)
+ txb[x] = DAHDI_LIN2X(getlin[x], ms);
break;
- case ZT_CONF_CONFANN:
- case ZT_CONF_CONFANNMON:
+ case DAHDI_CONF_CONFANN:
+ case DAHDI_CONF_CONFANNMON:
/* First, add tx buffer to conf */
ACSS(conf_sums_next[ms->_confn], getlin);
/* Start with silence */
- memset(getlin, 0, ZT_CHUNKSIZE * sizeof(short));
+ memset(getlin, 0, DAHDI_CHUNKSIZE * sizeof(short));
/* If a listener on the conf... */
- if (ms->confmode & ZT_CONF_LISTENER) {
+ if (ms->confmode & DAHDI_CONF_LISTENER) {
/* Subtract last value written */
SCSS(getlin, ms->conflast);
/* Add in conf */
ACSS(getlin, conf_sums[ms->_confn]);
}
- for (x=0;x<ZT_CHUNKSIZE;x++)
- txb[x] = ZT_LIN2X(getlin[x], ms);
+ for (x=0;x<DAHDI_CHUNKSIZE;x++)
+ txb[x] = DAHDI_LIN2X(getlin[x], ms);
break;
- case ZT_CONF_DIGITALMON:
+ case DAHDI_CONF_DIGITALMON:
/* Real digital monitoring, but still echo cancel if desired */
if (!chans[ms->confna])
break;
- if (chans[ms->confna]->flags & ZT_FLAG_PSEUDO) {
+ if (chans[ms->confna]->flags & DAHDI_FLAG_PSEUDO) {
if (ms->ec) {
- for (x=0;x<ZT_CHUNKSIZE;x++)
- txb[x] = ZT_LIN2X(chans[ms->confna]->getlin[x], ms);
+ for (x=0;x<DAHDI_CHUNKSIZE;x++)
+ txb[x] = DAHDI_LIN2X(chans[ms->confna]->getlin[x], ms);
} else {
- memcpy(txb, chans[ms->confna]->getraw, ZT_CHUNKSIZE);
+ memcpy(txb, chans[ms->confna]->getraw, DAHDI_CHUNKSIZE);
}
} else {
if (ms->ec) {
- for (x=0;x<ZT_CHUNKSIZE;x++)
- txb[x] = ZT_LIN2X(chans[ms->confna]->putlin[x], ms);
+ for (x=0;x<DAHDI_CHUNKSIZE;x++)
+ txb[x] = DAHDI_LIN2X(chans[ms->confna]->putlin[x], ms);
} else {
- memcpy(txb, chans[ms->confna]->putraw, ZT_CHUNKSIZE);
+ memcpy(txb, chans[ms->confna]->putraw, DAHDI_CHUNKSIZE);
}
}
- for (x=0;x<ZT_CHUNKSIZE;x++)
- getlin[x] = ZT_XLAW(txb[x], ms);
+ for (x=0;x<DAHDI_CHUNKSIZE;x++)
+ getlin[x] = DAHDI_XLAW(txb[x], ms);
break;
}
}
if (ms->confmute || (ms->echostate & __ECHO_STATE_MUTE)) {
- txb[0] = ZT_LIN2X(0, ms);
- memset(txb + 1, txb[0], ZT_CHUNKSIZE - 1);
+ txb[0] = DAHDI_LIN2X(0, ms);
+ memset(txb + 1, txb[0], DAHDI_CHUNKSIZE - 1);
if (ms->echostate == ECHO_STATE_STARTTRAINING) {
/* Transmit impulse now */
- txb[0] = ZT_LIN2X(16384, ms);
+ txb[0] = DAHDI_LIN2X(16384, ms);
ms->echostate = ECHO_STATE_AWAITINGECHO;
}
}
/* save value from last chunk */
- memcpy(ms->getlin_lastchunk, ms->getlin, ZT_CHUNKSIZE * sizeof(short));
+ memcpy(ms->getlin_lastchunk, ms->getlin, DAHDI_CHUNKSIZE * sizeof(short));
/* save value from current */
- memcpy(ms->getlin, getlin, ZT_CHUNKSIZE * sizeof(short));
+ memcpy(ms->getlin, getlin, DAHDI_CHUNKSIZE * sizeof(short));
/* save value from current */
- memcpy(ms->getraw, txb, ZT_CHUNKSIZE);
+ memcpy(ms->getraw, txb, DAHDI_CHUNKSIZE);
/* if to make tx tone */
if (ms->v1_1 || ms->v2_1 || ms->v3_1)
{
- for (x=0;x<ZT_CHUNKSIZE;x++)
+ for (x=0;x<DAHDI_CHUNKSIZE;x++)
{
- getlin[x] += zt_txtone_nextsample(ms);
- txb[x] = ZT_LIN2X(getlin[x], ms);
+ getlin[x] += dahdi_txtone_nextsample(ms);
+ txb[x] = DAHDI_LIN2X(getlin[x], ms);
}
}
/* This is what to send (after having applied gain) */
- for (x=0;x<ZT_CHUNKSIZE;x++)
+ for (x=0;x<DAHDI_CHUNKSIZE;x++)
txb[x] = ms->txgain[txb[x]];
}
-static inline void __zt_getbuf_chunk(struct zt_chan *ss, unsigned char *txb)
+static inline void __dahdi_getbuf_chunk(struct dahdi_chan *ss, unsigned char *txb)
{
/* Called with ss->lock held */
/* We transmit data from our master channel */
- struct zt_chan *ms = ss->master;
+ struct dahdi_chan *ms = ss->master;
/* Buffer we're using */
unsigned char *buf;
/* Old buffer number */
@@ -5723,7 +5723,7 @@ static inline void __zt_getbuf_chunk(struct zt_chan *ss, unsigned char *txb)
/* Linear representation */
int getlin;
/* How many bytes we need to process */
- int bytes = ZT_CHUNKSIZE, left;
+ int bytes = DAHDI_CHUNKSIZE, left;
int x;
/* Let's pick something to transmit. First source to
@@ -5735,7 +5735,7 @@ static inline void __zt_getbuf_chunk(struct zt_chan *ss, unsigned char *txb)
left = ms->writen[ms->outwritebuf] - ms->writeidx[ms->outwritebuf];
if (left > bytes)
left = bytes;
- if (ms->flags & ZT_FLAG_HDLC) {
+ if (ms->flags & DAHDI_FLAG_HDLC) {
/* If this is an HDLC channel we only send a byte of
HDLC. */
for(x=0;x<left;x++) {
@@ -5759,26 +5759,26 @@ static inline void __zt_getbuf_chunk(struct zt_chan *ss, unsigned char *txb)
ms->writeidx[oldbuf] = 0;
ms->outwritebuf = (ms->outwritebuf + 1) % ms->numbufs;
- if (!(ms->flags & ZT_FLAG_MTP2)) {
+ if (!(ms->flags & DAHDI_FLAG_MTP2)) {
ms->writen[oldbuf] = 0;
if (ms->outwritebuf == ms->inwritebuf) {
/* Whoopsies, we're run out of buffers. Mark ours
as -1 and wait for the filler to notify us that
there is something to write */
ms->outwritebuf = -1;
- if (ms->iomask & (ZT_IOMUX_WRITE | ZT_IOMUX_WRITEEMPTY))
+ if (ms->iomask & (DAHDI_IOMUX_WRITE | DAHDI_IOMUX_WRITEEMPTY))
wake_up_interruptible(&ms->eventbufq);
/* If we're only supposed to start when full, disable the transmitter */
- if (ms->txbufpolicy == ZT_POLICY_WHEN_FULL)
+ if (ms->txbufpolicy == DAHDI_POLICY_WHEN_FULL)
ms->txdisable = 1;
}
} else {
if (ms->outwritebuf == ms->inwritebuf) {
ms->outwritebuf = oldbuf;
- if (ms->iomask & (ZT_IOMUX_WRITE | ZT_IOMUX_WRITEEMPTY))
+ if (ms->iomask & (DAHDI_IOMUX_WRITE | DAHDI_IOMUX_WRITEEMPTY))
wake_up_interruptible(&ms->eventbufq);
/* If we're only supposed to start when full, disable the transmitter */
- if (ms->txbufpolicy == ZT_POLICY_WHEN_FULL)
+ if (ms->txbufpolicy == DAHDI_POLICY_WHEN_FULL)
ms->txdisable = 1;
}
}
@@ -5797,39 +5797,39 @@ in the read or iomux call, etc). That is why the write and iomux calls start
with an infinite loop that gets broken out of upon an active condition,
otherwise keeps sleeping and looking. The part in this code got "optimized"
out in the later versions, and is put back now. */
- if (!(ms->flags & (ZT_FLAG_NETDEV | ZT_FLAG_PPP))) {
+ if (!(ms->flags & (DAHDI_FLAG_NETDEV | DAHDI_FLAG_PPP))) {
wake_up_interruptible(&ms->writebufq);
wake_up_interruptible(&ms->sel);
- if (ms->iomask & ZT_IOMUX_WRITE)
+ if (ms->iomask & DAHDI_IOMUX_WRITE)
wake_up_interruptible(&ms->eventbufq);
}
/* Transmit a flag if this is an HDLC channel */
- if (ms->flags & ZT_FLAG_HDLC)
+ if (ms->flags & DAHDI_FLAG_HDLC)
fasthdlc_tx_frame_nocheck(&ms->txhdlc);
#ifdef CONFIG_ZAPATA_NET
- if (ms->flags & ZT_FLAG_NETDEV)
+ if (ms->flags & DAHDI_FLAG_NETDEV)
netif_wake_queue(ztchan_to_dev(ms));
#endif
#ifdef CONFIG_ZAPATA_PPP
- if (ms->flags & ZT_FLAG_PPP) {
+ if (ms->flags & DAHDI_FLAG_PPP) {
ms->do_ppp_wakeup = 1;
tasklet_schedule(&ms->ppp_calls);
}
#endif
}
- } else if (ms->curtone && !(ms->flags & ZT_FLAG_PSEUDO)) {
+ } else if (ms->curtone && !(ms->flags & DAHDI_FLAG_PSEUDO)) {
left = ms->curtone->tonesamples - ms->tonep;
if (left > bytes)
left = bytes;
for (x=0;x<left;x++) {
/* Pick our default value from the next sample of the current tone */
- getlin = zt_tone_nextsample(&ms->ts, ms->curtone);
- *(txb++) = ZT_LIN2X(getlin, ms);
+ getlin = dahdi_tone_nextsample(&ms->ts, ms->curtone);
+ *(txb++) = DAHDI_LIN2X(getlin, ms);
}
ms->tonep+=left;
bytes -= left;
if (ms->tonep >= ms->curtone->tonesamples) {
- struct zt_tone *last;
+ struct dahdi_tone *last;
/* Go to the next sample of the tone */
ms->tonep = 0;
last = ms->curtone;
@@ -5840,14 +5840,14 @@ out in the later versions, and is put back now. */
__do_dtmf(ms);
} else {
if (last != ms->curtone)
- zt_init_tone_state(&ms->ts, ms->curtone);
+ dahdi_init_tone_state(&ms->ts, ms->curtone);
}
}
- } else if (ms->flags & ZT_FLAG_LOOPED) {
+ } else if (ms->flags & DAHDI_FLAG_LOOPED) {
for (x = 0; x < bytes; x++)
txb[x] = ms->readchunk[x];
bytes = 0;
- } else if (ms->flags & ZT_FLAG_HDLC) {
+ } else if (ms->flags & DAHDI_FLAG_HDLC) {
for (x=0;x<bytes;x++) {
/* Okay, if we're HDLC, then transmit a flag by default */
if (ms->txhdlc.bits < 8)
@@ -5855,62 +5855,62 @@ out in the later versions, and is put back now. */
*(txb++) = fasthdlc_tx_run_nocheck(&ms->txhdlc);
}
bytes = 0;
- } else if (ms->flags & ZT_FLAG_CLEAR) {
+ } else if (ms->flags & DAHDI_FLAG_CLEAR) {
/* Clear channels that are idle in audio mode need
to send silence; in non-audio mode, always send 0xff
so stupid switches won't consider the channel active
*/
- if (ms->flags & ZT_FLAG_AUDIO) {
- memset(txb, ZT_LIN2X(0, ms), bytes);
+ if (ms->flags & DAHDI_FLAG_AUDIO) {
+ memset(txb, DAHDI_LIN2X(0, ms), bytes);
} else {
memset(txb, 0xFF, bytes);
}
bytes = 0;
} else {
- memset(txb, ZT_LIN2X(0, ms), bytes); /* Lastly we use silence on telephony channels */
+ memset(txb, DAHDI_LIN2X(0, ms), bytes); /* Lastly we use silence on telephony channels */
bytes = 0;
}
}
}
-static inline void rbs_itimer_expire(struct zt_chan *chan)
+static inline void rbs_itimer_expire(struct dahdi_chan *chan)
{
/* the only way this could have gotten here, is if a channel
went onf hook longer then the wink or flash detect timeout */
/* Called with chan->lock held */
switch(chan->sig)
{
- case ZT_SIG_FXOLS: /* if FXO, its definitely on hook */
- case ZT_SIG_FXOGS:
- case ZT_SIG_FXOKS:
- __qevent(chan,ZT_EVENT_ONHOOK);
+ case DAHDI_SIG_FXOLS: /* if FXO, its definitely on hook */
+ case DAHDI_SIG_FXOGS:
+ case DAHDI_SIG_FXOKS:
+ __qevent(chan,DAHDI_EVENT_ONHOOK);
chan->gotgs = 0;
break;
#if defined(EMFLASH) || defined(EMPULSE)
- case ZT_SIG_EM:
- case ZT_SIG_EM_E1:
- if (chan->rxhooksig == ZT_RXSIG_ONHOOK) {
- __qevent(chan,ZT_EVENT_ONHOOK);
+ case DAHDI_SIG_EM:
+ case DAHDI_SIG_EM_E1:
+ if (chan->rxhooksig == DAHDI_RXSIG_ONHOOK) {
+ __qevent(chan,DAHDI_EVENT_ONHOOK);
break;
}
- __qevent(chan,ZT_EVENT_RINGOFFHOOK);
+ __qevent(chan,DAHDI_EVENT_RINGOFFHOOK);
break;
#endif
#ifdef FXSFLASH
- case ZT_SIG_FXSKS:
- if (chan->rxhooksig == ZT_RXSIG_ONHOOK) {
- __qevent(chan, ZT_EVENT_ONHOOK);
+ case DAHDI_SIG_FXSKS:
+ if (chan->rxhooksig == DAHDI_RXSIG_ONHOOK) {
+ __qevent(chan, DAHDI_EVENT_ONHOOK);
break;
}
#endif
/* fall thru intentionally */
default: /* otherwise, its definitely off hook */
- __qevent(chan,ZT_EVENT_RINGOFFHOOK);
+ __qevent(chan,DAHDI_EVENT_RINGOFFHOOK);
break;
}
}
-static inline void __rbs_otimer_expire(struct zt_chan *chan)
+static inline void __rbs_otimer_expire(struct dahdi_chan *chan)
{
int len = 0;
/* Called with chan->lock held */
@@ -5918,10 +5918,10 @@ static inline void __rbs_otimer_expire(struct zt_chan *chan)
chan->otimer = 0;
/* Move to the next timer state */
switch(chan->txstate) {
- case ZT_TXSTATE_RINGOFF:
+ case DAHDI_TXSTATE_RINGOFF:
/* Turn on the ringer now that the silent time has passed */
++chan->cadencepos;
- if (chan->cadencepos >= ZT_MAX_CADENCE)
+ if (chan->cadencepos >= DAHDI_MAX_CADENCE)
chan->cadencepos = chan->firstcadencepos;
len = chan->ringcadence[chan->cadencepos];
@@ -5930,14 +5930,14 @@ static inline void __rbs_otimer_expire(struct zt_chan *chan)
len = chan->ringcadence[chan->cadencepos];
}
- zt_rbs_sethook(chan, ZT_TXSIG_START, ZT_TXSTATE_RINGON, len);
- __qevent(chan, ZT_EVENT_RINGERON);
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_START, DAHDI_TXSTATE_RINGON, len);
+ __qevent(chan, DAHDI_EVENT_RINGERON);
break;
- case ZT_TXSTATE_RINGON:
+ case DAHDI_TXSTATE_RINGON:
/* Turn off the ringer now that the loud time has passed */
++chan->cadencepos;
- if (chan->cadencepos >= ZT_MAX_CADENCE)
+ if (chan->cadencepos >= DAHDI_MAX_CADENCE)
chan->cadencepos = 0;
len = chan->ringcadence[chan->cadencepos];
@@ -5946,93 +5946,93 @@ static inline void __rbs_otimer_expire(struct zt_chan *chan)
len = chan->curzone->ringcadence[chan->cadencepos];
}
- zt_rbs_sethook(chan, ZT_TXSIG_OFFHOOK, ZT_TXSTATE_RINGOFF, len);
- __qevent(chan, ZT_EVENT_RINGEROFF);
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_OFFHOOK, DAHDI_TXSTATE_RINGOFF, len);
+ __qevent(chan, DAHDI_EVENT_RINGEROFF);
break;
- case ZT_TXSTATE_START:
+ case DAHDI_TXSTATE_START:
/* If we were starting, go off hook now ready to debounce */
- zt_rbs_sethook(chan, ZT_TXSIG_OFFHOOK, ZT_TXSTATE_AFTERSTART, ZT_AFTERSTART_TIME);
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_OFFHOOK, DAHDI_TXSTATE_AFTERSTART, DAHDI_AFTERSTART_TIME);
wake_up_interruptible(&chan->txstateq);
break;
- case ZT_TXSTATE_PREWINK:
+ case DAHDI_TXSTATE_PREWINK:
/* Actually wink */
- zt_rbs_sethook(chan, ZT_TXSIG_OFFHOOK, ZT_TXSTATE_WINK, chan->winktime);
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_OFFHOOK, DAHDI_TXSTATE_WINK, chan->winktime);
break;
- case ZT_TXSTATE_WINK:
+ case DAHDI_TXSTATE_WINK:
/* Wink complete, go on hook and stabalize */
- zt_rbs_sethook(chan, ZT_TXSIG_ONHOOK, ZT_TXSTATE_ONHOOK, 0);
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_ONHOOK, DAHDI_TXSTATE_ONHOOK, 0);
if (chan->file && (chan->file->f_flags & O_NONBLOCK))
- __qevent(chan, ZT_EVENT_HOOKCOMPLETE);
+ __qevent(chan, DAHDI_EVENT_HOOKCOMPLETE);
wake_up_interruptible(&chan->txstateq);
break;
- case ZT_TXSTATE_PREFLASH:
+ case DAHDI_TXSTATE_PREFLASH:
/* Actually flash */
- zt_rbs_sethook(chan, ZT_TXSIG_ONHOOK, ZT_TXSTATE_FLASH, chan->flashtime);
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_ONHOOK, DAHDI_TXSTATE_FLASH, chan->flashtime);
break;
- case ZT_TXSTATE_FLASH:
- zt_rbs_sethook(chan, ZT_TXSIG_OFFHOOK, ZT_TXSTATE_OFFHOOK, 0);
+ case DAHDI_TXSTATE_FLASH:
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_OFFHOOK, DAHDI_TXSTATE_OFFHOOK, 0);
if (chan->file && (chan->file->f_flags & O_NONBLOCK))
- __qevent(chan, ZT_EVENT_HOOKCOMPLETE);
+ __qevent(chan, DAHDI_EVENT_HOOKCOMPLETE);
wake_up_interruptible(&chan->txstateq);
break;
- case ZT_TXSTATE_DEBOUNCE:
- zt_rbs_sethook(chan, ZT_TXSIG_OFFHOOK, ZT_TXSTATE_OFFHOOK, 0);
+ case DAHDI_TXSTATE_DEBOUNCE:
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_OFFHOOK, DAHDI_TXSTATE_OFFHOOK, 0);
/* See if we've gone back on hook */
- if ((chan->rxhooksig == ZT_RXSIG_ONHOOK) && (chan->rxflashtime > 2))
- chan->itimerset = chan->itimer = chan->rxflashtime * ZT_CHUNKSIZE;
+ if ((chan->rxhooksig == DAHDI_RXSIG_ONHOOK) && (chan->rxflashtime > 2))
+ chan->itimerset = chan->itimer = chan->rxflashtime * DAHDI_CHUNKSIZE;
wake_up_interruptible(&chan->txstateq);
break;
- case ZT_TXSTATE_AFTERSTART:
- zt_rbs_sethook(chan, ZT_TXSIG_OFFHOOK, ZT_TXSTATE_OFFHOOK, 0);
+ case DAHDI_TXSTATE_AFTERSTART:
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_OFFHOOK, DAHDI_TXSTATE_OFFHOOK, 0);
if (chan->file && (chan->file->f_flags & O_NONBLOCK))
- __qevent(chan, ZT_EVENT_HOOKCOMPLETE);
+ __qevent(chan, DAHDI_EVENT_HOOKCOMPLETE);
wake_up_interruptible(&chan->txstateq);
break;
- case ZT_TXSTATE_KEWL:
- zt_rbs_sethook(chan, ZT_TXSIG_ONHOOK, ZT_TXSTATE_AFTERKEWL, ZT_AFTERKEWLTIME);
+ case DAHDI_TXSTATE_KEWL:
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_ONHOOK, DAHDI_TXSTATE_AFTERKEWL, DAHDI_AFTERKEWLTIME);
if (chan->file && (chan->file->f_flags & O_NONBLOCK))
- __qevent(chan, ZT_EVENT_HOOKCOMPLETE);
+ __qevent(chan, DAHDI_EVENT_HOOKCOMPLETE);
wake_up_interruptible(&chan->txstateq);
break;
- case ZT_TXSTATE_AFTERKEWL:
+ case DAHDI_TXSTATE_AFTERKEWL:
if (chan->kewlonhook) {
- __qevent(chan,ZT_EVENT_ONHOOK);
+ __qevent(chan,DAHDI_EVENT_ONHOOK);
}
- chan->txstate = ZT_TXSTATE_ONHOOK;
+ chan->txstate = DAHDI_TXSTATE_ONHOOK;
chan->gotgs = 0;
break;
- case ZT_TXSTATE_PULSEBREAK:
- zt_rbs_sethook(chan, ZT_TXSIG_OFFHOOK, ZT_TXSTATE_PULSEMAKE,
+ case DAHDI_TXSTATE_PULSEBREAK:
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_OFFHOOK, DAHDI_TXSTATE_PULSEMAKE,
chan->pulsemaketime);
wake_up_interruptible(&chan->txstateq);
break;
- case ZT_TXSTATE_PULSEMAKE:
+ case DAHDI_TXSTATE_PULSEMAKE:
if (chan->pdialcount)
chan->pdialcount--;
if (chan->pdialcount)
{
- zt_rbs_sethook(chan, ZT_TXSIG_ONHOOK,
- ZT_TXSTATE_PULSEBREAK, chan->pulsebreaktime);
+ dahdi_rbs_sethook(chan, DAHDI_TXSIG_ONHOOK,
+ DAHDI_TXSTATE_PULSEBREAK, chan->pulsebreaktime);
break;
}
- chan->txstate = ZT_TXSTATE_PULSEAFTER;
- chan->otimer = chan->pulseaftertime * ZT_CHUNKSIZE;
+ chan->txstate = DAHDI_TXSTATE_PULSEAFTER;
+ chan->otimer = chan->pulseaftertime * DAHDI_CHUNKSIZE;
wake_up_interruptible(&chan->txstateq);
break;
- case ZT_TXSTATE_PULSEAFTER:
- chan->txstate = ZT_TXSTATE_OFFHOOK;
+ case DAHDI_TXSTATE_PULSEAFTER:
+ chan->txstate = DAHDI_TXSTATE_OFFHOOK;
__do_dtmf(chan);
wake_up_interruptible(&chan->txstateq);
break;
@@ -6042,7 +6042,7 @@ static inline void __rbs_otimer_expire(struct zt_chan *chan)
}
}
-static void __zt_hooksig_pvt(struct zt_chan *chan, zt_rxsig_t rxsig)
+static void __dahdi_hooksig_pvt(struct dahdi_chan *chan, dahdi_rxsig_t rxsig)
{
/* State machines for receive hookstate transitions
@@ -6050,24 +6050,24 @@ static void __zt_hooksig_pvt(struct zt_chan *chan, zt_rxsig_t rxsig)
if ((chan->rxhooksig) == rxsig) return;
- if ((chan->flags & ZT_FLAG_SIGFREEZE)) return;
+ if ((chan->flags & DAHDI_FLAG_SIGFREEZE)) return;
chan->rxhooksig = rxsig;
#ifdef RINGBEGIN
- if ((chan->sig & __ZT_SIG_FXS) && (rxsig == ZT_RXSIG_RING) &&
+ if ((chan->sig & __DAHDI_SIG_FXS) && (rxsig == DAHDI_RXSIG_RING) &&
(!chan->ringdebtimer))
- __qevent(chan,ZT_EVENT_RINGBEGIN);
+ __qevent(chan,DAHDI_EVENT_RINGBEGIN);
#endif
switch(chan->sig) {
- case ZT_SIG_EM: /* E and M */
- case ZT_SIG_EM_E1:
+ case DAHDI_SIG_EM: /* E and M */
+ case DAHDI_SIG_EM_E1:
switch(rxsig) {
- case ZT_RXSIG_OFFHOOK: /* went off hook */
+ case DAHDI_RXSIG_OFFHOOK: /* went off hook */
/* The interface is going off hook */
#ifdef EMFLASH
if (chan->itimer)
{
- __qevent(chan,ZT_EVENT_WINKFLASH);
+ __qevent(chan,DAHDI_EVENT_WINKFLASH);
chan->itimerset = chan->itimer = 0;
break;
}
@@ -6076,36 +6076,36 @@ static void __zt_hooksig_pvt(struct zt_chan *chan, zt_rxsig_t rxsig)
if (chan->itimer) /* if timer still running */
{
int plen = chan->itimerset - chan->itimer;
- if (plen <= ZT_MAXPULSETIME)
+ if (plen <= DAHDI_MAXPULSETIME)
{
- if (plen >= ZT_MINPULSETIME)
+ if (plen >= DAHDI_MINPULSETIME)
{
chan->pulsecount++;
- chan->pulsetimer = ZT_PULSETIMEOUT;
+ chan->pulsetimer = DAHDI_PULSETIMEOUT;
chan->itimerset = chan->itimer = 0;
if (chan->pulsecount == 1)
- __qevent(chan,ZT_EVENT_PULSE_START);
+ __qevent(chan,DAHDI_EVENT_PULSE_START);
}
}
break;
}
#endif
/* set wink timer */
- chan->itimerset = chan->itimer = chan->rxwinktime * ZT_CHUNKSIZE;
+ chan->itimerset = chan->itimer = chan->rxwinktime * DAHDI_CHUNKSIZE;
break;
- case ZT_RXSIG_ONHOOK: /* went on hook */
+ case DAHDI_RXSIG_ONHOOK: /* went on hook */
/* This interface is now going on hook.
Check for WINK, etc */
if (chan->itimer)
- __qevent(chan,ZT_EVENT_WINKFLASH);
+ __qevent(chan,DAHDI_EVENT_WINKFLASH);
#if defined(EMFLASH) || defined(EMPULSE)
else {
#ifdef EMFLASH
- chan->itimerset = chan->itimer = chan->rxflashtime * ZT_CHUNKSIZE;
+ chan->itimerset = chan->itimer = chan->rxflashtime * DAHDI_CHUNKSIZE;
#else /* EMFLASH */
- chan->itimerset = chan->itimer = chan->rxwinktime * ZT_CHUNKSIZE;
+ chan->itimerset = chan->itimer = chan->rxwinktime * DAHDI_CHUNKSIZE;
#endif /* EMFLASH */
chan->gotgs = 0;
@@ -6113,7 +6113,7 @@ static void __zt_hooksig_pvt(struct zt_chan *chan, zt_rxsig_t rxsig)
}
#else /* EMFLASH || EMPULSE */
else {
- __qevent(chan,ZT_EVENT_ONHOOK);
+ __qevent(chan,DAHDI_EVENT_ONHOOK);
chan->gotgs = 0;
}
#endif
@@ -6123,50 +6123,50 @@ static void __zt_hooksig_pvt(struct zt_chan *chan, zt_rxsig_t rxsig)
break;
}
break;
- case ZT_SIG_FXSKS: /* FXS Kewlstart */
+ case DAHDI_SIG_FXSKS: /* FXS Kewlstart */
/* ignore a bit poopy if loop not closed and stable */
- if (chan->txstate != ZT_TXSTATE_OFFHOOK) break;
+ if (chan->txstate != DAHDI_TXSTATE_OFFHOOK) break;
#ifdef FXSFLASH
- if (rxsig == ZT_RXSIG_ONHOOK) {
- chan->itimer = ZT_FXSFLASHMAXTIME * ZT_CHUNKSIZE;
+ if (rxsig == DAHDI_RXSIG_ONHOOK) {
+ chan->itimer = DAHDI_FXSFLASHMAXTIME * DAHDI_CHUNKSIZE;
break;
- } else if (rxsig == ZT_RXSIG_OFFHOOK) {
+ } else if (rxsig == DAHDI_RXSIG_OFFHOOK) {
if (chan->itimer) {
/* did the offhook occur in the window? if not, ignore both events */
- if (chan->itimer <= ((ZT_FXSFLASHMAXTIME - ZT_FXSFLASHMINTIME) * ZT_CHUNKSIZE))
- __qevent(chan, ZT_EVENT_WINKFLASH);
+ if (chan->itimer <= ((DAHDI_FXSFLASHMAXTIME - DAHDI_FXSFLASHMINTIME) * DAHDI_CHUNKSIZE))
+ __qevent(chan, DAHDI_EVENT_WINKFLASH);
}
chan->itimer = 0;
break;
}
#endif
/* fall through intentionally */
- case ZT_SIG_FXSGS: /* FXS Groundstart */
- if (rxsig == ZT_RXSIG_ONHOOK) {
+ case DAHDI_SIG_FXSGS: /* FXS Groundstart */
+ if (rxsig == DAHDI_RXSIG_ONHOOK) {
chan->ringdebtimer = RING_DEBOUNCE_TIME;
chan->ringtrailer = 0;
- if (chan->txstate != ZT_TXSTATE_DEBOUNCE) {
+ if (chan->txstate != DAHDI_TXSTATE_DEBOUNCE) {
chan->gotgs = 0;
- __qevent(chan,ZT_EVENT_ONHOOK);
+ __qevent(chan,DAHDI_EVENT_ONHOOK);
}
}
break;
- case ZT_SIG_FXOGS: /* FXO Groundstart */
- if (rxsig == ZT_RXSIG_START) {
+ case DAHDI_SIG_FXOGS: /* FXO Groundstart */
+ if (rxsig == DAHDI_RXSIG_START) {
/* if havent got gs, report it */
if (!chan->gotgs) {
- __qevent(chan,ZT_EVENT_RINGOFFHOOK);
+ __qevent(chan,DAHDI_EVENT_RINGOFFHOOK);
chan->gotgs = 1;
}
}
/* fall through intentionally */
- case ZT_SIG_FXOLS: /* FXO Loopstart */
- case ZT_SIG_FXOKS: /* FXO Kewlstart */
+ case DAHDI_SIG_FXOLS: /* FXO Loopstart */
+ case DAHDI_SIG_FXOKS: /* FXO Kewlstart */
switch(rxsig) {
- case ZT_RXSIG_OFFHOOK: /* went off hook */
+ case DAHDI_RXSIG_OFFHOOK: /* went off hook */
/* if asserti ng ring, stop it */
- if (chan->txstate == ZT_TXSTATE_START) {
- zt_rbs_sethook(chan,ZT_TXSIG_OFFHOOK, ZT_TXSTATE_AFTERSTART, ZT_AFTERSTART_TIME);
+ if (chan->txstate == DAHDI_TXSTATE_START) {
+ dahdi_rbs_sethook(chan,DAHDI_TXSIG_OFFHOOK, DAHDI_TXSTATE_AFTERSTART, DAHDI_AFTERSTART_TIME);
}
chan->kewlonhook = 0;
#ifdef CONFIG_ZAPATA_DEBUG
@@ -6175,36 +6175,36 @@ static void __zt_hooksig_pvt(struct zt_chan *chan, zt_rxsig_t rxsig)
if (chan->itimer) /* if timer still running */
{
int plen = chan->itimerset - chan->itimer;
- if (plen <= ZT_MAXPULSETIME)
+ if (plen <= DAHDI_MAXPULSETIME)
{
- if (plen >= ZT_MINPULSETIME)
+ if (plen >= DAHDI_MINPULSETIME)
{
chan->pulsecount++;
- chan->pulsetimer = ZT_PULSETIMEOUT;
+ chan->pulsetimer = DAHDI_PULSETIMEOUT;
chan->itimer = chan->itimerset;
if (chan->pulsecount == 1)
- __qevent(chan,ZT_EVENT_PULSE_START);
+ __qevent(chan,DAHDI_EVENT_PULSE_START);
}
} else
- __qevent(chan,ZT_EVENT_WINKFLASH);
+ __qevent(chan,DAHDI_EVENT_WINKFLASH);
} else {
/* if havent got GS detect */
if (!chan->gotgs) {
- __qevent(chan,ZT_EVENT_RINGOFFHOOK);
+ __qevent(chan,DAHDI_EVENT_RINGOFFHOOK);
chan->gotgs = 1;
chan->itimerset = chan->itimer = 0;
}
}
chan->itimerset = chan->itimer = 0;
break;
- case ZT_RXSIG_ONHOOK: /* went on hook */
+ case DAHDI_RXSIG_ONHOOK: /* went on hook */
/* if not during offhook debounce time */
- if ((chan->txstate != ZT_TXSTATE_DEBOUNCE) &&
- (chan->txstate != ZT_TXSTATE_KEWL) &&
- (chan->txstate != ZT_TXSTATE_AFTERKEWL)) {
- chan->itimerset = chan->itimer = chan->rxflashtime * ZT_CHUNKSIZE;
+ if ((chan->txstate != DAHDI_TXSTATE_DEBOUNCE) &&
+ (chan->txstate != DAHDI_TXSTATE_KEWL) &&
+ (chan->txstate != DAHDI_TXSTATE_AFTERKEWL)) {
+ chan->itimerset = chan->itimer = chan->rxflashtime * DAHDI_CHUNKSIZE;
}
- if (chan->txstate == ZT_TXSTATE_KEWL)
+ if (chan->txstate == DAHDI_TXSTATE_KEWL)
chan->kewlonhook = 1;
break;
default:
@@ -6215,61 +6215,61 @@ static void __zt_hooksig_pvt(struct zt_chan *chan, zt_rxsig_t rxsig)
}
}
-void zt_hooksig(struct zt_chan *chan, zt_rxsig_t rxsig)
+void dahdi_hooksig(struct dahdi_chan *chan, dahdi_rxsig_t rxsig)
{
/* skip if no change */
unsigned long flags;
spin_lock_irqsave(&chan->lock, flags);
- __zt_hooksig_pvt(chan,rxsig);
+ __dahdi_hooksig_pvt(chan,rxsig);
spin_unlock_irqrestore(&chan->lock, flags);
}
-void zt_rbsbits(struct zt_chan *chan, int cursig)
+void dahdi_rbsbits(struct dahdi_chan *chan, int cursig)
{
unsigned long flags;
if (cursig == chan->rxsig)
return;
- if ((chan->flags & ZT_FLAG_SIGFREEZE)) return;
+ if ((chan->flags & DAHDI_FLAG_SIGFREEZE)) return;
spin_lock_irqsave(&chan->lock, flags);
switch(chan->sig) {
- case ZT_SIG_FXOGS: /* FXO Groundstart */
+ case DAHDI_SIG_FXOGS: /* FXO Groundstart */
/* B-bit only matters for FXO GS */
- if (!(cursig & ZT_BBIT)) {
- __zt_hooksig_pvt(chan, ZT_RXSIG_START);
+ if (!(cursig & DAHDI_BBIT)) {
+ __dahdi_hooksig_pvt(chan, DAHDI_RXSIG_START);
break;
}
/* Fall through */
- case ZT_SIG_EM: /* E and M */
- case ZT_SIG_EM_E1:
- case ZT_SIG_FXOLS: /* FXO Loopstart */
- case ZT_SIG_FXOKS: /* FXO Kewlstart */
- if (cursig & ZT_ABIT) /* off hook */
- __zt_hooksig_pvt(chan,ZT_RXSIG_OFFHOOK);
+ case DAHDI_SIG_EM: /* E and M */
+ case DAHDI_SIG_EM_E1:
+ case DAHDI_SIG_FXOLS: /* FXO Loopstart */
+ case DAHDI_SIG_FXOKS: /* FXO Kewlstart */
+ if (cursig & DAHDI_ABIT) /* off hook */
+ __dahdi_hooksig_pvt(chan,DAHDI_RXSIG_OFFHOOK);
else /* on hook */
- __zt_hooksig_pvt(chan,ZT_RXSIG_ONHOOK);
+ __dahdi_hooksig_pvt(chan,DAHDI_RXSIG_ONHOOK);
break;
- case ZT_SIG_FXSKS: /* FXS Kewlstart */
- case ZT_SIG_FXSGS: /* FXS Groundstart */
+ case DAHDI_SIG_FXSKS: /* FXS Kewlstart */
+ case DAHDI_SIG_FXSGS: /* FXS Groundstart */
/* Fall through */
- case ZT_SIG_FXSLS:
- if (!(cursig & ZT_BBIT)) {
+ case DAHDI_SIG_FXSLS:
+ if (!(cursig & DAHDI_BBIT)) {
/* Check for ringing first */
- __zt_hooksig_pvt(chan, ZT_RXSIG_RING);
+ __dahdi_hooksig_pvt(chan, DAHDI_RXSIG_RING);
break;
}
- if ((chan->sig != ZT_SIG_FXSLS) && (cursig & ZT_ABIT)) {
+ if ((chan->sig != DAHDI_SIG_FXSLS) && (cursig & DAHDI_ABIT)) {
/* if went on hook */
- __zt_hooksig_pvt(chan, ZT_RXSIG_ONHOOK);
+ __dahdi_hooksig_pvt(chan, DAHDI_RXSIG_ONHOOK);
} else {
- __zt_hooksig_pvt(chan, ZT_RXSIG_OFFHOOK);
+ __dahdi_hooksig_pvt(chan, DAHDI_RXSIG_OFFHOOK);
}
break;
- case ZT_SIG_CAS:
+ case DAHDI_SIG_CAS:
/* send event that something changed */
- __qevent(chan, ZT_EVENT_BITSCHANGED);
+ __qevent(chan, DAHDI_EVENT_BITSCHANGED);
break;
default:
@@ -6280,7 +6280,7 @@ void zt_rbsbits(struct zt_chan *chan, int cursig)
spin_unlock_irqrestore(&chan->lock, flags);
}
-static inline void __zt_ec_chunk(struct zt_chan *ss, unsigned char *rxchunk, const unsigned char *txchunk)
+static inline void __dahdi_ec_chunk(struct dahdi_chan *ss, unsigned char *rxchunk, const unsigned char *txchunk)
{
short rxlin, txlin;
int x;
@@ -6290,21 +6290,21 @@ static inline void __zt_ec_chunk(struct zt_chan *ss, unsigned char *rxchunk, con
if (ss->readchunkpreec) {
/* Save a copy of the audio before the echo can has its way with it */
- for (x = 0; x < ZT_CHUNKSIZE; x++)
+ for (x = 0; x < DAHDI_CHUNKSIZE; x++)
/* We only ever really need to deal with signed linear - let's just convert it now */
- ss->readchunkpreec[x] = ZT_XLAW(rxchunk[x], ss);
+ ss->readchunkpreec[x] = DAHDI_XLAW(rxchunk[x], ss);
}
/* Perform echo cancellation on a chunk if necessary */
if (ss->ec) {
#if defined(CONFIG_ZAPTEL_MMX) || defined(ECHO_CAN_FP)
- zt_kernel_fpu_begin();
+ dahdi_kernel_fpu_begin();
#endif
if (ss->echostate & __ECHO_STATE_MUTE) {
/* Special stuff for training the echo can */
- for (x=0;x<ZT_CHUNKSIZE;x++) {
- rxlin = ZT_XLAW(rxchunk[x], ss);
- txlin = ZT_XLAW(txchunk[x], ss);
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
+ rxlin = DAHDI_XLAW(rxchunk[x], ss);
+ txlin = DAHDI_XLAW(txchunk[x], ss);
if (ss->echostate == ECHO_STATE_PRETRAINING) {
if (--ss->echotimer <= 0) {
ss->echotimer = 0;
@@ -6324,25 +6324,25 @@ static inline void __zt_ec_chunk(struct zt_chan *ss, unsigned char *rxchunk, con
}
}
rxlin = 0;
- rxchunk[x] = ZT_LIN2X((int)rxlin, ss);
+ rxchunk[x] = DAHDI_LIN2X((int)rxlin, ss);
}
} else {
-#if !defined(ZT_EC_ARRAY_UPDATE)
- for (x=0;x<ZT_CHUNKSIZE;x++) {
- rxlin = ZT_XLAW(rxchunk[x], ss);
- rxlin = echo_can_update(ss->ec, ZT_XLAW(txchunk[x], ss), rxlin);
- rxchunk[x] = ZT_LIN2X((int) rxlin, ss);
+#if !defined(DAHDI_EC_ARRAY_UPDATE)
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
+ rxlin = DAHDI_XLAW(rxchunk[x], ss);
+ rxlin = echo_can_update(ss->ec, DAHDI_XLAW(txchunk[x], ss), rxlin);
+ rxchunk[x] = DAHDI_LIN2X((int) rxlin, ss);
}
-#else /* defined(ZT_EC_ARRAY_UPDATE) */
- short rxlins[ZT_CHUNKSIZE], txlins[ZT_CHUNKSIZE];
- for (x = 0; x < ZT_CHUNKSIZE; x++) {
- rxlins[x] = ZT_XLAW(rxchunk[x], ss);
- txlins[x] = ZT_XLAW(txchunk[x], ss);
+#else /* defined(DAHDI_EC_ARRAY_UPDATE) */
+ short rxlins[DAHDI_CHUNKSIZE], txlins[DAHDI_CHUNKSIZE];
+ for (x = 0; x < DAHDI_CHUNKSIZE; x++) {
+ rxlins[x] = DAHDI_XLAW(rxchunk[x], ss);
+ txlins[x] = DAHDI_XLAW(txchunk[x], ss);
}
echo_can_array_update(ss->ec, rxlins, txlins);
- for (x = 0; x < ZT_CHUNKSIZE; x++)
- rxchunk[x] = ZT_LIN2X((int) rxlins[x], ss);
-#endif /* defined(ZT_EC_ARRAY_UPDATE) */
+ for (x = 0; x < DAHDI_CHUNKSIZE; x++)
+ rxchunk[x] = DAHDI_LIN2X((int) rxlins[x], ss);
+#endif /* defined(DAHDI_EC_ARRAY_UPDATE) */
}
#if defined(CONFIG_ZAPTEL_MMX) || defined(ECHO_CAN_FP)
kernel_fpu_end();
@@ -6351,17 +6351,17 @@ static inline void __zt_ec_chunk(struct zt_chan *ss, unsigned char *rxchunk, con
spin_unlock_irqrestore(&ss->lock, flags);
}
-void zt_ec_chunk(struct zt_chan *ss, unsigned char *rxchunk, const unsigned char *txchunk)
+void dahdi_ec_chunk(struct dahdi_chan *ss, unsigned char *rxchunk, const unsigned char *txchunk)
{
- __zt_ec_chunk(ss, rxchunk, txchunk);
+ __dahdi_ec_chunk(ss, rxchunk, txchunk);
}
-void zt_ec_span(struct zt_span *span)
+void dahdi_ec_span(struct dahdi_span *span)
{
int x;
for (x = 0; x < span->channels; x++) {
if (span->chans[x].ec)
- __zt_ec_chunk(&span->chans[x], span->chans[x].readchunk, span->chans[x].writechunk);
+ __dahdi_ec_chunk(&span->chans[x], span->chans[x].readchunk, span->chans[x].writechunk);
}
}
@@ -6374,7 +6374,7 @@ static inline int sf_detect (sf_detect_state_t *s,
int i,rv = 0;
long x,y;
-#define SF_DETECT_SAMPLES (ZT_CHUNKSIZE * 5)
+#define SF_DETECT_SAMPLES (DAHDI_CHUNKSIZE * 5)
#define SF_DETECT_MIN_ENERGY 500
#define NB 14 /* number of bits to shift left */
@@ -6414,30 +6414,30 @@ long x,y;
return(rv);
}
-static inline void __zt_process_putaudio_chunk(struct zt_chan *ss, unsigned char *rxb)
+static inline void __dahdi_process_putaudio_chunk(struct dahdi_chan *ss, unsigned char *rxb)
{
/* We transmit data from our master channel */
/* Called with ss->lock held */
- struct zt_chan *ms = ss->master;
+ struct dahdi_chan *ms = ss->master;
/* Linear version of received data */
- short putlin[ZT_CHUNKSIZE],k[ZT_CHUNKSIZE];
+ short putlin[DAHDI_CHUNKSIZE],k[DAHDI_CHUNKSIZE];
int x,r;
if (ms->dialing) ms->afterdialingtimer = 50;
else if (ms->afterdialingtimer) ms->afterdialingtimer--;
- if (ms->afterdialingtimer && (!(ms->flags & ZT_FLAG_PSEUDO))) {
+ if (ms->afterdialingtimer && (!(ms->flags & DAHDI_FLAG_PSEUDO))) {
/* Be careful since memset is likely a macro */
- rxb[0] = ZT_LIN2X(0, ms);
- memset(&rxb[1], rxb[0], ZT_CHUNKSIZE - 1); /* receive as silence if dialing */
+ rxb[0] = DAHDI_LIN2X(0, ms);
+ memset(&rxb[1], rxb[0], DAHDI_CHUNKSIZE - 1); /* receive as silence if dialing */
}
- for (x=0;x<ZT_CHUNKSIZE;x++) {
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
rxb[x] = ms->rxgain[rxb[x]];
- putlin[x] = ZT_XLAW(rxb[x], ms);
+ putlin[x] = DAHDI_XLAW(rxb[x], ms);
}
#ifndef NO_ECHOCAN_DISABLE
if (ms->ec) {
- for (x=0;x<ZT_CHUNKSIZE;x++) {
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
if (echo_can_disable_detector_update(&ms->rxecdis, putlin[x])) {
printk("zaptel Disabled echo canceller because of tone (rx) on channel %d\n", ss->channo);
ms->echocancel = 0;
@@ -6454,71 +6454,71 @@ static inline void __zt_process_putaudio_chunk(struct zt_chan *ss, unsigned char
/* if doing rx tone decoding */
if (ms->rxp1 && ms->rxp2 && ms->rxp3)
{
- r = sf_detect(&ms->rd,putlin,ZT_CHUNKSIZE,ms->rxp1,
+ r = sf_detect(&ms->rd,putlin,DAHDI_CHUNKSIZE,ms->rxp1,
ms->rxp2,ms->rxp3);
/* Convert back */
- for(x=0;x<ZT_CHUNKSIZE;x++)
- rxb[x] = ZT_LIN2X(putlin[x], ms);
+ for(x=0;x<DAHDI_CHUNKSIZE;x++)
+ rxb[x] = DAHDI_LIN2X(putlin[x], ms);
if (r) /* if something happened */
{
if (r != ms->rd.lastdetect)
{
- if (((r == 2) && !(ms->toneflags & ZT_REVERSE_RXTONE)) ||
- ((r == 1) && (ms->toneflags & ZT_REVERSE_RXTONE)))
+ if (((r == 2) && !(ms->toneflags & DAHDI_REVERSE_RXTONE)) ||
+ ((r == 1) && (ms->toneflags & DAHDI_REVERSE_RXTONE)))
{
- __qevent(ms,ZT_EVENT_RINGOFFHOOK);
+ __qevent(ms,DAHDI_EVENT_RINGOFFHOOK);
}
else
{
- __qevent(ms,ZT_EVENT_ONHOOK);
+ __qevent(ms,DAHDI_EVENT_ONHOOK);
}
ms->rd.lastdetect = r;
}
}
}
- if (!(ms->flags & ZT_FLAG_PSEUDO)) {
- memcpy(ms->putlin, putlin, ZT_CHUNKSIZE * sizeof(short));
- memcpy(ms->putraw, rxb, ZT_CHUNKSIZE);
+ if (!(ms->flags & DAHDI_FLAG_PSEUDO)) {
+ memcpy(ms->putlin, putlin, DAHDI_CHUNKSIZE * sizeof(short));
+ memcpy(ms->putraw, rxb, DAHDI_CHUNKSIZE);
}
/* Take the rxc, twiddle it for conferencing if appropriate and put it
back */
if ((!ms->confmute && !ms->afterdialingtimer) ||
- (ms->flags & ZT_FLAG_PSEUDO)) {
- switch(ms->confmode & ZT_CONF_MODE_MASK) {
- case ZT_CONF_NORMAL: /* Normal mode */
+ (ms->flags & DAHDI_FLAG_PSEUDO)) {
+ switch(ms->confmode & DAHDI_CONF_MODE_MASK) {
+ case DAHDI_CONF_NORMAL: /* Normal mode */
/* Do nothing. rx goes output */
break;
- case ZT_CONF_MONITOR: /* Monitor a channel's rx mode */
+ case DAHDI_CONF_MONITOR: /* Monitor a channel's rx mode */
/* if not a pseudo-channel, ignore */
- if (!(ms->flags & ZT_FLAG_PSEUDO)) break;
+ if (!(ms->flags & DAHDI_FLAG_PSEUDO)) break;
/* Add monitored channel */
- if (chans[ms->confna]->flags & ZT_FLAG_PSEUDO) {
+ if (chans[ms->confna]->flags & DAHDI_FLAG_PSEUDO) {
ACSS(putlin, chans[ms->confna]->getlin);
} else {
ACSS(putlin, chans[ms->confna]->putlin);
}
/* Convert back */
- for(x=0;x<ZT_CHUNKSIZE;x++)
- rxb[x] = ZT_LIN2X(putlin[x], ms);
+ for(x=0;x<DAHDI_CHUNKSIZE;x++)
+ rxb[x] = DAHDI_LIN2X(putlin[x], ms);
break;
- case ZT_CONF_MONITORTX: /* Monitor a channel's tx mode */
+ case DAHDI_CONF_MONITORTX: /* Monitor a channel's tx mode */
/* if not a pseudo-channel, ignore */
- if (!(ms->flags & ZT_FLAG_PSEUDO)) break;
+ if (!(ms->flags & DAHDI_FLAG_PSEUDO)) break;
/* Add monitored channel */
- if (chans[ms->confna]->flags & ZT_FLAG_PSEUDO) {
+ if (chans[ms->confna]->flags & DAHDI_FLAG_PSEUDO) {
ACSS(putlin, chans[ms->confna]->putlin);
} else {
ACSS(putlin, chans[ms->confna]->getlin);
}
/* Convert back */
- for(x=0;x<ZT_CHUNKSIZE;x++)
- rxb[x] = ZT_LIN2X(putlin[x], ms);
+ for(x=0;x<DAHDI_CHUNKSIZE;x++)
+ rxb[x] = DAHDI_LIN2X(putlin[x], ms);
break;
- case ZT_CONF_MONITORBOTH: /* Monitor a channel's tx and rx mode */
+ case DAHDI_CONF_MONITORBOTH: /* Monitor a channel's tx and rx mode */
/* if not a pseudo-channel, ignore */
- if (!(ms->flags & ZT_FLAG_PSEUDO)) break;
+ if (!(ms->flags & DAHDI_FLAG_PSEUDO)) break;
/* Note: Technically, saturation should be done at
the end of the whole addition, but for performance
reasons, we don't do that. Besides, it only matters
@@ -6526,42 +6526,42 @@ static inline void __zt_process_putaudio_chunk(struct zt_chan *ss, unsigned char
ACSS(putlin, chans[ms->confna]->getlin);
ACSS(putlin, chans[ms->confna]->putlin);
/* Convert back */
- for(x=0;x<ZT_CHUNKSIZE;x++)
- rxb[x] = ZT_LIN2X(putlin[x], ms);
+ for(x=0;x<DAHDI_CHUNKSIZE;x++)
+ rxb[x] = DAHDI_LIN2X(putlin[x], ms);
break;
- case ZT_CONF_MONITOR_RX_PREECHO: /* Monitor a channel's rx mode */
+ case DAHDI_CONF_MONITOR_RX_PREECHO: /* Monitor a channel's rx mode */
/* if not a pseudo-channel, ignore */
- if (!(ms->flags & ZT_FLAG_PSEUDO))
+ if (!(ms->flags & DAHDI_FLAG_PSEUDO))
break;
if (!chans[ms->confna]->readchunkpreec)
break;
/* Add monitored channel */
- ACSS(putlin, chans[ms->confna]->flags & ZT_FLAG_PSEUDO ?
+ ACSS(putlin, chans[ms->confna]->flags & DAHDI_FLAG_PSEUDO ?
chans[ms->confna]->getlin : chans[ms->confna]->readchunkpreec);
- for (x = 0; x < ZT_CHUNKSIZE; x++)
- rxb[x] = ZT_LIN2X(putlin[x], ms);
+ for (x = 0; x < DAHDI_CHUNKSIZE; x++)
+ rxb[x] = DAHDI_LIN2X(putlin[x], ms);
break;
- case ZT_CONF_MONITOR_TX_PREECHO: /* Monitor a channel's tx mode */
+ case DAHDI_CONF_MONITOR_TX_PREECHO: /* Monitor a channel's tx mode */
/* if not a pseudo-channel, ignore */
- if (!(ms->flags & ZT_FLAG_PSEUDO))
+ if (!(ms->flags & DAHDI_FLAG_PSEUDO))
break;
if (!chans[ms->confna]->readchunkpreec)
break;
/* Add monitored channel */
- ACSS(putlin, chans[ms->confna]->flags & ZT_FLAG_PSEUDO ?
+ ACSS(putlin, chans[ms->confna]->flags & DAHDI_FLAG_PSEUDO ?
chans[ms->confna]->readchunkpreec : chans[ms->confna]->getlin);
- for (x = 0; x < ZT_CHUNKSIZE; x++)
- rxb[x] = ZT_LIN2X(putlin[x], ms);
+ for (x = 0; x < DAHDI_CHUNKSIZE; x++)
+ rxb[x] = DAHDI_LIN2X(putlin[x], ms);
break;
- case ZT_CONF_MONITORBOTH_PREECHO: /* Monitor a channel's tx and rx mode */
+ case DAHDI_CONF_MONITORBOTH_PREECHO: /* Monitor a channel's tx and rx mode */
/* if not a pseudo-channel, ignore */
- if (!(ms->flags & ZT_FLAG_PSEUDO))
+ if (!(ms->flags & DAHDI_FLAG_PSEUDO))
break;
if (!chans[ms->confna]->readchunkpreec)
@@ -6573,93 +6573,93 @@ static inline void __zt_process_putaudio_chunk(struct zt_chan *ss, unsigned char
when you're so loud you're clipping anyway */
ACSS(putlin, chans[ms->confna]->getlin);
ACSS(putlin, chans[ms->confna]->readchunkpreec);
- for (x = 0; x < ZT_CHUNKSIZE; x++)
- rxb[x] = ZT_LIN2X(putlin[x], ms);
+ for (x = 0; x < DAHDI_CHUNKSIZE; x++)
+ rxb[x] = DAHDI_LIN2X(putlin[x], ms);
break;
- case ZT_CONF_REALANDPSEUDO:
+ case DAHDI_CONF_REALANDPSEUDO:
/* do normal conf mode processing */
- if (ms->confmode & ZT_CONF_TALKER) {
+ if (ms->confmode & DAHDI_CONF_TALKER) {
/* Store temp value */
- memcpy(k, putlin, ZT_CHUNKSIZE * sizeof(short));
+ memcpy(k, putlin, DAHDI_CHUNKSIZE * sizeof(short));
/* Add conf value */
ACSS(k, conf_sums_next[ms->_confn]);
/* get amount actually added */
- memcpy(ms->conflast, k, ZT_CHUNKSIZE * sizeof(short));
+ memcpy(ms->conflast, k, DAHDI_CHUNKSIZE * sizeof(short));
SCSS(ms->conflast, conf_sums_next[ms->_confn]);
/* Really add in new value */
ACSS(conf_sums_next[ms->_confn], ms->conflast);
- } else memset(ms->conflast, 0, ZT_CHUNKSIZE * sizeof(short));
+ } else memset(ms->conflast, 0, DAHDI_CHUNKSIZE * sizeof(short));
/* do the pseudo-channel part processing */
- memset(putlin, 0, ZT_CHUNKSIZE * sizeof(short));
- if (ms->confmode & ZT_CONF_PSEUDO_LISTENER) {
+ memset(putlin, 0, DAHDI_CHUNKSIZE * sizeof(short));
+ if (ms->confmode & DAHDI_CONF_PSEUDO_LISTENER) {
/* Subtract out previous last sample written to conf */
SCSS(putlin, ms->conflast2);
/* Add in conference */
ACSS(putlin, conf_sums[ms->_confn]);
}
/* Convert back */
- for(x=0;x<ZT_CHUNKSIZE;x++)
- rxb[x] = ZT_LIN2X(putlin[x], ms);
+ for(x=0;x<DAHDI_CHUNKSIZE;x++)
+ rxb[x] = DAHDI_LIN2X(putlin[x], ms);
break;
- case ZT_CONF_CONF: /* Normal conference mode */
- if (ms->flags & ZT_FLAG_PSEUDO) /* if a pseudo-channel */
+ case DAHDI_CONF_CONF: /* Normal conference mode */
+ if (ms->flags & DAHDI_FLAG_PSEUDO) /* if a pseudo-channel */
{
- if (ms->confmode & ZT_CONF_LISTENER) {
+ if (ms->confmode & DAHDI_CONF_LISTENER) {
/* Subtract out last sample written to conf */
SCSS(putlin, ms->conflast);
/* Add in conference */
ACSS(putlin, conf_sums[ms->_confn]);
}
/* Convert back */
- for(x=0;x<ZT_CHUNKSIZE;x++)
- rxb[x] = ZT_LIN2X(putlin[x], ms);
- memcpy(ss->putlin, putlin, ZT_CHUNKSIZE * sizeof(short));
+ for(x=0;x<DAHDI_CHUNKSIZE;x++)
+ rxb[x] = DAHDI_LIN2X(putlin[x], ms);
+ memcpy(ss->putlin, putlin, DAHDI_CHUNKSIZE * sizeof(short));
break;
}
/* fall through */
- case ZT_CONF_CONFANN: /* Conference with announce */
- if (ms->confmode & ZT_CONF_TALKER) {
+ case DAHDI_CONF_CONFANN: /* Conference with announce */
+ if (ms->confmode & DAHDI_CONF_TALKER) {
/* Store temp value */
- memcpy(k, putlin, ZT_CHUNKSIZE * sizeof(short));
+ memcpy(k, putlin, DAHDI_CHUNKSIZE * sizeof(short));
/* Add conf value */
ACSS(k, conf_sums_next[ms->_confn]);
/* get amount actually added */
- memcpy(ms->conflast, k, ZT_CHUNKSIZE * sizeof(short));
+ memcpy(ms->conflast, k, DAHDI_CHUNKSIZE * sizeof(short));
SCSS(ms->conflast, conf_sums_next[ms->_confn]);
/* Really add in new value */
ACSS(conf_sums_next[ms->_confn], ms->conflast);
} else
- memset(ms->conflast, 0, ZT_CHUNKSIZE * sizeof(short));
+ memset(ms->conflast, 0, DAHDI_CHUNKSIZE * sizeof(short));
/* rxc unmodified */
break;
- case ZT_CONF_CONFMON:
- case ZT_CONF_CONFANNMON:
- if (ms->confmode & ZT_CONF_TALKER) {
+ case DAHDI_CONF_CONFMON:
+ case DAHDI_CONF_CONFANNMON:
+ if (ms->confmode & DAHDI_CONF_TALKER) {
/* Store temp value */
- memcpy(k, putlin, ZT_CHUNKSIZE * sizeof(short));
+ memcpy(k, putlin, DAHDI_CHUNKSIZE * sizeof(short));
/* Subtract last value */
SCSS(conf_sums[ms->_confn], ms->conflast);
/* Add conf value */
ACSS(k, conf_sums[ms->_confn]);
/* get amount actually added */
- memcpy(ms->conflast, k, ZT_CHUNKSIZE * sizeof(short));
+ memcpy(ms->conflast, k, DAHDI_CHUNKSIZE * sizeof(short));
SCSS(ms->conflast, conf_sums[ms->_confn]);
/* Really add in new value */
ACSS(conf_sums[ms->_confn], ms->conflast);
} else
- memset(ms->conflast, 0, ZT_CHUNKSIZE * sizeof(short));
- for (x=0;x<ZT_CHUNKSIZE;x++)
- rxb[x] = ZT_LIN2X((int)conf_sums_prev[ms->_confn][x], ms);
+ memset(ms->conflast, 0, DAHDI_CHUNKSIZE * sizeof(short));
+ for (x=0;x<DAHDI_CHUNKSIZE;x++)
+ rxb[x] = DAHDI_LIN2X((int)conf_sums_prev[ms->_confn][x], ms);
break;
- case ZT_CONF_DIGITALMON:
+ case DAHDI_CONF_DIGITALMON:
/* if not a pseudo-channel, ignore */
- if (!(ms->flags & ZT_FLAG_PSEUDO)) break;
+ if (!(ms->flags & DAHDI_FLAG_PSEUDO)) break;
/* Add monitored channel */
- if (chans[ms->confna]->flags & ZT_FLAG_PSEUDO) {
- memcpy(rxb, chans[ms->confna]->getraw, ZT_CHUNKSIZE);
+ if (chans[ms->confna]->flags & DAHDI_FLAG_PSEUDO) {
+ memcpy(rxb, chans[ms->confna]->getraw, DAHDI_CHUNKSIZE);
} else {
- memcpy(rxb, chans[ms->confna]->putraw, ZT_CHUNKSIZE);
+ memcpy(rxb, chans[ms->confna]->putraw, DAHDI_CHUNKSIZE);
}
break;
}
@@ -6667,11 +6667,11 @@ static inline void __zt_process_putaudio_chunk(struct zt_chan *ss, unsigned char
}
/* HDLC (or other) receiver buffer functions for read side */
-static inline void __putbuf_chunk(struct zt_chan *ss, unsigned char *rxb, int bytes)
+static inline void __putbuf_chunk(struct dahdi_chan *ss, unsigned char *rxb, int bytes)
{
/* We transmit data from our master channel */
/* Called with ss->lock held */
- struct zt_chan *ms = ss->master;
+ struct dahdi_chan *ms = ss->master;
/* Our receive buffer */
unsigned char *buf;
#if defined(CONFIG_ZAPATA_NET) || defined(CONFIG_ZAPATA_PPP)
@@ -6697,7 +6697,7 @@ static inline void __putbuf_chunk(struct zt_chan *ss, unsigned char *rxb, int by
left = ms->blocksize - ms->readidx[ms->inreadbuf];
if (left > bytes)
left = bytes;
- if (ms->flags & ZT_FLAG_HDLC) {
+ if (ms->flags & DAHDI_FLAG_HDLC) {
for (x=0;x<left;x++) {
/* Handle HDLC deframing */
fasthdlc_rx_load_nocheck(&ms->rxhdlc, *(rxb++));
@@ -6709,8 +6709,8 @@ static inline void __putbuf_chunk(struct zt_chan *ss, unsigned char *rxb, int by
else if (res & RETURN_COMPLETE_FLAG) {
/* Only count this if it's a non-empty frame */
if (ms->readidx[ms->inreadbuf]) {
- if ((ms->flags & ZT_FLAG_FCS) && (ms->infcs != PPP_GOODFCS)) {
- abort = ZT_EVENT_BADFCS;
+ if ((ms->flags & DAHDI_FLAG_FCS) && (ms->infcs != PPP_GOODFCS)) {
+ abort = DAHDI_EVENT_BADFCS;
} else
eof=1;
break;
@@ -6721,7 +6721,7 @@ static inline void __putbuf_chunk(struct zt_chan *ss, unsigned char *rxb, int by
"idle" instead of "flag" */
if (!ms->readidx[ms->inreadbuf])
continue;
- abort = ZT_EVENT_ABORT;
+ abort = DAHDI_EVENT_ABORT;
break;
} else {
unsigned char rxc;
@@ -6732,7 +6732,7 @@ static inline void __putbuf_chunk(struct zt_chan *ss, unsigned char *rxb, int by
if (ms->readidx[ms->inreadbuf] >= ms->blocksize) {
if (!ss->span->alarms)
printk(KERN_WARNING "HDLC Receiver overrun on channel %s (master=%s)\n", ss->name, ss->master->name);
- abort=ZT_EVENT_OVERRUN;
+ abort=DAHDI_EVENT_OVERRUN;
/* Force the HDLC state back to frame-search mode */
ms->rxhdlc.state = 0;
ms->rxhdlc.bits = 0;
@@ -6749,9 +6749,9 @@ static inline void __putbuf_chunk(struct zt_chan *ss, unsigned char *rxb, int by
bytes -= left;
/* End of frame is decided by block size of 'N' */
eof = (ms->readidx[ms->inreadbuf] >= ms->blocksize);
- if (eof && (ss->flags & ZT_FLAG_NOSTDTXRX)) {
+ if (eof && (ss->flags & DAHDI_FLAG_NOSTDTXRX)) {
eof = 0;
- abort = ZT_EVENT_OVERRUN;
+ abort = DAHDI_EVENT_OVERRUN;
}
}
if (eof) {
@@ -6763,7 +6763,7 @@ static inline void __putbuf_chunk(struct zt_chan *ss, unsigned char *rxb, int by
printk("EOF, len is %d\n", ms->readn[ms->inreadbuf]);
#endif
#if defined(CONFIG_ZAPATA_NET) || defined(CONFIG_ZAPATA_PPP)
- if (ms->flags & (ZT_FLAG_NETDEV | ZT_FLAG_PPP)) {
+ if (ms->flags & (DAHDI_FLAG_NETDEV | DAHDI_FLAG_PPP)) {
#ifdef CONFIG_ZAPATA_NET
#endif /* CONFIG_ZAPATA_NET */
/* Our network receiver logic is MUCH
@@ -6782,7 +6782,7 @@ static inline void __putbuf_chunk(struct zt_chan *ss, unsigned char *rxb, int by
memcpy(skb->data, ms->readbuf[ms->inreadbuf], ms->readn[ms->inreadbuf]);
skb_put(skb, ms->readn[ms->inreadbuf]);
#ifdef CONFIG_ZAPATA_NET
- if (ms->flags & ZT_FLAG_NETDEV) {
+ if (ms->flags & DAHDI_FLAG_NETDEV) {
#ifdef LINUX26
struct net_device_stats *stats = hdlc_stats(ms->hdlcnetdev->netdev);
#else /* LINUX26 */
@@ -6795,7 +6795,7 @@ static inline void __putbuf_chunk(struct zt_chan *ss, unsigned char *rxb, int by
} else {
#ifdef CONFIG_ZAPATA_NET
- if (ms->flags & ZT_FLAG_NETDEV) {
+ if (ms->flags & DAHDI_FLAG_NETDEV) {
#ifdef LINUX26
struct net_device_stats *stats = hdlc_stats(ms->hdlcnetdev->netdev);
#else /* LINUX26 */
@@ -6805,8 +6805,8 @@ static inline void __putbuf_chunk(struct zt_chan *ss, unsigned char *rxb, int by
}
#endif
#ifdef CONFIG_ZAPATA_PPP
- if (ms->flags & ZT_FLAG_PPP) {
- abort = ZT_EVENT_OVERRUN;
+ if (ms->flags & DAHDI_FLAG_PPP) {
+ abort = DAHDI_EVENT_OVERRUN;
}
#endif
#if 1
@@ -6831,13 +6831,13 @@ static inline void __putbuf_chunk(struct zt_chan *ss, unsigned char *rxb, int by
int comparemessage;
- if (ms->flags & ZT_FLAG_MTP2) {
+ if (ms->flags & DAHDI_FLAG_MTP2) {
comparemessage = (ms->inreadbuf - 1) & (ms->numbufs - 1);
res = memcmp(ms->readbuf[comparemessage], ms->readbuf[ms->inreadbuf], ms->readn[ms->inreadbuf]);
}
- if ((ms->flags & ZT_FLAG_MTP2) && !res) {
+ if ((ms->flags & DAHDI_FLAG_MTP2) && !res) {
/* Our messages are the same, so discard -
* Don't advance buffers, reset indexes and buffer sizes. */
ms->readn[ms->inreadbuf] = 0;
@@ -6876,7 +6876,7 @@ out in the later versions, and is put back now. */
#endif
wake_up_interruptible(&ms->readbufq);
wake_up_interruptible(&ms->sel);
- if (ms->iomask & ZT_IOMUX_READ)
+ if (ms->iomask & DAHDI_IOMUX_READ)
wake_up_interruptible(&ms->eventbufq);
}
}
@@ -6888,29 +6888,29 @@ out in the later versions, and is put back now. */
ms->infcs = PPP_INITFCS;
#ifdef CONFIG_ZAPATA_NET
- if (ms->flags & ZT_FLAG_NETDEV) {
+ if (ms->flags & DAHDI_FLAG_NETDEV) {
#ifdef LINUX26
struct net_device_stats *stats = hdlc_stats(ms->hdlcnetdev->netdev);
#else /* LINUX26 */
struct net_device_stats *stats = &ms->hdlcnetdev->netdev.stats;
#endif /* LINUX26 */
stats->rx_errors++;
- if (abort == ZT_EVENT_OVERRUN)
+ if (abort == DAHDI_EVENT_OVERRUN)
stats->rx_over_errors++;
- if (abort == ZT_EVENT_BADFCS)
+ if (abort == DAHDI_EVENT_BADFCS)
stats->rx_crc_errors++;
- if (abort == ZT_EVENT_ABORT)
+ if (abort == DAHDI_EVENT_ABORT)
stats->rx_frame_errors++;
} else
#endif
#ifdef CONFIG_ZAPATA_PPP
- if (ms->flags & ZT_FLAG_PPP) {
+ if (ms->flags & DAHDI_FLAG_PPP) {
ms->do_ppp_error = 1;
tasklet_schedule(&ms->ppp_calls);
} else
#endif
- if ((ms->flags & ZT_FLAG_OPEN) && !ss->span->alarms)
+ if ((ms->flags & DAHDI_FLAG_OPEN) && !ss->span->alarms)
/* Notify the receiver... */
__qevent(ss->master, abort);
#if 0
@@ -6921,7 +6921,7 @@ out in the later versions, and is put back now. */
} else /* No place to receive -- drop on the floor */
break;
#ifdef CONFIG_ZAPATA_NET
- if (skb && (ms->flags & ZT_FLAG_NETDEV))
+ if (skb && (ms->flags & DAHDI_FLAG_NETDEV))
#ifdef NEW_HDLC_INTERFACE
{
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,22)
@@ -6942,7 +6942,7 @@ out in the later versions, and is put back now. */
#endif
#endif
#ifdef CONFIG_ZAPATA_PPP
- if (skb && (ms->flags & ZT_FLAG_PPP)) {
+ if (skb && (ms->flags & DAHDI_FLAG_PPP)) {
unsigned char *tmp;
tmp = skb->data;
skb_pull(skb, 2);
@@ -6961,28 +6961,28 @@ out in the later versions, and is put back now. */
}
}
-static inline void __zt_putbuf_chunk(struct zt_chan *ss, unsigned char *rxb)
+static inline void __dahdi_putbuf_chunk(struct dahdi_chan *ss, unsigned char *rxb)
{
- __putbuf_chunk(ss, rxb, ZT_CHUNKSIZE);
+ __putbuf_chunk(ss, rxb, DAHDI_CHUNKSIZE);
}
-static void __zt_hdlc_abort(struct zt_chan *ss, int event)
+static void __dahdi_hdlc_abort(struct dahdi_chan *ss, int event)
{
if (ss->inreadbuf >= 0)
ss->readidx[ss->inreadbuf] = 0;
- if ((ss->flags & ZT_FLAG_OPEN) && !ss->span->alarms)
+ if ((ss->flags & DAHDI_FLAG_OPEN) && !ss->span->alarms)
__qevent(ss->master, event);
}
-extern void zt_hdlc_abort(struct zt_chan *ss, int event)
+extern void dahdi_hdlc_abort(struct dahdi_chan *ss, int event)
{
unsigned long flags;
spin_lock_irqsave(&ss->lock, flags);
- __zt_hdlc_abort(ss, event);
+ __dahdi_hdlc_abort(ss, event);
spin_unlock_irqrestore(&ss->lock, flags);
}
-extern void zt_hdlc_putbuf(struct zt_chan *ss, unsigned char *rxb, int bytes)
+extern void dahdi_hdlc_putbuf(struct dahdi_chan *ss, unsigned char *rxb, int bytes)
{
unsigned long flags;
int res;
@@ -7011,13 +7011,13 @@ extern void zt_hdlc_putbuf(struct zt_chan *ss, unsigned char *rxb, int bytes)
#ifdef CONFIG_ZAPATA_DEBUG
printk("HDLC frame isn't fit into buffer space\n");
#endif
- __zt_hdlc_abort(ss, ZT_EVENT_OVERRUN);
+ __dahdi_hdlc_abort(ss, DAHDI_EVENT_OVERRUN);
}
res = left;
spin_unlock_irqrestore(&ss->lock, flags);
}
-extern void zt_hdlc_finish(struct zt_chan *ss)
+extern void dahdi_hdlc_finish(struct dahdi_chan *ss)
{
int oldreadbuf;
unsigned long flags;
@@ -7056,14 +7056,14 @@ extern void zt_hdlc_finish(struct zt_chan *ss)
if (!ss->rxdisable) {
wake_up_interruptible(&ss->readbufq);
wake_up_interruptible(&ss->sel);
- if (ss->iomask & ZT_IOMUX_READ)
+ if (ss->iomask & DAHDI_IOMUX_READ)
wake_up_interruptible(&ss->eventbufq);
}
spin_unlock_irqrestore(&ss->lock, flags);
}
/* Returns 1 if EOF, 0 if data is still in frame, -1 if EOF and no buffers left */
-extern int zt_hdlc_getbuf(struct zt_chan *ss, unsigned char *bufptr, unsigned int *size)
+extern int dahdi_hdlc_getbuf(struct dahdi_chan *ss, unsigned char *bufptr, unsigned int *size)
{
unsigned char *buf;
unsigned long flags;
@@ -7094,10 +7094,10 @@ extern int zt_hdlc_getbuf(struct zt_chan *ss, unsigned char *bufptr, unsigned in
ss->outwritebuf = (ss->outwritebuf + 1) % ss->numbufs;
if (ss->outwritebuf == ss->inwritebuf) {
ss->outwritebuf = -1;
- if (ss->iomask & (ZT_IOMUX_WRITE | ZT_IOMUX_WRITEEMPTY))
+ if (ss->iomask & (DAHDI_IOMUX_WRITE | DAHDI_IOMUX_WRITEEMPTY))
wake_up_interruptible(&ss->eventbufq);
/* If we're only supposed to start when full, disable the transmitter */
- if (ss->txbufpolicy == ZT_POLICY_WHEN_FULL)
+ if (ss->txbufpolicy == DAHDI_POLICY_WHEN_FULL)
ss->txdisable = 1;
res = -1;
}
@@ -7105,10 +7105,10 @@ extern int zt_hdlc_getbuf(struct zt_chan *ss, unsigned char *bufptr, unsigned in
if (ss->inwritebuf < 0)
ss->inwritebuf = oldbuf;
- if (!(ss->flags & (ZT_FLAG_NETDEV | ZT_FLAG_PPP))) {
+ if (!(ss->flags & (DAHDI_FLAG_NETDEV | DAHDI_FLAG_PPP))) {
wake_up_interruptible(&ss->writebufq);
wake_up_interruptible(&ss->sel);
- if ((ss->iomask & ZT_IOMUX_WRITE) && (res >= 0))
+ if ((ss->iomask & DAHDI_IOMUX_WRITE) && (res >= 0))
wake_up_interruptible(&ss->eventbufq);
}
}
@@ -7125,12 +7125,12 @@ extern int zt_hdlc_getbuf(struct zt_chan *ss, unsigned char *bufptr, unsigned in
static void process_timers(void)
{
unsigned long flags;
- struct zt_timer *cur;
+ struct dahdi_timer *cur;
spin_lock_irqsave(&zaptimerlock, flags);
cur = zaptimers;
while(cur) {
if (cur->ms) {
- cur->pos -= ZT_CHUNKSIZE;
+ cur->pos -= DAHDI_CHUNKSIZE;
if (cur->pos <= 0) {
cur->tripped++;
cur->pos = cur->ms;
@@ -7142,9 +7142,9 @@ static void process_timers(void)
spin_unlock_irqrestore(&zaptimerlock, flags);
}
-static unsigned int zt_timer_poll(struct file *file, struct poll_table_struct *wait_table)
+static unsigned int dahdi_timer_poll(struct file *file, struct poll_table_struct *wait_table)
{
- struct zt_timer *timer = file->private_data;
+ struct dahdi_timer *timer = file->private_data;
unsigned long flags;
int ret = 0;
if (timer) {
@@ -7160,10 +7160,10 @@ static unsigned int zt_timer_poll(struct file *file, struct poll_table_struct *w
/* device poll routine */
static unsigned int
-zt_chan_poll(struct file *file, struct poll_table_struct *wait_table, int unit)
+dahdi_chan_poll(struct file *file, struct poll_table_struct *wait_table, int unit)
{
- struct zt_chan *chan = chans[unit];
+ struct dahdi_chan *chan = chans[unit];
int ret;
unsigned long flags;
@@ -7190,33 +7190,33 @@ zt_chan_poll(struct file *file, struct poll_table_struct *wait_table, int unit)
return(ret); /* return what we found */
}
-static int zt_mmap(struct file *file, struct vm_area_struct *vm)
+static int dahdi_mmap(struct file *file, struct vm_area_struct *vm)
{
int unit = UNIT(file);
if (unit == 250)
- return zt_transcode_fops->mmap(file, vm);
+ return dahdi_transcode_fops->mmap(file, vm);
return -ENOSYS;
}
-static unsigned int zt_poll(struct file *file, struct poll_table_struct *wait_table)
+static unsigned int dahdi_poll(struct file *file, struct poll_table_struct *wait_table)
{
int unit = UNIT(file);
- struct zt_chan *chan;
+ struct dahdi_chan *chan;
if (!unit)
return -EINVAL;
if (unit == 250)
- return zt_transcode_fops->poll(file, wait_table);
+ return dahdi_transcode_fops->poll(file, wait_table);
if (unit == 253)
- return zt_timer_poll(file, wait_table);
+ return dahdi_timer_poll(file, wait_table);
if (unit == 254) {
chan = file->private_data;
if (!chan)
return -EINVAL;
- return zt_chan_poll(file, wait_table,chan->channo);
+ return dahdi_chan_poll(file, wait_table,chan->channo);
}
if (unit == 255) {
chan = file->private_data;
@@ -7224,14 +7224,14 @@ static unsigned int zt_poll(struct file *file, struct poll_table_struct *wait_ta
printk("No pseudo channel structure to read?\n");
return -EINVAL;
}
- return zt_chan_poll(file, wait_table, chan->channo);
+ return dahdi_chan_poll(file, wait_table, chan->channo);
}
- return zt_chan_poll(file, wait_table, unit);
+ return dahdi_chan_poll(file, wait_table, unit);
}
-static void __zt_transmit_chunk(struct zt_chan *chan, unsigned char *buf)
+static void __dahdi_transmit_chunk(struct dahdi_chan *chan, unsigned char *buf)
{
- unsigned char silly[ZT_CHUNKSIZE];
+ unsigned char silly[DAHDI_CHUNKSIZE];
/* Called with chan->lock locked */
#ifdef OPTIMIZE_CHANMUTE
if(likely(chan->chanmute))
@@ -7239,20 +7239,20 @@ static void __zt_transmit_chunk(struct zt_chan *chan, unsigned char *buf)
#endif
if (!buf)
buf = silly;
- __zt_getbuf_chunk(chan, buf);
+ __dahdi_getbuf_chunk(chan, buf);
- if ((chan->flags & ZT_FLAG_AUDIO) || (chan->confmode)) {
+ if ((chan->flags & DAHDI_FLAG_AUDIO) || (chan->confmode)) {
#ifdef CONFIG_ZAPTEL_MMX
- zt_kernel_fpu_begin();
+ dahdi_kernel_fpu_begin();
#endif
- __zt_process_getaudio_chunk(chan, buf);
+ __dahdi_process_getaudio_chunk(chan, buf);
#ifdef CONFIG_ZAPTEL_MMX
kernel_fpu_end();
#endif
}
}
-static inline void __zt_real_transmit(struct zt_chan *chan)
+static inline void __dahdi_real_transmit(struct dahdi_chan *chan)
{
/* Called with chan->lock held */
#ifdef OPTIMIZE_CHANMUTE
@@ -7261,15 +7261,15 @@ static inline void __zt_real_transmit(struct zt_chan *chan)
#endif
if (chan->confmode) {
/* Pull queued data off the conference */
- __buf_pull(&chan->confout, chan->writechunk, chan, "zt_real_transmit");
+ __buf_pull(&chan->confout, chan->writechunk, chan, "dahdi_real_transmit");
} else {
- __zt_transmit_chunk(chan, chan->writechunk);
+ __dahdi_transmit_chunk(chan, chan->writechunk);
}
}
-static void __zt_getempty(struct zt_chan *ms, unsigned char *buf)
+static void __dahdi_getempty(struct dahdi_chan *ms, unsigned char *buf)
{
- int bytes = ZT_CHUNKSIZE;
+ int bytes = DAHDI_CHUNKSIZE;
int left;
unsigned char *txb = buf;
int x;
@@ -7284,13 +7284,13 @@ static void __zt_getempty(struct zt_chan *ms, unsigned char *buf)
left = bytes;
for (x=0;x<left;x++) {
/* Pick our default value from the next sample of the current tone */
- getlin = zt_tone_nextsample(&ms->ts, ms->curtone);
- *(txb++) = ZT_LIN2X(getlin, ms);
+ getlin = dahdi_tone_nextsample(&ms->ts, ms->curtone);
+ *(txb++) = DAHDI_LIN2X(getlin, ms);
}
ms->tonep+=left;
bytes -= left;
if (ms->tonep >= ms->curtone->tonesamples) {
- struct zt_tone *last;
+ struct dahdi_tone *last;
/* Go to the next sample of the tone */
ms->tonep = 0;
last = ms->curtone;
@@ -7301,44 +7301,44 @@ static void __zt_getempty(struct zt_chan *ms, unsigned char *buf)
__do_dtmf(ms);
} else {
if (last != ms->curtone)
- zt_init_tone_state(&ms->ts, ms->curtone);
+ dahdi_init_tone_state(&ms->ts, ms->curtone);
}
}
} else {
/* Use silence */
- memset(txb, ZT_LIN2X(0, ms), bytes);
+ memset(txb, DAHDI_LIN2X(0, ms), bytes);
bytes = 0;
}
}
}
-static void __zt_receive_chunk(struct zt_chan *chan, unsigned char *buf)
+static void __dahdi_receive_chunk(struct dahdi_chan *chan, unsigned char *buf)
{
/* Receive chunk of audio -- called with chan->lock held */
- unsigned char waste[ZT_CHUNKSIZE];
+ unsigned char waste[DAHDI_CHUNKSIZE];
#ifdef OPTIMIZE_CHANMUTE
if(likely(chan->chanmute))
return;
#endif
if (!buf) {
- memset(waste, ZT_LIN2X(0, chan), sizeof(waste));
+ memset(waste, DAHDI_LIN2X(0, chan), sizeof(waste));
buf = waste;
}
- if ((chan->flags & ZT_FLAG_AUDIO) || (chan->confmode)) {
+ if ((chan->flags & DAHDI_FLAG_AUDIO) || (chan->confmode)) {
#ifdef CONFIG_ZAPTEL_MMX
- zt_kernel_fpu_begin();
+ dahdi_kernel_fpu_begin();
#endif
- __zt_process_putaudio_chunk(chan, buf);
+ __dahdi_process_putaudio_chunk(chan, buf);
#ifdef CONFIG_ZAPTEL_MMX
kernel_fpu_end();
#endif
}
- __zt_putbuf_chunk(chan, buf);
+ __dahdi_putbuf_chunk(chan, buf);
}
-static inline void __zt_real_receive(struct zt_chan *chan)
+static inline void __dahdi_real_receive(struct dahdi_chan *chan)
{
/* Called with chan->lock held */
#ifdef OPTIMIZE_CHANMUTE
@@ -7347,13 +7347,13 @@ static inline void __zt_real_receive(struct zt_chan *chan)
#endif
if (chan->confmode) {
/* Load into queue if we have space */
- __buf_push(&chan->confin, chan->readchunk, "zt_real_receive");
+ __buf_push(&chan->confin, chan->readchunk, "dahdi_real_receive");
} else {
- __zt_receive_chunk(chan, chan->readchunk);
+ __dahdi_receive_chunk(chan, chan->readchunk);
}
}
-int zt_transmit(struct zt_span *span)
+int dahdi_transmit(struct dahdi_span *span)
{
int x,y,z;
unsigned long flags;
@@ -7361,31 +7361,31 @@ int zt_transmit(struct zt_span *span)
#if 1
for (x=0;x<span->channels;x++) {
spin_lock_irqsave(&span->chans[x].lock, flags);
- if (span->chans[x].flags & ZT_FLAG_NOSTDTXRX) {
+ if (span->chans[x].flags & DAHDI_FLAG_NOSTDTXRX) {
spin_unlock_irqrestore(&span->chans[x].lock, flags);
continue;
}
if (&span->chans[x] == span->chans[x].master) {
if (span->chans[x].otimer) {
- span->chans[x].otimer -= ZT_CHUNKSIZE;
+ span->chans[x].otimer -= DAHDI_CHUNKSIZE;
if (span->chans[x].otimer <= 0) {
__rbs_otimer_expire(&span->chans[x]);
}
}
- if (span->chans[x].flags & ZT_FLAG_AUDIO) {
- __zt_real_transmit(&span->chans[x]);
+ if (span->chans[x].flags & DAHDI_FLAG_AUDIO) {
+ __dahdi_real_transmit(&span->chans[x]);
} else {
if (span->chans[x].nextslave) {
- u_char data[ZT_CHUNKSIZE];
- int pos=ZT_CHUNKSIZE;
+ u_char data[DAHDI_CHUNKSIZE];
+ int pos=DAHDI_CHUNKSIZE;
/* Process master/slaves one way */
- for (y=0;y<ZT_CHUNKSIZE;y++) {
+ for (y=0;y<DAHDI_CHUNKSIZE;y++) {
/* Process slaves for this byte too */
z = x;
do {
- if (pos==ZT_CHUNKSIZE) {
+ if (pos==DAHDI_CHUNKSIZE) {
/* Get next chunk */
- __zt_transmit_chunk(&span->chans[x], data);
+ __dahdi_transmit_chunk(&span->chans[x], data);
pos = 0;
}
span->chans[z].writechunk[y] = data[pos++];
@@ -7394,10 +7394,10 @@ int zt_transmit(struct zt_span *span)
}
} else {
/* Process independents elsewise */
- __zt_real_transmit(&span->chans[x]);
+ __dahdi_real_transmit(&span->chans[x]);
}
}
- if (span->chans[x].sig == ZT_SIG_DACS_RBS) {
+ if (span->chans[x].sig == DAHDI_SIG_DACS_RBS) {
if (chans[span->chans[x].confna]) {
/* Just set bits for our destination */
if (span->chans[x].txsig != chans[span->chans[x].confna]->rxsig) {
@@ -7411,11 +7411,11 @@ int zt_transmit(struct zt_span *span)
spin_unlock_irqrestore(&span->chans[x].lock, flags);
}
if (span->mainttimer) {
- span->mainttimer -= ZT_CHUNKSIZE;
+ span->mainttimer -= DAHDI_CHUNKSIZE;
if (span->mainttimer <= 0) {
span->mainttimer = 0;
if (span->maint)
- span->maint(span, ZT_MAINT_LOOPSTOP);
+ span->maint(span, DAHDI_MAINT_LOOPSTOP);
span->maintstat = 0;
wake_up_interruptible(&span->maintq);
}
@@ -7424,7 +7424,7 @@ int zt_transmit(struct zt_span *span)
return 0;
}
-int zt_receive(struct zt_span *span)
+int dahdi_receive(struct dahdi_span *span)
{
int x,y,z;
unsigned long flags, flagso;
@@ -7438,16 +7438,16 @@ int zt_receive(struct zt_span *span)
spin_lock_irqsave(&span->chans[x].lock, flags);
if (span->chans[x].nextslave) {
/* Must process each slave at the same time */
- u_char data[ZT_CHUNKSIZE];
+ u_char data[DAHDI_CHUNKSIZE];
int pos = 0;
- for (y=0;y<ZT_CHUNKSIZE;y++) {
+ for (y=0;y<DAHDI_CHUNKSIZE;y++) {
/* Put all its slaves, too */
z = x;
do {
data[pos++] = span->chans[z].readchunk[y];
- if (pos == ZT_CHUNKSIZE) {
- if(!(span->chans[x].flags & ZT_FLAG_NOSTDTXRX))
- __zt_receive_chunk(&span->chans[x], data);
+ if (pos == DAHDI_CHUNKSIZE) {
+ if(!(span->chans[x].flags & DAHDI_FLAG_NOSTDTXRX))
+ __dahdi_receive_chunk(&span->chans[x], data);
pos = 0;
}
z=span->chans[z].nextslave;
@@ -7455,25 +7455,25 @@ int zt_receive(struct zt_span *span)
}
} else {
/* Process a normal channel */
- if (!(span->chans[x].flags & ZT_FLAG_NOSTDTXRX))
- __zt_real_receive(&span->chans[x]);
+ if (!(span->chans[x].flags & DAHDI_FLAG_NOSTDTXRX))
+ __dahdi_real_receive(&span->chans[x]);
}
if (span->chans[x].itimer) {
- span->chans[x].itimer -= ZT_CHUNKSIZE;
+ span->chans[x].itimer -= DAHDI_CHUNKSIZE;
if (span->chans[x].itimer <= 0) {
rbs_itimer_expire(&span->chans[x]);
}
}
if (span->chans[x].ringdebtimer)
span->chans[x].ringdebtimer--;
- if (span->chans[x].sig & __ZT_SIG_FXS) {
- if (span->chans[x].rxhooksig == ZT_RXSIG_RING)
- span->chans[x].ringtrailer = ZT_RINGTRAILER;
+ if (span->chans[x].sig & __DAHDI_SIG_FXS) {
+ if (span->chans[x].rxhooksig == DAHDI_RXSIG_RING)
+ span->chans[x].ringtrailer = DAHDI_RINGTRAILER;
else if (span->chans[x].ringtrailer) {
- span->chans[x].ringtrailer-= ZT_CHUNKSIZE;
+ span->chans[x].ringtrailer-= DAHDI_CHUNKSIZE;
/* See if RING trailer is expired */
if (!span->chans[x].ringtrailer && !span->chans[x].ringdebtimer)
- __qevent(&span->chans[x],ZT_EVENT_RINGOFFHOOK);
+ __qevent(&span->chans[x],DAHDI_EVENT_RINGOFFHOOK);
}
}
if (span->chans[x].pulsetimer)
@@ -7489,13 +7489,13 @@ int zt_receive(struct zt_span *span)
span->chans[x].pulsecount,
span->chans[x].name);
} else if (span->chans[x].pulsecount > 11) {
- __qevent(&span->chans[x], ZT_EVENT_PULSEDIGIT | '#');
+ __qevent(&span->chans[x], DAHDI_EVENT_PULSEDIGIT | '#');
} else if (span->chans[x].pulsecount > 10) {
- __qevent(&span->chans[x], ZT_EVENT_PULSEDIGIT | '*');
+ __qevent(&span->chans[x], DAHDI_EVENT_PULSEDIGIT | '*');
} else if (span->chans[x].pulsecount > 9) {
- __qevent(&span->chans[x], ZT_EVENT_PULSEDIGIT | '0');
+ __qevent(&span->chans[x], DAHDI_EVENT_PULSEDIGIT | '0');
} else {
- __qevent(&span->chans[x], ZT_EVENT_PULSEDIGIT | ('0' +
+ __qevent(&span->chans[x], DAHDI_EVENT_PULSEDIGIT | ('0' +
span->chans[x].pulsecount));
}
span->chans[x].pulsecount = 0;
@@ -7514,14 +7514,14 @@ int zt_receive(struct zt_span *span)
process_timers();
/* If we have dynamic stuff, call the ioctl with 0,0 parameters to
make it run */
- if (zt_dynamic_ioctl)
- zt_dynamic_ioctl(0,0);
+ if (dahdi_dynamic_ioctl)
+ dahdi_dynamic_ioctl(0,0);
for (x=1;x<maxchans;x++) {
- if (chans[x] && chans[x]->confmode && !(chans[x]->flags & ZT_FLAG_PSEUDO)) {
+ if (chans[x] && chans[x]->confmode && !(chans[x]->flags & DAHDI_FLAG_PSEUDO)) {
u_char *data;
spin_lock_irqsave(&chans[x]->lock, flags);
data = __buf_peek(&chans[x]->confin);
- __zt_receive_chunk(chans[x], data);
+ __dahdi_receive_chunk(chans[x], data);
if (data)
__buf_pull(&chans[x]->confin, NULL,chans[x], "confreceive");
spin_unlock_irqrestore(&chans[x]->lock, flags);
@@ -7531,15 +7531,15 @@ int zt_receive(struct zt_span *span)
rotate_sums();
/* do all the pseudo and/or conferenced channel receives (getbuf's) */
for (x=1;x<maxchans;x++) {
- if (chans[x] && (chans[x]->flags & ZT_FLAG_PSEUDO)) {
+ if (chans[x] && (chans[x]->flags & DAHDI_FLAG_PSEUDO)) {
spin_lock_irqsave(&chans[x]->lock, flags);
- __zt_transmit_chunk(chans[x], NULL);
+ __dahdi_transmit_chunk(chans[x], NULL);
spin_unlock_irqrestore(&chans[x]->lock, flags);
}
}
if (maxlinks) {
#ifdef CONFIG_ZAPTEL_MMX
- zt_kernel_fpu_begin();
+ dahdi_kernel_fpu_begin();
#endif
/* process all the conf links */
for(x = 1; x <= maxlinks; x++) {
@@ -7555,20 +7555,20 @@ int zt_receive(struct zt_span *span)
}
/* do all the pseudo/conferenced channel transmits (putbuf's) */
for (x=1;x<maxchans;x++) {
- if (chans[x] && (chans[x]->flags & ZT_FLAG_PSEUDO)) {
- unsigned char tmp[ZT_CHUNKSIZE];
+ if (chans[x] && (chans[x]->flags & DAHDI_FLAG_PSEUDO)) {
+ unsigned char tmp[DAHDI_CHUNKSIZE];
spin_lock_irqsave(&chans[x]->lock, flags);
- __zt_getempty(chans[x], tmp);
- __zt_receive_chunk(chans[x], tmp);
+ __dahdi_getempty(chans[x], tmp);
+ __dahdi_receive_chunk(chans[x], tmp);
spin_unlock_irqrestore(&chans[x]->lock, flags);
}
}
for (x=1;x<maxchans;x++) {
- if (chans[x] && chans[x]->confmode && !(chans[x]->flags & ZT_FLAG_PSEUDO)) {
+ if (chans[x] && chans[x]->confmode && !(chans[x]->flags & DAHDI_FLAG_PSEUDO)) {
u_char *data;
spin_lock_irqsave(&chans[x]->lock, flags);
data = __buf_pushpeek(&chans[x]->confout);
- __zt_transmit_chunk(chans[x], data);
+ __dahdi_transmit_chunk(chans[x], data);
if (data)
__buf_push(&chans[x]->confout, NULL, "conftransmit");
spin_unlock_irqrestore(&chans[x]->lock, flags);
@@ -7576,7 +7576,7 @@ int zt_receive(struct zt_span *span)
}
#ifdef ZAPTEL_SYNC_TICK
for (x=0;x<maxspans;x++) {
- struct zt_span *s = spans[x];
+ struct dahdi_span *s = spans[x];
if (s && s->sync_tick)
s->sync_tick(s, s == master);
@@ -7605,16 +7605,16 @@ MODULE_PARM(debug, "i");
MODULE_PARM(deftaps, "i");
#endif
-static struct file_operations zt_fops = {
+static struct file_operations dahdi_fops = {
owner: THIS_MODULE,
llseek: NULL,
- open: zt_open,
- release: zt_release,
- ioctl: zt_ioctl,
- read: zt_read,
- write: zt_write,
- poll: zt_poll,
- mmap: zt_mmap,
+ open: dahdi_open,
+ release: dahdi_release,
+ ioctl: dahdi_ioctl,
+ read: dahdi_read,
+ write: dahdi_write,
+ poll: dahdi_poll,
+ mmap: dahdi_mmap,
flush: NULL,
fsync: NULL,
fasync: NULL,
@@ -7631,27 +7631,27 @@ static void watchdog_check(unsigned long ignored)
local_irq_save(flags);
for (x=0;x<maxspans;x++) {
- if (spans[x] && (spans[x]->flags & ZT_FLAG_RUNNING)) {
- if (spans[x]->watchcounter == ZT_WATCHDOG_INIT) {
+ if (spans[x] && (spans[x]->flags & DAHDI_FLAG_RUNNING)) {
+ if (spans[x]->watchcounter == DAHDI_WATCHDOG_INIT) {
/* Whoops, dead card */
- if ((spans[x]->watchstate == ZT_WATCHSTATE_OK) ||
- (spans[x]->watchstate == ZT_WATCHSTATE_UNKNOWN)) {
- spans[x]->watchstate = ZT_WATCHSTATE_RECOVERING;
+ if ((spans[x]->watchstate == DAHDI_WATCHSTATE_OK) ||
+ (spans[x]->watchstate == DAHDI_WATCHSTATE_UNKNOWN)) {
+ spans[x]->watchstate = DAHDI_WATCHSTATE_RECOVERING;
if (spans[x]->watchdog) {
printk("Kicking span %s\n", spans[x]->name);
- spans[x]->watchdog(spans[x], ZT_WATCHDOG_NOINTS);
+ spans[x]->watchdog(spans[x], DAHDI_WATCHDOG_NOINTS);
} else {
printk("Span %s is dead with no revival\n", spans[x]->name);
- spans[x]->watchstate = ZT_WATCHSTATE_FAILED;
+ spans[x]->watchstate = DAHDI_WATCHSTATE_FAILED;
}
}
} else {
- if ((spans[x]->watchstate != ZT_WATCHSTATE_OK) &&
- (spans[x]->watchstate != ZT_WATCHSTATE_UNKNOWN))
+ if ((spans[x]->watchstate != DAHDI_WATCHSTATE_OK) &&
+ (spans[x]->watchstate != DAHDI_WATCHSTATE_UNKNOWN))
printk("Span %s is alive!\n", spans[x]->name);
- spans[x]->watchstate = ZT_WATCHSTATE_OK;
+ spans[x]->watchstate = DAHDI_WATCHSTATE_OK;
}
- spans[x]->watchcounter = ZT_WATCHDOG_INIT;
+ spans[x]->watchcounter = DAHDI_WATCHDOG_INIT;
}
}
local_irq_restore(flags);
@@ -7680,7 +7680,7 @@ static void __exit watchdog_cleanup(void)
#endif
-int zt_register_chardev(struct zt_chardev *dev)
+int dahdi_register_chardev(struct dahdi_chardev *dev)
{
#ifdef CONFIG_DEVFS_FS
umode_t mode = S_IFCHR|S_IRUGO|S_IWUGO;
@@ -7691,20 +7691,20 @@ int zt_register_chardev(struct zt_chardev *dev)
strcpy(udevname, "zap");
strcat(udevname, dev->name);
- CLASS_DEV_CREATE(zap_class, MKDEV(ZT_MAJOR, dev->minor), NULL, udevname);
+ CLASS_DEV_CREATE(zap_class, MKDEV(DAHDI_MAJOR, dev->minor), NULL, udevname);
#endif /* CONFIG_ZAP_UDEV */
#ifdef CONFIG_DEVFS_FS
- dev->devfs_handle = devfs_register(zaptel_devfs_dir, dev->name, DEVFS_FL_DEFAULT, ZT_MAJOR, dev->minor, mode, &zt_fops, NULL);
+ dev->devfs_handle = devfs_register(zaptel_devfs_dir, dev->name, DEVFS_FL_DEFAULT, DAHDI_MAJOR, dev->minor, mode, &dahdi_fops, NULL);
#endif /* CONFIG_DEVFS_FS */
return 0;
}
-int zt_unregister_chardev(struct zt_chardev *dev)
+int dahdi_unregister_chardev(struct dahdi_chardev *dev)
{
#ifdef CONFIG_ZAP_UDEV
- class_device_destroy(zap_class, MKDEV(ZT_MAJOR, dev->minor));
+ class_device_destroy(zap_class, MKDEV(DAHDI_MAJOR, dev->minor));
#endif /* CONFIG_ZAP_UDEV */
#ifdef CONFIG_DEVFS_FS
@@ -7714,7 +7714,7 @@ int zt_unregister_chardev(struct zt_chardev *dev)
return 0;
}
-static int __init zt_init(void) {
+static int __init dahdi_init(void) {
int res = 0;
#ifdef CONFIG_PROC_FS
@@ -7723,35 +7723,35 @@ static int __init zt_init(void) {
#ifdef CONFIG_ZAP_UDEV /* udev support functions */
zap_class = class_create(THIS_MODULE, "zaptel");
- CLASS_DEV_CREATE(zap_class, MKDEV(ZT_MAJOR, 253), NULL, "zaptimer");
- CLASS_DEV_CREATE(zap_class, MKDEV(ZT_MAJOR, 254), NULL, "zapchannel");
- CLASS_DEV_CREATE(zap_class, MKDEV(ZT_MAJOR, 255), NULL, "zappseudo");
- CLASS_DEV_CREATE(zap_class, MKDEV(ZT_MAJOR, 0), NULL, "zapctl");
+ CLASS_DEV_CREATE(zap_class, MKDEV(DAHDI_MAJOR, 253), NULL, "zaptimer");
+ CLASS_DEV_CREATE(zap_class, MKDEV(DAHDI_MAJOR, 254), NULL, "zapchannel");
+ CLASS_DEV_CREATE(zap_class, MKDEV(DAHDI_MAJOR, 255), NULL, "zappseudo");
+ CLASS_DEV_CREATE(zap_class, MKDEV(DAHDI_MAJOR, 0), NULL, "zapctl");
#endif /* CONFIG_ZAP_UDEV */
#ifdef CONFIG_DEVFS_FS
{
umode_t mode = S_IFCHR|S_IRUGO|S_IWUGO;
- devfs_register_chrdev(ZT_MAJOR, "zaptel", &zt_fops);
+ devfs_register_chrdev(DAHDI_MAJOR, "zaptel", &dahdi_fops);
if (!(zaptel_devfs_dir = devfs_mk_dir(NULL, "zap", NULL)))
return -EBUSY; /* This would be bad */
- timer = devfs_register(zaptel_devfs_dir, "timer", DEVFS_FL_DEFAULT, ZT_MAJOR, 253, mode, &zt_fops, NULL);
- channel = devfs_register(zaptel_devfs_dir, "channel", DEVFS_FL_DEFAULT, ZT_MAJOR, 254, mode, &zt_fops, NULL);
- pseudo = devfs_register(zaptel_devfs_dir, "pseudo", DEVFS_FL_DEFAULT, ZT_MAJOR, 255, mode, &zt_fops, NULL);
- ctl = devfs_register(zaptel_devfs_dir, "ctl", DEVFS_FL_DEFAULT, ZT_MAJOR, 0, mode, &zt_fops, NULL);
+ timer = devfs_register(zaptel_devfs_dir, "timer", DEVFS_FL_DEFAULT, DAHDI_MAJOR, 253, mode, &dahdi_fops, NULL);
+ channel = devfs_register(zaptel_devfs_dir, "channel", DEVFS_FL_DEFAULT, DAHDI_MAJOR, 254, mode, &dahdi_fops, NULL);
+ pseudo = devfs_register(zaptel_devfs_dir, "pseudo", DEVFS_FL_DEFAULT, DAHDI_MAJOR, 255, mode, &dahdi_fops, NULL);
+ ctl = devfs_register(zaptel_devfs_dir, "ctl", DEVFS_FL_DEFAULT, DAHDI_MAJOR, 0, mode, &dahdi_fops, NULL);
}
#else
- if ((res = register_chrdev(ZT_MAJOR, "zaptel", &zt_fops))) {
- printk(KERN_ERR "Unable to register Zaptel character device handler on %d\n", ZT_MAJOR);
+ if ((res = register_chrdev(DAHDI_MAJOR, "zaptel", &dahdi_fops))) {
+ printk(KERN_ERR "Unable to register Zaptel character device handler on %d\n", DAHDI_MAJOR);
return res;
}
#endif /* CONFIG_DEVFS_FS */
- printk(KERN_INFO "Zapata Telephony Interface Registered on major %d\n", ZT_MAJOR);
+ printk(KERN_INFO "Zapata Telephony Interface Registered on major %d\n", DAHDI_MAJOR);
printk(KERN_INFO "Zaptel Version: %s\n", ZAPTEL_VERSION);
echo_can_init();
- zt_conv_init();
+ dahdi_conv_init();
fasthdlc_precalc();
rotate_sums();
rwlock_init(&chan_lock);
@@ -7761,7 +7761,7 @@ static int __init zt_init(void) {
return res;
}
-static void __exit zt_cleanup(void) {
+static void __exit dahdi_cleanup(void) {
int x;
#ifdef CONFIG_PROC_FS
@@ -7769,7 +7769,7 @@ static void __exit zt_cleanup(void) {
#endif
printk(KERN_INFO "Zapata Telephony Interface Unloaded\n");
- for (x = 0; x < ZT_TONE_ZONE_MAX; x++) {
+ for (x = 0; x < DAHDI_TONE_ZONE_MAX; x++) {
if (tone_zones[x])
kfree(tone_zones[x]);
}
@@ -7780,16 +7780,16 @@ static void __exit zt_cleanup(void) {
devfs_unregister(pseudo);
devfs_unregister(ctl);
devfs_unregister(zaptel_devfs_dir);
- devfs_unregister_chrdev(ZT_MAJOR, "zaptel");
+ devfs_unregister_chrdev(DAHDI_MAJOR, "zaptel");
#else
#ifdef CONFIG_ZAP_UDEV
- class_device_destroy(zap_class, MKDEV(ZT_MAJOR, 253)); /* timer */
- class_device_destroy(zap_class, MKDEV(ZT_MAJOR, 254)); /* channel */
- class_device_destroy(zap_class, MKDEV(ZT_MAJOR, 255)); /* pseudo */
- class_device_destroy(zap_class, MKDEV(ZT_MAJOR, 0)); /* ctl */
+ class_device_destroy(zap_class, MKDEV(DAHDI_MAJOR, 253)); /* timer */
+ class_device_destroy(zap_class, MKDEV(DAHDI_MAJOR, 254)); /* channel */
+ class_device_destroy(zap_class, MKDEV(DAHDI_MAJOR, 255)); /* pseudo */
+ class_device_destroy(zap_class, MKDEV(DAHDI_MAJOR, 0)); /* ctl */
class_destroy(zap_class);
#endif /* CONFIG_ZAP_UDEV */
- unregister_chrdev(ZT_MAJOR, "zaptel");
+ unregister_chrdev(DAHDI_MAJOR, "zaptel");
#endif
#ifdef CONFIG_ZAPTEL_WATCHDOG
watchdog_cleanup();
@@ -7798,5 +7798,5 @@ static void __exit zt_cleanup(void) {
echo_can_shutdown();
}
-module_init(zt_init);
-module_exit(zt_cleanup);
+module_init(dahdi_init);
+module_exit(dahdi_cleanup);
diff --git a/drivers/dahdi/dahdi_dummy.c b/drivers/dahdi/dahdi_dummy.c
index 3921d46..046da79 100644
--- a/drivers/dahdi/dahdi_dummy.c
+++ b/drivers/dahdi/dahdi_dummy.c
@@ -99,8 +99,8 @@
#endif
struct ztdummy {
- struct zt_span span;
- struct zt_chan chan;
+ struct dahdi_span span;
+ struct dahdi_chan chan;
#ifdef LINUX26
unsigned int counter;
#ifdef USE_RTC
@@ -310,8 +310,8 @@ static void ztdummy_rtc_interrupt(void *private_data)
taskletpending = 1;
tasklet_hi_schedule(&ztd_tlet);
}
- zt_receive(&ztd->span);
- zt_transmit(&ztd->span);
+ dahdi_receive(&ztd->span);
+ dahdi_transmit(&ztd->span);
}
spin_unlock_irqrestore(&ztd->rtclock, flags);
}
@@ -321,8 +321,8 @@ static enum hrtimer_restart ztdummy_hr_int(struct hrtimer *htmr)
unsigned long overrun;
/* Trigger Zaptel */
- zt_receive(&ztd->span);
- zt_transmit(&ztd->span);
+ dahdi_receive(&ztd->span);
+ dahdi_transmit(&ztd->span);
/* Overrun should always return 1, since we are in the timer that
* expired.
@@ -357,8 +357,8 @@ static void ztdummy_timer(unsigned long param)
ztd->counter += ZAPTEL_TIME;
while (ztd->counter >= HZ) {
ztd->counter -= HZ;
- zt_receive(&ztd->span);
- zt_transmit(&ztd->span);
+ dahdi_receive(&ztd->span);
+ dahdi_transmit(&ztd->span);
}
}
#endif
@@ -371,8 +371,8 @@ static void ztdummy_interrupt(int irq, void *dev_id, struct pt_regs *regs)
status = inw (io_addr + USBSTS);
if (status != 0) { /* interrupt from our USB port */
static int check_int = 0;
- zt_receive(&ztd->span);
- zt_transmit(&ztd->span);
+ dahdi_receive(&ztd->span);
+ dahdi_transmit(&ztd->span);
/* TODO: What's the relation between monitor and
* DEBUG_TICKS */
if (monitor && check_int) {
@@ -394,11 +394,11 @@ static int ztdummy_initialize(struct ztdummy *ztd)
ztd->chan.chanpos = 1;
ztd->span.chans = &ztd->chan;
ztd->span.channels = 0; /* no channels on our span */
- ztd->span.deflaw = ZT_LAW_MULAW;
+ ztd->span.deflaw = DAHDI_LAW_MULAW;
init_waitqueue_head(&ztd->span.maintq);
ztd->span.pvt = ztd;
ztd->chan.pvt = ztd;
- if (zt_register(&ztd->span, 0)) {
+ if (dahdi_register(&ztd->span, 0)) {
return -1;
}
return 0;
@@ -452,7 +452,7 @@ int init_module(void)
err = rtc_register(&ztd->rtc_task);
if (err < 0) {
printk(KERN_ERR "ztdummy: Unable to register zaptel rtc driver\n");
- zt_unregister(&ztd->span);
+ dahdi_unregister(&ztd->span);
kfree(ztd);
return err;
}
@@ -526,7 +526,7 @@ void cleanup_module(void)
#else
free_irq(s->irq, ztd); /* disable interrupts */
#endif
- zt_unregister(&ztd->span);
+ dahdi_unregister(&ztd->span);
kfree(ztd);
#ifndef LINUX26
unlink_td(s, td, 1);
diff --git a/drivers/dahdi/dahdi_dummy.h b/drivers/dahdi/dahdi_dummy.h
index 25e37c9..0f027cf 100644
--- a/drivers/dahdi/dahdi_dummy.h
+++ b/drivers/dahdi/dahdi_dummy.h
@@ -30,8 +30,8 @@
#endif
struct ztdummy {
- struct zt_span span;
- struct zt_chan chan;
+ struct dahdi_span span;
+ struct dahdi_chan chan;
#ifdef LINUX26
unsigned int counter;
#ifdef USE_RTC
diff --git a/drivers/dahdi/dahdi_dynamic.c b/drivers/dahdi/dahdi_dynamic.c
index 42d6291..6daa052 100644
--- a/drivers/dahdi/dahdi_dynamic.c
+++ b/drivers/dahdi/dahdi_dynamic.c
@@ -74,7 +74,7 @@
*/
/* Arbitrary limit to the max # of channels in a span */
-#define ZT_DYNAMIC_MAX_CHANS 256
+#define DAHDI_DYNAMIC_MAX_CHANS 256
#define ZTD_FLAG_YELLOW_ALARM (1 << 0)
#define ZTD_FLAG_SIGBITS_PRESENT (1 << 1)
@@ -84,9 +84,9 @@
#define ERR_NCHAN (1 << 17)
#define ERR_LEN (1 << 18)
-EXPORT_SYMBOL(zt_dynamic_register);
-EXPORT_SYMBOL(zt_dynamic_unregister);
-EXPORT_SYMBOL(zt_dynamic_receive);
+EXPORT_SYMBOL(dahdi_dynamic_register);
+EXPORT_SYMBOL(dahdi_dynamic_unregister);
+EXPORT_SYMBOL(dahdi_dynamic_receive);
#ifdef ENABLE_TASKLETS
static int taskletrun;
@@ -100,7 +100,7 @@ static void ztd_tasklet(unsigned long data);
#endif
-static struct zt_dynamic {
+static struct dahdi_dynamic {
char addr[40];
char dname[20];
int err;
@@ -109,17 +109,17 @@ static struct zt_dynamic {
long rxjif;
unsigned short txcnt;
unsigned short rxcnt;
- struct zt_span span;
- struct zt_chan *chans;
- struct zt_dynamic *next;
- struct zt_dynamic_driver *driver;
+ struct dahdi_span span;
+ struct dahdi_chan *chans;
+ struct dahdi_dynamic *next;
+ struct dahdi_dynamic_driver *driver;
void *pvt;
int timing;
int master;
unsigned char *msgbuf;
} *dspans;
-static struct zt_dynamic_driver *drivers = NULL;
+static struct dahdi_dynamic_driver *drivers = NULL;
static int debug = 0;
@@ -141,13 +141,13 @@ static void checkmaster(void)
unsigned long flags;
int newhasmaster=0;
int best = 9999999;
- struct zt_dynamic *z, *master=NULL;
+ struct dahdi_dynamic *z, *master=NULL;
spin_lock_irqsave(&dlock, flags);
z = dspans;
while(z) {
if (z->timing) {
z->master = 0;
- if (!(z->span.alarms & ZT_ALARM_RED) &&
+ if (!(z->span.alarms & DAHDI_ALARM_RED) &&
(z->timing < best) && !z->dead) {
/* If not in alarm and they're
a better timing source, use them */
@@ -169,7 +169,7 @@ static void checkmaster(void)
printk("TDMoX: No master.\n");
}
-static void ztd_sendmessage(struct zt_dynamic *z)
+static void ztd_sendmessage(struct dahdi_dynamic *z)
{
unsigned char *buf = z->msgbuf;
unsigned short bits;
@@ -178,12 +178,12 @@ static void ztd_sendmessage(struct zt_dynamic *z)
int offset;
/* Byte 0: Number of samples per channel */
- *buf = ZT_CHUNKSIZE;
+ *buf = DAHDI_CHUNKSIZE;
buf++; msglen++;
/* Byte 1: Flags */
*buf = 0;
- if (z->span.alarms & ZT_ALARM_RED)
+ if (z->span.alarms & DAHDI_ALARM_RED)
*buf |= ZTD_FLAG_YELLOW_ALARM;
*buf |= ZTD_FLAG_SIGBITS_PRESENT;
buf++; msglen++;
@@ -220,9 +220,9 @@ static void ztd_sendmessage(struct zt_dynamic *z)
}
for (x=0;x<z->span.channels;x++) {
- memcpy(buf, z->chans[x].writechunk, ZT_CHUNKSIZE);
- buf += ZT_CHUNKSIZE;
- msglen += ZT_CHUNKSIZE;
+ memcpy(buf, z->chans[x].writechunk, DAHDI_CHUNKSIZE);
+ buf += DAHDI_CHUNKSIZE;
+ msglen += DAHDI_CHUNKSIZE;
}
z->driver->transmit(z->pvt, z->msgbuf, msglen);
@@ -232,8 +232,8 @@ static void ztd_sendmessage(struct zt_dynamic *z)
static void __ztdynamic_run(void)
{
unsigned long flags;
- struct zt_dynamic *z;
- struct zt_dynamic_driver *drv;
+ struct dahdi_dynamic *z;
+ struct dahdi_dynamic_driver *drv;
int y;
spin_lock_irqsave(&dlock, flags);
z = dspans;
@@ -242,10 +242,10 @@ static void __ztdynamic_run(void)
/* Ignore dead spans */
for (y=0;y<z->span.channels;y++) {
/* Echo cancel double buffered data */
- zt_ec_chunk(&z->span.chans[y], z->span.chans[y].readchunk, z->span.chans[y].writechunk);
+ dahdi_ec_chunk(&z->span.chans[y], z->span.chans[y].readchunk, z->span.chans[y].writechunk);
}
- zt_receive(&z->span);
- zt_transmit(&z->span);
+ dahdi_receive(&z->span);
+ dahdi_transmit(&z->span);
/* Handle all transmissions now */
ztd_sendmessage(z);
}
@@ -280,9 +280,9 @@ static void ztdynamic_run(void)
#define ztdynamic_run __ztdynamic_run
#endif
-void zt_dynamic_receive(struct zt_span *span, unsigned char *msg, int msglen)
+void dahdi_dynamic_receive(struct dahdi_span *span, unsigned char *msg, int msglen)
{
- struct zt_dynamic *ztd = span->pvt;
+ struct dahdi_dynamic *ztd = span->pvt;
int newerr=0;
unsigned long flags;
int sflags;
@@ -305,11 +305,11 @@ void zt_dynamic_receive(struct zt_span *span, unsigned char *msg, int msglen)
}
/* First, check the chunksize */
- if (*msg != ZT_CHUNKSIZE) {
+ if (*msg != DAHDI_CHUNKSIZE) {
spin_unlock_irqrestore(&dlock, flags);
newerr = ERR_NSAMP | msg[0];
if (newerr != ztd->err) {
- printk("Span %s: Expected %d samples, but receiving %d\n", span->name, ZT_CHUNKSIZE, msg[0]);
+ printk("Span %s: Expected %d samples, but receiving %d\n", span->name, DAHDI_CHUNKSIZE, msg[0]);
}
ztd->err = newerr;
return;
@@ -341,7 +341,7 @@ void zt_dynamic_receive(struct zt_span *span, unsigned char *msg, int msglen)
/* Start with header */
xlen = 6;
/* Add samples of audio */
- xlen += nchans * ZT_CHUNKSIZE;
+ xlen += nchans * DAHDI_CHUNKSIZE;
/* If RBS info is there, add that */
if (sflags & ZTD_FLAG_SIGBITS_PRESENT) {
/* Account for sigbits -- one short per 4 channels*/
@@ -375,15 +375,15 @@ void zt_dynamic_receive(struct zt_span *span, unsigned char *msg, int msglen)
/* Update signalling if appropriate */
if (sig != span->chans[x].rxsig)
- zt_rbsbits(&span->chans[x], sig);
+ dahdi_rbsbits(&span->chans[x], sig);
}
}
/* Record data for channels */
for (x=0;x<nchans;x++) {
- memcpy(span->chans[x].readchunk, msg, ZT_CHUNKSIZE);
- msg += ZT_CHUNKSIZE;
+ memcpy(span->chans[x].readchunk, msg, DAHDI_CHUNKSIZE);
+ msg += DAHDI_CHUNKSIZE;
}
master = ztd->master;
@@ -394,13 +394,13 @@ void zt_dynamic_receive(struct zt_span *span, unsigned char *msg, int msglen)
spin_unlock_irqrestore(&dlock, flags);
/* Check for Yellow alarm */
- newalarm = span->alarms & ~(ZT_ALARM_YELLOW | ZT_ALARM_RED);
+ newalarm = span->alarms & ~(DAHDI_ALARM_YELLOW | DAHDI_ALARM_RED);
if (sflags & ZTD_FLAG_YELLOW_ALARM)
- newalarm |= ZT_ALARM_YELLOW;
+ newalarm |= DAHDI_ALARM_YELLOW;
if (newalarm != span->alarms) {
span->alarms = newalarm;
- zt_alarm_notify(span);
+ dahdi_alarm_notify(span);
checkmaster();
}
@@ -417,11 +417,11 @@ void zt_dynamic_receive(struct zt_span *span, unsigned char *msg, int msglen)
}
-static void dynamic_destroy(struct zt_dynamic *z)
+static void dynamic_destroy(struct dahdi_dynamic *z)
{
/* Unregister span if appropriate */
- if (z->span.flags & ZT_FLAG_REGISTERED)
- zt_unregister(&z->span);
+ if (z->span.flags & DAHDI_FLAG_REGISTERED)
+ dahdi_unregister(&z->span);
/* Destroy the pvt stuff if there */
if (z->pvt)
@@ -440,9 +440,9 @@ static void dynamic_destroy(struct zt_dynamic *z)
checkmaster();
}
-static struct zt_dynamic *find_dynamic(ZT_DYNAMIC_SPAN *zds)
+static struct dahdi_dynamic *find_dynamic(DAHDI_DYNAMIC_SPAN *zds)
{
- struct zt_dynamic *z;
+ struct dahdi_dynamic *z;
z = dspans;
while(z) {
if (!strcmp(z->dname, zds->driver) &&
@@ -453,9 +453,9 @@ static struct zt_dynamic *find_dynamic(ZT_DYNAMIC_SPAN *zds)
return z;
}
-static struct zt_dynamic_driver *find_driver(char *name)
+static struct dahdi_dynamic_driver *find_driver(char *name)
{
- struct zt_dynamic_driver *ztd;
+ struct dahdi_dynamic_driver *ztd;
ztd = drivers;
while(ztd) {
/* here's our driver */
@@ -466,10 +466,10 @@ static struct zt_dynamic_driver *find_driver(char *name)
return ztd;
}
-static int destroy_dynamic(ZT_DYNAMIC_SPAN *zds)
+static int destroy_dynamic(DAHDI_DYNAMIC_SPAN *zds)
{
unsigned long flags;
- struct zt_dynamic *z, *cur, *prev=NULL;
+ struct dahdi_dynamic *z, *cur, *prev=NULL;
spin_lock_irqsave(&dlock, flags);
z = find_dynamic(zds);
if (!z) {
@@ -503,15 +503,15 @@ static int destroy_dynamic(ZT_DYNAMIC_SPAN *zds)
return 0;
}
-static int ztd_rbsbits(struct zt_chan *chan, int bits)
+static int ztd_rbsbits(struct dahdi_chan *chan, int bits)
{
/* Don't have to do anything */
return 0;
}
-static int ztd_open(struct zt_chan *chan)
+static int ztd_open(struct dahdi_chan *chan)
{
- struct zt_dynamic *z;
+ struct dahdi_dynamic *z;
z = chan->span->pvt;
if (z) {
if (z->dead)
@@ -527,14 +527,14 @@ static int ztd_open(struct zt_chan *chan)
return 0;
}
-static int ztd_chanconfig(struct zt_chan *chan, int sigtype)
+static int ztd_chanconfig(struct dahdi_chan *chan, int sigtype)
{
return 0;
}
-static int ztd_close(struct zt_chan *chan)
+static int ztd_close(struct dahdi_chan *chan)
{
- struct zt_dynamic *z;
+ struct dahdi_dynamic *z;
z = chan->span->pvt;
if (z)
z->usecount--;
@@ -548,10 +548,10 @@ static int ztd_close(struct zt_chan *chan)
return 0;
}
-static int create_dynamic(ZT_DYNAMIC_SPAN *zds)
+static int create_dynamic(DAHDI_DYNAMIC_SPAN *zds)
{
- struct zt_dynamic *z;
- struct zt_dynamic_driver *ztd;
+ struct dahdi_dynamic *z;
+ struct dahdi_dynamic_driver *ztd;
unsigned long flags;
int x;
int bufsize;
@@ -560,8 +560,8 @@ static int create_dynamic(ZT_DYNAMIC_SPAN *zds)
printk("Can't be less than 1 channel (%d)!\n", zds->numchans);
return -EINVAL;
}
- if (zds->numchans >= ZT_DYNAMIC_MAX_CHANS) {
- printk("Can't create dynamic span with greater than %d channels. See ztdynamic.c and increase ZT_DYNAMIC_MAX_CHANS\n", zds->numchans);
+ if (zds->numchans >= DAHDI_DYNAMIC_MAX_CHANS) {
+ printk("Can't create dynamic span with greater than %d channels. See ztdynamic.c and increase DAHDI_DYNAMIC_MAX_CHANS\n", zds->numchans);
return -EINVAL;
}
@@ -579,25 +579,25 @@ static int create_dynamic(ZT_DYNAMIC_SPAN *zds)
/* Allocate memory */
- z = (struct zt_dynamic *)kmalloc(sizeof(struct zt_dynamic), GFP_KERNEL);
+ z = (struct dahdi_dynamic *)kmalloc(sizeof(struct dahdi_dynamic), GFP_KERNEL);
if (!z)
return -ENOMEM;
/* Zero it out */
- memset(z, 0, sizeof(struct zt_dynamic));
+ memset(z, 0, sizeof(struct dahdi_dynamic));
/* Allocate other memories */
- z->chans = vmalloc(sizeof(struct zt_chan) * zds->numchans);
+ z->chans = vmalloc(sizeof(struct dahdi_chan) * zds->numchans);
if (!z->chans) {
dynamic_destroy(z);
return -ENOMEM;
}
/* Zero out channel stuff */
- memset(z->chans, 0, sizeof(struct zt_chan) * zds->numchans);
+ memset(z->chans, 0, sizeof(struct dahdi_chan) * zds->numchans);
/* Allocate message buffer with sample space and header space */
- bufsize = zds->numchans * ZT_CHUNKSIZE + zds->numchans / 4 + 48;
+ bufsize = zds->numchans * DAHDI_CHUNKSIZE + zds->numchans / 4 + 48;
z->msgbuf = kmalloc(bufsize, GFP_KERNEL);
@@ -617,8 +617,8 @@ static int create_dynamic(ZT_DYNAMIC_SPAN *zds)
sprintf(z->span.desc, "Dynamic '%s' span at '%s'", zds->driver, zds->addr);
z->span.channels = zds->numchans;
z->span.pvt = z;
- z->span.deflaw = ZT_LAW_MULAW;
- z->span.flags |= ZT_FLAG_RBS;
+ z->span.deflaw = DAHDI_LAW_MULAW;
+ z->span.flags |= DAHDI_FLAG_RBS;
z->span.chans = z->chans;
z->span.rbsbits = ztd_rbsbits;
z->span.open = ztd_open;
@@ -626,10 +626,10 @@ static int create_dynamic(ZT_DYNAMIC_SPAN *zds)
z->span.chanconfig = ztd_chanconfig;
for (x=0;x<zds->numchans;x++) {
sprintf(z->chans[x].name, "ZTD/%s/%s/%d", zds->driver, zds->addr, x+1);
- z->chans[x].sigcap = ZT_SIG_EM | ZT_SIG_CLEAR | ZT_SIG_FXSLS |
- ZT_SIG_FXSKS | ZT_SIG_FXSGS | ZT_SIG_FXOLS |
- ZT_SIG_FXOKS | ZT_SIG_FXOGS | ZT_SIG_SF |
- ZT_SIG_DACS_RBS | ZT_SIG_CAS;
+ z->chans[x].sigcap = DAHDI_SIG_EM | DAHDI_SIG_CLEAR | DAHDI_SIG_FXSLS |
+ DAHDI_SIG_FXSKS | DAHDI_SIG_FXSGS | DAHDI_SIG_FXOLS |
+ DAHDI_SIG_FXOKS | DAHDI_SIG_FXOGS | DAHDI_SIG_SF |
+ DAHDI_SIG_DACS_RBS | DAHDI_SIG_CAS;
z->chans[x].chanpos = x + 1;
z->chans[x].pvt = z;
}
@@ -668,7 +668,7 @@ static int create_dynamic(ZT_DYNAMIC_SPAN *zds)
z->driver = ztd;
/* Whee! We're created. Now register the span */
- if (zt_register(&z->span, 0)) {
+ if (dahdi_register(&z->span, 0)) {
printk("Unable to register span '%s'\n", z->span.name);
dynamic_destroy(z);
return -EINVAL;
@@ -701,7 +701,7 @@ static void ztd_tasklet(unsigned long data)
static int ztdynamic_ioctl(unsigned int cmd, unsigned long data)
{
- ZT_DYNAMIC_SPAN zds;
+ DAHDI_DYNAMIC_SPAN zds;
int res;
switch(cmd) {
case 0:
@@ -711,8 +711,8 @@ static int ztdynamic_ioctl(unsigned int cmd, unsigned long data)
if (!hasmaster)
ztdynamic_run();
return 0;
- case ZT_DYNAMIC_CREATE:
- if (copy_from_user(&zds, (ZT_DYNAMIC_SPAN *)data, sizeof(zds)))
+ case DAHDI_DYNAMIC_CREATE:
+ if (copy_from_user(&zds, (DAHDI_DYNAMIC_SPAN *)data, sizeof(zds)))
return -EFAULT;
if (debug)
printk("Dynamic Create\n");
@@ -721,11 +721,11 @@ static int ztdynamic_ioctl(unsigned int cmd, unsigned long data)
return res;
zds.spanno = res;
/* Let them know the new span number */
- if (copy_to_user((ZT_DYNAMIC_SPAN *)data, &zds, sizeof(zds)))
+ if (copy_to_user((DAHDI_DYNAMIC_SPAN *)data, &zds, sizeof(zds)))
return -EFAULT;
return 0;
- case ZT_DYNAMIC_DESTROY:
- if (copy_from_user(&zds, (ZT_DYNAMIC_SPAN *)data, sizeof(zds)))
+ case DAHDI_DYNAMIC_DESTROY:
+ if (copy_from_user(&zds, (DAHDI_DYNAMIC_SPAN *)data, sizeof(zds)))
return -EFAULT;
if (debug)
printk("Dynamic Destroy\n");
@@ -735,7 +735,7 @@ static int ztdynamic_ioctl(unsigned int cmd, unsigned long data)
return -ENOTTY;
}
-int zt_dynamic_register(struct zt_dynamic_driver *dri)
+int dahdi_dynamic_register(struct dahdi_dynamic_driver *dri)
{
unsigned long flags;
int res = 0;
@@ -750,10 +750,10 @@ int zt_dynamic_register(struct zt_dynamic_driver *dri)
return res;
}
-void zt_dynamic_unregister(struct zt_dynamic_driver *dri)
+void dahdi_dynamic_unregister(struct dahdi_dynamic_driver *dri)
{
- struct zt_dynamic_driver *cur, *prev=NULL;
- struct zt_dynamic *z, *zp, *zn;
+ struct dahdi_dynamic_driver *cur, *prev=NULL;
+ struct dahdi_dynamic *z, *zp, *zn;
unsigned long flags;
write_lock_irqsave(&drvlock, flags);
cur = drivers;
@@ -799,17 +799,17 @@ static void check_for_red_alarm(unsigned long ignored)
unsigned long flags;
int newalarm;
int alarmchanged = 0;
- struct zt_dynamic *z;
+ struct dahdi_dynamic *z;
spin_lock_irqsave(&dlock, flags);
z = dspans;
while(z) {
- newalarm = z->span.alarms & ~ZT_ALARM_RED;
+ newalarm = z->span.alarms & ~DAHDI_ALARM_RED;
/* If nothing received for a second, consider that RED ALARM */
if ((jiffies - z->rxjif) > 1 * HZ) {
- newalarm |= ZT_ALARM_RED;
+ newalarm |= DAHDI_ALARM_RED;
if (z->span.alarms != newalarm) {
z->span.alarms = newalarm;
- zt_alarm_notify(&z->span);
+ dahdi_alarm_notify(&z->span);
alarmchanged++;
}
}
@@ -826,7 +826,7 @@ static void check_for_red_alarm(unsigned long ignored)
int ztdynamic_init(void)
{
- zt_set_dynamic_ioctl(ztdynamic_ioctl);
+ dahdi_set_dynamic_ioctl(ztdynamic_ioctl);
/* Start process to check for RED ALARM */
init_timer(&alarmcheck);
alarmcheck.expires = 0;
@@ -849,7 +849,7 @@ void ztdynamic_cleanup(void)
tasklet_kill(&ztd_tlet);
}
#endif
- zt_set_dynamic_ioctl(NULL);
+ dahdi_set_dynamic_ioctl(NULL);
del_timer(&alarmcheck);
printk("Zaptel Dynamic Span support unloaded\n");
}
diff --git a/drivers/dahdi/dahdi_dynamic_eth.c b/drivers/dahdi/dahdi_dynamic_eth.c
index 1795487..5c2851f 100644
--- a/drivers/dahdi/dahdi_dynamic_eth.c
+++ b/drivers/dahdi/dahdi_dynamic_eth.c
@@ -59,17 +59,17 @@ static struct sk_buff_head skbs;
static struct ztdeth {
unsigned char addr[ETH_ALEN];
unsigned short subaddr; /* Network byte order */
- struct zt_span *span;
+ struct dahdi_span *span;
char ethdev[IFNAMSIZ];
struct net_device *dev;
struct ztdeth *next;
} *zdevs = NULL;
-struct zt_span *ztdeth_getspan(unsigned char *addr, unsigned short subaddr)
+struct dahdi_span *ztdeth_getspan(unsigned char *addr, unsigned short subaddr)
{
unsigned long flags;
struct ztdeth *z;
- struct zt_span *span = NULL;
+ struct dahdi_span *span = NULL;
spin_lock_irqsave(&zlock, flags);
z = zdevs;
while(z) {
@@ -90,7 +90,7 @@ static int ztdeth_rcv(struct sk_buff *skb, struct net_device *dev, struct packet
static int ztdeth_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
#endif
{
- struct zt_span *span;
+ struct dahdi_span *span;
struct ztdeth_header *zh;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
zh = (struct ztdeth_header *)skb_network_header(skb);
@@ -104,7 +104,7 @@ static int ztdeth_rcv(struct sk_buff *skb, struct net_device *dev, struct packet
#endif
if (span) {
skb_pull(skb, sizeof(struct ztdeth_header));
- zt_dynamic_receive(span, (unsigned char *)skb->data, skb->len);
+ dahdi_dynamic_receive(span, (unsigned char *)skb->data, skb->len);
}
kfree_skb(skb);
return 0;
@@ -300,7 +300,7 @@ static void ztdeth_destroy(void *pvt)
}
}
-static void *ztdeth_create(struct zt_span *span, char *addr)
+static void *ztdeth_create(struct dahdi_span *span, char *addr)
{
struct ztdeth *z;
char src[256];
@@ -408,7 +408,7 @@ static void *ztdeth_create(struct zt_span *span, char *addr)
return z;
}
-static struct zt_dynamic_driver ztd_eth = {
+static struct dahdi_dynamic_driver ztd_eth = {
"eth",
"Ethernet",
ztdeth_create,
@@ -425,7 +425,7 @@ static int __init ztdeth_init(void)
{
dev_add_pack(&ztdeth_ptype);
register_netdevice_notifier(&ztdeth_nblock);
- zt_dynamic_register(&ztd_eth);
+ dahdi_dynamic_register(&ztd_eth);
skb_queue_head_init(&skbs);
@@ -436,7 +436,7 @@ static void __exit ztdeth_exit(void)
{
dev_remove_pack(&ztdeth_ptype);
unregister_netdevice_notifier(&ztdeth_nblock);
- zt_dynamic_unregister(&ztd_eth);
+ dahdi_dynamic_unregister(&ztd_eth);
}
MODULE_DESCRIPTION("Zaptel Dynamic TDMoE Support");
diff --git a/drivers/dahdi/dahdi_dynamic_loc.c b/drivers/dahdi/dahdi_dynamic_loc.c
index 69057a0..d5ee144 100644
--- a/drivers/dahdi/dahdi_dynamic_loc.c
+++ b/drivers/dahdi/dahdi_dynamic_loc.c
@@ -75,7 +75,7 @@ static struct ztdlocal {
unsigned short id;
struct ztdlocal *monitor_rx_peer; /* Indicates the peer span that monitors this span */
struct ztdlocal *peer; /* Indicates the rw peer for this span */
- struct zt_span *span;
+ struct dahdi_span *span;
struct ztdlocal *next;
} *zdevs = NULL;
@@ -87,10 +87,10 @@ static struct ztdlocal {
spin_lock_irqsave(&zlock, flags);
z = pvt;
if (z->peer && z->peer->span) {
- zt_dynamic_receive(z->peer->span, msg, msglen);
+ dahdi_dynamic_receive(z->peer->span, msg, msglen);
}
if (z->monitor_rx_peer && z->monitor_rx_peer->span) {
- zt_dynamic_receive(z->monitor_rx_peer->span, msg, msglen);
+ dahdi_dynamic_receive(z->monitor_rx_peer->span, msg, msglen);
}
spin_unlock_irqrestore(&zlock, flags);
return 0;
@@ -167,7 +167,7 @@ static int digit2int(char d)
}
}
-/*static*/ void *ztdlocal_create(struct zt_span *span, char *address)
+/*static*/ void *ztdlocal_create(struct dahdi_span *span, char *address)
{
struct ztdlocal *z, *l;
unsigned long flags;
@@ -253,7 +253,7 @@ INVALID_ADDRESS:
return NULL;
}
-static struct zt_dynamic_driver ztd_local = {
+static struct dahdi_dynamic_driver ztd_local = {
"loc",
"Local",
ztdlocal_create,
@@ -264,13 +264,13 @@ static struct zt_dynamic_driver ztd_local = {
/*static*/ int __init ztdlocal_init(void)
{
- zt_dynamic_register(&ztd_local);
+ dahdi_dynamic_register(&ztd_local);
return 0;
}
/*static*/ void __exit ztdlocal_exit(void)
{
- zt_dynamic_unregister(&ztd_local);
+ dahdi_dynamic_unregister(&ztd_local);
}
module_init(ztdlocal_init);
diff --git a/drivers/dahdi/dahdi_transcode.c b/drivers/dahdi/dahdi_transcode.c
index eaf2f9b..d21d89a 100644
--- a/drivers/dahdi/dahdi_transcode.c
+++ b/drivers/dahdi/dahdi_transcode.c
@@ -48,18 +48,18 @@
#include <dahdi/user.h>
static int debug = 0;
-static struct zt_transcoder *trans;
+static struct dahdi_transcoder *trans;
static spinlock_t translock = SPIN_LOCK_UNLOCKED;
-EXPORT_SYMBOL(zt_transcoder_register);
-EXPORT_SYMBOL(zt_transcoder_unregister);
-EXPORT_SYMBOL(zt_transcoder_alert);
-EXPORT_SYMBOL(zt_transcoder_alloc);
-EXPORT_SYMBOL(zt_transcoder_free);
+EXPORT_SYMBOL(dahdi_transcoder_register);
+EXPORT_SYMBOL(dahdi_transcoder_unregister);
+EXPORT_SYMBOL(dahdi_transcoder_alert);
+EXPORT_SYMBOL(dahdi_transcoder_alloc);
+EXPORT_SYMBOL(dahdi_transcoder_free);
-struct zt_transcoder *zt_transcoder_alloc(int numchans)
+struct dahdi_transcoder *dahdi_transcoder_alloc(int numchans)
{
- struct zt_transcoder *ztc;
+ struct dahdi_transcoder *ztc;
unsigned int x;
size_t size = sizeof(*ztc) + (sizeof(ztc->channels[0]) * numchans);
@@ -99,15 +99,15 @@ static int schluffen(wait_queue_head_t *q)
return 0;
}
-void zt_transcoder_free(struct zt_transcoder *ztc)
+void dahdi_transcoder_free(struct dahdi_transcoder *ztc)
{
kfree(ztc);
}
/* Register a transcoder */
-int zt_transcoder_register(struct zt_transcoder *tc)
+int dahdi_transcoder_register(struct dahdi_transcoder *tc)
{
- struct zt_transcoder *cur;
+ struct dahdi_transcoder *cur;
int res = -EBUSY;
spin_lock(&translock);
@@ -129,9 +129,9 @@ int zt_transcoder_register(struct zt_transcoder *tc)
}
/* Unregister a transcoder */
-int zt_transcoder_unregister(struct zt_transcoder *tc)
+int dahdi_transcoder_unregister(struct dahdi_transcoder *tc)
{
- struct zt_transcoder *cur, *prev;
+ struct dahdi_transcoder *cur, *prev;
int res = -EINVAL;
spin_lock(&translock);
@@ -159,21 +159,21 @@ int zt_transcoder_unregister(struct zt_transcoder *tc)
}
/* Alert a transcoder */
-int zt_transcoder_alert(struct zt_transcoder_channel *ztc)
+int dahdi_transcoder_alert(struct dahdi_transcoder_channel *ztc)
{
if (debug)
printk("ZT Transcoder Alert!\n");
if (ztc->tch)
- ztc->tch->status &= ~ZT_TC_FLAG_BUSY;
+ ztc->tch->status &= ~DAHDI_TC_FLAG_BUSY;
wake_up_interruptible(&ztc->ready);
return 0;
}
-static int zt_tc_open(struct inode *inode, struct file *file)
+static int dahdi_tc_open(struct inode *inode, struct file *file)
{
- struct zt_transcoder_channel *ztc;
- struct zt_transcode_header *zth;
+ struct dahdi_transcoder_channel *ztc;
+ struct dahdi_transcode_header *zth;
struct page *page;
if (!(ztc = kmalloc(sizeof(*ztc), GFP_KERNEL)))
@@ -186,11 +186,11 @@ static int zt_tc_open(struct inode *inode, struct file *file)
memset(ztc, 0, sizeof(*ztc));
memset(zth, 0, sizeof(*zth));
- ztc->flags = ZT_TC_FLAG_TRANSIENT | ZT_TC_FLAG_BUSY;
+ ztc->flags = DAHDI_TC_FLAG_TRANSIENT | DAHDI_TC_FLAG_BUSY;
ztc->tch = zth;
if (debug)
printk("Allocated Transcoder Channel, header is at %p!\n", zth);
- zth->magic = ZT_TRANSCODE_MAGIC;
+ zth->magic = DAHDI_TRANSCODE_MAGIC;
file->private_data = ztc;
for (page = virt_to_page(zth);
page < virt_to_page((unsigned long) zth + sizeof(*zth));
@@ -200,15 +200,15 @@ static int zt_tc_open(struct inode *inode, struct file *file)
return 0;
}
-static void ztc_release(struct zt_transcoder_channel *ztc)
+static void ztc_release(struct dahdi_transcoder_channel *ztc)
{
- struct zt_transcode_header *zth = ztc->tch;
+ struct dahdi_transcode_header *zth = ztc->tch;
struct page *page;
if (!ztc)
return;
- ztc->flags &= ~(ZT_TC_FLAG_BUSY);
+ ztc->flags &= ~(DAHDI_TC_FLAG_BUSY);
if(ztc->tch) {
for (page = virt_to_page(zth);
@@ -220,24 +220,24 @@ static void ztc_release(struct zt_transcoder_channel *ztc)
ztc->tch = NULL;
/* Actually reset the transcoder channel */
- if (ztc->flags & ZT_TC_FLAG_TRANSIENT)
+ if (ztc->flags & DAHDI_TC_FLAG_TRANSIENT)
kfree(ztc);
if (debug)
printk("Released Transcoder!\n");
}
-static int zt_tc_release(struct inode *inode, struct file *file)
+static int dahdi_tc_release(struct inode *inode, struct file *file)
{
ztc_release(file->private_data);
return 0;
}
-static int do_reset(struct zt_transcoder_channel **ztc)
+static int do_reset(struct dahdi_transcoder_channel **ztc)
{
- struct zt_transcoder_channel *newztc = NULL, *origztc = NULL;
- struct zt_transcode_header *zth = (*ztc)->tch;
- struct zt_transcoder *tc;
+ struct dahdi_transcoder_channel *newztc = NULL, *origztc = NULL;
+ struct dahdi_transcode_header *zth = (*ztc)->tch;
+ struct dahdi_transcoder *tc;
unsigned int x;
unsigned int match = 0;
@@ -254,13 +254,13 @@ static int do_reset(struct zt_transcoder_channel **ztc)
match = 1;
for (x = 0; x < tc->numchannels; x++) {
- if (tc->channels[x].flags & ZT_TC_FLAG_BUSY)
+ if (tc->channels[x].flags & DAHDI_TC_FLAG_BUSY)
continue;
if ((tc->channels[x].chan_built) && ((zth->srcfmt | zth->dstfmt) != tc->channels[x].built_fmts))
continue;
newztc = &tc->channels[x];
- newztc->flags = ZT_TC_FLAG_BUSY;
+ newztc->flags = DAHDI_TC_FLAG_BUSY;
break;
}
}
@@ -274,36 +274,36 @@ static int do_reset(struct zt_transcoder_channel **ztc)
(*ztc) = newztc;
(*ztc)->tch = origztc->tch;
origztc->tch = NULL;
- (*ztc)->flags |= (origztc->flags & ~(ZT_TC_FLAG_TRANSIENT));
+ (*ztc)->flags |= (origztc->flags & ~(DAHDI_TC_FLAG_TRANSIENT));
ztc_release(origztc);
}
/* Actually reset the transcoder channel */
if ((*ztc)->parent && ((*ztc)->parent->operation))
- return (*ztc)->parent->operation((*ztc), ZT_TCOP_ALLOCATE);
+ return (*ztc)->parent->operation((*ztc), DAHDI_TCOP_ALLOCATE);
return -EINVAL;
}
-static int wait_busy(struct zt_transcoder_channel *ztc)
+static int wait_busy(struct dahdi_transcoder_channel *ztc)
{
int ret;
for (;;) {
- if (!(ztc->tch->status & ZT_TC_FLAG_BUSY))
+ if (!(ztc->tch->status & DAHDI_TC_FLAG_BUSY))
return 0;
if ((ret = schluffen(&ztc->ready)))
return ret;
}
}
-static int zt_tc_getinfo(unsigned long data)
+static int dahdi_tc_getinfo(unsigned long data)
{
- struct zt_transcode_info info;
+ struct dahdi_transcode_info info;
unsigned int x;
- struct zt_transcoder *tc;
+ struct dahdi_transcoder *tc;
- if (copy_from_user(&info, (struct zt_transcode_info *) data, sizeof(info)))
+ if (copy_from_user(&info, (struct dahdi_transcode_info *) data, sizeof(info)))
return -EFAULT;
spin_lock(&translock);
@@ -318,16 +318,16 @@ static int zt_tc_getinfo(unsigned long data)
info.srcfmts = tc->srcfmts;
info.dstfmts = tc->dstfmts;
- return copy_to_user((struct zt_transcode_info *) data, &info, sizeof(info)) ? -EFAULT : 0;
+ return copy_to_user((struct dahdi_transcode_info *) data, &info, sizeof(info)) ? -EFAULT : 0;
}
-static int zt_tc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data)
+static int dahdi_tc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data)
{
int op;
int ret;
- struct zt_transcoder_channel *ztc = file->private_data;
+ struct dahdi_transcoder_channel *ztc = file->private_data;
- if (cmd != ZT_TRANSCODE_OP)
+ if (cmd != DAHDI_TRANSCODE_OP)
return -ENOSYS;
if (get_user(op, (int *) data))
@@ -337,33 +337,33 @@ static int zt_tc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
printk("ZT Transcode ioctl op = %d!\n", op);
switch(op) {
- case ZT_TCOP_GETINFO:
- ret = zt_tc_getinfo(data);
+ case DAHDI_TCOP_GETINFO:
+ ret = dahdi_tc_getinfo(data);
break;
- case ZT_TCOP_ALLOCATE:
+ case DAHDI_TCOP_ALLOCATE:
/* Reset transcoder, possibly changing who we point to */
ret = do_reset(&ztc);
file->private_data = ztc;
break;
- case ZT_TCOP_RELEASE:
- ret = ztc->parent->operation(ztc, ZT_TCOP_RELEASE);
+ case DAHDI_TCOP_RELEASE:
+ ret = ztc->parent->operation(ztc, DAHDI_TCOP_RELEASE);
break;
- case ZT_TCOP_TEST:
- ret = ztc->parent->operation(ztc, ZT_TCOP_TEST);
+ case DAHDI_TCOP_TEST:
+ ret = ztc->parent->operation(ztc, DAHDI_TCOP_TEST);
break;
- case ZT_TCOP_TRANSCODE:
+ case DAHDI_TCOP_TRANSCODE:
if (!ztc->parent->operation)
return -EINVAL;
- ztc->tch->status |= ZT_TC_FLAG_BUSY;
- if (!(ret = ztc->parent->operation(ztc, ZT_TCOP_TRANSCODE))) {
+ ztc->tch->status |= DAHDI_TC_FLAG_BUSY;
+ if (!(ret = ztc->parent->operation(ztc, DAHDI_TCOP_TRANSCODE))) {
/* Wait for busy to go away if we're not non-blocking */
if (!(file->f_flags & O_NONBLOCK)) {
if (!(ret = wait_busy(ztc)))
ret = ztc->errorstatus;
}
} else
- ztc->tch->status &= ~ZT_TC_FLAG_BUSY;
+ ztc->tch->status &= ~DAHDI_TC_FLAG_BUSY;
break;
default:
ret = -ENOSYS;
@@ -372,9 +372,9 @@ static int zt_tc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
return ret;
}
-static int zt_tc_mmap(struct file *file, struct vm_area_struct *vma)
+static int dahdi_tc_mmap(struct file *file, struct vm_area_struct *vma)
{
- struct zt_transcoder_channel *ztc = file->private_data;
+ struct dahdi_transcoder_channel *ztc = file->private_data;
unsigned long physical;
int res;
@@ -388,20 +388,20 @@ static int zt_tc_mmap(struct file *file, struct vm_area_struct *vma)
return -EINVAL;
}
- if ((vma->vm_end - vma->vm_start) != sizeof(struct zt_transcode_header)) {
+ if ((vma->vm_end - vma->vm_start) != sizeof(struct dahdi_transcode_header)) {
if (debug)
- printk("zttranscode: Attempted to mmap with size %d != %zd!\n", (int) (vma->vm_end - vma->vm_start), sizeof(struct zt_transcode_header));
+ printk("zttranscode: Attempted to mmap with size %d != %zd!\n", (int) (vma->vm_end - vma->vm_start), sizeof(struct dahdi_transcode_header));
return -EINVAL;
}
physical = (unsigned long) virt_to_phys(ztc->tch);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
- res = remap_pfn_range(vma, vma->vm_start, physical >> PAGE_SHIFT, sizeof(struct zt_transcode_header), PAGE_SHARED);
+ res = remap_pfn_range(vma, vma->vm_start, physical >> PAGE_SHIFT, sizeof(struct dahdi_transcode_header), PAGE_SHARED);
#else
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- res = remap_page_range(vma->vm_start, physical, sizeof(struct zt_transcode_header), PAGE_SHARED);
+ res = remap_page_range(vma->vm_start, physical, sizeof(struct dahdi_transcode_header), PAGE_SHARED);
#else
- res = remap_page_range(vma, vma->vm_start, physical, sizeof(struct zt_transcode_header), PAGE_SHARED);
+ res = remap_page_range(vma, vma->vm_start, physical, sizeof(struct dahdi_transcode_header), PAGE_SHARED);
#endif
#endif
if (res) {
@@ -416,33 +416,33 @@ static int zt_tc_mmap(struct file *file, struct vm_area_struct *vma)
return 0;
}
-static unsigned int zt_tc_poll(struct file *file, struct poll_table_struct *wait_table)
+static unsigned int dahdi_tc_poll(struct file *file, struct poll_table_struct *wait_table)
{
- struct zt_transcoder_channel *ztc = file->private_data;
+ struct dahdi_transcoder_channel *ztc = file->private_data;
if (!ztc)
return -EINVAL;
poll_wait(file, &ztc->ready, wait_table);
- return ztc->tch->status & ZT_TC_FLAG_BUSY ? 0 : POLLPRI;
+ return ztc->tch->status & DAHDI_TC_FLAG_BUSY ? 0 : POLLPRI;
}
-static struct file_operations __zt_transcode_fops = {
+static struct file_operations __dahdi_transcode_fops = {
owner: THIS_MODULE,
llseek: NULL,
- open: zt_tc_open,
- release: zt_tc_release,
- ioctl: zt_tc_ioctl,
+ open: dahdi_tc_open,
+ release: dahdi_tc_release,
+ ioctl: dahdi_tc_ioctl,
read: NULL,
write: NULL,
- poll: zt_tc_poll,
- mmap: zt_tc_mmap,
+ poll: dahdi_tc_poll,
+ mmap: dahdi_tc_mmap,
flush: NULL,
fsync: NULL,
fasync: NULL,
};
-static struct zt_chardev transcode_chardev = {
+static struct dahdi_chardev transcode_chardev = {
.name = "transcode",
.minor = 250,
};
@@ -451,14 +451,14 @@ int zttranscode_init(void)
{
int res;
- if (zt_transcode_fops) {
- printk("Whoa, zt_transcode_fops already set?!\n");
+ if (dahdi_transcode_fops) {
+ printk("Whoa, dahdi_transcode_fops already set?!\n");
return -EBUSY;
}
- zt_transcode_fops = &__zt_transcode_fops;
+ dahdi_transcode_fops = &__dahdi_transcode_fops;
- if ((res = zt_register_chardev(&transcode_chardev)))
+ if ((res = dahdi_register_chardev(&transcode_chardev)))
return res;
printk("Zaptel Transcoder support loaded\n");
@@ -468,9 +468,9 @@ int zttranscode_init(void)
void zttranscode_cleanup(void)
{
- zt_unregister_chardev(&transcode_chardev);
+ dahdi_unregister_chardev(&transcode_chardev);
- zt_transcode_fops = NULL;
+ dahdi_transcode_fops = NULL;
printk("Zaptel Transcoder support unloaded\n");
}
diff --git a/drivers/dahdi/digits.h b/drivers/dahdi/digits.h
index 9f4ea9b..160fdc7 100644
--- a/drivers/dahdi/digits.h
+++ b/drivers/dahdi/digits.h
@@ -20,28 +20,28 @@
#ifndef _DIGITS_H
#define _DIGITS_H
-#define DEFAULT_DTMF_LENGTH 100 * ZT_CHUNKSIZE
-#define DEFAULT_MFR1_LENGTH 68 * ZT_CHUNKSIZE
-#define DEFAULT_MFR2_LENGTH 100 * ZT_CHUNKSIZE
-#define PAUSE_LENGTH 500 * ZT_CHUNKSIZE
+#define DEFAULT_DTMF_LENGTH 100 * DAHDI_CHUNKSIZE
+#define DEFAULT_MFR1_LENGTH 68 * DAHDI_CHUNKSIZE
+#define DEFAULT_MFR2_LENGTH 100 * DAHDI_CHUNKSIZE
+#define PAUSE_LENGTH 500 * DAHDI_CHUNKSIZE
/* At the end of silence, the tone stops */
-static struct zt_tone dtmf_silence = {
+static struct dahdi_tone dtmf_silence = {
.tonesamples = DEFAULT_DTMF_LENGTH,
};
/* At the end of silence, the tone stops */
-static struct zt_tone mfr1_silence = {
+static struct dahdi_tone mfr1_silence = {
.tonesamples = DEFAULT_MFR1_LENGTH,
};
/* At the end of silence, the tone stops */
-static struct zt_tone mfr2_silence = {
+static struct dahdi_tone mfr2_silence = {
.tonesamples = DEFAULT_MFR2_LENGTH,
};
/* A pause in the dialing */
-static struct zt_tone tone_pause = {
+static struct dahdi_tone tone_pause = {
.tonesamples = PAUSE_LENGTH,
};
diff --git a/drivers/dahdi/hpec/hpec_dahdi.h b/drivers/dahdi/hpec/hpec_dahdi.h
index 2f90571..3eddbf2 100644
--- a/drivers/dahdi/hpec/hpec_dahdi.h
+++ b/drivers/dahdi/hpec/hpec_dahdi.h
@@ -23,7 +23,7 @@
#if !defined(_HPEC_ZAPTEL_H)
#define _HPEC_ZAPTEL_H
-#define ZT_EC_ARRAY_UPDATE
+#define DAHDI_EC_ARRAY_UPDATE
#include "hpec_user.h"
#include "hpec.h"
@@ -62,7 +62,7 @@ static void memfree(void *ptr)
static void echo_can_init(void)
{
printk("Zaptel Echo Canceller: Digium High-Performance Echo Canceller\n");
- hpec_init(logger, debug, ZT_CHUNKSIZE, memalloc, memfree);
+ hpec_init(logger, debug, DAHDI_CHUNKSIZE, memalloc, memfree);
}
static void echo_can_identify(char *buf, size_t len)
@@ -87,7 +87,7 @@ static inline void echo_can_array_update(struct echo_can_state *ec, short *iref,
DECLARE_MUTEX(alloc_lock);
-static int echo_can_create(struct zt_echocanparams *ecp, struct zt_echocanparam *p,
+static int echo_can_create(struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p,
struct echo_can_state **ec)
{
if (ecp->param_count > 0) {
@@ -119,7 +119,7 @@ static int hpec_license_ioctl(unsigned int cmd, unsigned long data)
int result = 0;
switch (cmd) {
- case ZT_EC_LICENSE_CHALLENGE:
+ case DAHDI_EC_LICENSE_CHALLENGE:
if (down_interruptible(&license_lock))
return -EINTR;
memset(&challenge, 0, sizeof(challenge));
@@ -129,7 +129,7 @@ static int hpec_license_ioctl(unsigned int cmd, unsigned long data)
result = -EFAULT;
up(&license_lock);
return result;
- case ZT_EC_LICENSE_RESPONSE:
+ case DAHDI_EC_LICENSE_RESPONSE:
if (down_interruptible(&license_lock))
return -EINTR;
if (copy_from_user(&license, (unsigned char *) data, sizeof(license)))
diff --git a/drivers/dahdi/hpec/hpec_user.h b/drivers/dahdi/hpec/hpec_user.h
index bf006eb..fcaae3d 100644
--- a/drivers/dahdi/hpec/hpec_user.h
+++ b/drivers/dahdi/hpec/hpec_user.h
@@ -33,8 +33,8 @@ struct hpec_license {
__u8 response[16];
};
-#define ZT_EC_LICENSE_CHALLENGE _IOR(ZT_CODE, 60, struct hpec_challenge)
-#define ZT_EC_LICENSE_RESPONSE _IOW(ZT_CODE, 61, struct hpec_license)
+#define DAHDI_EC_LICENSE_CHALLENGE _IOR(DAHDI_CODE, 60, struct hpec_challenge)
+#define DAHDI_EC_LICENSE_RESPONSE _IOW(DAHDI_CODE, 61, struct hpec_license)
#endif /* !defined(_HPEC_USER_H) */
diff --git a/drivers/dahdi/kb1ec.h b/drivers/dahdi/kb1ec.h
index cfafdf6..caeefbd 100644
--- a/drivers/dahdi/kb1ec.h
+++ b/drivers/dahdi/kb1ec.h
@@ -521,7 +521,7 @@ static inline short echo_can_update(struct echo_can_state *ec, short iref, short
return u;
}
-static int echo_can_create(struct zt_echocanparams *ecp, struct zt_echocanparam *p,
+static int echo_can_create(struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p,
struct echo_can_state **ec)
{
int maxy;
diff --git a/drivers/dahdi/mg2ec.h b/drivers/dahdi/mg2ec.h
index 1d4189b..fce1d03 100644
--- a/drivers/dahdi/mg2ec.h
+++ b/drivers/dahdi/mg2ec.h
@@ -642,7 +642,7 @@ static inline short echo_can_update(struct echo_can_state *ec, short iref, short
return u;
}
-static int echo_can_create(struct zt_echocanparams *ecp, struct zt_echocanparam *p,
+static int echo_can_create(struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p,
struct echo_can_state **ec)
{
int maxy;
diff --git a/drivers/dahdi/pciradio.c b/drivers/dahdi/pciradio.c
index 5dab834..82c8a39 100644
--- a/drivers/dahdi/pciradio.c
+++ b/drivers/dahdi/pciradio.c
@@ -106,8 +106,8 @@ With driver: 303826 (1.5 %)
#define RAD_CTCSS_ACQUIRE_TIME 10
#define RAD_CTCSS_TALKOFF_TIME 1000
-#define ZT_RADPAR_CTCSSACQUIRETIME 18 /* DEBUG only, this belongs in zaptel.h */
-#define ZT_RADPAR_CTCSSTALKOFFTIME 19 /* DEBUG only, this belongs in zaptel.h */
+#define DAHDI_RADPAR_CTCSSACQUIRETIME 18 /* DEBUG only, this belongs in zaptel.h */
+#define DAHDI_RADPAR_CTCSSTALKOFFTIME 19 /* DEBUG only, this belongs in zaptel.h */
/*
* MX828 Commands
@@ -151,7 +151,7 @@ struct encdec
struct pciradio {
struct pci_dev *dev;
- struct zt_span span;
+ struct dahdi_span span;
unsigned char ios;
int usecount;
unsigned int intcount;
@@ -204,7 +204,7 @@ struct pciradio {
#define RADMODE_IGNORECT 16
#define RADMODE_NOENCODE 32
unsigned char corthresh[NUM_CHANS];
- struct zt_chan chans[NUM_CHANS];
+ struct dahdi_chan chans[NUM_CHANS];
unsigned char mx828_addr;
struct encdec encdec;
unsigned long lastremcmd;
@@ -690,12 +690,12 @@ static inline void pciradio_transmitprep(struct pciradio *rad, unsigned char int
/* Write is at interrupt address. Start writing from normal offset */
writechunk = rad->writechunk;
else
- writechunk = rad->writechunk + ZT_CHUNKSIZE;
+ writechunk = rad->writechunk + DAHDI_CHUNKSIZE;
/* Calculate Transmission */
- zt_transmit(&rad->span);
+ dahdi_transmit(&rad->span);
- for (x=0;x<ZT_CHUNKSIZE;x++) {
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
/* Send a sample, as a 32-bit word */
writechunk[x] = 0;
writechunk[x] |= (rad->chans[0].writechunk[x] << 24);
@@ -711,20 +711,20 @@ static inline void pciradio_receiveprep(struct pciradio *rad, unsigned char ints
int x;
if (ints & 0x08)
- readchunk = rad->readchunk + ZT_CHUNKSIZE;
+ readchunk = rad->readchunk + DAHDI_CHUNKSIZE;
else
/* Read is at interrupt address. Valid data is available at normal offset */
readchunk = rad->readchunk;
- for (x=0;x<ZT_CHUNKSIZE;x++) {
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
rad->chans[0].readchunk[x] = (readchunk[x] >> 24) & 0xff;
rad->chans[1].readchunk[x] = (readchunk[x] >> 16) & 0xff;
rad->chans[2].readchunk[x] = (readchunk[x] >> 8) & 0xff;
rad->chans[3].readchunk[x] = (readchunk[x]) & 0xff;
}
for (x=0;x<rad->nchans;x++) {
- zt_ec_chunk(&rad->chans[x], rad->chans[x].readchunk, rad->chans[x].writechunk);
+ dahdi_ec_chunk(&rad->chans[x], rad->chans[x].readchunk, rad->chans[x].writechunk);
}
- zt_receive(&rad->span);
+ dahdi_receive(&rad->span);
}
static void pciradio_stop_dma(struct pciradio *rad);
@@ -931,10 +931,10 @@ ZAP_IRQ_HANDLER(pciradio_interrupt)
else
printk("Chan %d got rx\n",x + 1);
}
- zt_hooksig(&rad->chans[x],ZT_RXSIG_OFFHOOK);
+ dahdi_hooksig(&rad->chans[x],DAHDI_RXSIG_OFFHOOK);
} else {
if (debug) printk("Chan %d lost rx\n",x + 1);
- zt_hooksig(&rad->chans[x],ZT_RXSIG_ONHOOK);
+ dahdi_hooksig(&rad->chans[x],DAHDI_RXSIG_ONHOOK);
}
rad->encdec.req[x] = 1;
}
@@ -981,45 +981,45 @@ ZAP_IRQ_HANDLER(pciradio_interrupt)
}
-static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data)
+static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long data)
{
int i,mycode;
unsigned long flags;
unsigned char byte1,byte2,mask;
union {
- struct zt_radio_stat s;
- struct zt_radio_param p;
+ struct dahdi_radio_stat s;
+ struct dahdi_radio_param p;
} stack;
struct pciradio *rad = chan->pvt;
DECLARE_WAIT_QUEUE_HEAD(mywait);
switch (cmd) {
- case ZT_RADIO_GETPARAM:
- if (copy_from_user(&stack.p,(struct zt_radio_param *)data,sizeof(struct zt_radio_param))) return -EFAULT;
+ case DAHDI_RADIO_GETPARAM:
+ if (copy_from_user(&stack.p,(struct dahdi_radio_param *)data,sizeof(struct dahdi_radio_param))) return -EFAULT;
spin_lock_irqsave(&rad->lock,flags);
stack.p.data = 0; /* start with 0 value in output */
switch(stack.p.radpar) {
- case ZT_RADPAR_INVERTCOR:
+ case DAHDI_RADPAR_INVERTCOR:
if (rad->radmode[chan->chanpos - 1] & RADMODE_INVERTCOR)
stack.p.data = 1;
break;
- case ZT_RADPAR_IGNORECOR:
+ case DAHDI_RADPAR_IGNORECOR:
if (rad->radmode[chan->chanpos - 1] & RADMODE_IGNORECOR)
stack.p.data = 1;
break;
- case ZT_RADPAR_IGNORECT:
+ case DAHDI_RADPAR_IGNORECT:
if (rad->radmode[chan->chanpos - 1] & RADMODE_IGNORECT)
stack.p.data = 1;
break;
- case ZT_RADPAR_NOENCODE:
+ case DAHDI_RADPAR_NOENCODE:
if (rad->radmode[chan->chanpos - 1] & RADMODE_NOENCODE)
stack.p.data = 1;
break;
- case ZT_RADPAR_CORTHRESH:
+ case DAHDI_RADPAR_CORTHRESH:
stack.p.data = rad->corthresh[chan->chanpos - 1] & 7;
break;
- case ZT_RADPAR_EXTRXTONE:
+ case DAHDI_RADPAR_EXTRXTONE:
if (rad->radmode[chan->chanpos - 1] & RADMODE_EXTTONE)
{
stack.p.data = 1;
@@ -1029,10 +1029,10 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
}
}
break;
- case ZT_RADPAR_NUMTONES:
+ case DAHDI_RADPAR_NUMTONES:
stack.p.data = NUM_CODES;
break;
- case ZT_RADPAR_RXTONE:
+ case DAHDI_RADPAR_RXTONE:
if ((stack.p.index < 1) || (stack.p.index > NUM_CODES)) {
spin_unlock_irqrestore(&rad->lock,flags);
return -EINVAL;
@@ -1040,14 +1040,14 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
stack.p.data =
cttable_rx[rad->rxcode[chan->chanpos - 1][stack.p.index] & 0x7fff].code;
break;
- case ZT_RADPAR_RXTONECLASS:
+ case DAHDI_RADPAR_RXTONECLASS:
if ((stack.p.index < 1) || (stack.p.index > NUM_CODES)) {
spin_unlock_irqrestore(&rad->lock,flags);
return -EINVAL;
}
stack.p.data = rad->rxclass[chan->chanpos - 1][stack.p.index] & 0xffff;
break;
- case ZT_RADPAR_TXTONE:
+ case DAHDI_RADPAR_TXTONE:
if (stack.p.index > NUM_CODES) {
spin_unlock_irqrestore(&rad->lock,flags);
return -EINVAL;
@@ -1057,34 +1057,34 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
if (rad->txcode[chan->chanpos - 1][stack.p.index] & 0x8000)
stack.p.data |= 0x8000;
break;
- case ZT_RADPAR_DEBOUNCETIME:
+ case DAHDI_RADPAR_DEBOUNCETIME:
stack.p.data = rad->debouncetime[chan->chanpos - 1];
break;
- case ZT_RADPAR_CTCSSACQUIRETIME:
+ case DAHDI_RADPAR_CTCSSACQUIRETIME:
stack.p.data = rad->ctcssacquiretime[chan->chanpos - 1];
break;
- case ZT_RADPAR_CTCSSTALKOFFTIME:
+ case DAHDI_RADPAR_CTCSSTALKOFFTIME:
stack.p.data = rad->ctcsstalkofftime[chan->chanpos - 1];
break;
- case ZT_RADPAR_BURSTTIME:
+ case DAHDI_RADPAR_BURSTTIME:
stack.p.data = rad->bursttime[chan->chanpos - 1];
break;
- case ZT_RADPAR_UIODATA:
+ case DAHDI_RADPAR_UIODATA:
stack.p.data = 0;
byte1 = __pciradio_getcreg(rad,8);
if (byte1 & (1 << (chan->chanpos - 1))) stack.p.data |= 1;
if (byte1 & (1 << (chan->chanpos + 3))) stack.p.data |= 2;
break;
- case ZT_RADPAR_UIOMODE:
+ case DAHDI_RADPAR_UIOMODE:
stack.p.data = 0;
byte1 = __pciradio_getcreg(rad,0xe);
if (byte1 & (1 << (chan->chanpos - 1))) stack.p.data |= 1;
if (byte1 & (1 << (chan->chanpos + 3))) stack.p.data |= 2;
break;
- case ZT_RADPAR_REMMODE:
+ case DAHDI_RADPAR_REMMODE:
stack.p.data = rad->remmode[chan->chanpos - 1];
break;
default:
@@ -1092,37 +1092,37 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
return -EINVAL;
}
spin_unlock_irqrestore(&rad->lock,flags);
- if (copy_to_user((struct zt_radio_param *)data,&stack.p,sizeof(struct zt_radio_param))) return -EFAULT;
+ if (copy_to_user((struct dahdi_radio_param *)data,&stack.p,sizeof(struct dahdi_radio_param))) return -EFAULT;
break;
- case ZT_RADIO_SETPARAM:
- if (copy_from_user(&stack.p,(struct zt_radio_param *)data,sizeof(struct zt_radio_param))) return -EFAULT;
+ case DAHDI_RADIO_SETPARAM:
+ if (copy_from_user(&stack.p,(struct dahdi_radio_param *)data,sizeof(struct dahdi_radio_param))) return -EFAULT;
spin_lock_irqsave(&rad->lock,flags);
switch(stack.p.radpar) {
- case ZT_RADPAR_INVERTCOR:
+ case DAHDI_RADPAR_INVERTCOR:
if (stack.p.data)
rad->radmode[chan->chanpos - 1] |= RADMODE_INVERTCOR;
else
rad->radmode[chan->chanpos - 1] &= ~RADMODE_INVERTCOR;
break;
- case ZT_RADPAR_IGNORECOR:
+ case DAHDI_RADPAR_IGNORECOR:
if (stack.p.data)
rad->radmode[chan->chanpos - 1] |= RADMODE_IGNORECOR;
else
rad->radmode[chan->chanpos - 1] &= ~RADMODE_IGNORECOR;
break;
- case ZT_RADPAR_IGNORECT:
+ case DAHDI_RADPAR_IGNORECT:
if (stack.p.data)
rad->radmode[chan->chanpos - 1] |= RADMODE_IGNORECT;
else
rad->radmode[chan->chanpos - 1] &= ~RADMODE_IGNORECT;
break;
- case ZT_RADPAR_NOENCODE:
+ case DAHDI_RADPAR_NOENCODE:
if (stack.p.data)
rad->radmode[chan->chanpos - 1] |= RADMODE_NOENCODE;
else
rad->radmode[chan->chanpos - 1] &= ~RADMODE_NOENCODE;
break;
- case ZT_RADPAR_CORTHRESH:
+ case DAHDI_RADPAR_CORTHRESH:
if ((stack.p.data < 0) || (stack.p.data > 7)) {
spin_unlock_irqrestore(&rad->lock,flags);
return -EINVAL;
@@ -1133,7 +1133,7 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
mx828_command_wait(rad,chan->chanpos - 1, MX828_GEN_CTRL, &byte1, &byte2);
spin_lock_irqsave(&rad->lock,flags);
break;
- case ZT_RADPAR_EXTRXTONE:
+ case DAHDI_RADPAR_EXTRXTONE:
if (stack.p.data)
rad->radmode[chan->chanpos - 1] |= RADMODE_EXTTONE;
else
@@ -1143,7 +1143,7 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
else
rad->radmode[chan->chanpos - 1] &= ~RADMODE_EXTINVERT;
break;
- case ZT_RADPAR_INITTONE:
+ case DAHDI_RADPAR_INITTONE:
for(i = 0; i <= NUM_CODES; i++)
{
rad->rxcode[chan->chanpos - 1][i] = 0;
@@ -1163,7 +1163,7 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
}
spin_lock_irqsave(&rad->lock,flags);
break;
- case ZT_RADPAR_RXTONE:
+ case DAHDI_RADPAR_RXTONE:
if (!stack.p.index) /* if RX DCS mode */
{
if ((stack.p.data < 0) || (stack.p.data > 777)) {
@@ -1198,14 +1198,14 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
rad->rxcode[chan->chanpos - 1][0] = 0;
rad->encdec.req[chan->chanpos - 1] = 1;
break;
- case ZT_RADPAR_RXTONECLASS:
+ case DAHDI_RADPAR_RXTONECLASS:
if ((stack.p.index < 1) || (stack.p.index > NUM_CODES)) {
spin_unlock_irqrestore(&rad->lock,flags);
return -EINVAL;
}
rad->rxclass[chan->chanpos - 1][stack.p.index] = stack.p.data & 0xffff;
break;
- case ZT_RADPAR_TXTONE:
+ case DAHDI_RADPAR_TXTONE:
if (stack.p.index > NUM_CODES) {
spin_unlock_irqrestore(&rad->lock,flags);
return -EINVAL;
@@ -1222,22 +1222,22 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
rad->txcode[chan->chanpos - 1][stack.p.index] = mycode;
rad->encdec.req[chan->chanpos - 1] = 1;
break;
- case ZT_RADPAR_DEBOUNCETIME:
+ case DAHDI_RADPAR_DEBOUNCETIME:
rad->debouncetime[chan->chanpos - 1] = stack.p.data;
break;
- case ZT_RADPAR_CTCSSACQUIRETIME:
+ case DAHDI_RADPAR_CTCSSACQUIRETIME:
rad->ctcssacquiretime[chan->chanpos - 1] = stack.p.data;
break;
- case ZT_RADPAR_CTCSSTALKOFFTIME:
+ case DAHDI_RADPAR_CTCSSTALKOFFTIME:
rad->ctcsstalkofftime[chan->chanpos - 1] = stack.p.data;
break;
- case ZT_RADPAR_BURSTTIME:
+ case DAHDI_RADPAR_BURSTTIME:
rad->bursttime[chan->chanpos - 1] = stack.p.data;
break;
- case ZT_RADPAR_UIODATA:
+ case DAHDI_RADPAR_UIODATA:
byte1 = __pciradio_getcreg(rad,8);
byte1 &= ~(1 << (chan->chanpos - 1));
byte1 &= ~(1 << (chan->chanpos + 3));
@@ -1245,7 +1245,7 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
if (stack.p.data & 2) byte1 |= (1 << (chan->chanpos + 3));
__pciradio_setcreg(rad,8,byte1);
break;
- case ZT_RADPAR_UIOMODE:
+ case DAHDI_RADPAR_UIOMODE:
byte1 = __pciradio_getcreg(rad,0xe);
byte1 &= ~(1 << (chan->chanpos - 1));
byte1 &= ~(1 << (chan->chanpos + 3));
@@ -1253,18 +1253,18 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
if (stack.p.data & 2) byte1 |= (1 << (chan->chanpos + 3));
__pciradio_setcreg(rad,0xe,byte1);
break;
- case ZT_RADPAR_REMMODE:
+ case DAHDI_RADPAR_REMMODE:
rad->remmode[chan->chanpos - 1] = stack.p.data;
break;
- case ZT_RADPAR_REMCOMMAND:
+ case DAHDI_RADPAR_REMCOMMAND:
/* if no remote mode, return an error */
- if (rad->remmode[chan->chanpos - 1] == ZT_RADPAR_REM_NONE)
+ if (rad->remmode[chan->chanpos - 1] == DAHDI_RADPAR_REM_NONE)
{
spin_unlock_irqrestore(&rad->lock,flags);
return -EINVAL;
}
i = 0;
- if (rad->remmode[chan->chanpos - 1] == ZT_RADPAR_REM_RBI1)
+ if (rad->remmode[chan->chanpos - 1] == DAHDI_RADPAR_REM_RBI1)
{
/* set UIOA and UIOB for output */
byte1 = __pciradio_getcreg(rad,0xe);
@@ -1337,7 +1337,7 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
rad->rxbuf[rad->rxindex] = 0;
if ((rad->rxindex < stack.p.data) &&
(rad->srxtimer < SRX_TIMEOUT) &&
- ((rad->remmode[chan->chanpos - 1] == ZT_RADPAR_REM_SERIAL) ||
+ ((rad->remmode[chan->chanpos - 1] == DAHDI_RADPAR_REM_SERIAL) ||
(!strchr((char *)rad->rxbuf,'\r'))))
{
spin_unlock_irqrestore(&rad->lock,flags);
@@ -1354,7 +1354,7 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
break;
}
/* wait for done if in SERIAL_ASCII mode, or if no Rx aftwards */
- if ((rad->remmode[chan->chanpos - 1] == ZT_RADPAR_REM_SERIAL_ASCII) ||
+ if ((rad->remmode[chan->chanpos - 1] == DAHDI_RADPAR_REM_SERIAL_ASCII) ||
(!stack.p.data))
{
/* wait for TX to be done if not already */
@@ -1369,9 +1369,9 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
}
rad->remote_locked = 0;
spin_unlock_irqrestore(&rad->lock,flags);
- if (rad->remmode[chan->chanpos - 1] == ZT_RADPAR_REM_SERIAL_ASCII)
+ if (rad->remmode[chan->chanpos - 1] == DAHDI_RADPAR_REM_SERIAL_ASCII)
interruptible_sleep_on_timeout(&mywait,100);
- if (copy_to_user((struct zt_radio_stat *)data,&stack.p,sizeof(struct zt_radio_param))) return -EFAULT;
+ if (copy_to_user((struct dahdi_radio_stat *)data,&stack.p,sizeof(struct dahdi_radio_param))) return -EFAULT;
return 0;
default:
spin_unlock_irqrestore(&rad->lock,flags);
@@ -1379,14 +1379,14 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
}
spin_unlock_irqrestore(&rad->lock,flags);
break;
- case ZT_RADIO_GETSTAT:
+ case DAHDI_RADIO_GETSTAT:
spin_lock_irqsave(&rad->lock,flags);
/* start with clean object */
- memset(&stack.s,0,sizeof(struct zt_radio_stat));
+ memset(&stack.s,0,sizeof(struct dahdi_radio_stat));
/* if we have rx */
if (rad->gotrx[chan->chanpos - 1])
{
- stack.s.radstat |= ZT_RADSTAT_RX;
+ stack.s.radstat |= DAHDI_RADSTAT_RX;
if (rad->rxcode[chan->chanpos - 1][0])
stack.s.ctcode_rx =
dcstable[rad->rxcode[chan->chanpos - 1][0]].code | 0x8000;
@@ -1402,8 +1402,8 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
{
unsigned short x,myindex;
- stack.s.radstat |= ZT_RADSTAT_TX;
- stack.s.radstat |= ZT_RADSTAT_TX;
+ stack.s.radstat |= DAHDI_RADSTAT_TX;
+ stack.s.radstat |= DAHDI_RADSTAT_TX;
myindex = 0;
if ((!rad->rxcode[chan->chanpos - 1][0])
@@ -1418,17 +1418,17 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
}
if (rad->radmode[chan->chanpos - 1] & RADMODE_IGNORECOR)
- stack.s.radstat |= ZT_RADSTAT_IGNCOR;
+ stack.s.radstat |= DAHDI_RADSTAT_IGNCOR;
if (rad->radmode[chan->chanpos - 1] & RADMODE_IGNORECT)
- stack.s.radstat |= ZT_RADSTAT_IGNCT;
+ stack.s.radstat |= DAHDI_RADSTAT_IGNCT;
if (rad->radmode[chan->chanpos - 1] & RADMODE_NOENCODE)
- stack.s.radstat |= ZT_RADSTAT_NOENCODE;
+ stack.s.radstat |= DAHDI_RADSTAT_NOENCODE;
if (rad->gotcor[chan->chanpos - 1])
- stack.s.radstat |= ZT_RADSTAT_RXCOR;
+ stack.s.radstat |= DAHDI_RADSTAT_RXCOR;
if (rad->gotct[chan->chanpos - 1])
- stack.s.radstat |= ZT_RADSTAT_RXCT;
+ stack.s.radstat |= DAHDI_RADSTAT_RXCT;
spin_unlock_irqrestore(&rad->lock,flags);
- if (copy_to_user((struct zt_radio_stat *)data,&stack.s,sizeof(struct zt_radio_stat))) return -EFAULT;
+ if (copy_to_user((struct dahdi_radio_stat *)data,&stack.s,sizeof(struct dahdi_radio_stat))) return -EFAULT;
break;
default:
return -ENOTTY;
@@ -1437,7 +1437,7 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
}
-static int pciradio_open(struct zt_chan *chan)
+static int pciradio_open(struct dahdi_chan *chan)
{
struct pciradio *rad = chan->pvt;
if (rad->dead)
@@ -1449,14 +1449,14 @@ static int pciradio_open(struct zt_chan *chan)
return 0;
}
-static int pciradio_watchdog(struct zt_span *span, int event)
+static int pciradio_watchdog(struct dahdi_span *span, int event)
{
printk("PCI RADIO: Restarting DMA\n");
pciradio_restart_dma(span->pvt);
return 0;
}
-static int pciradio_close(struct zt_chan *chan)
+static int pciradio_close(struct dahdi_chan *chan)
{
struct pciradio *rad = chan->pvt;
rad->usecount--;
@@ -1469,16 +1469,16 @@ static int pciradio_close(struct zt_chan *chan)
return 0;
}
-static int pciradio_hooksig(struct zt_chan *chan, zt_txsig_t txsig)
+static int pciradio_hooksig(struct dahdi_chan *chan, dahdi_txsig_t txsig)
{
struct pciradio *rad = chan->pvt;
switch(txsig) {
- case ZT_TXSIG_START:
- case ZT_TXSIG_OFFHOOK:
+ case DAHDI_TXSIG_START:
+ case DAHDI_TXSIG_OFFHOOK:
rad->gottx[chan->chanpos - 1] = 1;
break;
- case ZT_TXSIG_ONHOOK:
+ case DAHDI_TXSIG_ONHOOK:
rad->gottx[chan->chanpos - 1] = 0;
break;
default:
@@ -1497,10 +1497,10 @@ static int pciradio_initialize(struct pciradio *rad)
/* Zapata stuff */
sprintf(rad->span.name, "PCIRADIO/%d", rad->pos);
sprintf(rad->span.desc, "Board %d", rad->pos + 1);
- rad->span.deflaw = ZT_LAW_MULAW;
+ rad->span.deflaw = DAHDI_LAW_MULAW;
for (x=0;x<rad->nchans;x++) {
sprintf(rad->chans[x].name, "PCIRADIO/%d/%d", rad->pos, x);
- rad->chans[x].sigcap = ZT_SIG_SF | ZT_SIG_EM;
+ rad->chans[x].sigcap = DAHDI_SIG_SF | DAHDI_SIG_EM;
rad->chans[x].chanpos = x+1;
rad->chans[x].pvt = rad;
rad->debouncetime[x] = RAD_GOTRX_DEBOUNCE_TIME;
@@ -1512,13 +1512,13 @@ static int pciradio_initialize(struct pciradio *rad)
rad->span.hooksig = pciradio_hooksig;
rad->span.open = pciradio_open;
rad->span.close = pciradio_close;
- rad->span.flags = ZT_FLAG_RBS;
+ rad->span.flags = DAHDI_FLAG_RBS;
rad->span.ioctl = pciradio_ioctl;
rad->span.watchdog = pciradio_watchdog;
init_waitqueue_head(&rad->span.maintq);
rad->span.pvt = rad;
- if (zt_register(&rad->span, 0)) {
+ if (dahdi_register(&rad->span, 0)) {
printk("Unable to register span with zaptel\n");
return -1;
}
@@ -1645,12 +1645,12 @@ unsigned long endjif;
/* Setup DMA Addresses */
outl(rad->writedma, rad->ioaddr + RAD_DMAWS); /* Write start */
- outl(rad->writedma + ZT_CHUNKSIZE * 4 - 4, rad->ioaddr + RAD_DMAWI); /* Middle (interrupt) */
- outl(rad->writedma + ZT_CHUNKSIZE * 8 - 4, rad->ioaddr + RAD_DMAWE); /* End */
+ outl(rad->writedma + DAHDI_CHUNKSIZE * 4 - 4, rad->ioaddr + RAD_DMAWI); /* Middle (interrupt) */
+ outl(rad->writedma + DAHDI_CHUNKSIZE * 8 - 4, rad->ioaddr + RAD_DMAWE); /* End */
outl(rad->readdma, rad->ioaddr + RAD_DMARS); /* Read start */
- outl(rad->readdma + ZT_CHUNKSIZE * 4 - 4, rad->ioaddr + RAD_DMARI); /* Middle (interrupt) */
- outl(rad->readdma + ZT_CHUNKSIZE * 8 - 4, rad->ioaddr + RAD_DMARE); /* End */
+ outl(rad->readdma + DAHDI_CHUNKSIZE * 4 - 4, rad->ioaddr + RAD_DMARI); /* Middle (interrupt) */
+ outl(rad->readdma + DAHDI_CHUNKSIZE * 8 - 4, rad->ioaddr + RAD_DMARE); /* End */
/* Clear interrupts */
outb(0xff, rad->ioaddr + RAD_INTSTAT);
@@ -1759,7 +1759,7 @@ static int __devinit pciradio_init_one(struct pci_dev *pdev, const struct pci_de
/* Allocate enough memory for two zt chunks, receive and transmit. Each sample uses
32 bits. Allocate an extra set just for control too */
- rad->writechunk = pci_alloc_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, &rad->writedma);
+ rad->writechunk = pci_alloc_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, &rad->writedma);
if (!rad->writechunk) {
printk("pciradio: Unable to allocate DMA-able memory\n");
if (rad->freeregion)
@@ -1767,8 +1767,8 @@ static int __devinit pciradio_init_one(struct pci_dev *pdev, const struct pci_de
return -ENOMEM;
}
- rad->readchunk = rad->writechunk + ZT_MAX_CHUNKSIZE * 2; /* in doublewords */
- rad->readdma = rad->writedma + ZT_MAX_CHUNKSIZE * 8; /* in bytes */
+ rad->readchunk = rad->writechunk + DAHDI_MAX_CHUNKSIZE * 2; /* in doublewords */
+ rad->readdma = rad->writedma + DAHDI_MAX_CHUNKSIZE * 8; /* in bytes */
if (pciradio_initialize(rad)) {
printk("pciradio: Unable to intialize\n");
@@ -1782,7 +1782,7 @@ static int __devinit pciradio_init_one(struct pci_dev *pdev, const struct pci_de
free_irq(pdev->irq, rad);
if (rad->freeregion)
release_region(rad->ioaddr, 0xff);
- pci_free_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)rad->writechunk, rad->writedma);
+ pci_free_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)rad->writechunk, rad->writedma);
kfree(rad);
return -EIO;
}
@@ -1806,9 +1806,9 @@ static int __devinit pciradio_init_one(struct pci_dev *pdev, const struct pci_de
free_irq(pdev->irq, rad);
if (rad->freeregion)
release_region(rad->ioaddr, 0xff);
- pci_free_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)rad->writechunk, rad->writedma);
+ pci_free_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)rad->writechunk, rad->writedma);
pci_set_drvdata(pdev, NULL);
- zt_unregister(&rad->span);
+ dahdi_unregister(&rad->span);
kfree(rad);
return -EIO;
@@ -1818,7 +1818,7 @@ static int __devinit pciradio_init_one(struct pci_dev *pdev, const struct pci_de
printk("pciradio: Unable to request IRQ %d\n", pdev->irq);
if (rad->freeregion)
release_region(rad->ioaddr, 0xff);
- pci_free_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)rad->writechunk, rad->writedma);
+ pci_free_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)rad->writechunk, rad->writedma);
pci_set_drvdata(pdev, NULL);
kfree(rad);
return -EIO;
@@ -1827,7 +1827,7 @@ static int __devinit pciradio_init_one(struct pci_dev *pdev, const struct pci_de
/* Enable interrupts */
pciradio_enable_interrupts(rad);
/* Initialize Write/Buffers to all blank data */
- memset((void *)rad->writechunk,0,ZT_MAX_CHUNKSIZE * 2 * 2 * 4);
+ memset((void *)rad->writechunk,0,DAHDI_MAX_CHUNKSIZE * 2 * 2 * 4);
/* Start DMA */
pciradio_start_dma(rad);
@@ -1841,7 +1841,7 @@ static int __devinit pciradio_init_one(struct pci_dev *pdev, const struct pci_de
static void pciradio_release(struct pciradio *rad)
{
- zt_unregister(&rad->span);
+ dahdi_unregister(&rad->span);
if (rad->freeregion)
release_region(rad->ioaddr, 0xff);
kfree(rad);
@@ -1861,7 +1861,7 @@ static void __devexit pciradio_remove_one(struct pci_dev *pdev)
pciradio_disable_interrupts(rad);
/* Immediately free resources */
- pci_free_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)rad->writechunk, rad->writedma);
+ pci_free_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)rad->writechunk, rad->writedma);
free_irq(pdev->irq, rad);
/* Reset PCI chip and registers */
diff --git a/drivers/dahdi/sec-2.h b/drivers/dahdi/sec-2.h
index 94ce6ab..1759606 100644
--- a/drivers/dahdi/sec-2.h
+++ b/drivers/dahdi/sec-2.h
@@ -126,7 +126,7 @@ static void echo_can_shutdown(void)
/* #define MIN_TX_POWER_FOR_ADAPTION 4096
#define MIN_RX_POWER_FOR_ADAPTION 64 */
-static int echo_can_create(struct zt_echocanparams *ecp, struct zt_echocanparam *p,
+static int echo_can_create(struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p,
struct echo_can_state **ec)
{
size_t size;
diff --git a/drivers/dahdi/sec.h b/drivers/dahdi/sec.h
index be31807..f15b681 100644
--- a/drivers/dahdi/sec.h
+++ b/drivers/dahdi/sec.h
@@ -130,7 +130,7 @@ static int16_t echo_can_update(struct echo_can_state *ec, int16_t tx, int16_t rx
#define MIN_RX_POWER_FOR_ADAPTION 64
*/
-static int echo_can_create(struct zt_echocanparams *ecp, struct zt_echocanparam *p,
+static int echo_can_create(struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p,
struct echo_can_state **ec)
{
size_t size;
diff --git a/drivers/dahdi/tor2.c b/drivers/dahdi/tor2.c
index e12dfa8..2863363 100644
--- a/drivers/dahdi/tor2.c
+++ b/drivers/dahdi/tor2.c
@@ -101,9 +101,9 @@ struct tor2 {
unsigned long xilinx8_region; /* 8 bit Region allocated to Xilinx */
unsigned long xilinx8_len; /* Length of 8 bit Xilinx region */
volatile unsigned char *mem8; /* Virtual representation of 8 bit Xilinx memory area */
- struct zt_span spans[SPANS_PER_CARD]; /* Spans */
+ struct dahdi_span spans[SPANS_PER_CARD]; /* Spans */
struct tor2_span tspans[SPANS_PER_CARD]; /* Span data */
- struct zt_chan *chans[SPANS_PER_CARD]; /* Pointers to blocks of 24(30/31) contiguous zt_chans for each span */
+ struct dahdi_chan *chans[SPANS_PER_CARD]; /* Pointers to blocks of 24(30/31) contiguous dahdi_chans for each span */
struct tor2_chan tchans[32 * SPANS_PER_CARD]; /* Channel user data */
unsigned char txsigs[SPANS_PER_CARD][16]; /* Copy of tx sig registers */
int loopupcnt[SPANS_PER_CARD]; /* loop up code counter */
@@ -111,8 +111,8 @@ struct tor2 {
int spansstarted; /* number of spans started */
spinlock_t lock; /* lock context */
unsigned char leds; /* copy of LED register */
- unsigned char ec_chunk1[SPANS_PER_CARD][32][ZT_CHUNKSIZE]; /* first EC chunk buffer */
- unsigned char ec_chunk2[SPANS_PER_CARD][32][ZT_CHUNKSIZE]; /* second EC chunk buffer */
+ unsigned char ec_chunk1[SPANS_PER_CARD][32][DAHDI_CHUNKSIZE]; /* first EC chunk buffer */
+ unsigned char ec_chunk2[SPANS_PER_CARD][32][DAHDI_CHUNKSIZE]; /* second EC chunk buffer */
#ifdef ENABLE_TASKLETS
int taskletrun;
int taskletsched;
@@ -181,11 +181,11 @@ static int highestorder;
static int timingcable;
static void set_clear(struct tor2 *tor);
-static int tor2_startup(struct zt_span *span);
-static int tor2_shutdown(struct zt_span *span);
-static int tor2_rbsbits(struct zt_chan *chan, int bits);
-static int tor2_maint(struct zt_span *span, int cmd);
-static int tor2_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data);
+static int tor2_startup(struct dahdi_span *span);
+static int tor2_shutdown(struct dahdi_span *span);
+static int tor2_rbsbits(struct dahdi_chan *chan, int bits);
+static int tor2_maint(struct dahdi_span *span, int cmd);
+static int tor2_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long data);
ZAP_IRQ_HANDLER(tor2_intr);
/* translations of data channels for 24 channels in a 32 bit PCM highway */
@@ -197,7 +197,7 @@ unsigned datxlt_e1[] = {
1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
25,26,27,28,29,30,31 };
-static int tor2_spanconfig(struct zt_span *span, struct zt_lineconfig *lc)
+static int tor2_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
{
int i;
struct tor2_span *p = span->pvt;
@@ -221,19 +221,19 @@ static int tor2_spanconfig(struct zt_span *span, struct zt_lineconfig *lc)
p->tor->psyncs[lc->sync - 1] = p->span + 1;
}
/* If we're already running, then go ahead and apply the changes */
- if (span->flags & ZT_FLAG_RUNNING)
+ if (span->flags & DAHDI_FLAG_RUNNING)
return tor2_startup(span);
return 0;
}
-static int tor2_chanconfig(struct zt_chan *chan, int sigtype)
+static int tor2_chanconfig(struct dahdi_chan *chan, int sigtype)
{
int alreadyrunning;
unsigned long flags;
struct tor2_chan *p = chan->pvt;
- alreadyrunning = chan->span->flags & ZT_FLAG_RUNNING;
+ alreadyrunning = chan->span->flags & DAHDI_FLAG_RUNNING;
if (debug) {
if (alreadyrunning)
printk("Tor2: Reconfigured channel %d (%s) sigtype %d\n", chan->channo, chan->name, sigtype);
@@ -249,7 +249,7 @@ static int tor2_chanconfig(struct zt_chan *chan, int sigtype)
return 0;
}
-static int tor2_open(struct zt_chan *chan)
+static int tor2_open(struct dahdi_chan *chan)
{
#ifndef LINUX26
MOD_INC_USE_COUNT;
@@ -257,7 +257,7 @@ static int tor2_open(struct zt_chan *chan)
return 0;
}
-static int tor2_close(struct zt_chan *chan)
+static int tor2_close(struct dahdi_chan *chan)
{
#ifndef LINUX26
MOD_DEC_USE_COUNT;
@@ -287,27 +287,27 @@ static void init_spans(struct tor2 *tor)
tor->spans[x].close = tor2_close;
if (tor->cardtype == TYPE_T1) {
tor->spans[x].channels = 24;
- tor->spans[x].deflaw = ZT_LAW_MULAW;
- tor->spans[x].linecompat = ZT_CONFIG_AMI | ZT_CONFIG_B8ZS | ZT_CONFIG_D4 | ZT_CONFIG_ESF;
+ tor->spans[x].deflaw = DAHDI_LAW_MULAW;
+ tor->spans[x].linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_B8ZS | DAHDI_CONFIG_D4 | DAHDI_CONFIG_ESF;
tor->spans[x].spantype = "T1";
} else {
tor->spans[x].channels = 31;
- tor->spans[x].deflaw = ZT_LAW_ALAW;
- tor->spans[x].linecompat = ZT_CONFIG_HDB3 | ZT_CONFIG_CCS | ZT_CONFIG_CRC4;
+ tor->spans[x].deflaw = DAHDI_LAW_ALAW;
+ tor->spans[x].linecompat = DAHDI_CONFIG_HDB3 | DAHDI_CONFIG_CCS | DAHDI_CONFIG_CRC4;
tor->spans[x].spantype = "E1";
}
tor->spans[x].chans = tor->chans[x];
- tor->spans[x].flags = ZT_FLAG_RBS;
+ tor->spans[x].flags = DAHDI_FLAG_RBS;
tor->spans[x].ioctl = tor2_ioctl;
tor->spans[x].pvt = &tor->tspans[x];
tor->tspans[x].tor = tor;
tor->tspans[x].span = x;
init_waitqueue_head(&tor->spans[x].maintq);
for (y=0;y<tor->spans[x].channels;y++) {
- struct zt_chan *mychans = tor->chans[x] + y;
+ struct dahdi_chan *mychans = tor->chans[x] + y;
sprintf(mychans->name, "Tor2/%d/%d/%d", tor->num, x + 1, y + 1);
- mychans->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 | ZT_SIG_EM_E1;
+ mychans->sigcap = 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 | DAHDI_SIG_EM_E1;
c = (x * tor->spans[x].channels) + y;
mychans->pvt = &tor->tchans[c];
mychans->chanpos = y + 1;
@@ -319,29 +319,29 @@ static void init_spans(struct tor2 *tor)
static int __devinit tor2_launch(struct tor2 *tor)
{
- if (tor->spans[0].flags & ZT_FLAG_REGISTERED)
+ if (tor->spans[0].flags & DAHDI_FLAG_REGISTERED)
return 0;
printk("Tor2: Launching card: %d\n", tor->order);
- if (zt_register(&tor->spans[0], 0)) {
+ if (dahdi_register(&tor->spans[0], 0)) {
printk(KERN_ERR "Unable to register span %s\n", tor->spans[0].name);
return -1;
}
- if (zt_register(&tor->spans[1], 0)) {
+ if (dahdi_register(&tor->spans[1], 0)) {
printk(KERN_ERR "Unable to register span %s\n", tor->spans[1].name);
- zt_unregister(&tor->spans[0]);
+ dahdi_unregister(&tor->spans[0]);
return -1;
}
- if (zt_register(&tor->spans[2], 0)) {
+ if (dahdi_register(&tor->spans[2], 0)) {
printk(KERN_ERR "Unable to register span %s\n", tor->spans[2].name);
- zt_unregister(&tor->spans[0]);
- zt_unregister(&tor->spans[1]);
+ dahdi_unregister(&tor->spans[0]);
+ dahdi_unregister(&tor->spans[1]);
return -1;
}
- if (zt_register(&tor->spans[3], 0)) {
+ if (dahdi_register(&tor->spans[3], 0)) {
printk(KERN_ERR "Unable to register span %s\n", tor->spans[3].name);
- zt_unregister(&tor->spans[0]);
- zt_unregister(&tor->spans[1]);
- zt_unregister(&tor->spans[2]);
+ dahdi_unregister(&tor->spans[0]);
+ dahdi_unregister(&tor->spans[1]);
+ dahdi_unregister(&tor->spans[2]);
return -1;
}
tor->plx[INTCSR] = cpu_to_le16(PLX_INTENA); /* enable PLX interrupt */
@@ -368,10 +368,10 @@ static int __devinit tor2_probe(struct pci_dev *pdev, const struct pci_device_id
memset(tor,0,sizeof(struct tor2));
spin_lock_init(&tor->lock);
for (x = 0; x < SPANS_PER_CARD; x++) {
- tor->chans[x] = kmalloc(sizeof(struct zt_chan) * 31,GFP_KERNEL);
+ tor->chans[x] = kmalloc(sizeof(struct dahdi_chan) * 31,GFP_KERNEL);
if (!tor->chans[x])
return -ENOMEM;
- memset(tor->chans[x],0,sizeof(struct zt_chan) * 31);
+ memset(tor->chans[x],0,sizeof(struct dahdi_chan) * 31);
}
/* Load the resources */
tor->pci = pdev;
@@ -603,14 +603,14 @@ static void __devexit tor2_remove(struct pci_dev *pdev)
tor->mem8[LEDREG] = 0;
tor->plx[INTCSR] = cpu_to_le16(0);
free_irq(tor->irq, tor);
- if (tor->spans[0].flags & ZT_FLAG_REGISTERED)
- zt_unregister(&tor->spans[0]);
- if (tor->spans[1].flags & ZT_FLAG_REGISTERED)
- zt_unregister(&tor->spans[1]);
- if (tor->spans[2].flags & ZT_FLAG_REGISTERED)
- zt_unregister(&tor->spans[2]);
- if (tor->spans[3].flags & ZT_FLAG_REGISTERED)
- zt_unregister(&tor->spans[3]);
+ if (tor->spans[0].flags & DAHDI_FLAG_REGISTERED)
+ dahdi_unregister(&tor->spans[0]);
+ if (tor->spans[1].flags & DAHDI_FLAG_REGISTERED)
+ dahdi_unregister(&tor->spans[1]);
+ if (tor->spans[2].flags & DAHDI_FLAG_REGISTERED)
+ dahdi_unregister(&tor->spans[2]);
+ if (tor->spans[3].flags & DAHDI_FLAG_REGISTERED)
+ dahdi_unregister(&tor->spans[3]);
release_mem_region(tor->plx_region, tor->plx_len);
release_mem_region(tor->xilinx32_region, tor->xilinx32_len);
release_mem_region(tor->xilinx8_region, tor->xilinx8_len);
@@ -656,7 +656,7 @@ static void set_clear(struct tor2 *tor)
for (s = 0; s < SPANS_PER_CARD; s++) {
for (i = 0; i < 24; i++) {
j = (i/8);
- if (tor->spans[s].chans[i].flags & ZT_FLAG_CLEAR)
+ if (tor->spans[s].chans[i].flags & DAHDI_FLAG_CLEAR)
val |= 1 << (i % 8);
if ((i % 8)==7) {
@@ -673,7 +673,7 @@ static void set_clear(struct tor2 *tor)
}
-static int tor2_rbsbits(struct zt_chan *chan, int bits)
+static int tor2_rbsbits(struct dahdi_chan *chan, int bits)
{
u_char m,c;
int k,n,b;
@@ -704,7 +704,7 @@ static int tor2_rbsbits(struct zt_chan *chan, int bits)
c = p->tor->txsigs[k][b];
c &= ~m; /* clear mask bit */
/* set mask bit, if bit is to be set */
- if (bits & ZT_ABIT) c |= m;
+ if (bits & DAHDI_ABIT) c |= m;
p->tor->txsigs[k][b] = c;
spin_lock_irqsave(&p->tor->lock, flags);
t1out(p->tor,k + 1,0x70 + b,c);
@@ -713,7 +713,7 @@ static int tor2_rbsbits(struct zt_chan *chan, int bits)
c = p->tor->txsigs[k][b];
c &= ~m; /* clear mask bit */
/* set mask bit, if bit is to be set */
- if (bits & ZT_BBIT) c |= m;
+ if (bits & DAHDI_BBIT) c |= m;
/* save new signalling values */
p->tor->txsigs[k][b] = c;
/* output them into the chip */
@@ -723,7 +723,7 @@ static int tor2_rbsbits(struct zt_chan *chan, int bits)
c = p->tor->txsigs[k][b];
c &= ~m; /* clear mask bit */
/* set mask bit, if bit is to be set */
- if (bits & ZT_CBIT) c |= m;
+ if (bits & DAHDI_CBIT) c |= m;
/* save new signalling values */
p->tor->txsigs[k][b] = c;
/* output them into the chip */
@@ -733,7 +733,7 @@ static int tor2_rbsbits(struct zt_chan *chan, int bits)
c = p->tor->txsigs[k][b];
c &= ~m; /* clear mask bit */
/* set mask bit, if bit is to be set */
- if (bits & ZT_DBIT) c |= m;
+ if (bits & DAHDI_DBIT) c |= m;
/* save new signalling values */
p->tor->txsigs[k][b] = c;
/* output them into the chip */
@@ -742,7 +742,7 @@ static int tor2_rbsbits(struct zt_chan *chan, int bits)
return 0;
}
-static int tor2_shutdown(struct zt_span *span)
+static int tor2_shutdown(struct dahdi_span *span)
{
int i;
int tspan;
@@ -757,9 +757,9 @@ static int tor2_shutdown(struct zt_span *span)
}
spin_lock_irqsave(&p->tor->lock, flags);
- wasrunning = span->flags & ZT_FLAG_RUNNING;
+ wasrunning = span->flags & DAHDI_FLAG_RUNNING;
- span->flags &= ~ZT_FLAG_RUNNING;
+ span->flags &= ~DAHDI_FLAG_RUNNING;
/* Zero out all registers */
if (p->tor->cardtype == TYPE_E1) {
for (i = 0; i < 192; i++)
@@ -771,10 +771,10 @@ static int tor2_shutdown(struct zt_span *span)
if (wasrunning)
p->tor->spansstarted--;
spin_unlock_irqrestore(&p->tor->lock, flags);
- if (!(p->tor->spans[0].flags & ZT_FLAG_RUNNING) &&
- !(p->tor->spans[1].flags & ZT_FLAG_RUNNING) &&
- !(p->tor->spans[2].flags & ZT_FLAG_RUNNING) &&
- !(p->tor->spans[3].flags & ZT_FLAG_RUNNING))
+ if (!(p->tor->spans[0].flags & DAHDI_FLAG_RUNNING) &&
+ !(p->tor->spans[1].flags & DAHDI_FLAG_RUNNING) &&
+ !(p->tor->spans[2].flags & DAHDI_FLAG_RUNNING) &&
+ !(p->tor->spans[3].flags & DAHDI_FLAG_RUNNING))
/* No longer in use, disable interrupts */
p->tor->mem8[CTLREG] = 0;
if (debug)
@@ -783,7 +783,7 @@ static int tor2_shutdown(struct zt_span *span)
}
-static int tor2_startup(struct zt_span *span)
+static int tor2_startup(struct dahdi_span *span)
{
unsigned long endjif;
int i;
@@ -803,15 +803,15 @@ static int tor2_startup(struct zt_span *span)
spin_lock_irqsave(&p->tor->lock, flags);
- alreadyrunning = span->flags & ZT_FLAG_RUNNING;
+ alreadyrunning = span->flags & DAHDI_FLAG_RUNNING;
/* initialize the start value for the entire chunk of last ec buffer */
for (i = 0; i < span->channels; i++)
{
memset(p->tor->ec_chunk1[p->span][i],
- ZT_LIN2X(0,&span->chans[i]),ZT_CHUNKSIZE);
+ DAHDI_LIN2X(0,&span->chans[i]),DAHDI_CHUNKSIZE);
memset(p->tor->ec_chunk2[p->span][i],
- ZT_LIN2X(0,&span->chans[i]),ZT_CHUNKSIZE);
+ DAHDI_LIN2X(0,&span->chans[i]),DAHDI_CHUNKSIZE);
}
/* Force re-evaluation of the timing source */
if (timingcable)
@@ -848,18 +848,18 @@ static int tor2_startup(struct zt_span *span)
crcing = "";
tcr1 = 9; /* base TCR1 value: TSis mode */
tcr2 = 0;
- if (span->lineconfig & ZT_CONFIG_CCS) {
+ if (span->lineconfig & DAHDI_CONFIG_CCS) {
ccr1 |= 8; /* CCR1: Rx Sig mode: CCS */
coding = "CCS";
} else {
tcr1 |= 0x20;
coding = "CAS";
}
- if (span->lineconfig & ZT_CONFIG_HDB3) {
+ if (span->lineconfig & DAHDI_CONFIG_HDB3) {
ccr1 |= 0x44; /* CCR1: TX and RX HDB3 */
framing = "HDB3";
} else framing = "AMI";
- if (span->lineconfig & ZT_CONFIG_CRC4) {
+ if (span->lineconfig & DAHDI_CONFIG_CRC4) {
ccr1 |= 0x11; /* CCR1: TX and TX CRC4 */
tcr2 |= 0x02; /* TCR2: CRC4 bit auto */
crcing = "/CRC4";
@@ -884,7 +884,7 @@ static int tor2_startup(struct zt_span *span)
t1out(p->tor,tspan,0x1b,0x9a); /* CCR3: set also ESR */
t1out(p->tor,tspan,0x1b,0x82); /* CCR3: TSCLKM only now */
- span->flags |= ZT_FLAG_RUNNING;
+ span->flags |= DAHDI_FLAG_RUNNING;
p->tor->spansstarted++;
/* enable interrupts */
@@ -937,9 +937,9 @@ static int tor2_startup(struct zt_span *span)
}
/* Enable F bits pattern */
i = 0x20;
- if (span->lineconfig & ZT_CONFIG_ESF)
+ if (span->lineconfig & DAHDI_CONFIG_ESF)
i = 0x88;
- if (span->lineconfig & ZT_CONFIG_B8ZS)
+ if (span->lineconfig & DAHDI_CONFIG_B8ZS)
i |= 0x44;
t1out(p->tor,tspan, 0x38, i);
if (i & 0x80)
@@ -969,7 +969,7 @@ static int tor2_startup(struct zt_span *span)
t1out(p->tor,tspan,0x0a,0x30); /* LIRST back to normal, Resetting elastic stores */
- span->flags |= ZT_FLAG_RUNNING;
+ span->flags |= DAHDI_FLAG_RUNNING;
p->tor->spansstarted++;
/* enable interrupts */
@@ -982,9 +982,9 @@ static int tor2_startup(struct zt_span *span)
if (debug) {
if (alreadyrunning)
- printk("Tor2: Reconfigured span %d (%s/%s) LBO: %s\n", span->spanno, coding, framing, zt_lboname(span->txlevel));
+ printk("Tor2: Reconfigured span %d (%s/%s) LBO: %s\n", span->spanno, coding, framing, dahdi_lboname(span->txlevel));
else
- printk("Tor2: Startup span %d (%s/%s) LBO: %s\n", span->spanno, coding, framing, zt_lboname(span->txlevel));
+ printk("Tor2: Startup span %d (%s/%s) LBO: %s\n", span->spanno, coding, framing, dahdi_lboname(span->txlevel));
}
}
if (p->tor->syncs[0] == span->spanno) printk("SPAN %d: Primary Sync Source\n",span->spanno);
@@ -994,7 +994,7 @@ static int tor2_startup(struct zt_span *span)
return 0;
}
-static int tor2_maint(struct zt_span *span, int cmd)
+static int tor2_maint(struct dahdi_span *span, int cmd)
{
struct tor2_span *p = span->pvt;
@@ -1003,18 +1003,18 @@ static int tor2_maint(struct zt_span *span, int cmd)
if (p->tor->cardtype == TYPE_E1)
{
switch(cmd) {
- case ZT_MAINT_NONE:
+ case DAHDI_MAINT_NONE:
t1out(p->tor,tspan,0xa8,0); /* no loops */
break;
- case ZT_MAINT_LOCALLOOP:
+ case DAHDI_MAINT_LOCALLOOP:
t1out(p->tor,tspan,0xa8,0x40); /* local loop */
break;
- case ZT_MAINT_REMOTELOOP:
+ case DAHDI_MAINT_REMOTELOOP:
t1out(p->tor,tspan,0xa8,0x80); /* remote loop */
break;
- case ZT_MAINT_LOOPUP:
- case ZT_MAINT_LOOPDOWN:
- case ZT_MAINT_LOOPSTOP:
+ case DAHDI_MAINT_LOOPUP:
+ case DAHDI_MAINT_LOOPDOWN:
+ case DAHDI_MAINT_LOOPSTOP:
return -ENOSYS;
default:
printk("Tor2: Unknown maint command: %d\n", cmd);
@@ -1023,29 +1023,29 @@ static int tor2_maint(struct zt_span *span, int cmd)
return 0;
}
switch(cmd) {
- case ZT_MAINT_NONE:
+ case DAHDI_MAINT_NONE:
t1out(p->tor,tspan,0x19,(japan ? 0x80 : 0x00)); /* no local loop */
t1out(p->tor,tspan,0x0a,0); /* no remote loop */
break;
- case ZT_MAINT_LOCALLOOP:
+ case DAHDI_MAINT_LOCALLOOP:
t1out(p->tor,tspan,0x19,0x40 | (japan ? 0x80 : 0x00)); /* local loop */
t1out(p->tor,tspan,0x0a,0); /* no remote loop */
break;
- case ZT_MAINT_REMOTELOOP:
+ case DAHDI_MAINT_REMOTELOOP:
t1out(p->tor,tspan,0x1e,(japan ? 0x80 : 0x00)); /* no local loop */
t1out(p->tor,tspan,0x0a,0x40); /* remote loop */
break;
- case ZT_MAINT_LOOPUP:
+ case DAHDI_MAINT_LOOPUP:
t1out(p->tor,tspan,0x30,2); /* send loopup code */
t1out(p->tor,tspan,0x12,0x22); /* send loopup code */
t1out(p->tor,tspan,0x13,0x80); /* send loopup code */
break;
- case ZT_MAINT_LOOPDOWN:
+ case DAHDI_MAINT_LOOPDOWN:
t1out(p->tor,tspan,0x30,2); /* send loopdown code */
t1out(p->tor,tspan,0x12,0x62); /* send loopdown code */
t1out(p->tor,tspan,0x13,0x90); /* send loopdown code */
break;
- case ZT_MAINT_LOOPSTOP:
+ case DAHDI_MAINT_LOOPSTOP:
t1out(p->tor,tspan,0x30,0); /* stop sending loopup code */
break;
default:
@@ -1059,26 +1059,26 @@ static inline void tor2_run(struct tor2 *tor)
{
int x,y;
for (x = 0; x < SPANS_PER_CARD; x++) {
- if (tor->spans[x].flags & ZT_FLAG_RUNNING) {
+ if (tor->spans[x].flags & DAHDI_FLAG_RUNNING) {
/* since the Tormenta 2 PCI is double-buffered, you
need to delay the transmit data 2 entire chunks so
that the transmit will be in sync with the receive */
for (y=0;y<tor->spans[x].channels;y++) {
- zt_ec_chunk(&tor->spans[x].chans[y],
+ dahdi_ec_chunk(&tor->spans[x].chans[y],
tor->spans[x].chans[y].readchunk,
tor->ec_chunk2[x][y]);
memcpy(tor->ec_chunk2[x][y],tor->ec_chunk1[x][y],
- ZT_CHUNKSIZE);
+ DAHDI_CHUNKSIZE);
memcpy(tor->ec_chunk1[x][y],
tor->spans[x].chans[y].writechunk,
- ZT_CHUNKSIZE);
+ DAHDI_CHUNKSIZE);
}
- zt_receive(&tor->spans[x]);
+ dahdi_receive(&tor->spans[x]);
}
}
for (x = 0; x < SPANS_PER_CARD; x++) {
- if (tor->spans[x].flags & ZT_FLAG_RUNNING)
- zt_transmit(&tor->spans[x]);
+ if (tor->spans[x].flags & DAHDI_FLAG_RUNNING)
+ dahdi_transmit(&tor->spans[x]);
}
}
@@ -1127,8 +1127,8 @@ static int tor2_findsync(struct tor2 *tor)
if (cards[x]->syncpos[i]) {
nonzero = 1;
if ((cards[x]->syncpos[i] == p) &&
- !(cards[x]->spans[i].alarms & (ZT_ALARM_RED | ZT_ALARM_BLUE | ZT_ALARM_LOOPBACK)) &&
- (cards[x]->spans[i].flags & ZT_FLAG_RUNNING)) {
+ !(cards[x]->spans[i].alarms & (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE | DAHDI_ALARM_LOOPBACK)) &&
+ (cards[x]->spans[i].flags & DAHDI_FLAG_RUNNING)) {
/* This makes a good sync source */
newsyncsrc = cards[x]->spans[i].spanno;
newsyncnum = x;
@@ -1213,7 +1213,7 @@ ZAP_IRQ_HANDLER(tor2_intr)
/* do the transmit output */
for (n = 0; n < tor->spans[0].channels; n++) {
- for (i = 0; i < ZT_CHUNKSIZE; i++) {
+ for (i = 0; i < DAHDI_CHUNKSIZE; i++) {
/* span 1 */
txword = tor->spans[0].chans[n].writechunk[i] << 24;
/* span 2 */
@@ -1233,7 +1233,7 @@ ZAP_IRQ_HANDLER(tor2_intr)
/* Do the receive input */
for (n = 0; n < tor->spans[0].channels; n++) {
- for (i = 0; i < ZT_CHUNKSIZE; i++) {
+ for (i = 0; i < DAHDI_CHUNKSIZE; i++) {
/* read from */
#ifdef FIXTHISFOR64
rxword = tor->mem32[tor->datxlt[n] + (32 * i)];
@@ -1260,14 +1260,14 @@ ZAP_IRQ_HANDLER(tor2_intr)
rxc = c & 15;
if (rxc != tor->spans[k - 1].chans[j + 16].rxsig) {
/* Check for changes in received bits */
- if (!(tor->spans[k - 1].chans[j + 16].sig & ZT_SIG_CLEAR))
- zt_rbsbits(&tor->spans[k - 1].chans[j + 16], rxc);
+ if (!(tor->spans[k - 1].chans[j + 16].sig & DAHDI_SIG_CLEAR))
+ dahdi_rbsbits(&tor->spans[k - 1].chans[j + 16], rxc);
}
rxc = c >> 4;
if (rxc != tor->spans[k - 1].chans[j].rxsig) {
/* Check for changes in received bits */
- if (!(tor->spans[k - 1].chans[j].sig & ZT_SIG_CLEAR))
- zt_rbsbits(&tor->spans[k - 1].chans[j], rxc);
+ if (!(tor->spans[k - 1].chans[j].sig & DAHDI_SIG_CLEAR))
+ dahdi_rbsbits(&tor->spans[k - 1].chans[j], rxc);
}
}
}
@@ -1283,12 +1283,12 @@ ZAP_IRQ_HANDLER(tor2_intr)
/* Get channel number */
i = (n * 8) + j;
rxc = 0;
- if (abits & (1 << j)) rxc |= ZT_ABIT;
- if (bbits & (1 << j)) rxc |= ZT_BBIT;
+ if (abits & (1 << j)) rxc |= DAHDI_ABIT;
+ if (bbits & (1 << j)) rxc |= DAHDI_BBIT;
if (tor->spans[k].chans[i].rxsig != rxc) {
/* Check for changes in received bits */
- if (!(tor->spans[k].chans[i].sig & ZT_SIG_CLEAR)) {
- zt_rbsbits(&tor->spans[k].chans[i], rxc);
+ if (!(tor->spans[k].chans[i].sig & DAHDI_SIG_CLEAR)) {
+ dahdi_rbsbits(&tor->spans[k].chans[i], rxc);
}
}
}
@@ -1299,12 +1299,12 @@ ZAP_IRQ_HANDLER(tor2_intr)
if (tor->alarmtimer[i]) {
if (!--tor->alarmtimer[i]) {
/* clear recover status */
- tor->spans[i].alarms &= ~ZT_ALARM_RECOVER;
+ tor->spans[i].alarms &= ~DAHDI_ALARM_RECOVER;
if (tor->cardtype == TYPE_E1)
t1out(tor,i + 1,0x21,0x5f); /* turn off yel */
else
t1out(tor,i + 1,0x35,0x10); /* turn off yel */
- zt_alarm_notify(&tor->spans[i]); /* let them know */
+ dahdi_alarm_notify(&tor->spans[i]); /* let them know */
}
}
}
@@ -1324,11 +1324,11 @@ ZAP_IRQ_HANDLER(tor2_intr)
{
/* set into remote loop, if not there already */
if ((tor->loopupcnt[i]++ > 80) &&
- (tor->spans[i].maintstat != ZT_MAINT_REMOTELOOP))
+ (tor->spans[i].maintstat != DAHDI_MAINT_REMOTELOOP))
{
t1out(tor,i + 1,0x1e,(japan ? 0x80 : 0x00)); /* no local loop */
t1out(tor,i + 1,0x0a,0x40); /* remote loop */
- tor->spans[i].maintstat = ZT_MAINT_REMOTELOOP;
+ tor->spans[i].maintstat = DAHDI_MAINT_REMOTELOOP;
}
} else tor->loopupcnt[i] = 0;
/* detect the code, only if we are not sending one */
@@ -1336,55 +1336,55 @@ ZAP_IRQ_HANDLER(tor2_intr)
{
/* if in remote loop, get out of it */
if ((tor->loopdowncnt[i]++ > 80) &&
- (tor->spans[i].maintstat == ZT_MAINT_REMOTELOOP))
+ (tor->spans[i].maintstat == DAHDI_MAINT_REMOTELOOP))
{
t1out(tor,i + 1,0x1e,(japan ? 0x80 : 0x00)); /* no local loop */
t1out(tor,i + 1,0x0a,0); /* no remote loop */
- tor->spans[i].maintstat = ZT_MAINT_NONE;
+ tor->spans[i].maintstat = DAHDI_MAINT_NONE;
}
} else tor->loopdowncnt[i] = 0;
if (c & 3) /* if red alarm */
{
- j |= ZT_ALARM_RED;
+ j |= DAHDI_ALARM_RED;
}
if (c & 8) /* if blue alarm */
{
- j |= ZT_ALARM_BLUE;
+ j |= DAHDI_ALARM_BLUE;
}
} else { /* its an E1 card */
t1out(tor,i + 1,6,0xff);
c = t1in(tor,i + 1,6); /* get the status */
if (c & 9) /* if red alarm */
{
- j |= ZT_ALARM_RED;
+ j |= DAHDI_ALARM_RED;
}
if (c & 2) /* if blue alarm */
{
- j |= ZT_ALARM_BLUE;
+ j |= DAHDI_ALARM_BLUE;
}
}
/* only consider previous carrier alarm state */
- tor->spans[i].alarms &= (ZT_ALARM_RED | ZT_ALARM_BLUE | ZT_ALARM_NOTOPEN);
+ tor->spans[i].alarms &= (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE | DAHDI_ALARM_NOTOPEN);
n = 1; /* set to 1 so will not be in yellow alarm if we dont
care about open channels */
/* if to have yellow alarm if nothing open */
- if (tor->spans[i].lineconfig & ZT_CONFIG_NOTOPEN)
+ if (tor->spans[i].lineconfig & DAHDI_CONFIG_NOTOPEN)
{
/* go thru all chans, and count # open */
for (n = 0,k = 0; k < tor->spans[i].channels; k++)
{
- if (((tor->chans[i] + k)->flags & ZT_FLAG_OPEN) ||
- ((tor->chans[i] + k)->flags & ZT_FLAG_NETDEV)) n++;
+ if (((tor->chans[i] + k)->flags & DAHDI_FLAG_OPEN) ||
+ ((tor->chans[i] + k)->flags & DAHDI_FLAG_NETDEV)) n++;
}
/* if none open, set alarm condition */
- if (!n) j |= ZT_ALARM_NOTOPEN;
+ if (!n) j |= DAHDI_ALARM_NOTOPEN;
}
/* if no more alarms, and we had some */
if ((!j) && tor->spans[i].alarms)
{
- tor->alarmtimer[i] = ZT_ALARMSETTLE_TIME;
+ tor->alarmtimer[i] = DAHDI_ALARMSETTLE_TIME;
}
- if (tor->alarmtimer[i]) j |= ZT_ALARM_RECOVER;
+ if (tor->alarmtimer[i]) j |= DAHDI_ALARM_RECOVER;
/* if going into alarm state, set yellow alarm */
if ((j) && (!tor->spans[i].alarms)) {
if (tor->cardtype == TYPE_E1)
@@ -1393,19 +1393,19 @@ ZAP_IRQ_HANDLER(tor2_intr)
t1out(tor,i + 1,0x35,0x11);
}
if (c & 4) /* if yellow alarm */
- j |= ZT_ALARM_YELLOW;
- if (tor->spans[i].maintstat || tor->spans[i].mainttimer) j |= ZT_ALARM_LOOPBACK;
+ j |= DAHDI_ALARM_YELLOW;
+ if (tor->spans[i].maintstat || tor->spans[i].mainttimer) j |= DAHDI_ALARM_LOOPBACK;
tor->spans[i].alarms = j;
c = (LEDRED | LEDGREEN) << (2 * i);
tor->leds &= ~c; /* mask out bits for this span */
/* light LED's if span configured and running */
- if (tor->spans[i].flags & ZT_FLAG_RUNNING) {
- if (j & ZT_ALARM_RED) tor->leds |= LEDRED << (2 * i);
- else if (j & ZT_ALARM_YELLOW) tor->leds |= (LEDRED | LEDGREEN) << (2 * i);
+ if (tor->spans[i].flags & DAHDI_FLAG_RUNNING) {
+ if (j & DAHDI_ALARM_RED) tor->leds |= LEDRED << (2 * i);
+ else if (j & DAHDI_ALARM_YELLOW) tor->leds |= (LEDRED | LEDGREEN) << (2 * i);
else tor->leds |= LEDGREEN << (2 * i);
}
tor->mem8[LEDREG] = tor->leds;
- zt_alarm_notify(&tor->spans[i]);
+ dahdi_alarm_notify(&tor->spans[i]);
}
if (!(tor->passno % 1000)) /* even second boundary */
{
@@ -1416,7 +1416,7 @@ ZAP_IRQ_HANDLER(tor2_intr)
{
/* add this second's BPV count to total one */
tor->spans[i - 1].bpvcount += t1in(tor,i,1) + (t1in(tor,i,0) << 8);
- if (tor->spans[i - 1].lineconfig & ZT_CONFIG_CRC4)
+ if (tor->spans[i - 1].lineconfig & DAHDI_CONFIG_CRC4)
{
tor->spans[i - 1].crc4count += t1in(tor,i,3) + ((t1in(tor,i,2) & 3) << 8);
tor->spans[i - 1].ebitcount += t1in(tor,i,5) + ((t1in(tor,i,4) & 3) << 8);
@@ -1438,8 +1438,8 @@ ZAP_IRQ_HANDLER(tor2_intr)
if (tor->psyncs[0])
{
/* if no alarms, use it */
- if (!(tor->spans[tor->psyncs[0] - 1].alarms & (ZT_ALARM_RED | ZT_ALARM_BLUE |
- ZT_ALARM_LOOPBACK))) {
+ if (!(tor->spans[tor->psyncs[0] - 1].alarms & (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE |
+ DAHDI_ALARM_LOOPBACK))) {
tor->syncsrc = tor->psyncs[0];
syncsrc = tor->syncs[0];
}
@@ -1449,8 +1449,8 @@ ZAP_IRQ_HANDLER(tor2_intr)
/* if we dont have one yet, and there is one specified at this level, see if we can use it */
if ((!tor->syncsrc) && (tor->psyncs[i])) {
/* if no alarms, use it */
- if (!(tor->spans[tor->psyncs[i] - 1].alarms & (ZT_ALARM_RED | ZT_ALARM_BLUE |
- ZT_ALARM_LOOPBACK))) {
+ if (!(tor->spans[tor->psyncs[i] - 1].alarms & (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE |
+ DAHDI_ALARM_LOOPBACK))) {
tor->syncsrc = tor->psyncs[i];
syncsrc = tor->syncs[i];
}
@@ -1490,7 +1490,7 @@ ZAP_IRQ_HANDLER(tor2_intr)
}
-static int tor2_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data)
+static int tor2_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long data)
{
switch(cmd) {
default:
diff --git a/drivers/dahdi/wcfxo.c b/drivers/dahdi/wcfxo.c
index a8e0313..d9b23a6 100644
--- a/drivers/dahdi/wcfxo.c
+++ b/drivers/dahdi/wcfxo.c
@@ -141,8 +141,8 @@ static int wecareregs[] =
struct wcfxo {
struct pci_dev *dev;
char *variety;
- struct zt_span span;
- struct zt_chan chan;
+ struct dahdi_span span;
+ struct dahdi_chan chan;
int usecount;
int dead;
int pos;
@@ -169,9 +169,9 @@ struct wcfxo {
int ignoreread;
int reset;
/* Up to 6 register can be written at a time */
- struct reg regs[ZT_CHUNKSIZE];
- struct reg oldregs[ZT_CHUNKSIZE];
- unsigned char lasttx[ZT_CHUNKSIZE];
+ struct reg regs[DAHDI_CHUNKSIZE];
+ struct reg oldregs[DAHDI_CHUNKSIZE];
+ unsigned char lasttx[DAHDI_CHUNKSIZE];
/* Up to 32 registers of whatever we most recently read */
unsigned char readregs[32];
unsigned long ioaddr;
@@ -252,34 +252,34 @@ static inline void wcfxo_transmitprep(struct wcfxo *wc, unsigned char ints)
int written=0;
unsigned short cmd;
- /* if nothing to transmit, have to do the zt_transmit() anyway */
+ /* if nothing to transmit, have to do the dahdi_transmit() anyway */
if (!(ints & 3)) {
/* Calculate Transmission */
- zt_transmit(&wc->span);
+ dahdi_transmit(&wc->span);
return;
}
/* Remember what it was we just sent */
- memcpy(wc->lasttx, wc->chan.writechunk, ZT_CHUNKSIZE);
+ memcpy(wc->lasttx, wc->chan.writechunk, DAHDI_CHUNKSIZE);
if (ints & 0x01) {
/* Write is at interrupt address. Start writing from normal offset */
writechunk = wc->writechunk;
} else {
- writechunk = wc->writechunk + ZT_CHUNKSIZE * 2;
+ writechunk = wc->writechunk + DAHDI_CHUNKSIZE * 2;
}
- zt_transmit(&wc->span);
+ dahdi_transmit(&wc->span);
- for (x=0;x<ZT_CHUNKSIZE;x++) {
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
/* Send a sample, as a 32-bit word, and be sure to indicate that a command follows */
if (wc->flags & FLAG_INVERTSER)
writechunk[x << 1] = cpu_to_le32(
- ~((unsigned short)(ZT_XLAW(wc->chan.writechunk[x], (&wc->chan)))| 0x1) << 16
+ ~((unsigned short)(DAHDI_XLAW(wc->chan.writechunk[x], (&wc->chan)))| 0x1) << 16
);
else
writechunk[x << 1] = cpu_to_le32(
- ((unsigned short)(ZT_XLAW(wc->chan.writechunk[x], (&wc->chan)))| 0x1) << 16
+ ((unsigned short)(DAHDI_XLAW(wc->chan.writechunk[x], (&wc->chan)))| 0x1) << 16
);
/* We always have a command to follow our signal */
@@ -320,7 +320,7 @@ static inline void wcfxo_transmitprep(struct wcfxo *wc, unsigned char ints)
wc->readpos = 0;
wc->wregcount = 0;
- for (x=0;x<ZT_CHUNKSIZE;x++) {
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
/* Rotate through registers */
wc->oldregs[x] = wc->regs[x];
wc->regs[x].flags = FLAG_EMPTY;
@@ -339,11 +339,11 @@ static inline void wcfxo_receiveprep(struct wcfxo *wc, unsigned char ints)
/* Read is at interrupt address. Valid data is available at normal offset */
readchunk = wc->readchunk;
else
- readchunk = wc->readchunk + ZT_CHUNKSIZE * 2;
+ readchunk = wc->readchunk + DAHDI_CHUNKSIZE * 2;
/* Keep track of how quickly our peg alternates */
- wc->pegtimer+=ZT_CHUNKSIZE;
- for (x=0;x<ZT_CHUNKSIZE;x++) {
+ wc->pegtimer+=DAHDI_CHUNKSIZE;
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
/* We always have a command to follow our signal. */
if (wc->oldregs[x].flags == FLAG_READ && !wc->ignoreread) {
@@ -377,7 +377,7 @@ static inline void wcfxo_receiveprep(struct wcfxo *wc, unsigned char ints)
wc->pegtimer = 0;
wc->peg = -1;
}
- wc->chan.readchunk[x] = ZT_LIN2X((sample), (&wc->chan));
+ wc->chan.readchunk[x] = DAHDI_LIN2X((sample), (&wc->chan));
}
if (wc->pegtimer > PEGTIME) {
/* Reset pegcount if our timer expires */
@@ -391,14 +391,14 @@ static inline void wcfxo_receiveprep(struct wcfxo *wc, unsigned char ints)
/* It's ringing */
if (debug)
printk("RING!\n");
- zt_hooksig(&wc->chan, ZT_RXSIG_RING);
+ dahdi_hooksig(&wc->chan, DAHDI_RXSIG_RING);
wc->ring = 1;
}
if (wc->ring && !wc->pegcount) {
/* No more ring */
if (debug)
printk("NO RING!\n");
- zt_hooksig(&wc->chan, ZT_RXSIG_OFFHOOK);
+ dahdi_hooksig(&wc->chan, DAHDI_RXSIG_OFFHOOK);
wc->ring = 0;
}
}
@@ -407,10 +407,10 @@ static inline void wcfxo_receiveprep(struct wcfxo *wc, unsigned char ints)
/* Do the echo cancellation... We are echo cancelling against
what we sent two chunks ago*/
- zt_ec_chunk(&wc->chan, wc->chan.readchunk, wc->lasttx);
+ dahdi_ec_chunk(&wc->chan, wc->chan.readchunk, wc->lasttx);
/* Receive the result */
- zt_receive(&wc->span);
+ dahdi_receive(&wc->span);
}
#ifdef ENABLE_TASKLETS
@@ -504,7 +504,7 @@ ZAP_IRQ_HANDLER(wcfxo_interrupt)
wc->battery = 0;
#ifdef JAPAN
if ((!wc->ohdebounce) && wc->offhook) {
- zt_hooksig(&wc->chan, ZT_RXSIG_ONHOOK);
+ dahdi_hooksig(&wc->chan, DAHDI_RXSIG_ONHOOK);
if (debug)
printk("Signalled On Hook\n");
#ifdef ZERO_BATT_RING
@@ -512,7 +512,7 @@ ZAP_IRQ_HANDLER(wcfxo_interrupt)
#endif
}
#else
- zt_hooksig(&wc->chan, ZT_RXSIG_ONHOOK);
+ dahdi_hooksig(&wc->chan, DAHDI_RXSIG_ONHOOK);
#endif
wc->battdebounce = BATT_DEBOUNCE;
} else if (!wc->battery)
@@ -522,8 +522,8 @@ ZAP_IRQ_HANDLER(wcfxo_interrupt)
!(wc->readregs[WC_DAA_DCTL1] & 0x04) &&
#endif
(!wc->span.alarms)) {
- wc->span.alarms = ZT_ALARM_RED;
- zt_alarm_notify(&wc->span);
+ wc->span.alarms = DAHDI_ALARM_RED;
+ dahdi_alarm_notify(&wc->span);
}
} else if (b == 0xf) {
if (!wc->battery && !wc->battdebounce) {
@@ -532,19 +532,19 @@ ZAP_IRQ_HANDLER(wcfxo_interrupt)
#ifdef ZERO_BATT_RING
if (wc->onhook) {
wc->onhook = 0;
- zt_hooksig(&wc->chan, ZT_RXSIG_OFFHOOK);
+ dahdi_hooksig(&wc->chan, DAHDI_RXSIG_OFFHOOK);
if (debug)
printk("Signalled Off Hook\n");
}
#else
- zt_hooksig(&wc->chan, ZT_RXSIG_OFFHOOK);
+ dahdi_hooksig(&wc->chan, DAHDI_RXSIG_OFFHOOK);
#endif
wc->battery = 1;
wc->nobatttimer = 0;
wc->battdebounce = BATT_DEBOUNCE;
if (wc->span.alarms) {
wc->span.alarms = 0;
- zt_alarm_notify(&wc->span);
+ dahdi_alarm_notify(&wc->span);
}
} else if (wc->battery)
wc->battdebounce = BATT_DEBOUNCE;
@@ -569,7 +569,7 @@ ZAP_IRQ_HANDLER(wcfxo_interrupt)
static int wcfxo_setreg(struct wcfxo *wc, unsigned char reg, unsigned char value)
{
int x;
- if (wc->wregcount < ZT_CHUNKSIZE) {
+ if (wc->wregcount < DAHDI_CHUNKSIZE) {
x = wc->wregcount;
wc->regs[x].reg = reg;
wc->regs[x].value = value;
@@ -581,7 +581,7 @@ static int wcfxo_setreg(struct wcfxo *wc, unsigned char reg, unsigned char value
return -1;
}
-static int wcfxo_open(struct zt_chan *chan)
+static int wcfxo_open(struct dahdi_chan *chan)
{
struct wcfxo *wc = chan->pvt;
if (wc->dead)
@@ -593,14 +593,14 @@ static int wcfxo_open(struct zt_chan *chan)
return 0;
}
-static int wcfxo_watchdog(struct zt_span *span, int event)
+static int wcfxo_watchdog(struct dahdi_span *span, int event)
{
printk("FXO: Restarting DMA\n");
wcfxo_restart_dma(span->pvt);
return 0;
}
-static int wcfxo_close(struct zt_chan *chan)
+static int wcfxo_close(struct dahdi_chan *chan)
{
struct wcfxo *wc = chan->pvt;
wc->usecount--;
@@ -613,13 +613,13 @@ static int wcfxo_close(struct zt_chan *chan)
return 0;
}
-static int wcfxo_hooksig(struct zt_chan *chan, zt_txsig_t txsig)
+static int wcfxo_hooksig(struct dahdi_chan *chan, dahdi_txsig_t txsig)
{
struct wcfxo *wc = chan->pvt;
int reg=0;
switch(txsig) {
- case ZT_TXSIG_START:
- case ZT_TXSIG_OFFHOOK:
+ case DAHDI_TXSIG_START:
+ case DAHDI_TXSIG_OFFHOOK:
/* Take off hook and enable normal mode reception. This must
be done in two steps because of a hardware bug. */
reg = wc->readregs[WC_DAA_DCTL1] & ~0x08;
@@ -634,7 +634,7 @@ static int wcfxo_hooksig(struct zt_chan *chan, zt_txsig_t txsig)
wc->ohdebounce = OH_DEBOUNCE;
#endif
break;
- case ZT_TXSIG_ONHOOK:
+ case DAHDI_TXSIG_ONHOOK:
/* Put on hook and enable on hook line monitor */
reg = wc->readregs[WC_DAA_DCTL1] & 0xfe;
wcfxo_setreg(wc, WC_DAA_DCTL1, reg);
@@ -666,7 +666,7 @@ static int wcfxo_initialize(struct wcfxo *wc)
"PCI Bus %02d Slot %02d", wc->dev->bus->number, PCI_SLOT(wc->dev->devfn) + 1);
wc->span.manufacturer = "Digium";
zap_copy_string(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype));
- wc->chan.sigcap = ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF;
+ wc->chan.sigcap = DAHDI_SIG_FXSKS | DAHDI_SIG_FXSLS | DAHDI_SIG_SF;
wc->chan.chanpos = 1;
wc->span.chans = &wc->chan;
wc->span.channels = 1;
@@ -674,8 +674,8 @@ static int wcfxo_initialize(struct wcfxo *wc)
wc->span.irq = wc->dev->irq;
wc->span.open = wcfxo_open;
wc->span.close = wcfxo_close;
- wc->span.flags = ZT_FLAG_RBS;
- wc->span.deflaw = ZT_LAW_MULAW;
+ wc->span.flags = DAHDI_FLAG_RBS;
+ wc->span.deflaw = DAHDI_LAW_MULAW;
wc->span.watchdog = wcfxo_watchdog;
#ifdef ENABLE_TASKLETS
tasklet_init(&wc->wcfxo_tlet, wcfxo_tasklet, (unsigned long)wc);
@@ -684,7 +684,7 @@ static int wcfxo_initialize(struct wcfxo *wc)
wc->span.pvt = wc;
wc->chan.pvt = wc;
- if (zt_register(&wc->span, 0)) {
+ if (dahdi_register(&wc->span, 0)) {
printk("Unable to register span with zaptel\n");
return -1;
}
@@ -729,12 +729,12 @@ static int wcfxo_hardware_init(struct wcfxo *wc)
/* Setup DMA Addresses */
outl(wc->writedma, wc->ioaddr + WC_DMAWS); /* Write start */
- outl(wc->writedma + ZT_CHUNKSIZE * 8 - 4, wc->ioaddr + WC_DMAWI); /* Middle (interrupt) */
- outl(wc->writedma + ZT_CHUNKSIZE * 16 - 4, wc->ioaddr + WC_DMAWE); /* End */
+ outl(wc->writedma + DAHDI_CHUNKSIZE * 8 - 4, wc->ioaddr + WC_DMAWI); /* Middle (interrupt) */
+ outl(wc->writedma + DAHDI_CHUNKSIZE * 16 - 4, wc->ioaddr + WC_DMAWE); /* End */
outl(wc->readdma, wc->ioaddr + WC_DMARS); /* Read start */
- outl(wc->readdma + ZT_CHUNKSIZE * 8 - 4, wc->ioaddr + WC_DMARI); /* Middle (interrupt) */
- outl(wc->readdma + ZT_CHUNKSIZE * 16 - 4, wc->ioaddr + WC_DMARE); /* End */
+ outl(wc->readdma + DAHDI_CHUNKSIZE * 8 - 4, wc->ioaddr + WC_DMARI); /* Middle (interrupt) */
+ outl(wc->readdma + DAHDI_CHUNKSIZE * 16 - 4, wc->ioaddr + WC_DMARE); /* End */
/* Clear interrupts */
outb(0xff, wc->ioaddr + WC_INTSTAT);
@@ -807,7 +807,7 @@ static void wcfxo_set_daa_mode(struct wcfxo *wc)
/* Wait a couple of jiffies for our writes to finish */
set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1 + (ZT_CHUNKSIZE * HZ) / 800);
+ schedule_timeout(1 + (DAHDI_CHUNKSIZE * HZ) / 800);
printk("wcfxo: DAA mode is '%s'\n", fxo_modes[opermode].name);
}
@@ -826,7 +826,7 @@ static int wcfxo_init_daa(struct wcfxo *wc)
/* Let the reset go */
set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(1 + (ZT_CHUNKSIZE * HZ) / 800);
+ schedule_timeout(1 + (DAHDI_CHUNKSIZE * HZ) / 800);
/* We have a clock at 18.432 Mhz, so N1=1, M1=2, CGM=0 */
wcfxo_setreg(wc, WC_DAA_PLL1_N1, 0x0); /* This value is N1 - 1 */
@@ -836,7 +836,7 @@ static int wcfxo_init_daa(struct wcfxo *wc)
/* Wait until the PLL's are locked. Time is between 100 uSec and 1 mSec */
set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1 + HZ/1000 + (ZT_CHUNKSIZE * HZ) / 800);
+ schedule_timeout(1 + HZ/1000 + (DAHDI_CHUNKSIZE * HZ) / 800);
/* No additional ration is applied to the PLL and faster lock times
* are possible */
@@ -853,7 +853,7 @@ static int wcfxo_init_daa(struct wcfxo *wc)
/* Wait a couple of jiffies for our writes to finish */
set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1 + (ZT_CHUNKSIZE * HZ) / 800);
+ schedule_timeout(1 + (DAHDI_CHUNKSIZE * HZ) / 800);
reg15 = 0x0;
/* Go ahead and attenuate transmit signal by 6 db */
if (quiet) {
@@ -936,7 +936,7 @@ static int __devinit wcfxo_init_one(struct pci_dev *pdev, const struct pci_devic
/* Allocate enough memory for two zt chunks, receive and transmit. Each sample uses
32 bits. Allocate an extra set just for control too */
- wc->writechunk = (int *)pci_alloc_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, &wc->writedma);
+ wc->writechunk = (int *)pci_alloc_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, &wc->writedma);
if (!wc->writechunk) {
printk("wcfxo: Unable to allocate DMA-able memory\n");
if (wc->freeregion)
@@ -944,8 +944,8 @@ static int __devinit wcfxo_init_one(struct pci_dev *pdev, const struct pci_devic
return -ENOMEM;
}
- wc->readchunk = wc->writechunk + ZT_MAX_CHUNKSIZE * 4; /* in doublewords */
- wc->readdma = wc->writedma + ZT_MAX_CHUNKSIZE * 16; /* in bytes */
+ wc->readchunk = wc->writechunk + DAHDI_MAX_CHUNKSIZE * 4; /* in doublewords */
+ wc->readdma = wc->writedma + DAHDI_MAX_CHUNKSIZE * 16; /* in bytes */
if (wcfxo_initialize(wc)) {
printk("wcfxo: Unable to intialize modem\n");
@@ -974,7 +974,7 @@ static int __devinit wcfxo_init_one(struct pci_dev *pdev, const struct pci_devic
/* Enable interrupts */
wcfxo_enable_interrupts(wc);
/* Initialize Write/Buffers to all blank data */
- memset((void *)wc->writechunk,0,ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4);
+ memset((void *)wc->writechunk,0,DAHDI_MAX_CHUNKSIZE * 2 * 2 * 2 * 4);
/* Start DMA */
wcfxo_start_dma(wc);
@@ -983,7 +983,7 @@ static int __devinit wcfxo_init_one(struct pci_dev *pdev, const struct pci_devic
printk("Failed to initailize DAA, giving up...\n");
wcfxo_stop_dma(wc);
wcfxo_disable_interrupts(wc);
- zt_unregister(&wc->span);
+ dahdi_unregister(&wc->span);
free_irq(pdev->irq, wc);
/* Reset PCI chip and registers */
@@ -1002,7 +1002,7 @@ static int __devinit wcfxo_init_one(struct pci_dev *pdev, const struct pci_devic
static void wcfxo_release(struct wcfxo *wc)
{
- zt_unregister(&wc->span);
+ dahdi_unregister(&wc->span);
if (wc->freeregion)
release_region(wc->ioaddr, 0xff);
kfree(wc);
@@ -1022,7 +1022,7 @@ static void __devexit wcfxo_remove_one(struct pci_dev *pdev)
wcfxo_disable_interrupts(wc);
/* Immediately free resources */
- pci_free_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)wc->writechunk, wc->writedma);
+ pci_free_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)wc->writechunk, wc->writedma);
free_irq(pdev->irq, wc);
/* Reset PCI chip and registers */
diff --git a/drivers/dahdi/wct1xxp.c b/drivers/dahdi/wct1xxp.c
index b636743..fdd2f3f 100644
--- a/drivers/dahdi/wct1xxp.c
+++ b/drivers/dahdi/wct1xxp.c
@@ -159,11 +159,11 @@ struct t1xxp {
dma_addr_t writedma;
volatile unsigned char *writechunk; /* Double-word aligned write memory */
volatile unsigned char *readchunk; /* Double-word aligned read memory */
- unsigned char ec_chunk1[31][ZT_CHUNKSIZE];
- unsigned char ec_chunk2[31][ZT_CHUNKSIZE];
+ unsigned char ec_chunk1[31][DAHDI_CHUNKSIZE];
+ unsigned char ec_chunk2[31][DAHDI_CHUNKSIZE];
unsigned char tempo[32];
- struct zt_span span; /* Span */
- struct zt_chan chans[31]; /* Channels */
+ struct dahdi_span span; /* Span */
+ struct dahdi_chan chans[31]; /* Channels */
};
#define CANARY 0xca1e
@@ -205,7 +205,7 @@ static inline void __select_control(struct t1xxp *wc)
}
}
-static int t1xxp_open(struct zt_chan *chan)
+static int t1xxp_open(struct dahdi_chan *chan)
{
struct t1xxp *wc = chan->pvt;
if (wc->dead)
@@ -277,12 +277,12 @@ static int control_get_reg(struct t1xxp *wc, int reg)
static void t1xxp_release(struct t1xxp *wc)
{
- zt_unregister(&wc->span);
+ dahdi_unregister(&wc->span);
kfree(wc);
printk("Freed a Wildcard\n");
}
-static int t1xxp_close(struct zt_chan *chan)
+static int t1xxp_close(struct dahdi_chan *chan)
{
struct t1xxp *wc = chan->pvt;
wc->usecount--;
@@ -342,7 +342,7 @@ static void __t1xxp_set_clear(struct t1xxp *wc)
for (x=0;x<3;x++) {
b = 0;
for (y=0;y<8;y++)
- if (wc->chans[x * 8 + y].sig & ZT_SIG_CLEAR)
+ if (wc->chans[x * 8 + y].sig & DAHDI_SIG_CLEAR)
b |= (1 << y);
__t1_set_reg(wc, 0x39 + x, b);
}
@@ -353,27 +353,27 @@ static void t1xxp_t1_framer_start(struct t1xxp *wc)
int i;
char *coding, *framing;
unsigned long endjiffies;
- int alreadyrunning = wc->span.flags & ZT_FLAG_RUNNING;
+ int alreadyrunning = wc->span.flags & DAHDI_FLAG_RUNNING;
unsigned long flags;
spin_lock_irqsave(&wc->lock, flags);
/* Build up config */
i = 0x20;
- if (wc->span.lineconfig & ZT_CONFIG_ESF) {
+ if (wc->span.lineconfig & DAHDI_CONFIG_ESF) {
coding = "ESF";
i = 0x88;
} else {
coding = "SF";
}
- if (wc->span.lineconfig & ZT_CONFIG_B8ZS) {
+ if (wc->span.lineconfig & DAHDI_CONFIG_B8ZS) {
framing = "B8ZS";
i |= 0x44;
} else {
framing = "AMI";
}
__t1_set_reg(wc, 0x38, i);
- if (!(wc->span.lineconfig & ZT_CONFIG_ESF)) {
+ if (!(wc->span.lineconfig & DAHDI_CONFIG_ESF)) {
/* 1c in FDL bit */
__t1_set_reg(wc, 0x7e, 0x1c);
} else {
@@ -401,7 +401,7 @@ static void t1xxp_t1_framer_start(struct t1xxp *wc)
/* Reset LIRST bit and reset elastic stores */
__t1_set_reg(wc, 0xa, 0x30);
- wc->span.flags |= ZT_FLAG_RUNNING;
+ wc->span.flags |= DAHDI_FLAG_RUNNING;
}
spin_unlock_irqrestore(&wc->lock, flags);
}
@@ -411,7 +411,7 @@ static void t1xxp_e1_framer_start(struct t1xxp *wc)
int i;
char *coding, *framing;
unsigned long endjiffies;
- int alreadyrunning = wc->span.flags & ZT_FLAG_RUNNING;
+ int alreadyrunning = wc->span.flags & DAHDI_FLAG_RUNNING;
unsigned long flags;
char *crcing = "";
unsigned char ccr1, tcr1, tcr2;
@@ -422,20 +422,20 @@ static void t1xxp_e1_framer_start(struct t1xxp *wc)
ccr1 = 0;
tcr1 = 8;
tcr2 = 0;
- if (wc->span.lineconfig & ZT_CONFIG_CCS) {
+ if (wc->span.lineconfig & DAHDI_CONFIG_CCS) {
coding = "CCS"; /* Receive CCS */
ccr1 |= 8;
} else {
tcr1 |= 0x20;
coding = "CAS";
}
- if (wc->span.lineconfig & ZT_CONFIG_HDB3) {
+ if (wc->span.lineconfig & DAHDI_CONFIG_HDB3) {
ccr1 |= 0x44; /* TX/RX HDB3 */
framing = "HDB3";
} else {
framing = "AMI";
}
- if (wc->span.lineconfig & ZT_CONFIG_CRC4) {
+ if (wc->span.lineconfig & DAHDI_CONFIG_CRC4) {
ccr1 |= 0x11;
tcr2 |= 0x02;
crcing = " with CRC4";
@@ -473,7 +473,7 @@ static void t1xxp_e1_framer_start(struct t1xxp *wc)
/* Reset LIRST bit and reset elastic stores */
- wc->span.flags |= ZT_FLAG_RUNNING;
+ wc->span.flags |= DAHDI_FLAG_RUNNING;
}
spin_unlock_irqrestore(&wc->lock, flags);
}
@@ -552,7 +552,7 @@ static int t1xxp_framer_hard_reset(struct t1xxp *wc)
return 0;
}
-static int t1xxp_rbsbits(struct zt_chan *chan, int bits)
+static int t1xxp_rbsbits(struct dahdi_chan *chan, int bits)
{
struct t1xxp *wc = chan->pvt;
unsigned long flags;
@@ -577,14 +577,14 @@ static int t1xxp_rbsbits(struct zt_chan *chan, int bits)
mask = (1 << o);
- if (bits & ZT_ABIT) {
+ if (bits & DAHDI_ABIT) {
/* Set A-bit */
wc->txsiga[b] |= mask;
} else {
/* Clear A-bit */
wc->txsiga[b] &= ~mask;
}
- if (bits & ZT_BBIT) {
+ if (bits & DAHDI_BBIT) {
/* Set B-bit */
wc->txsigb[b] |= mask;
} else {
@@ -600,7 +600,7 @@ static int t1xxp_rbsbits(struct zt_chan *chan, int bits)
return 0;
}
-static int t1xxp_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data)
+static int t1xxp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long data)
{
switch(cmd) {
default:
@@ -608,19 +608,19 @@ static int t1xxp_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
}
}
-static int t1xxp_startup(struct zt_span *span)
+static int t1xxp_startup(struct dahdi_span *span)
{
struct t1xxp *wc = span->pvt;
- int i,alreadyrunning = span->flags & ZT_FLAG_RUNNING;
+ int i,alreadyrunning = span->flags & DAHDI_FLAG_RUNNING;
/* initialize the start value for the entire chunk of last ec buffer */
for(i = 0; i < span->channels; i++)
{
memset(wc->ec_chunk1[i],
- ZT_LIN2X(0,&span->chans[i]),ZT_CHUNKSIZE);
+ DAHDI_LIN2X(0,&span->chans[i]),DAHDI_CHUNKSIZE);
memset(wc->ec_chunk2[i],
- ZT_LIN2X(0,&span->chans[i]),ZT_CHUNKSIZE);
+ DAHDI_LIN2X(0,&span->chans[i]),DAHDI_CHUNKSIZE);
}
/* Reset framer with proper parameters and start */
@@ -634,12 +634,12 @@ static int t1xxp_startup(struct zt_span *span)
/* Only if we're not already going */
t1xxp_enable_interrupts(wc);
t1xxp_start_dma(wc);
- span->flags |= ZT_FLAG_RUNNING;
+ span->flags |= DAHDI_FLAG_RUNNING;
}
return 0;
}
-static int t1xxp_shutdown(struct zt_span *span)
+static int t1xxp_shutdown(struct dahdi_span *span)
{
struct t1xxp *wc = span->pvt;
unsigned long flags;
@@ -647,14 +647,14 @@ static int t1xxp_shutdown(struct zt_span *span)
spin_lock_irqsave(&wc->lock, flags);
__t1xxp_stop_dma(wc);
__t1xxp_disable_interrupts(wc);
- span->flags &= ~ZT_FLAG_RUNNING;
+ span->flags &= ~DAHDI_FLAG_RUNNING;
spin_unlock_irqrestore(&wc->lock, flags);
t1xxp_framer_hard_reset(wc);
return 0;
}
-static int t1xxp_maint(struct zt_span *span, int cmd)
+static int t1xxp_maint(struct dahdi_span *span, int cmd)
{
struct t1xxp *wc = span->pvt;
int res = 0;
@@ -662,18 +662,18 @@ static int t1xxp_maint(struct zt_span *span, int cmd)
spin_lock_irqsave(&wc->lock, flags);
if (wc->ise1) {
switch(cmd) {
- case ZT_MAINT_NONE:
+ case DAHDI_MAINT_NONE:
__t1_set_reg(wc,0xa8,0); /* no loops */
break;
- case ZT_MAINT_LOCALLOOP:
+ case DAHDI_MAINT_LOCALLOOP:
__t1_set_reg(wc,0xa8,0x40); /* local loop */
break;
- case ZT_MAINT_REMOTELOOP:
+ case DAHDI_MAINT_REMOTELOOP:
__t1_set_reg(wc,0xa8,0x80); /* remote loop */
break;
- case ZT_MAINT_LOOPUP:
- case ZT_MAINT_LOOPDOWN:
- case ZT_MAINT_LOOPSTOP:
+ case DAHDI_MAINT_LOOPUP:
+ case DAHDI_MAINT_LOOPDOWN:
+ case DAHDI_MAINT_LOOPSTOP:
res = -ENOSYS;
break;
default:
@@ -683,29 +683,29 @@ static int t1xxp_maint(struct zt_span *span, int cmd)
}
} else {
switch(cmd) {
- case ZT_MAINT_NONE:
+ case DAHDI_MAINT_NONE:
__t1_set_reg(wc,0x19,0); /* no local loop */
__t1_set_reg(wc,0x0a,0); /* no remote loop */
break;
- case ZT_MAINT_LOCALLOOP:
+ case DAHDI_MAINT_LOCALLOOP:
__t1_set_reg(wc,0x19,0x40); /* local loop */
__t1_set_reg(wc,0x0a,0); /* no remote loop */
break;
- case ZT_MAINT_REMOTELOOP:
+ case DAHDI_MAINT_REMOTELOOP:
__t1_set_reg(wc,0x1e,0); /* no local loop */
__t1_set_reg(wc,0x0a,0x40); /* remote loop */
break;
- case ZT_MAINT_LOOPUP:
+ case DAHDI_MAINT_LOOPUP:
__t1_set_reg(wc,0x30,2); /* send loopup code */
__t1_set_reg(wc,0x12,0x22); /* send loopup code */
__t1_set_reg(wc,0x13,0x80); /* send loopup code */
break;
- case ZT_MAINT_LOOPDOWN:
+ case DAHDI_MAINT_LOOPDOWN:
__t1_set_reg(wc,0x30,2); /* send loopdown code */
__t1_set_reg(wc,0x12,0x62); /* send loopdown code */
__t1_set_reg(wc,0x13,0x90); /* send loopdown code */
break;
- case ZT_MAINT_LOOPSTOP:
+ case DAHDI_MAINT_LOOPSTOP:
__t1_set_reg(wc,0x30,0); /* stop sending loopup code */
break;
default:
@@ -717,11 +717,11 @@ static int t1xxp_maint(struct zt_span *span, int cmd)
return res;
}
-static int t1xxp_chanconfig(struct zt_chan *chan, int sigtype)
+static int t1xxp_chanconfig(struct dahdi_chan *chan, int sigtype)
{
struct t1xxp *wc = chan->pvt;
unsigned long flags;
- int alreadyrunning = chan->span->flags & ZT_FLAG_RUNNING;
+ int alreadyrunning = chan->span->flags & DAHDI_FLAG_RUNNING;
spin_lock_irqsave(&wc->lock, flags);
@@ -732,14 +732,14 @@ static int t1xxp_chanconfig(struct zt_chan *chan, int sigtype)
return 0;
}
-static int t1xxp_spanconfig(struct zt_span *span, struct zt_lineconfig *lc)
+static int t1xxp_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
{
struct t1xxp *wc = span->pvt;
/* Do we want to SYNC on receive or not */
wc->sync = lc->sync;
/* If already running, apply changes immediately */
- if (span->flags & ZT_FLAG_RUNNING)
+ if (span->flags & DAHDI_FLAG_RUNNING)
return t1xxp_startup(span);
return 0;
@@ -773,31 +773,31 @@ static int t1xxp_software_init(struct t1xxp *wc)
wc->span.open = t1xxp_open;
wc->span.close = t1xxp_close;
wc->span.chans = wc->chans;
- wc->span.flags = ZT_FLAG_RBS;
+ wc->span.flags = DAHDI_FLAG_RBS;
wc->span.ioctl = t1xxp_ioctl;
wc->span.pvt = wc;
if (wc->ise1) {
wc->span.channels = 31;
- wc->span.deflaw = ZT_LAW_ALAW;
- wc->span.linecompat = ZT_CONFIG_HDB3 | ZT_CONFIG_CCS | ZT_CONFIG_CRC4;
+ wc->span.deflaw = DAHDI_LAW_ALAW;
+ wc->span.linecompat = DAHDI_CONFIG_HDB3 | DAHDI_CONFIG_CCS | DAHDI_CONFIG_CRC4;
wc->span.spantype = "E1";
} else {
wc->span.channels = 24;
- wc->span.deflaw = ZT_LAW_MULAW;
- wc->span.linecompat = ZT_CONFIG_AMI | ZT_CONFIG_B8ZS | ZT_CONFIG_D4 | ZT_CONFIG_ESF;
+ wc->span.deflaw = DAHDI_LAW_MULAW;
+ wc->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_B8ZS | DAHDI_CONFIG_D4 | DAHDI_CONFIG_ESF;
wc->span.spantype = "T1";
}
init_waitqueue_head(&wc->span.maintq);
for (x=0;x<wc->span.channels;x++) {
sprintf(wc->chans[x].name, "WCT1/%d/%d", wc->num, x + 1);
- wc->chans[x].sigcap = ZT_SIG_EM | ZT_SIG_CLEAR | ZT_SIG_EM_E1 |
- ZT_SIG_FXSLS | ZT_SIG_FXSGS |
- ZT_SIG_FXSKS | ZT_SIG_FXOLS | ZT_SIG_DACS_RBS |
- ZT_SIG_FXOGS | ZT_SIG_FXOKS | ZT_SIG_CAS | ZT_SIG_SF;
+ wc->chans[x].sigcap = DAHDI_SIG_EM | DAHDI_SIG_CLEAR | DAHDI_SIG_EM_E1 |
+ DAHDI_SIG_FXSLS | DAHDI_SIG_FXSGS |
+ DAHDI_SIG_FXSKS | DAHDI_SIG_FXOLS | DAHDI_SIG_DACS_RBS |
+ DAHDI_SIG_FXOGS | DAHDI_SIG_FXOKS | DAHDI_SIG_CAS | DAHDI_SIG_SF;
wc->chans[x].pvt = wc;
wc->chans[x].chanpos = x + 1;
}
- if (zt_register(&wc->span, 0)) {
+ if (dahdi_register(&wc->span, 0)) {
printk("Unable to register span with zaptel\n");
return -1;
}
@@ -809,7 +809,7 @@ static inline void __handle_leds(struct t1xxp *wc)
int oldreg;
wc->blinktimer++;
- if (wc->span.alarms & (ZT_ALARM_RED | ZT_ALARM_BLUE)) {
+ if (wc->span.alarms & (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE)) {
/* Red/Blue alarm */
#ifdef FANCY_ALARM
if (wc->blinktimer == (altab[wc->alarmpos] >> 1)) {
@@ -834,7 +834,7 @@ static inline void __handle_leds(struct t1xxp *wc)
wc->blinktimer = 0;
}
#endif
- } else if (wc->span.alarms & ZT_ALARM_YELLOW) {
+ } else if (wc->span.alarms & DAHDI_ALARM_YELLOW) {
/* Yellow Alarm */
if (!(wc->blinktimer % 2))
wc->ledtestreg = (wc->ledtestreg | BIT_LED1) & ~BIT_LED0;
@@ -844,11 +844,11 @@ static inline void __handle_leds(struct t1xxp *wc)
} else {
/* No Alarm */
oldreg = wc->ledtestreg;
- if (wc->span.maintstat != ZT_MAINT_NONE)
+ if (wc->span.maintstat != DAHDI_MAINT_NONE)
wc->ledtestreg |= BIT_TEST;
else
wc->ledtestreg &= ~BIT_TEST;
- if (wc->span.flags & ZT_FLAG_RUNNING)
+ if (wc->span.flags & DAHDI_FLAG_RUNNING)
wc->ledtestreg = (wc->ledtestreg | BIT_LED0) & ~BIT_LED1;
else
wc->ledtestreg = wc->ledtestreg & ~(BIT_LED0 | BIT_LED1);
@@ -868,19 +868,19 @@ static void t1xxp_transmitprep(struct t1xxp *wc, int ints)
txbuf = wc->writechunk;
} else {
/* Just finished sending second buffer, fill it now */
- txbuf = wc->writechunk + 32 * ZT_CHUNKSIZE;
+ txbuf = wc->writechunk + 32 * DAHDI_CHUNKSIZE;
}
- zt_transmit(&wc->span);
+ dahdi_transmit(&wc->span);
for (x=0;x<wc->offset;x++)
txbuf[x] = wc->tempo[x];
- for (y=0;y<ZT_CHUNKSIZE;y++) {
+ for (y=0;y<DAHDI_CHUNKSIZE;y++) {
for (x=0;x<wc->span.channels;x++) {
pos = y * 32 + wc->chanmap[x] + wc->offset;
/* Put channel number as outgoing data */
- if (pos < 32 * ZT_CHUNKSIZE)
+ if (pos < 32 * DAHDI_CHUNKSIZE)
txbuf[pos] = wc->chans[x].writechunk[y];
else
- wc->tempo[pos - 32 * ZT_CHUNKSIZE] = wc->chans[x].writechunk[y];
+ wc->tempo[pos - 32 * DAHDI_CHUNKSIZE] = wc->chans[x].writechunk[y];
}
}
}
@@ -895,10 +895,10 @@ static void t1xxp_receiveprep(struct t1xxp *wc, int ints)
if (ints & 0x04) {
/* Just received first buffer */
rxbuf = wc->readchunk;
- canary = (unsigned int *)(wc->readchunk + ZT_CHUNKSIZE * 64 - 4);
+ canary = (unsigned int *)(wc->readchunk + DAHDI_CHUNKSIZE * 64 - 4);
} else {
- rxbuf = wc->readchunk + ZT_CHUNKSIZE * 32;
- canary = (unsigned int *)(wc->readchunk + ZT_CHUNKSIZE * 32 - 4);
+ rxbuf = wc->readchunk + DAHDI_CHUNKSIZE * 32;
+ canary = (unsigned int *)(wc->readchunk + DAHDI_CHUNKSIZE * 32 - 4);
}
oldcan = *canary;
if (((oldcan & 0xffff0000) >> 16) != CANARY) {
@@ -909,7 +909,7 @@ static void t1xxp_receiveprep(struct t1xxp *wc, int ints)
if (debug) printk("Expecting bottom %d, got %d\n", wc->canary - 1, oldcan & 0xffff);
wc->span.irqmisses++;
}
- for (y=0;y<ZT_CHUNKSIZE;y++) {
+ for (y=0;y<DAHDI_CHUNKSIZE;y++) {
for (x=0;x<wc->span.channels;x++) {
/* XXX Optimize, remove * and + XXX */
/* Must map received channels into appropriate data */
@@ -949,15 +949,15 @@ static void t1xxp_receiveprep(struct t1xxp *wc, int ints)
}
}
/* Store the next canary */
- canary = (unsigned int *)(rxbuf + ZT_CHUNKSIZE * 32 - 4);
+ canary = (unsigned int *)(rxbuf + DAHDI_CHUNKSIZE * 32 - 4);
*canary = (wc->canary++) | (CANARY << 16);
for (x=0;x<wc->span.channels;x++) {
- zt_ec_chunk(&wc->chans[x], wc->chans[x].readchunk,
+ dahdi_ec_chunk(&wc->chans[x], wc->chans[x].readchunk,
wc->ec_chunk2[x]);
- memcpy(wc->ec_chunk2[x],wc->ec_chunk1[x],ZT_CHUNKSIZE);
- memcpy(wc->ec_chunk1[x],wc->chans[x].writechunk,ZT_CHUNKSIZE);
+ memcpy(wc->ec_chunk2[x],wc->ec_chunk1[x],DAHDI_CHUNKSIZE);
+ memcpy(wc->ec_chunk1[x],wc->chans[x].writechunk,DAHDI_CHUNKSIZE);
}
- zt_receive(&wc->span);
+ dahdi_receive(&wc->span);
}
static void t1xxp_check_sigbits(struct t1xxp *wc, int x)
@@ -972,18 +972,18 @@ static void t1xxp_check_sigbits(struct t1xxp *wc, int x)
a = __t1_get_reg(wc, 0x31 + i);
/* Get high channel in low bits */
rxs = (a & 0xf);
- if (!(wc->chans[i+16].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->chans[i+16].sig & DAHDI_SIG_CLEAR)) {
if (wc->chans[i+16].rxsig != rxs) {
spin_unlock_irqrestore(&wc->lock, flags);
- zt_rbsbits(&wc->chans[i+16], rxs);
+ dahdi_rbsbits(&wc->chans[i+16], rxs);
spin_lock_irqsave(&wc->lock, flags);
}
}
rxs = (a >> 4) & 0xf;
- if (!(wc->chans[i].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->chans[i].sig & DAHDI_SIG_CLEAR)) {
if (wc->chans[i].rxsig != rxs) {
spin_unlock_irqrestore(&wc->lock, flags);
- zt_rbsbits(&wc->chans[i], rxs);
+ dahdi_rbsbits(&wc->chans[i], rxs);
spin_lock_irqsave(&wc->lock, flags);
}
}
@@ -995,13 +995,13 @@ static void t1xxp_check_sigbits(struct t1xxp *wc, int x)
i = x * 8 + y;
rxs = 0;
if (a & (1 << y))
- rxs |= ZT_ABIT;
+ rxs |= DAHDI_ABIT;
if (b & (1 << y))
- rxs |= ZT_BBIT;
- if (!(wc->chans[i].sig & ZT_SIG_CLEAR)) {
+ rxs |= DAHDI_BBIT;
+ if (!(wc->chans[i].sig & DAHDI_SIG_CLEAR)) {
if (wc->chans[i].rxsig != rxs) {
spin_unlock_irqrestore(&wc->lock, flags);
- zt_rbsbits(&wc->chans[i], rxs);
+ dahdi_rbsbits(&wc->chans[i], rxs);
spin_lock_irqsave(&wc->lock, flags);
}
}
@@ -1036,7 +1036,7 @@ static void t1xxp_check_alarms(struct t1xxp *wc)
alarms = 0;
/* And consider only carrier alarms */
- wc->span.alarms &= (ZT_ALARM_RED | ZT_ALARM_BLUE | ZT_ALARM_NOTOPEN);
+ wc->span.alarms &= (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE | DAHDI_ALARM_NOTOPEN);
if (wc->ise1) {
/* XXX Implement me XXX */
@@ -1044,10 +1044,10 @@ static void t1xxp_check_alarms(struct t1xxp *wc)
/* Detect loopup code if we're not sending one */
if ((!wc->span.mainttimer) && (c & 0x80)) {
/* Loop-up code detected */
- if ((wc->loopupcnt++ > 80) && (wc->span.maintstat != ZT_MAINT_REMOTELOOP)) {
+ if ((wc->loopupcnt++ > 80) && (wc->span.maintstat != DAHDI_MAINT_REMOTELOOP)) {
__t1_set_reg(wc, 0x1e, 0); /* No local loop */
__t1_set_reg(wc, 0x0a, 0x40); /* Remote Loop */
- wc->span.maintstat = ZT_MAINT_REMOTELOOP;
+ wc->span.maintstat = DAHDI_MAINT_REMOTELOOP;
}
} else {
wc->loopupcnt = 0;
@@ -1055,39 +1055,39 @@ static void t1xxp_check_alarms(struct t1xxp *wc)
/* Same for loopdown code */
if ((!wc->span.mainttimer) && (c & 0x40)) {
/* Loop-down code detected */
- if ((wc->loopdowncnt++ > 80) && (wc->span.maintstat == ZT_MAINT_REMOTELOOP)) {
+ if ((wc->loopdowncnt++ > 80) && (wc->span.maintstat == DAHDI_MAINT_REMOTELOOP)) {
__t1_set_reg(wc, 0x1e, 0); /* No local loop */
__t1_set_reg(wc, 0x0a, 0x0); /* No remote Loop */
- wc->span.maintstat = ZT_MAINT_NONE;
+ wc->span.maintstat = DAHDI_MAINT_NONE;
}
} else
wc->loopdowncnt = 0;
}
- if (wc->span.lineconfig & ZT_CONFIG_NOTOPEN) {
+ if (wc->span.lineconfig & DAHDI_CONFIG_NOTOPEN) {
for (x=0,j=0;x < wc->span.channels;x++)
- if ((wc->chans[x].flags & ZT_FLAG_OPEN) ||
- (wc->chans[x].flags & ZT_FLAG_NETDEV))
+ if ((wc->chans[x].flags & DAHDI_FLAG_OPEN) ||
+ (wc->chans[x].flags & DAHDI_FLAG_NETDEV))
j++;
if (!j)
- alarms |= ZT_ALARM_NOTOPEN;
+ alarms |= DAHDI_ALARM_NOTOPEN;
}
if (wc->ise1) {
if (c & 0x9)
- alarms |= ZT_ALARM_RED;
+ alarms |= DAHDI_ALARM_RED;
if (c & 0x2)
- alarms |= ZT_ALARM_BLUE;
+ alarms |= DAHDI_ALARM_BLUE;
} else {
/* Check actual alarm status */
if (c & 0x3)
- alarms |= ZT_ALARM_RED;
+ alarms |= DAHDI_ALARM_RED;
if (c & 0x8)
- alarms |= ZT_ALARM_BLUE;
+ alarms |= DAHDI_ALARM_BLUE;
}
/* Keep track of recovering */
if ((!alarms) && wc->span.alarms)
- wc->alarmtimer = ZT_ALARMSETTLE_TIME;
+ wc->alarmtimer = DAHDI_ALARMSETTLE_TIME;
/* If receiving alarms, go into Yellow alarm state */
if (alarms && (!wc->span.alarms)) {
@@ -1103,7 +1103,7 @@ static void t1xxp_check_alarms(struct t1xxp *wc)
if (wc->span.alarms != alarms) {
d = __control_get_reg(wc, WC_CLOCK);
start_alarm(wc);
- if (!(alarms & (ZT_ALARM_RED | ZT_ALARM_BLUE | ZT_ALARM_LOOPBACK)) &&
+ if (!(alarms & (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE | DAHDI_ALARM_LOOPBACK)) &&
wc->sync) {
/* Use the recieve signalling */
wc->span.syncsrc = wc->span.spanno;
@@ -1115,15 +1115,15 @@ static void t1xxp_check_alarms(struct t1xxp *wc)
__control_set_reg(wc, WC_CLOCK, d);
}
if (wc->alarmtimer)
- alarms |= ZT_ALARM_RECOVER;
+ alarms |= DAHDI_ALARM_RECOVER;
if (c & 0x4)
- alarms |= ZT_ALARM_YELLOW;
+ alarms |= DAHDI_ALARM_YELLOW;
wc->span.alarms = alarms;
spin_unlock_irqrestore(&wc->lock, flags);
- zt_alarm_notify(&wc->span);
+ dahdi_alarm_notify(&wc->span);
}
static void t1xxp_do_counters(struct t1xxp *wc)
@@ -1133,7 +1133,7 @@ static void t1xxp_do_counters(struct t1xxp *wc)
spin_lock_irqsave(&wc->lock, flags);
if (wc->alarmtimer) {
if (!--wc->alarmtimer) {
- wc->span.alarms &= ~(ZT_ALARM_RECOVER);
+ wc->span.alarms &= ~(DAHDI_ALARM_RECOVER);
/* Clear yellow alarm */
#if 0
printk("Coming out of alarm\n");
@@ -1143,7 +1143,7 @@ static void t1xxp_do_counters(struct t1xxp *wc)
else
__t1_set_reg(wc, 0x35, 0x10);
spin_unlock_irqrestore(&wc->lock, flags);
- zt_alarm_notify(&wc->span);
+ dahdi_alarm_notify(&wc->span);
spin_lock_irqsave(&wc->lock, flags);
}
}
@@ -1242,15 +1242,15 @@ static int t1xxp_hardware_init(struct t1xxp *wc)
/* Start at writedma */
outl(wc->writedma, wc->ioaddr + WC_DMAWS); /* Write start */
/* First frame */
- outl(wc->writedma + ZT_CHUNKSIZE * 32 - 4, wc->ioaddr + WC_DMAWI); /* Middle (interrupt) */
+ outl(wc->writedma + DAHDI_CHUNKSIZE * 32 - 4, wc->ioaddr + WC_DMAWI); /* Middle (interrupt) */
/* Second frame */
- outl(wc->writedma + ZT_CHUNKSIZE * 32 * 2 - 4, wc->ioaddr + WC_DMAWE); /* End */
+ outl(wc->writedma + DAHDI_CHUNKSIZE * 32 * 2 - 4, wc->ioaddr + WC_DMAWE); /* End */
outl(wc->readdma, wc->ioaddr + WC_DMARS); /* Read start */
/* First frame */
- outl(wc->readdma + ZT_CHUNKSIZE * 32 - 4, wc->ioaddr + WC_DMARI); /* Middle (interrupt) */
+ outl(wc->readdma + DAHDI_CHUNKSIZE * 32 - 4, wc->ioaddr + WC_DMARI); /* Middle (interrupt) */
/* Second frame */
- outl(wc->readdma + ZT_CHUNKSIZE * 32 * 2 - 4, wc->ioaddr + WC_DMARE); /* End */
+ outl(wc->readdma + DAHDI_CHUNKSIZE * 32 * 2 - 4, wc->ioaddr + WC_DMARE); /* End */
if (debug) printk("Setting up DMA (write/read = %08lx/%08lx)\n", (long)wc->writedma, (long)wc->readdma);
@@ -1297,22 +1297,22 @@ static int __devinit t1xxp_init_one(struct pci_dev *pdev, const struct pci_devic
wc->writechunk =
/* 32 channels, Double-buffer, Read/Write */
- (unsigned char *)pci_alloc_consistent(pdev, ZT_MAX_CHUNKSIZE * 32 * 2 * 2, &wc->writedma);
+ (unsigned char *)pci_alloc_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 32 * 2 * 2, &wc->writedma);
if (!wc->writechunk) {
printk("wct1xxp: Unable to allocate DMA-able memory\n");
return -ENOMEM;
}
/* Read is after the whole write piece (in bytes) */
- wc->readchunk = wc->writechunk + ZT_CHUNKSIZE * 32 * 2;
+ wc->readchunk = wc->writechunk + DAHDI_CHUNKSIZE * 32 * 2;
/* Same thing... */
- wc->readdma = wc->writedma + ZT_CHUNKSIZE * 32 * 2;
+ wc->readdma = wc->writedma + DAHDI_CHUNKSIZE * 32 * 2;
/* Initialize Write/Buffers to all blank data */
- memset((void *)wc->writechunk,0x00,ZT_MAX_CHUNKSIZE * 2 * 2 * 32);
+ memset((void *)wc->writechunk,0x00,DAHDI_MAX_CHUNKSIZE * 2 * 2 * 32);
/* Initialize canary */
- canary = (unsigned int *)(wc->readchunk + ZT_CHUNKSIZE * 64 - 4);
+ canary = (unsigned int *)(wc->readchunk + DAHDI_CHUNKSIZE * 64 - 4);
*canary = (CANARY << 16) | (0xffff);
/* Enable bus mastering */
@@ -1373,7 +1373,7 @@ static void __devexit t1xxp_remove_one(struct pci_dev *pdev)
t1xxp_stop_stuff(wc);
/* Immediately free resources */
- pci_free_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 32 * 4, (void *)wc->writechunk, wc->writedma);
+ pci_free_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 32 * 4, (void *)wc->writechunk, wc->writedma);
free_irq(pdev->irq, wc);
/* Reset PCI chip and registers */
diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c
index 26b08a9..7608f73 100644
--- a/drivers/dahdi/wct4xxp/base.c
+++ b/drivers/dahdi/wct4xxp/base.c
@@ -258,18 +258,18 @@ struct t4_span {
#ifdef SUPPORT_GEN1
int e1check; /* E1 check */
#endif
- struct zt_span span;
+ struct dahdi_span span;
unsigned char txsigs[16]; /* Transmit sigs */
int loopupcnt;
int loopdowncnt;
#ifdef SUPPORT_GEN1
- unsigned char ec_chunk1[31][ZT_CHUNKSIZE]; /* first EC chunk buffer */
- unsigned char ec_chunk2[31][ZT_CHUNKSIZE]; /* second EC chunk buffer */
+ unsigned char ec_chunk1[31][DAHDI_CHUNKSIZE]; /* first EC chunk buffer */
+ unsigned char ec_chunk2[31][DAHDI_CHUNKSIZE]; /* second EC chunk buffer */
#endif
int irqmisses;
/* HDLC controller fields */
- struct zt_chan *sigchan;
+ struct dahdi_chan *sigchan;
unsigned char sigmode;
int sigactive;
int frames_out;
@@ -285,7 +285,7 @@ struct t4_span {
#ifdef ENABLE_WORKQUEUES
struct work_struct swork;
#endif
- struct zt_chan chans[0]; /* Individual channels */
+ struct dahdi_chan chans[0]; /* Individual channels */
};
struct t4 {
@@ -355,15 +355,15 @@ static void t4_vpm450_init(struct t4 *wc);
static void t4_vpm_set_dtmf_threshold(struct t4 *wc, unsigned int threshold);
#endif
static void __set_clear(struct t4 *wc, int span);
-static int t4_startup(struct zt_span *span);
-static int t4_shutdown(struct zt_span *span);
-static int t4_rbsbits(struct zt_chan *chan, int bits);
-static int t4_maint(struct zt_span *span, int cmd);
+static int t4_startup(struct dahdi_span *span);
+static int t4_shutdown(struct dahdi_span *span);
+static int t4_rbsbits(struct dahdi_chan *chan, int bits);
+static int t4_maint(struct dahdi_span *span, int cmd);
#ifdef SUPPORT_GEN1
static int t4_reset_dma(struct t4 *wc);
#endif
-static void t4_hdlc_hard_xmit(struct zt_chan *chan);
-static int t4_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data);
+static void t4_hdlc_hard_xmit(struct dahdi_chan *chan);
+static int t4_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long data);
static void t4_tsi_assign(struct t4 *wc, int fromspan, int fromchan, int tospan, int tochan);
static void t4_tsi_unassign(struct t4 *wc, int tospan, int tochan);
static void __t4_set_timing_source(struct t4 *wc, int unit, int master, int slave);
@@ -760,20 +760,20 @@ static void t4_check_vpm450(struct t4 *wc)
guessed it. */
if (test_bit(channel, &wc->tspans[span]->dtmfmutemask)) {
unsigned long flags;
- struct zt_chan *chan = &wc->tspans[span]->span.chans[channel];
+ struct dahdi_chan *chan = &wc->tspans[span]->span.chans[channel];
int y;
spin_lock_irqsave(&chan->lock, flags);
for (y=0;y<chan->numbufs;y++) {
if ((chan->inreadbuf > -1) && (chan->readidx[y]))
- memset(chan->readbuf[chan->inreadbuf], ZT_XLAW(0, chan), chan->readidx[y]);
+ memset(chan->readbuf[chan->inreadbuf], DAHDI_XLAW(0, chan), chan->readidx[y]);
}
spin_unlock_irqrestore(&chan->lock, flags);
}
set_bit(channel, &wc->tspans[span]->dtmfactive);
- zt_qevent_lock(&wc->tspans[span]->span.chans[channel], (ZT_EVENT_DTMFDOWN | tone));
+ dahdi_qevent_lock(&wc->tspans[span]->span.chans[channel], (DAHDI_EVENT_DTMFDOWN | tone));
} else {
clear_bit(channel, &wc->tspans[span]->dtmfactive);
- zt_qevent_lock(&wc->tspans[span]->span.chans[channel], (ZT_EVENT_DTMFUP | tone));
+ dahdi_qevent_lock(&wc->tspans[span]->span.chans[channel], (DAHDI_EVENT_DTMFUP | tone));
}
}
}
@@ -817,26 +817,26 @@ static void t4_check_vpm400(struct t4 *wc, unsigned int newio)
digit = vpm_digits[regbyte];
if (!(wc->tspans[0]->spanflags & FLAG_VPM2GEN)) {
energy = t4_vpm_in(wc, x, 0x58 + channel);
- energy = ZT_XLAW(energy, ts->chans);
+ energy = DAHDI_XLAW(energy, ts->chans);
ts->dtmfenergy[base] = energy;
}
set_bit(base, &ts->dtmfactive);
if (ts->dtmfdigit[base]) {
if (ts->dtmfmask & (1 << base))
- zt_qevent_lock(&ts->span.chans[base], (ZT_EVENT_DTMFUP | ts->dtmfdigit[base]));
+ dahdi_qevent_lock(&ts->span.chans[base], (DAHDI_EVENT_DTMFUP | ts->dtmfdigit[base]));
}
ts->dtmfdigit[base] = digit;
if (test_bit(base, &ts->dtmfmask))
- zt_qevent_lock(&ts->span.chans[base], (ZT_EVENT_DTMFDOWN | digit));
+ dahdi_qevent_lock(&ts->span.chans[base], (DAHDI_EVENT_DTMFDOWN | digit));
if (test_bit(base, &ts->dtmfmutemask)) {
/* Mute active receive buffer*/
unsigned long flags;
- struct zt_chan *chan = &ts->span.chans[base];
+ struct dahdi_chan *chan = &ts->span.chans[base];
int y;
spin_lock_irqsave(&chan->lock, flags);
for (y=0;y<chan->numbufs;y++) {
if ((chan->inreadbuf > -1) && (chan->readidx[y]))
- memset(chan->readbuf[chan->inreadbuf], ZT_XLAW(0, chan), chan->readidx[y]);
+ memset(chan->readbuf[chan->inreadbuf], DAHDI_XLAW(0, chan), chan->readidx[y]);
}
spin_unlock_irqrestore(&chan->lock, flags);
}
@@ -867,7 +867,7 @@ static void t4_check_vpm400(struct t4 *wc, unsigned int newio)
clear_bit(base, &ts->dtmfactive);
if (ts->dtmfdigit[base]) {
if (test_bit(base, &ts->dtmfmask))
- zt_qevent_lock(&ts->span.chans[base], (ZT_EVENT_DTMFUP | ts->dtmfdigit[base]));
+ dahdi_qevent_lock(&ts->span.chans[base], (DAHDI_EVENT_DTMFUP | ts->dtmfdigit[base]));
}
digit = ts->dtmfdigit[base];
ts->dtmfdigit[base] = 0;
@@ -938,7 +938,7 @@ static inline void t4_framer_cmd_wait(struct t4 *wc, unsigned int span, int cmd)
t4_framer_out(wc, span, FRMR_CMDR, cmd);
}
-static int hdlc_start(struct t4 *wc, unsigned int span, struct zt_chan *chan, unsigned char mode)
+static int hdlc_start(struct t4 *wc, unsigned int span, struct dahdi_chan *chan, unsigned char mode)
{
struct t4_span *t = wc->tspans[span];
unsigned char imr0, imr1;
@@ -999,7 +999,7 @@ static void __set_clear(struct t4 *wc, int span)
if ((ts->spantype == TYPE_T1) || (ts->spantype == TYPE_J1)) {
for (i=0;i<24;i++) {
j = (i/8);
- if (ts->span.chans[i].flags & ZT_FLAG_CLEAR) {
+ if (ts->span.chans[i].flags & DAHDI_FLAG_CLEAR) {
val |= 1 << (7 - (i % 8));
ts->notclear &= ~(1 << i);
} else
@@ -1014,7 +1014,7 @@ static void __set_clear(struct t4 *wc, int span)
}
} else {
for (i=0;i<31;i++) {
- if (ts->span.chans[i].flags & ZT_FLAG_CLEAR)
+ if (ts->span.chans[i].flags & DAHDI_FLAG_CLEAR)
ts->notclear &= ~(1 << i);
else
ts->notclear |= (1 << i);
@@ -1041,7 +1041,7 @@ static void set_clear(struct t4 *wc, int span)
}
#endif
-static int t4_dacs(struct zt_chan *dst, struct zt_chan *src)
+static int t4_dacs(struct dahdi_chan *dst, struct dahdi_chan *src)
{
struct t4 *wc;
struct t4_span *ts;
@@ -1106,7 +1106,7 @@ static int t4_vpm_unit(int span, int channel)
return unit;
}
-static int t4_echocan(struct zt_chan *chan, int eclen)
+static int t4_echocan(struct dahdi_chan *chan, int eclen)
{
struct t4 *wc = chan->pvt;
int channel;
@@ -1145,7 +1145,7 @@ static int t4_echocan(struct zt_chan *chan, int eclen)
}
#endif
-static int t4_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data)
+static int t4_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long data)
{
struct t4_regs regs;
int x;
@@ -1175,18 +1175,18 @@ static int t4_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data)
return -EFAULT;
break;
#ifdef VPM_SUPPORT
- case ZT_TONEDETECT:
+ case DAHDI_TONEDETECT:
if (get_user(j, (int *)data))
return -EFAULT;
if (!wc->vpm)
return -ENOSYS;
if (j && (vpmdtmfsupport == 0))
return -ENOSYS;
- if (j & ZT_TONEDETECT_ON)
+ if (j & DAHDI_TONEDETECT_ON)
set_bit(chan->chanpos - 1, &ts->dtmfmask);
else
clear_bit(chan->chanpos - 1, &ts->dtmfmask);
- if (j & ZT_TONEDETECT_MUTE)
+ if (j & DAHDI_TONEDETECT_MUTE)
set_bit(chan->chanpos - 1, &ts->dtmfmutemask);
else
clear_bit(chan->chanpos - 1, &ts->dtmfmutemask);
@@ -1195,7 +1195,7 @@ static int t4_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data)
if (!wc->t1e1)
channel += (4 << 2);
channel |= chan->span->offset;
- vpm450m_setdtmf(wc->vpm450m, channel, j & ZT_TONEDETECT_ON, j & ZT_TONEDETECT_MUTE);
+ vpm450m_setdtmf(wc->vpm450m, channel, j & DAHDI_TONEDETECT_ON, j & DAHDI_TONEDETECT_MUTE);
}
return 0;
#endif
@@ -1210,7 +1210,7 @@ static void inline t4_hdlc_xmit_fifo(struct t4 *wc, unsigned int span, struct t4
int res, i, size = 32;
unsigned char buf[32];
- res = zt_hdlc_getbuf(ts->sigchan, buf, &size);
+ res = dahdi_hdlc_getbuf(ts->sigchan, buf, &size);
if (debug & DEBUG_FRAMER) printk("Got buffer sized %d and res %d for %d\n", size, res, span);
if (size > 0) {
ts->sigactive = 1;
@@ -1243,7 +1243,7 @@ static void inline t4_hdlc_xmit_fifo(struct t4 *wc, unsigned int span, struct t4
ts->sigactive = 0;
}
-static void t4_hdlc_hard_xmit(struct zt_chan *chan)
+static void t4_hdlc_hard_xmit(struct dahdi_chan *chan)
{
struct t4 *wc = chan->pvt;
int span = chan->span->offset;
@@ -1264,29 +1264,29 @@ static void t4_hdlc_hard_xmit(struct zt_chan *chan)
t4_hdlc_xmit_fifo(wc, span, ts);
}
-static int t4_maint(struct zt_span *span, int cmd)
+static int t4_maint(struct dahdi_span *span, int cmd)
{
struct t4_span *ts = span->pvt;
struct t4 *wc = ts->owner;
if (ts->spantype == TYPE_E1) {
switch(cmd) {
- case ZT_MAINT_NONE:
+ case DAHDI_MAINT_NONE:
printk("XXX Turn off local and remote loops E1 XXX\n");
break;
- case ZT_MAINT_LOCALLOOP:
+ case DAHDI_MAINT_LOCALLOOP:
printk("XXX Turn on local loopback E1 XXX\n");
break;
- case ZT_MAINT_REMOTELOOP:
+ case DAHDI_MAINT_REMOTELOOP:
printk("XXX Turn on remote loopback E1 XXX\n");
break;
- case ZT_MAINT_LOOPUP:
+ case DAHDI_MAINT_LOOPUP:
printk("XXX Send loopup code E1 XXX\n");
break;
- case ZT_MAINT_LOOPDOWN:
+ case DAHDI_MAINT_LOOPDOWN:
printk("XXX Send loopdown code E1 XXX\n");
break;
- case ZT_MAINT_LOOPSTOP:
+ case DAHDI_MAINT_LOOPSTOP:
printk("XXX Stop sending loop codes E1 XXX\n");
break;
default:
@@ -1295,22 +1295,22 @@ static int t4_maint(struct zt_span *span, int cmd)
}
} else {
switch(cmd) {
- case ZT_MAINT_NONE:
+ case DAHDI_MAINT_NONE:
printk("XXX Turn off local and remote loops T1 XXX\n");
break;
- case ZT_MAINT_LOCALLOOP:
+ case DAHDI_MAINT_LOCALLOOP:
printk("XXX Turn on local loop and no remote loop XXX\n");
break;
- case ZT_MAINT_REMOTELOOP:
+ case DAHDI_MAINT_REMOTELOOP:
printk("XXX Turn on remote loopup XXX\n");
break;
- case ZT_MAINT_LOOPUP:
+ case DAHDI_MAINT_LOOPUP:
t4_framer_out(wc, span->offset, 0x21, 0x50); /* FMR5: Nothing but RBS mode */
break;
- case ZT_MAINT_LOOPDOWN:
+ case DAHDI_MAINT_LOOPDOWN:
t4_framer_out(wc, span->offset, 0x21, 0x60); /* FMR5: Nothing but RBS mode */
break;
- case ZT_MAINT_LOOPSTOP:
+ case DAHDI_MAINT_LOOPSTOP:
t4_framer_out(wc, span->offset, 0x21, 0x40); /* FMR5: Nothing but RBS mode */
break;
default:
@@ -1321,7 +1321,7 @@ static int t4_maint(struct zt_span *span, int cmd)
return 0;
}
-static int t4_rbsbits(struct zt_chan *chan, int bits)
+static int t4_rbsbits(struct dahdi_chan *chan, int bits)
{
u_char m,c;
int k,n,b;
@@ -1347,7 +1347,7 @@ static int t4_rbsbits(struct zt_chan *chan, int bits)
ts->txsigs[b] = c;
/* output them to the chip */
__t4_framer_out(wc,k,0x71 + b,c);
- } else if (ts->span.lineconfig & ZT_CONFIG_D4) {
+ } else if (ts->span.lineconfig & DAHDI_CONFIG_D4) {
n = chan->chanpos - 1;
b = (n/4);
c = ts->txsigs[b];
@@ -1358,7 +1358,7 @@ static int t4_rbsbits(struct zt_chan *chan, int bits)
/* output them to the chip */
__t4_framer_out(wc,k,0x70 + b,c);
__t4_framer_out(wc,k,0x70 + b + 6,c);
- } else if (ts->span.lineconfig & ZT_CONFIG_ESF) {
+ } else if (ts->span.lineconfig & DAHDI_CONFIG_ESF) {
n = chan->chanpos - 1;
b = (n/2);
c = ts->txsigs[b];
@@ -1375,7 +1375,7 @@ static int t4_rbsbits(struct zt_chan *chan, int bits)
return 0;
}
-static int t4_shutdown(struct zt_span *span)
+static int t4_shutdown(struct dahdi_span *span)
{
int tspan;
int wasrunning;
@@ -1396,19 +1396,19 @@ static int t4_shutdown(struct zt_span *span)
hdlc_stop(wc, span->offset);
spin_lock_irqsave(&wc->reglock, flags);
- wasrunning = span->flags & ZT_FLAG_RUNNING;
+ wasrunning = span->flags & DAHDI_FLAG_RUNNING;
- span->flags &= ~ZT_FLAG_RUNNING;
+ span->flags &= ~DAHDI_FLAG_RUNNING;
__t4_set_led(wc, span->offset, WC_OFF);
if (((wc->numspans == 4) &&
- (!(wc->tspans[0]->span.flags & ZT_FLAG_RUNNING)) &&
- (!(wc->tspans[1]->span.flags & ZT_FLAG_RUNNING)) &&
- (!(wc->tspans[2]->span.flags & ZT_FLAG_RUNNING)) &&
- (!(wc->tspans[3]->span.flags & ZT_FLAG_RUNNING)))
+ (!(wc->tspans[0]->span.flags & DAHDI_FLAG_RUNNING)) &&
+ (!(wc->tspans[1]->span.flags & DAHDI_FLAG_RUNNING)) &&
+ (!(wc->tspans[2]->span.flags & DAHDI_FLAG_RUNNING)) &&
+ (!(wc->tspans[3]->span.flags & DAHDI_FLAG_RUNNING)))
||
((wc->numspans == 2) &&
- (!(wc->tspans[0]->span.flags & ZT_FLAG_RUNNING)) &&
- (!(wc->tspans[1]->span.flags & ZT_FLAG_RUNNING)))) {
+ (!(wc->tspans[0]->span.flags & DAHDI_FLAG_RUNNING)) &&
+ (!(wc->tspans[1]->span.flags & DAHDI_FLAG_RUNNING)))) {
/* No longer in use, disable interrupts */
printk("TE%dXXP: Disabling interrupts since there are no active spans\n", wc->numspans);
set_bit(T4_STOP_DMA, &wc->checkflag);
@@ -1427,7 +1427,7 @@ static int t4_shutdown(struct zt_span *span)
return 0;
}
-static int t4_spanconfig(struct zt_span *span, struct zt_lineconfig *lc)
+static int t4_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
{
int i;
struct t4_span *ts = span->pvt;
@@ -1462,20 +1462,20 @@ static int t4_spanconfig(struct zt_span *span, struct zt_lineconfig *lc)
clear_bit(T4_STOP_DMA, &wc->checkflag);
/* If we're already running, then go ahead and apply the changes */
- if (span->flags & ZT_FLAG_RUNNING)
+ if (span->flags & DAHDI_FLAG_RUNNING)
return t4_startup(span);
printk("Done with spanconfig!\n");
return 0;
}
-static int t4_chanconfig(struct zt_chan *chan, int sigtype)
+static int t4_chanconfig(struct dahdi_chan *chan, int sigtype)
{
int alreadyrunning;
unsigned long flags;
struct t4 *wc = chan->pvt;
struct t4_span *ts = wc->tspans[chan->span->offset];
- alreadyrunning = ts->span.flags & ZT_FLAG_RUNNING;
+ alreadyrunning = ts->span.flags & DAHDI_FLAG_RUNNING;
if (debug & DEBUG_MAIN) {
if (alreadyrunning)
printk("TE%dXXP: Reconfigured channel %d (%s) sigtype %d\n", wc->numspans, chan->channo, chan->name, sigtype);
@@ -1491,13 +1491,13 @@ static int t4_chanconfig(struct zt_chan *chan, int sigtype)
spin_unlock_irqrestore(&wc->reglock, flags);
/* (re)configure signalling channel */
- if ((sigtype == ZT_SIG_HARDHDLC) || (ts->sigchan == chan)) {
+ if ((sigtype == DAHDI_SIG_HARDHDLC) || (ts->sigchan == chan)) {
if (debug & DEBUG_FRAMER)
- printk("%sonfiguring hardware HDLC on %s\n", ((sigtype == ZT_SIG_HARDHDLC) ? "C" : "Unc"), chan->name);
+ printk("%sonfiguring hardware HDLC on %s\n", ((sigtype == DAHDI_SIG_HARDHDLC) ? "C" : "Unc"), chan->name);
if (alreadyrunning) {
if (ts->sigchan)
hdlc_stop(wc, ts->sigchan->span->offset);
- if (sigtype == ZT_SIG_HARDHDLC) {
+ if (sigtype == DAHDI_SIG_HARDHDLC) {
if (hdlc_start(wc, chan->span->offset, chan, ts->sigmode)) {
printk("Error initializing signalling controller\n");
return -1;
@@ -1511,7 +1511,7 @@ static int t4_chanconfig(struct zt_chan *chan, int sigtype)
}
else {
spin_lock_irqsave(&wc->reglock, flags);
- ts->sigchan = (sigtype == ZT_SIG_HARDHDLC) ? chan : NULL;
+ ts->sigchan = (sigtype == DAHDI_SIG_HARDHDLC) ? chan : NULL;
spin_unlock_irqrestore(&wc->reglock, flags);
ts->sigactive = 0;
}
@@ -1519,7 +1519,7 @@ static int t4_chanconfig(struct zt_chan *chan, int sigtype)
return 0;
}
-static int t4_open(struct zt_chan *chan)
+static int t4_open(struct dahdi_chan *chan)
{
#ifndef LINUX26
MOD_INC_USE_COUNT;
@@ -1530,7 +1530,7 @@ static int t4_open(struct zt_chan *chan)
return 0;
}
-static int t4_close(struct zt_chan *chan)
+static int t4_close(struct dahdi_chan *chan)
{
#ifndef LINUX26
MOD_DEC_USE_COUNT;
@@ -1603,15 +1603,15 @@ static void init_spans(struct t4 *wc)
if (ts->spantype == TYPE_T1 || ts->spantype == TYPE_J1) {
ts->span.channels = 24;
- ts->span.deflaw = ZT_LAW_MULAW;
- ts->span.linecompat = ZT_CONFIG_AMI | ZT_CONFIG_B8ZS | ZT_CONFIG_D4 | ZT_CONFIG_ESF;
+ ts->span.deflaw = DAHDI_LAW_MULAW;
+ ts->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_B8ZS | DAHDI_CONFIG_D4 | DAHDI_CONFIG_ESF;
} else {
ts->span.channels = 31;
- ts->span.deflaw = ZT_LAW_ALAW;
- ts->span.linecompat = ZT_CONFIG_HDB3 | ZT_CONFIG_CCS | ZT_CONFIG_CRC4;
+ ts->span.deflaw = DAHDI_LAW_ALAW;
+ ts->span.linecompat = DAHDI_CONFIG_HDB3 | DAHDI_CONFIG_CCS | DAHDI_CONFIG_CRC4;
}
ts->span.chans = ts->chans;
- ts->span.flags = ZT_FLAG_RBS;
+ ts->span.flags = DAHDI_FLAG_RBS;
ts->span.ioctl = t4_ioctl;
ts->span.hdlc_hard_xmit = t4_hdlc_hard_xmit;
if (gen2) {
@@ -1627,10 +1627,10 @@ static void init_spans(struct t4 *wc)
ts->readchunk = (void *)(wc->readchunk + x * 32 * 2);
init_waitqueue_head(&ts->span.maintq);
for (y=0;y<wc->tspans[x]->span.channels;y++) {
- struct zt_chan *mychans = ts->chans + y;
+ struct dahdi_chan *mychans = ts->chans + y;
sprintf(mychans->name, "TE%d/%d/%d/%d", wc->numspans, wc->num, x + 1, y + 1);
- mychans->sigcap = ZT_SIG_EM | ZT_SIG_CLEAR | ZT_SIG_FXSLS | ZT_SIG_FXSGS | ZT_SIG_FXSKS | ZT_SIG_HARDHDLC | ZT_SIG_MTP2 |
- ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_FXOKS | ZT_SIG_CAS | ZT_SIG_EM_E1 | ZT_SIG_DACS_RBS;
+ mychans->sigcap = DAHDI_SIG_EM | DAHDI_SIG_CLEAR | DAHDI_SIG_FXSLS | DAHDI_SIG_FXSGS | DAHDI_SIG_FXSKS | DAHDI_SIG_HARDHDLC | DAHDI_SIG_MTP2 |
+ DAHDI_SIG_FXOLS | DAHDI_SIG_FXOGS | DAHDI_SIG_FXOKS | DAHDI_SIG_CAS | DAHDI_SIG_EM_E1 | DAHDI_SIG_DACS_RBS;
mychans->pvt = wc;
mychans->chanpos = y + 1;
if (gen2) {
@@ -1790,8 +1790,8 @@ static int __t4_findsync(struct t4 *wc)
if (cards[x]->tspans[i]->syncpos) {
nonzero = 1;
if ((cards[x]->tspans[i]->syncpos == p) &&
- !(cards[x]->tspans[i]->span.alarms & (ZT_ALARM_RED | ZT_ALARM_BLUE | ZT_ALARM_LOOPBACK)) &&
- (cards[x]->tspans[i]->span.flags & ZT_FLAG_RUNNING)) {
+ !(cards[x]->tspans[i]->span.alarms & (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE | DAHDI_ALARM_LOOPBACK)) &&
+ (cards[x]->tspans[i]->span.flags & DAHDI_FLAG_RUNNING)) {
/* This makes a good sync source */
newsyncsrc = cards[x]->tspans[i]->span.spanno;
newsyncnum = x;
@@ -1834,8 +1834,8 @@ static void __t4_set_timing_source_auto(struct t4 *wc)
} else {
for (x=0;x<wc->numspans;x++) {
if (wc->tspans[x]->sync) {
- if ((wc->tspans[wc->tspans[x]->psync - 1]->span.flags & ZT_FLAG_RUNNING) &&
- !(wc->tspans[wc->tspans[x]->psync - 1]->span.alarms & (ZT_ALARM_RED | ZT_ALARM_BLUE) )) {
+ if ((wc->tspans[wc->tspans[x]->psync - 1]->span.flags & DAHDI_FLAG_RUNNING) &&
+ !(wc->tspans[wc->tspans[x]->psync - 1]->span.alarms & (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE) )) {
/* Valid timing source */
__t4_set_timing_source(wc, wc->tspans[x]->psync - 1, 0, 0);
return;
@@ -1866,14 +1866,14 @@ static void __t4_configure_t1(struct t4 *wc, int unit, int lineconfig, int txlev
__t4_framer_out(wc, unit, 0x1e, fmr2);
/* Configure line interface */
- if (lineconfig & ZT_CONFIG_AMI) {
+ if (lineconfig & DAHDI_CONFIG_AMI) {
line = "AMI";
fmr0 = 0xa0;
} else {
line = "B8ZS";
fmr0 = 0xf0;
}
- if (lineconfig & ZT_CONFIG_D4) {
+ if (lineconfig & DAHDI_CONFIG_D4) {
framing = "D4";
} else {
framing = "ESF";
@@ -1940,7 +1940,7 @@ static void __t4_configure_e1(struct t4 *wc, int unit, int lineconfig)
fmr2 = 0x03; /* FMR2: Auto transmit remote alarm, auto loss of multiframe recovery, no payload loopback */
if (loopback)
fmr2 |= 0x4;
- if (lineconfig & ZT_CONFIG_CRC4) {
+ if (lineconfig & DAHDI_CONFIG_CRC4) {
fmr1 |= 0x08; /* CRC4 transmit */
fmr2 |= 0xc0; /* CRC4 receive */
crc4 = "/CRC4";
@@ -1949,14 +1949,14 @@ static void __t4_configure_e1(struct t4 *wc, int unit, int lineconfig)
__t4_framer_out(wc, unit, 0x1e, fmr2);
/* Configure line interface */
- if (lineconfig & ZT_CONFIG_AMI) {
+ if (lineconfig & DAHDI_CONFIG_AMI) {
line = "AMI";
fmr0 = 0xa0;
} else {
line = "HDB3";
fmr0 = 0xf0;
}
- if (lineconfig & ZT_CONFIG_CCS) {
+ if (lineconfig & DAHDI_CONFIG_CCS) {
framing = "CCS";
imr3extra = 0x28;
} else {
@@ -2008,7 +2008,7 @@ static void __t4_configure_e1(struct t4 *wc, int unit, int lineconfig)
printk("TE%dXXP: Span %d configured for %s/%s%s\n", wc->numspans, unit + 1, framing, line, crc4);
}
-static int t4_startup(struct zt_span *span)
+static int t4_startup(struct dahdi_span *span)
{
#ifdef SUPPORT_GEN1
int i;
@@ -2028,16 +2028,16 @@ static int t4_startup(struct zt_span *span)
spin_lock_irqsave(&wc->reglock, flags);
- alreadyrunning = span->flags & ZT_FLAG_RUNNING;
+ alreadyrunning = span->flags & DAHDI_FLAG_RUNNING;
#ifdef SUPPORT_GEN1
/* initialize the start value for the entire chunk of last ec buffer */
for(i = 0; i < span->channels; i++)
{
memset(ts->ec_chunk1[i],
- ZT_LIN2X(0,&span->chans[i]),ZT_CHUNKSIZE);
+ DAHDI_LIN2X(0,&span->chans[i]),DAHDI_CHUNKSIZE);
memset(ts->ec_chunk2[i],
- ZT_LIN2X(0,&span->chans[i]),ZT_CHUNKSIZE);
+ DAHDI_LIN2X(0,&span->chans[i]),DAHDI_CHUNKSIZE);
}
#endif
/* Force re-evaluation fo timing source */
@@ -2055,7 +2055,7 @@ static int t4_startup(struct zt_span *span)
__set_clear(wc, span->offset);
if (!alreadyrunning) {
- span->flags |= ZT_FLAG_RUNNING;
+ span->flags |= DAHDI_FLAG_RUNNING;
wc->spansstarted++;
/* enable interrupts */
/* Start DMA, enabling DMA interrupts on read only */
@@ -2078,7 +2078,7 @@ static int t4_startup(struct zt_span *span)
}
if (ts->sigchan) {
- struct zt_chan *sigchan = ts->sigchan;
+ struct dahdi_chan *sigchan = ts->sigchan;
spin_unlock_irqrestore(&wc->reglock, flags);
if (hdlc_start(wc, span->offset, sigchan, ts->sigmode)) {
@@ -2118,7 +2118,7 @@ static inline void e1_check(struct t4 *wc, int span, int val)
{
struct t4_span *ts = wc->tspans[span];
if ((ts->span.channels > 24) &&
- (ts->span.flags & ZT_FLAG_RUNNING) &&
+ (ts->span.flags & DAHDI_FLAG_RUNNING) &&
!(ts->span.alarms) &&
(!wc->e1recover)) {
if (val != 0x1b) {
@@ -2154,7 +2154,7 @@ static void t4_receiveprep(struct t4 *wc, int irq)
dbl = 1;
wc->last0 = 0;
} else {
- readchunk = wc->readchunk + ZT_CHUNKSIZE * 32;
+ readchunk = wc->readchunk + DAHDI_CHUNKSIZE * 32;
if (wc->last0)
dbl = 1;
wc->last0 = 1;
@@ -2165,7 +2165,7 @@ static void t4_receiveprep(struct t4 *wc, int irq)
if (debug & DEBUG_MAIN)
printk("TE%dXXP: Double/missed interrupt detected\n", wc->numspans);
}
- for (x=0;x<ZT_CHUNKSIZE;x++) {
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
for (z=0;z<24;z++) {
/* All T1/E1 channels */
tmp = readchunk[z+1+offset];
@@ -2205,25 +2205,25 @@ static void t4_receiveprep(struct t4 *wc, int irq)
readchunk += 32;
}
for (x=0;x<wc->numspans;x++) {
- if (wc->tspans[x]->span.flags & ZT_FLAG_RUNNING) {
+ if (wc->tspans[x]->span.flags & DAHDI_FLAG_RUNNING) {
for (y=0;y<wc->tspans[x]->span.channels;y++) {
/* Echo cancel double buffered data */
- zt_ec_chunk(&wc->tspans[x]->span.chans[y],
+ dahdi_ec_chunk(&wc->tspans[x]->span.chans[y],
wc->tspans[x]->span.chans[y].readchunk,
wc->tspans[x]->ec_chunk2[y]);
memcpy(wc->tspans[x]->ec_chunk2[y],wc->tspans[x]->ec_chunk1[y],
- ZT_CHUNKSIZE);
+ DAHDI_CHUNKSIZE);
memcpy(wc->tspans[x]->ec_chunk1[y],
wc->tspans[x]->span.chans[y].writechunk,
- ZT_CHUNKSIZE);
+ DAHDI_CHUNKSIZE);
}
- zt_receive(&wc->tspans[x]->span);
+ dahdi_receive(&wc->tspans[x]->span);
}
}
}
#endif
-#if (ZT_CHUNKSIZE != 8)
+#if (DAHDI_CHUNKSIZE != 8)
#error Sorry, nextgen does not support chunksize != 8
#endif
@@ -2237,7 +2237,7 @@ static inline void __receive_span(struct t4_span *ts)
for (y=0;y<ts->span.channels;y++) {
/* Mute any DTMFs which are supposed to be muted */
if (test_bit(y, &merged)) {
- memset(ts->span.chans[y].readchunk, ZT_XLAW(0, (ts->span.chans + y)), ZT_CHUNKSIZE);
+ memset(ts->span.chans[y].readchunk, DAHDI_XLAW(0, (ts->span.chans + y)), DAHDI_CHUNKSIZE);
}
}
}
@@ -2262,13 +2262,13 @@ static inline void __receive_span(struct t4_span *ts)
prefetch((void *)(ts->writechunk + 56));
#endif
- zt_ec_span(&ts->span);
- zt_receive(&ts->span);
+ dahdi_ec_span(&ts->span);
+ dahdi_receive(&ts->span);
}
static inline void __transmit_span(struct t4_span *ts)
{
- zt_transmit(&ts->span);
+ dahdi_transmit(&ts->span);
}
#ifdef ENABLE_WORKQUEUES
@@ -2288,7 +2288,7 @@ static void t4_prep_gen2(struct t4 *wc)
{
int x;
for (x=0;x<wc->numspans;x++) {
- if (wc->tspans[x]->span.flags & ZT_FLAG_RUNNING) {
+ if (wc->tspans[x]->span.flags & DAHDI_FLAG_RUNNING) {
__receive_span(wc->tspans[x]);
__transmit_span(wc->tspans[x]);
}
@@ -2309,14 +2309,14 @@ static void t4_transmitprep(struct t4 *wc, int irq)
/* First part */
writechunk = wc->writechunk + 1;
} else {
- writechunk = wc->writechunk + ZT_CHUNKSIZE * 32 + 1;
+ writechunk = wc->writechunk + DAHDI_CHUNKSIZE * 32 + 1;
}
for (y=0;y<wc->numspans;y++) {
- if (wc->tspans[y]->span.flags & ZT_FLAG_RUNNING)
- zt_transmit(&wc->tspans[y]->span);
+ if (wc->tspans[y]->span.flags & DAHDI_FLAG_RUNNING)
+ dahdi_transmit(&wc->tspans[y]->span);
}
- for (x=0;x<ZT_CHUNKSIZE;x++) {
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
/* Once per chunk */
for (z=0;z<24;z++) {
/* All T1/E1 channels */
@@ -2358,46 +2358,46 @@ static void t4_check_sigbits(struct t4 *wc, int span)
if (debug & DEBUG_RBS)
printk("Checking sigbits on span %d\n", span + 1);
- if (!(ts->span.flags & ZT_FLAG_RUNNING))
+ if (!(ts->span.flags & DAHDI_FLAG_RUNNING))
return;
if (ts->spantype == TYPE_E1) {
for (i = 0; i < 15; i++) {
a = t4_framer_in(wc, span, 0x71 + i);
/* Get high channel in low bits */
rxs = (a & 0xf);
- if (!(ts->span.chans[i+16].sig & ZT_SIG_CLEAR)) {
+ if (!(ts->span.chans[i+16].sig & DAHDI_SIG_CLEAR)) {
if (ts->span.chans[i+16].rxsig != rxs)
- zt_rbsbits(&ts->span.chans[i+16], rxs);
+ dahdi_rbsbits(&ts->span.chans[i+16], rxs);
}
rxs = (a >> 4) & 0xf;
- if (!(ts->span.chans[i].sig & ZT_SIG_CLEAR)) {
+ if (!(ts->span.chans[i].sig & DAHDI_SIG_CLEAR)) {
if (ts->span.chans[i].rxsig != rxs)
- zt_rbsbits(&ts->span.chans[i], rxs);
+ dahdi_rbsbits(&ts->span.chans[i], rxs);
}
}
- } else if (ts->span.lineconfig & ZT_CONFIG_D4) {
+ } else if (ts->span.lineconfig & DAHDI_CONFIG_D4) {
for (i = 0; i < 24; i+=4) {
a = t4_framer_in(wc, span, 0x70 + (i>>2));
/* Get high channel in low bits */
rxs = (a & 0x3) << 2;
- if (!(ts->span.chans[i+3].sig & ZT_SIG_CLEAR)) {
+ if (!(ts->span.chans[i+3].sig & DAHDI_SIG_CLEAR)) {
if (ts->span.chans[i+3].rxsig != rxs)
- zt_rbsbits(&ts->span.chans[i+3], rxs);
+ dahdi_rbsbits(&ts->span.chans[i+3], rxs);
}
rxs = (a & 0xc);
- if (!(ts->span.chans[i+2].sig & ZT_SIG_CLEAR)) {
+ if (!(ts->span.chans[i+2].sig & DAHDI_SIG_CLEAR)) {
if (ts->span.chans[i+2].rxsig != rxs)
- zt_rbsbits(&ts->span.chans[i+2], rxs);
+ dahdi_rbsbits(&ts->span.chans[i+2], rxs);
}
rxs = (a >> 2) & 0xc;
- if (!(ts->span.chans[i+1].sig & ZT_SIG_CLEAR)) {
+ if (!(ts->span.chans[i+1].sig & DAHDI_SIG_CLEAR)) {
if (ts->span.chans[i+1].rxsig != rxs)
- zt_rbsbits(&ts->span.chans[i+1], rxs);
+ dahdi_rbsbits(&ts->span.chans[i+1], rxs);
}
rxs = (a >> 4) & 0xc;
- if (!(ts->span.chans[i].sig & ZT_SIG_CLEAR)) {
+ if (!(ts->span.chans[i].sig & DAHDI_SIG_CLEAR)) {
if (ts->span.chans[i].rxsig != rxs)
- zt_rbsbits(&ts->span.chans[i], rxs);
+ dahdi_rbsbits(&ts->span.chans[i], rxs);
}
}
} else {
@@ -2405,17 +2405,17 @@ static void t4_check_sigbits(struct t4 *wc, int span)
a = t4_framer_in(wc, span, 0x70 + (i>>1));
/* Get high channel in low bits */
rxs = (a & 0xf);
- if (!(ts->span.chans[i+1].sig & ZT_SIG_CLEAR)) {
+ if (!(ts->span.chans[i+1].sig & DAHDI_SIG_CLEAR)) {
/* XXX Not really reset on every trans! XXX */
if (ts->span.chans[i+1].rxsig != rxs) {
- zt_rbsbits(&ts->span.chans[i+1], rxs);
+ dahdi_rbsbits(&ts->span.chans[i+1], rxs);
}
}
rxs = (a >> 4) & 0xf;
- if (!(ts->span.chans[i].sig & ZT_SIG_CLEAR)) {
+ if (!(ts->span.chans[i].sig & DAHDI_SIG_CLEAR)) {
/* XXX Not really reset on every trans! XXX */
if (ts->span.chans[i].rxsig != rxs) {
- zt_rbsbits(&ts->span.chans[i], rxs);
+ dahdi_rbsbits(&ts->span.chans[i], rxs);
}
}
}
@@ -2430,7 +2430,7 @@ static void t4_check_alarms(struct t4 *wc, int span)
struct t4_span *ts = wc->tspans[span];
unsigned long flags;
- if (!(ts->span.flags & ZT_FLAG_RUNNING))
+ if (!(ts->span.flags & DAHDI_FLAG_RUNNING))
return;
spin_lock_irqsave(&wc->reglock, flags);
@@ -2442,7 +2442,7 @@ static void t4_check_alarms(struct t4 *wc, int span)
alarms = 0;
/* And consider only carrier alarms */
- ts->span.alarms &= (ZT_ALARM_RED | ZT_ALARM_BLUE | ZT_ALARM_NOTOPEN);
+ ts->span.alarms &= (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE | DAHDI_ALARM_NOTOPEN);
if (ts->spantype == TYPE_E1) {
if (c & 0x04) {
@@ -2468,43 +2468,43 @@ static void t4_check_alarms(struct t4 *wc, int span)
/* Detect loopup code if we're not sending one */
if ((!ts->span.mainttimer) && (d & 0x08)) {
/* Loop-up code detected */
- if ((ts->loopupcnt++ > 80) && (ts->span.maintstat != ZT_MAINT_REMOTELOOP)) {
+ if ((ts->loopupcnt++ > 80) && (ts->span.maintstat != DAHDI_MAINT_REMOTELOOP)) {
__t4_framer_out(wc, span, 0x36, 0x08); /* LIM0: Disable any local loop */
__t4_framer_out(wc, span, 0x37, 0xf6 ); /* LIM1: Enable remote loop */
- ts->span.maintstat = ZT_MAINT_REMOTELOOP;
+ ts->span.maintstat = DAHDI_MAINT_REMOTELOOP;
}
} else
ts->loopupcnt = 0;
/* Same for loopdown code */
if ((!ts->span.mainttimer) && (d & 0x10)) {
/* Loop-down code detected */
- if ((ts->loopdowncnt++ > 80) && (ts->span.maintstat == ZT_MAINT_REMOTELOOP)) {
+ if ((ts->loopdowncnt++ > 80) && (ts->span.maintstat == DAHDI_MAINT_REMOTELOOP)) {
__t4_framer_out(wc, span, 0x36, 0x08); /* LIM0: Disable any local loop */
__t4_framer_out(wc, span, 0x37, 0xf0 ); /* LIM1: Disable remote loop */
- ts->span.maintstat = ZT_MAINT_NONE;
+ ts->span.maintstat = DAHDI_MAINT_NONE;
}
} else
ts->loopdowncnt = 0;
}
- if (ts->span.lineconfig & ZT_CONFIG_NOTOPEN) {
+ if (ts->span.lineconfig & DAHDI_CONFIG_NOTOPEN) {
for (x=0,j=0;x < ts->span.channels;x++)
- if ((ts->span.chans[x].flags & ZT_FLAG_OPEN) ||
- (ts->span.chans[x].flags & ZT_FLAG_NETDEV))
+ if ((ts->span.chans[x].flags & DAHDI_FLAG_OPEN) ||
+ (ts->span.chans[x].flags & DAHDI_FLAG_NETDEV))
j++;
if (!j)
- alarms |= ZT_ALARM_NOTOPEN;
+ alarms |= DAHDI_ALARM_NOTOPEN;
}
if (c & 0xa0) {
if (ts->alarmcount >= alarmdebounce)
- alarms |= ZT_ALARM_RED;
+ alarms |= DAHDI_ALARM_RED;
else
ts->alarmcount++;
} else
ts->alarmcount = 0;
if (c & 0x4)
- alarms |= ZT_ALARM_BLUE;
+ alarms |= DAHDI_ALARM_BLUE;
if (((!ts->span.alarms) && alarms) ||
(ts->span.alarms && (!alarms)))
@@ -2512,9 +2512,9 @@ static void t4_check_alarms(struct t4 *wc, int span)
/* Keep track of recovering */
if ((!alarms) && ts->span.alarms)
- ts->alarmtimer = ZT_ALARMSETTLE_TIME;
+ ts->alarmtimer = DAHDI_ALARMSETTLE_TIME;
if (ts->alarmtimer)
- alarms |= ZT_ALARM_RECOVER;
+ alarms |= DAHDI_ALARM_RECOVER;
/* If receiving alarms, go into Yellow alarm state */
if (alarms && !(ts->spanflags & FLAG_SENDINGYELLOW)) {
@@ -2540,12 +2540,12 @@ static void t4_check_alarms(struct t4 *wc, int span)
/* Re-check the timing source when we enter/leave alarm, not withstanding
yellow alarm */
if (c & 0x10)
- alarms |= ZT_ALARM_YELLOW;
+ alarms |= DAHDI_ALARM_YELLOW;
if (ts->span.mainttimer || ts->span.maintstat)
- alarms |= ZT_ALARM_LOOPBACK;
+ alarms |= DAHDI_ALARM_LOOPBACK;
ts->span.alarms = alarms;
spin_unlock_irqrestore(&wc->reglock, flags);
- zt_alarm_notify(&ts->span);
+ dahdi_alarm_notify(&ts->span);
}
static void t4_do_counters(struct t4 *wc)
@@ -2561,13 +2561,13 @@ static void t4_do_counters(struct t4 *wc)
if (ts->alarmtimer) {
if (!--ts->alarmtimer) {
docheck++;
- ts->span.alarms &= ~(ZT_ALARM_RECOVER);
+ ts->span.alarms &= ~(DAHDI_ALARM_RECOVER);
}
}
spin_unlock(&wc->reglock);
if (docheck) {
t4_check_alarms(wc, span);
- zt_alarm_notify(&ts->span);
+ dahdi_alarm_notify(&ts->span);
}
}
}
@@ -2579,8 +2579,8 @@ static inline void __handle_leds(struct t4 *wc)
wc->blinktimer++;
for (x=0;x<wc->numspans;x++) {
struct t4_span *ts = wc->tspans[x];
- if (ts->span.flags & ZT_FLAG_RUNNING) {
- if (ts->span.alarms & (ZT_ALARM_RED | ZT_ALARM_BLUE)) {
+ if (ts->span.flags & DAHDI_FLAG_RUNNING) {
+ if (ts->span.alarms & (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE)) {
#ifdef FANCY_ALARM
if (wc->blinktimer == (altab[wc->alarmpos] >> 1)) {
__t4_set_led(wc, x, WC_RED);
@@ -2595,7 +2595,7 @@ static inline void __handle_leds(struct t4 *wc)
__t4_set_led(wc, x, WC_OFF);
}
#endif
- } else if (ts->span.alarms & ZT_ALARM_YELLOW) {
+ } else if (ts->span.alarms & DAHDI_ALARM_YELLOW) {
/* Yellow Alarm */
__t4_set_led(wc, x, WC_YELLOW);
} else if (ts->span.mainttimer || ts->span.maintstat) {
@@ -2640,7 +2640,7 @@ static inline void t4_framer_interrupt(struct t4 *wc, int span)
unsigned char gis, isr0, isr1, isr2, isr3, isr4;
int readsize = -1;
struct t4_span *ts = wc->tspans[span];
- struct zt_chan *sigchan;
+ struct dahdi_chan *sigchan;
unsigned long flags;
if (debug & DEBUG_FRAMER)
@@ -2743,26 +2743,26 @@ static inline void t4_framer_interrupt(struct t4 *wc, int span)
if (debug & DEBUG_FRAMER) printk("Received HDLC frame %d. RSIS = 0x%x (%x)\n", ts->frames_in, rsis, rsis_reg);
if (!(rsis & FRMR_RSIS_CRC16)) {
if (debug & DEBUG_FRAMER) printk("CRC check failed %d\n", span);
- zt_hdlc_abort(sigchan, ZT_EVENT_BADFCS);
+ dahdi_hdlc_abort(sigchan, DAHDI_EVENT_BADFCS);
} else if (rsis & FRMR_RSIS_RAB) {
if (debug & DEBUG_FRAMER) printk("ABORT of current frame due to overflow %d\n", span);
- zt_hdlc_abort(sigchan, ZT_EVENT_ABORT);
+ dahdi_hdlc_abort(sigchan, DAHDI_EVENT_ABORT);
} else if (rsis & FRMR_RSIS_RDO) {
if (debug & DEBUG_FRAMER) printk("HDLC overflow occured %d\n", span);
- zt_hdlc_abort(sigchan, ZT_EVENT_OVERRUN);
+ dahdi_hdlc_abort(sigchan, DAHDI_EVENT_OVERRUN);
} else if (!(rsis & FRMR_RSIS_VFR)) {
if (debug & DEBUG_FRAMER) printk("Valid Frame check failed on span %d\n", span);
- zt_hdlc_abort(sigchan, ZT_EVENT_ABORT);
+ dahdi_hdlc_abort(sigchan, DAHDI_EVENT_ABORT);
} else {
- zt_hdlc_putbuf(sigchan, readbuf, readsize - 1);
- zt_hdlc_finish(sigchan);
+ dahdi_hdlc_putbuf(sigchan, readbuf, readsize - 1);
+ dahdi_hdlc_finish(sigchan);
if (debug & DEBUG_FRAMER) printk("Received valid HDLC frame on span %d\n", span);
}
#if 0
debug = olddebug;
#endif
} else if (isr0 & FRMR_ISR0_RPF)
- zt_hdlc_putbuf(sigchan, readbuf, readsize);
+ dahdi_hdlc_putbuf(sigchan, readbuf, readsize);
}
/* Transmit side */
@@ -2954,20 +2954,20 @@ ZAP_IRQ_HANDLER(t4_interrupt_gen2)
#ifdef ENABLE_WORKQUEUES
int cpus = num_online_cpus();
atomic_set(&wc->worklist, wc->numspans);
- if (wc->tspans[0]->span.flags & ZT_FLAG_RUNNING)
+ if (wc->tspans[0]->span.flags & DAHDI_FLAG_RUNNING)
t4_queue_work(wc->workq, &wc->tspans[0]->swork, 0);
else
atomic_dec(&wc->worklist);
- if (wc->tspans[1]->span.flags & ZT_FLAG_RUNNING)
+ if (wc->tspans[1]->span.flags & DAHDI_FLAG_RUNNING)
t4_queue_work(wc->workq, &wc->tspans[1]->swork, 1 % cpus);
else
atomic_dec(&wc->worklist);
if (wc->numspans == 4) {
- if (wc->tspans[2]->span.flags & ZT_FLAG_RUNNING)
+ if (wc->tspans[2]->span.flags & DAHDI_FLAG_RUNNING)
t4_queue_work(wc->workq, &wc->tspans[2]->swork, 2 % cpus);
else
atomic_dec(&wc->worklist);
- if (wc->tspans[3]->span.flags & ZT_FLAG_RUNNING)
+ if (wc->tspans[3]->span.flags & DAHDI_FLAG_RUNNING)
t4_queue_work(wc->workq, &wc->tspans[3]->swork, 3 % cpus);
else
atomic_dec(&wc->worklist);
@@ -3042,7 +3042,7 @@ static int t4_reset_dma(struct t4 *wc)
/* Turn it all back on */
t4_pci_out(wc, WC_RDADDR, wc->readdma);
t4_pci_out(wc, WC_WRADDR, wc->writedma);
- t4_pci_out(wc, WC_COUNT, ((ZT_MAX_CHUNKSIZE * 2 * 32 - 1) << 18) | ((ZT_MAX_CHUNKSIZE * 2 * 32 - 1) << 2));
+ t4_pci_out(wc, WC_COUNT, ((DAHDI_MAX_CHUNKSIZE * 2 * 32 - 1) << 18) | ((DAHDI_MAX_CHUNKSIZE * 2 * 32 - 1) << 2));
t4_pci_out(wc, WC_INTR, 0);
#ifdef VPM_SUPPORT
wc->dmactrl = 0xc0000000 | (1 << 29) | wc->vpm;
@@ -3442,7 +3442,7 @@ static int t4_hardware_init_1(struct t4 *wc, unsigned int cardflags)
if (cardflags & FLAG_2NDGEN) {
t4_tsi_reset(wc);
} else {
- t4_pci_out(wc, WC_COUNT, ((ZT_MAX_CHUNKSIZE * 2 * 32 - 1) << 18) | ((ZT_MAX_CHUNKSIZE * 2 * 32 - 1) << 2));
+ t4_pci_out(wc, WC_COUNT, ((DAHDI_MAX_CHUNKSIZE * 2 * 32 - 1) << 18) | ((DAHDI_MAX_CHUNKSIZE * 2 * 32 - 1) << 2));
}
/* Reset pending interrupts */
@@ -3484,7 +3484,7 @@ static int __devinit t4_launch(struct t4 *wc)
{
int x;
unsigned long flags;
- if (wc->tspans[0]->span.flags & ZT_FLAG_REGISTERED)
+ if (wc->tspans[0]->span.flags & DAHDI_FLAG_REGISTERED)
return 0;
printk("TE%dXXP: Launching card: %d\n", wc->numspans, wc->order);
@@ -3492,28 +3492,28 @@ static int __devinit t4_launch(struct t4 *wc)
for (x=0;x<4;x++)
t4_serial_setup(wc, x);
- if (zt_register(&wc->tspans[0]->span, 0)) {
+ if (dahdi_register(&wc->tspans[0]->span, 0)) {
printk(KERN_ERR "Unable to register span %s\n", wc->tspans[0]->span.name);
return -1;
}
- if (zt_register(&wc->tspans[1]->span, 0)) {
+ if (dahdi_register(&wc->tspans[1]->span, 0)) {
printk(KERN_ERR "Unable to register span %s\n", wc->tspans[1]->span.name);
- zt_unregister(&wc->tspans[0]->span);
+ dahdi_unregister(&wc->tspans[0]->span);
return -1;
}
if (wc->numspans == 4) {
- if (zt_register(&wc->tspans[2]->span, 0)) {
+ if (dahdi_register(&wc->tspans[2]->span, 0)) {
printk(KERN_ERR "Unable to register span %s\n", wc->tspans[2]->span.name);
- zt_unregister(&wc->tspans[0]->span);
- zt_unregister(&wc->tspans[1]->span);
+ dahdi_unregister(&wc->tspans[0]->span);
+ dahdi_unregister(&wc->tspans[1]->span);
return -1;
}
- if (zt_register(&wc->tspans[3]->span, 0)) {
+ if (dahdi_register(&wc->tspans[3]->span, 0)) {
printk(KERN_ERR "Unable to register span %s\n", wc->tspans[3]->span.name);
- zt_unregister(&wc->tspans[0]->span);
- zt_unregister(&wc->tspans[1]->span);
- zt_unregister(&wc->tspans[2]->span);
+ dahdi_unregister(&wc->tspans[0]->span);
+ dahdi_unregister(&wc->tspans[1]->span);
+ dahdi_unregister(&wc->tspans[2]->span);
return -1;
}
}
@@ -3547,9 +3547,9 @@ static int __devinit t4_init_one(struct pci_dev *pdev, const struct pci_device_i
spin_lock_init(&wc->reglock);
dt = (struct devtype *)(ent->driver_data);
if (dt->flags & FLAG_2NDGEN)
- basesize = ZT_MAX_CHUNKSIZE * 32 * 4;
+ basesize = DAHDI_MAX_CHUNKSIZE * 32 * 4;
else
- basesize = ZT_MAX_CHUNKSIZE * 32 * 2 * 4;
+ basesize = DAHDI_MAX_CHUNKSIZE * 32 * 2 * 4;
if (dt->flags & FLAG_2PORT)
wc->numspans = 2;
@@ -3592,9 +3592,9 @@ static int __devinit t4_init_one(struct pci_dev *pdev, const struct pci_device_i
memset((void *)wc->writechunk,0x00, basesize);
memset((void *)wc->readchunk,0xff, basesize);
#if 0
- memset((void *)wc->readchunk,0xff,ZT_MAX_CHUNKSIZE * 2 * 32 * 4);
+ memset((void *)wc->readchunk,0xff,DAHDI_MAX_CHUNKSIZE * 2 * 32 * 4);
/* Initialize canary */
- canary = (unsigned int *)(wc->readchunk + ZT_CHUNKSIZE * 64 * 4 - 4);
+ canary = (unsigned int *)(wc->readchunk + DAHDI_CHUNKSIZE * 64 * 4 - 4);
*canary = (CANARY << 16) | (0xffff);
#endif
@@ -3631,15 +3631,15 @@ static int __devinit t4_init_one(struct pci_dev *pdev, const struct pci_device_i
/* Allocate pieces we need here */
for (x=0;x<4;x++) {
if (wc->t1e1 & (1 << x)) {
- wc->tspans[x] = kmalloc(sizeof(struct t4_span) + sizeof(struct zt_chan) * 31, GFP_KERNEL);
+ wc->tspans[x] = kmalloc(sizeof(struct t4_span) + sizeof(struct dahdi_chan) * 31, GFP_KERNEL);
if (wc->tspans[x]) {
- memset(wc->tspans[x], 0, sizeof(struct t4_span) + sizeof(struct zt_chan) * 31);
+ memset(wc->tspans[x], 0, sizeof(struct t4_span) + sizeof(struct dahdi_chan) * 31);
wc->tspans[x]->spantype = TYPE_E1;
}
} else {
- wc->tspans[x] = kmalloc(sizeof(struct t4_span) + sizeof(struct zt_chan) * 24, GFP_KERNEL);
+ wc->tspans[x] = kmalloc(sizeof(struct t4_span) + sizeof(struct dahdi_chan) * 24, GFP_KERNEL);
if (wc->tspans[x]) {
- memset(wc->tspans[x], 0, sizeof(struct t4_span) + sizeof(struct zt_chan) * 24);
+ memset(wc->tspans[x], 0, sizeof(struct t4_span) + sizeof(struct dahdi_chan) * 24);
if (j1mode)
wc->tspans[x]->spantype = TYPE_J1;
else
@@ -3756,15 +3756,15 @@ static void __devexit t4_remove_one(struct pci_dev *pdev)
release_vpm450m(wc->vpm450m);
wc->vpm450m = NULL;
/* Unregister spans */
- if (wc->tspans[0]->span.flags & ZT_FLAG_REGISTERED)
- zt_unregister(&wc->tspans[0]->span);
- if (wc->tspans[1]->span.flags & ZT_FLAG_REGISTERED)
- zt_unregister(&wc->tspans[1]->span);
+ if (wc->tspans[0]->span.flags & DAHDI_FLAG_REGISTERED)
+ dahdi_unregister(&wc->tspans[0]->span);
+ if (wc->tspans[1]->span.flags & DAHDI_FLAG_REGISTERED)
+ dahdi_unregister(&wc->tspans[1]->span);
if (wc->numspans == 4) {
- if (wc->tspans[2]->span.flags & ZT_FLAG_REGISTERED)
- zt_unregister(&wc->tspans[2]->span);
- if (wc->tspans[3]->span.flags & ZT_FLAG_REGISTERED)
- zt_unregister(&wc->tspans[3]->span);
+ if (wc->tspans[2]->span.flags & DAHDI_FLAG_REGISTERED)
+ dahdi_unregister(&wc->tspans[2]->span);
+ if (wc->tspans[3]->span.flags & DAHDI_FLAG_REGISTERED)
+ dahdi_unregister(&wc->tspans[3]->span);
}
#ifdef ENABLE_WORKQUEUES
if (wc->workq) {
@@ -3781,7 +3781,7 @@ static void __devexit t4_remove_one(struct pci_dev *pdev)
pci_release_regions(pdev);
/* Immediately free resources */
- pci_free_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 32 * 4, (void *)wc->writechunk, wc->writedma);
+ pci_free_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 32 * 4, (void *)wc->writechunk, wc->writedma);
order_index[wc->order]--;
diff --git a/drivers/dahdi/wct4xxp/wct4xxp.h b/drivers/dahdi/wct4xxp/wct4xxp.h
index 7d14b85..60b8154 100644
--- a/drivers/dahdi/wct4xxp/wct4xxp.h
+++ b/drivers/dahdi/wct4xxp/wct4xxp.h
@@ -110,5 +110,5 @@ struct t4_regs {
#define T4_STOP_DMA 2
#define T4_CHECK_TIMING 3
-#define WCT4_GET_REGS _IOW (ZT_CODE, 60, struct t4_regs)
+#define WCT4_GET_REGS _IOW (DAHDI_CODE, 60, struct t4_regs)
diff --git a/drivers/dahdi/wctc4xxp/base.c b/drivers/dahdi/wctc4xxp/base.c
index 16043d1..8ad84f2 100644
--- a/drivers/dahdi/wctc4xxp/base.c
+++ b/drivers/dahdi/wctc4xxp/base.c
@@ -274,7 +274,7 @@
0x00,0x01, s&0x0F, 0x01, 0xFF,0xFF, 0x0A, 0x00, 0x00,0x06,0x09,0x04, 0x00,0x00, \
0x24,0x00, 0x00,0x00 }
-#define zt_send_cmd(wc, command, length, hex) \
+#define dahdi_send_cmd(wc, command, length, hex) \
({ \
int ret = 0; \
do { \
@@ -368,8 +368,8 @@ struct wcdte {
struct workqueue_struct *dte_wq;
struct work_struct dte_work;
- struct zt_transcoder *uencode;
- struct zt_transcoder *udecode;
+ struct dahdi_transcoder *uencode;
+ struct dahdi_transcoder *udecode;
};
struct wcdte_desc {
@@ -418,8 +418,8 @@ struct dte_state {
};
-static struct zt_transcoder *uencode;
-static struct zt_transcoder *udecode;
+static struct dahdi_transcoder *uencode;
+static struct dahdi_transcoder *udecode;
static struct dte_state *encoders;
static struct dte_state *decoders;
static int debug = 0;
@@ -490,7 +490,7 @@ static int __dump_descriptors(struct wcdte *wc)
}
/* Sanity check values */
-static inline int zt_tc_sanitycheck(struct zt_transcode_header *zth, unsigned int outbytes)
+static inline int dahdi_tc_sanitycheck(struct dahdi_transcode_header *zth, unsigned int outbytes)
{
if (zth->dstoffset >= sizeof(zth->dstdata))
return 0;
@@ -544,16 +544,16 @@ static unsigned int wcdte_zapfmt_to_dtefmt(unsigned int fmt)
switch(fmt)
{
- case ZT_FORMAT_G723_1:
+ case DAHDI_FORMAT_G723_1:
pt = DTE_FORMAT_G723_1;
break;
- case ZT_FORMAT_ULAW:
+ case DAHDI_FORMAT_ULAW:
pt = DTE_FORMAT_ULAW;
break;
- case ZT_FORMAT_ALAW:
+ case DAHDI_FORMAT_ALAW:
pt = DTE_FORMAT_ALAW;
break;
- case ZT_FORMAT_G729A:
+ case DAHDI_FORMAT_G729A:
pt = DTE_FORMAT_G729A;
break;
default:
@@ -673,11 +673,11 @@ static inline int transmit_demand(struct wcdte *wc)
return val;
}
-static int dte_operation(struct zt_transcoder_channel *ztc, int op)
+static int dte_operation(struct dahdi_transcoder_channel *ztc, int op)
{
- struct zt_transcoder_channel *compl_ztc;
+ struct dahdi_transcoder_channel *compl_ztc;
struct dte_state *st = ztc->pvt, *compl_st;
- struct zt_transcode_header *zth = ztc->tch;
+ struct dahdi_transcode_header *zth = ztc->tch;
struct wcdte *wc = st->wc;
unsigned char *chars;
unsigned int inbytes = 0;
@@ -686,7 +686,7 @@ static int dte_operation(struct zt_transcoder_channel *ztc, int op)
int res = 0;
unsigned int ipchksum, ndx;
switch(op) {
- case ZT_TCOP_ALLOCATE:
+ case DAHDI_TCOP_ALLOCATE:
down(&wc->chansem);
if (ztc->chan_built == 0)
{
@@ -714,7 +714,7 @@ static int dte_operation(struct zt_transcoder_channel *ztc, int op)
}
up(&wc->chansem);
break;
- case ZT_TCOP_RELEASE:
+ case DAHDI_TCOP_RELEASE:
down(&wc->chansem);
ndx = st->timeslot_in_num/2;
@@ -724,7 +724,7 @@ static int dte_operation(struct zt_transcoder_channel *ztc, int op)
compl_ztc = &(wc->uencode->channels[ndx]);
/* If the channel complement (other half of the encoder/decoder pair) is not being used... */
- if ((compl_ztc->flags & ZT_TC_FLAG_BUSY) == 0)
+ if ((compl_ztc->flags & DAHDI_TC_FLAG_BUSY) == 0)
{
if (st->encoder == 1)
wcdte_destroy_channel(wc, st->chan_in_num, st->chan_out_num);
@@ -747,27 +747,27 @@ static int dte_operation(struct zt_transcoder_channel *ztc, int op)
st->dte_seqno_rcv = 0;
up(&wc->chansem);
break;
- case ZT_TCOP_TRANSCODE:
- if ( (((zth->srcfmt == ZT_FORMAT_ULAW) || (zth->srcfmt == ZT_FORMAT_ALAW)) && ((zth->dstfmt == ZT_FORMAT_G729A && zth->srclen >= G729_SAMPLES) ||(zth->dstfmt == ZT_FORMAT_G723_1 && zth->srclen >= G723_SAMPLES)) )
- || ((zth->srcfmt == ZT_FORMAT_G729A) && (zth->srclen >= G729_BYTES))
- || ((zth->srcfmt == ZT_FORMAT_G723_1) && (zth->srclen >= G723_SID_BYTES)) )
+ case DAHDI_TCOP_TRANSCODE:
+ if ( (((zth->srcfmt == DAHDI_FORMAT_ULAW) || (zth->srcfmt == DAHDI_FORMAT_ALAW)) && ((zth->dstfmt == DAHDI_FORMAT_G729A && zth->srclen >= G729_SAMPLES) ||(zth->dstfmt == DAHDI_FORMAT_G723_1 && zth->srclen >= G723_SAMPLES)) )
+ || ((zth->srcfmt == DAHDI_FORMAT_G729A) && (zth->srclen >= G729_BYTES))
+ || ((zth->srcfmt == DAHDI_FORMAT_G723_1) && (zth->srclen >= G723_SID_BYTES)) )
{
do
{
chars = (unsigned char *)(zth->srcdata + zth->srcoffset);
- if ((zth->srcfmt == ZT_FORMAT_ULAW) || (zth->srcfmt == ZT_FORMAT_ALAW)) {
- if (zth->dstfmt == ZT_FORMAT_G729A) {
+ if ((zth->srcfmt == DAHDI_FORMAT_ULAW) || (zth->srcfmt == DAHDI_FORMAT_ALAW)) {
+ if (zth->dstfmt == DAHDI_FORMAT_G729A) {
inbytes = G729_SAMPLES;
timestamp_inc = G729_SAMPLES;
- } else if (zth->dstfmt == ZT_FORMAT_G723_1) {
+ } else if (zth->dstfmt == DAHDI_FORMAT_G723_1) {
inbytes = G723_SAMPLES;
timestamp_inc = G723_SAMPLES;
}
- } else if (zth->srcfmt == ZT_FORMAT_G729A) {
+ } else if (zth->srcfmt == DAHDI_FORMAT_G729A) {
inbytes = G729_BYTES;
timestamp_inc = G729_SAMPLES;
- } else if (zth->srcfmt == ZT_FORMAT_G723_1) {
+ } else if (zth->srcfmt == DAHDI_FORMAT_G723_1) {
/* determine the size of the frame */
switch (chars[0] & 0x03) {
case 0x00:
@@ -851,12 +851,12 @@ static int dte_operation(struct zt_transcoder_channel *ztc, int op)
zth->srcoffset += inbytes;
- } while ((((zth->srcfmt == ZT_FORMAT_ULAW) || (zth->srcfmt == ZT_FORMAT_ALAW)) && ((zth->dstfmt == ZT_FORMAT_G729A && zth->srclen >= G729_SAMPLES) ||(zth->dstfmt == ZT_FORMAT_G723_1 && zth->srclen >= G723_SAMPLES)) )
- || ((zth->srcfmt == ZT_FORMAT_G729A) && (zth->srclen >= G729_BYTES))
- || ((zth->srcfmt == ZT_FORMAT_G723_1) && (zth->srclen >= G723_SID_BYTES)) );
+ } while ((((zth->srcfmt == DAHDI_FORMAT_ULAW) || (zth->srcfmt == DAHDI_FORMAT_ALAW)) && ((zth->dstfmt == DAHDI_FORMAT_G729A && zth->srclen >= G729_SAMPLES) ||(zth->dstfmt == DAHDI_FORMAT_G723_1 && zth->srclen >= G723_SAMPLES)) )
+ || ((zth->srcfmt == DAHDI_FORMAT_G729A) && (zth->srclen >= G729_BYTES))
+ || ((zth->srcfmt == DAHDI_FORMAT_G723_1) && (zth->srclen >= G723_SID_BYTES)) );
} else {
- zt_transcoder_alert(ztc);
+ dahdi_transcoder_alert(ztc);
}
res = 0;
@@ -870,8 +870,8 @@ static void wcdte_stop_dma(struct wcdte *wc);
static inline void wcdte_receiveprep(struct wcdte *wc, int dbl)
{
volatile unsigned char *readchunk;
- struct zt_transcoder_channel *ztc = NULL;
- struct zt_transcode_header *zth = NULL;
+ struct dahdi_transcoder_channel *ztc = NULL;
+ struct dahdi_transcode_header *zth = NULL;
struct dte_state *st = NULL;
int o2,i;
unsigned char rseq, rcodec;
@@ -1036,7 +1036,7 @@ static inline void wcdte_receiveprep(struct wcdte *wc, int dbl)
if (rcodec == 0x00) /* ulaw */
{
- if (zt_tc_sanitycheck(zth, rlen) && ((zth->srcfmt == ZT_FORMAT_G729A && rlen == G729_SAMPLES) || (zth->srcfmt == ZT_FORMAT_G723_1 && rlen == G723_SAMPLES))) {
+ if (dahdi_tc_sanitycheck(zth, rlen) && ((zth->srcfmt == DAHDI_FORMAT_G729A && rlen == G729_SAMPLES) || (zth->srcfmt == DAHDI_FORMAT_G723_1 && rlen == G723_SAMPLES))) {
for (i = 0; i < rlen; i++)
chars[i] = readchunk[i+54];
@@ -1046,11 +1046,11 @@ static inline void wcdte_receiveprep(struct wcdte *wc, int dbl)
} else {
ztc->errorstatus = -EOVERFLOW;
}
- zt_transcoder_alert(ztc);
+ dahdi_transcoder_alert(ztc);
}
else if (rcodec == 0x08) /* alaw */
{
- if (zt_tc_sanitycheck(zth, rlen) && ((zth->srcfmt == ZT_FORMAT_G729A && rlen == G729_SAMPLES) || (zth->srcfmt == ZT_FORMAT_G723_1 && rlen == G723_SAMPLES))) {
+ if (dahdi_tc_sanitycheck(zth, rlen) && ((zth->srcfmt == DAHDI_FORMAT_G729A && rlen == G729_SAMPLES) || (zth->srcfmt == DAHDI_FORMAT_G723_1 && rlen == G723_SAMPLES))) {
for (i = 0; i < rlen; i++)
chars[i] = readchunk[i+54];
@@ -1061,11 +1061,11 @@ static inline void wcdte_receiveprep(struct wcdte *wc, int dbl)
} else {
ztc->errorstatus = -EOVERFLOW;
}
- zt_transcoder_alert(ztc);
+ dahdi_transcoder_alert(ztc);
}
else if (rcodec == 0x04) /* G.723.1 */
{
- if (zt_tc_sanitycheck(zth, rlen) &&
+ if (dahdi_tc_sanitycheck(zth, rlen) &&
((rlen == G723_6K_BYTES) || (rlen == G723_5K_BYTES) || (rlen == G723_SID_BYTES)))
{
for (i = 0; i < rlen; i++)
@@ -1080,12 +1080,12 @@ static inline void wcdte_receiveprep(struct wcdte *wc, int dbl)
if (!(zth->dstsamples % G723_SAMPLES))
{
- zt_transcoder_alert(ztc);
+ dahdi_transcoder_alert(ztc);
}
}
else if (rcodec == 0x12) /* G.729a */
{
- if (zt_tc_sanitycheck(zth, rlen) && (rlen == G729_BYTES))
+ if (dahdi_tc_sanitycheck(zth, rlen) && (rlen == G729_BYTES))
{
for (i = 0; i < rlen; i++)
chars[i] = readchunk[i+54];
@@ -1099,7 +1099,7 @@ static inline void wcdte_receiveprep(struct wcdte *wc, int dbl)
if (!(zth->dstsamples % G729_SAMPLES))
{
- zt_transcoder_alert(ztc);
+ dahdi_transcoder_alert(ztc);
}
}
}
@@ -1528,7 +1528,7 @@ static int wcdte_create_channel(struct wcdte *wc, int simple, int complicated, i
{
int length = 0;
unsigned char chan1, chan2;
- struct zt_transcoder_channel *ztc1, *ztc2;
+ struct dahdi_transcoder_channel *ztc1, *ztc2;
struct dte_state *st1, *st2;
if(complicated == DTE_FORMAT_G729A)
length = G729_LENGTH;
@@ -1536,13 +1536,13 @@ static int wcdte_create_channel(struct wcdte *wc, int simple, int complicated, i
length = G723_LENGTH;
/* Create complex channel */
- zt_send_cmd(wc, CMD_MSG_CREATE_CHANNEL(wc->seq_num++, part1_id), CMD_MSG_CREATE_CHANNEL_LEN, 0x0010);
- zt_send_cmd(wc, CMD_MSG_QUERY_CHANNEL(wc->seq_num++, part1_id), CMD_MSG_QUERY_CHANNEL_LEN, 0x0010);
+ dahdi_send_cmd(wc, CMD_MSG_CREATE_CHANNEL(wc->seq_num++, part1_id), CMD_MSG_CREATE_CHANNEL_LEN, 0x0010);
+ dahdi_send_cmd(wc, CMD_MSG_QUERY_CHANNEL(wc->seq_num++, part1_id), CMD_MSG_QUERY_CHANNEL_LEN, 0x0010);
chan1 = wc->last_rparm1;
/* Create simple channel */
- zt_send_cmd(wc, CMD_MSG_CREATE_CHANNEL(wc->seq_num++, part2_id), CMD_MSG_CREATE_CHANNEL_LEN, 0x0010);
- zt_send_cmd(wc, CMD_MSG_QUERY_CHANNEL(wc->seq_num++, part2_id), CMD_MSG_QUERY_CHANNEL_LEN, 0x0010);
+ dahdi_send_cmd(wc, CMD_MSG_CREATE_CHANNEL(wc->seq_num++, part2_id), CMD_MSG_CREATE_CHANNEL_LEN, 0x0010);
+ dahdi_send_cmd(wc, CMD_MSG_QUERY_CHANNEL(wc->seq_num++, part2_id), CMD_MSG_QUERY_CHANNEL_LEN, 0x0010);
chan2 = wc->last_rparm1;
ztc1 = &(wc->uencode->channels[part1_id/2]);
@@ -1551,25 +1551,25 @@ static int wcdte_create_channel(struct wcdte *wc, int simple, int complicated, i
st2 = ztc2->pvt;
/* Configure complex channel */
- zt_send_cmd(wc, CMD_MSG_SET_IP_HDR_CHANNEL(st1->cmd_seqno++, chan1, part2_id, part1_id), CMD_MSG_SET_IP_HDR_CHANNEL_LEN, 0x9000);
- zt_send_cmd(wc, CMD_MSG_VOIP_VCEOPT(st1->cmd_seqno++, chan1, length, 0), CMD_MSG_VOIP_VCEOPT_LEN, 0x8001);
+ dahdi_send_cmd(wc, CMD_MSG_SET_IP_HDR_CHANNEL(st1->cmd_seqno++, chan1, part2_id, part1_id), CMD_MSG_SET_IP_HDR_CHANNEL_LEN, 0x9000);
+ dahdi_send_cmd(wc, CMD_MSG_VOIP_VCEOPT(st1->cmd_seqno++, chan1, length, 0), CMD_MSG_VOIP_VCEOPT_LEN, 0x8001);
/* Configure simple channel */
- zt_send_cmd(wc, CMD_MSG_SET_IP_HDR_CHANNEL(st2->cmd_seqno++, chan2, part1_id, part2_id), CMD_MSG_SET_IP_HDR_CHANNEL_LEN, 0x9000);
- zt_send_cmd(wc, CMD_MSG_VOIP_VCEOPT(st2->cmd_seqno++, chan2, length, 0), CMD_MSG_VOIP_VCEOPT_LEN, 0x8001);
+ dahdi_send_cmd(wc, CMD_MSG_SET_IP_HDR_CHANNEL(st2->cmd_seqno++, chan2, part1_id, part2_id), CMD_MSG_SET_IP_HDR_CHANNEL_LEN, 0x9000);
+ dahdi_send_cmd(wc, CMD_MSG_VOIP_VCEOPT(st2->cmd_seqno++, chan2, length, 0), CMD_MSG_VOIP_VCEOPT_LEN, 0x8001);
#ifdef QUIET_DSP
- zt_send_cmd(wc, CMD_MSG_VOIP_TONECTL(st1->cmd_seqno++, chan1), CMD_MSG_VOIP_TONECTL_LEN, 0x805B);
- zt_send_cmd(wc, CMD_MSG_VOIP_DTMFOPT(st1->cmd_seqno++, chan1), CMD_MSG_VOIP_DTMFOPT_LEN, 0x8002);
- zt_send_cmd(wc, CMD_MSG_VOIP_TONECTL(st2->cmd_seqno++, chan2), CMD_MSG_VOIP_TONECTL_LEN, 0x805B);
- zt_send_cmd(wc, CMD_MSG_VOIP_DTMFOPT(st2->cmd_seqno++, chan2), CMD_MSG_VOIP_DTMFOPT_LEN, 0x8002);
- zt_send_cmd(wc, CMD_MSG_VOIP_INDCTRL(st1->cmd_seqno++, chan1), CMD_MSG_VOIP_INDCTRL_LEN, 0x8084);
- zt_send_cmd(wc, CMD_MSG_VOIP_INDCTRL(st2->cmd_seqno++, chan2), CMD_MSG_VOIP_INDCTRL_LEN, 0x8084);
+ dahdi_send_cmd(wc, CMD_MSG_VOIP_TONECTL(st1->cmd_seqno++, chan1), CMD_MSG_VOIP_TONECTL_LEN, 0x805B);
+ dahdi_send_cmd(wc, CMD_MSG_VOIP_DTMFOPT(st1->cmd_seqno++, chan1), CMD_MSG_VOIP_DTMFOPT_LEN, 0x8002);
+ dahdi_send_cmd(wc, CMD_MSG_VOIP_TONECTL(st2->cmd_seqno++, chan2), CMD_MSG_VOIP_TONECTL_LEN, 0x805B);
+ dahdi_send_cmd(wc, CMD_MSG_VOIP_DTMFOPT(st2->cmd_seqno++, chan2), CMD_MSG_VOIP_DTMFOPT_LEN, 0x8002);
+ dahdi_send_cmd(wc, CMD_MSG_VOIP_INDCTRL(st1->cmd_seqno++, chan1), CMD_MSG_VOIP_INDCTRL_LEN, 0x8084);
+ dahdi_send_cmd(wc, CMD_MSG_VOIP_INDCTRL(st2->cmd_seqno++, chan2), CMD_MSG_VOIP_INDCTRL_LEN, 0x8084);
#endif
- zt_send_cmd(wc, CMD_MSG_TRANS_CONNECT(wc->seq_num++, 1, chan1, chan2, complicated, simple), CMD_MSG_TRANS_CONNECT_LEN, 0x9322);
- zt_send_cmd(wc, CMD_MSG_VOIP_VOPENA(st1->cmd_seqno++, chan1, complicated), CMD_MSG_VOIP_VOPENA_LEN, 0x8000);
- zt_send_cmd(wc, CMD_MSG_VOIP_VOPENA(st2->cmd_seqno++, chan2, simple), CMD_MSG_VOIP_VOPENA_LEN, 0x8000);
+ dahdi_send_cmd(wc, CMD_MSG_TRANS_CONNECT(wc->seq_num++, 1, chan1, chan2, complicated, simple), CMD_MSG_TRANS_CONNECT_LEN, 0x9322);
+ dahdi_send_cmd(wc, CMD_MSG_VOIP_VOPENA(st1->cmd_seqno++, chan1, complicated), CMD_MSG_VOIP_VOPENA_LEN, 0x8000);
+ dahdi_send_cmd(wc, CMD_MSG_VOIP_VOPENA(st2->cmd_seqno++, chan2, simple), CMD_MSG_VOIP_VOPENA_LEN, 0x8000);
*dte_chan1 = chan1;
*dte_chan2 = chan2;
@@ -1579,7 +1579,7 @@ static int wcdte_create_channel(struct wcdte *wc, int simple, int complicated, i
static int wcdte_destroy_channel(struct wcdte *wc, unsigned int chan1, unsigned int chan2)
{
- struct zt_transcoder_channel *ztc1, *ztc2;
+ struct dahdi_transcoder_channel *ztc1, *ztc2;
struct dte_state *st1, *st2;
ztc1 = &(wc->uencode->channels[chan1/2]);
@@ -1588,15 +1588,15 @@ static int wcdte_destroy_channel(struct wcdte *wc, unsigned int chan1, unsigned
st2 = ztc2->pvt;
/* Turn off both channels */
- zt_send_cmd(wc, CMD_MSG_VOIP_VOPENA_CLOSE(st1->cmd_seqno++, chan1), CMD_MSG_VOIP_VOPENA_CLOSE_LEN, 0x8000);
- zt_send_cmd(wc, CMD_MSG_VOIP_VOPENA_CLOSE(st2->cmd_seqno++, chan2), CMD_MSG_VOIP_VOPENA_CLOSE_LEN, 0x8000);
+ dahdi_send_cmd(wc, CMD_MSG_VOIP_VOPENA_CLOSE(st1->cmd_seqno++, chan1), CMD_MSG_VOIP_VOPENA_CLOSE_LEN, 0x8000);
+ dahdi_send_cmd(wc, CMD_MSG_VOIP_VOPENA_CLOSE(st2->cmd_seqno++, chan2), CMD_MSG_VOIP_VOPENA_CLOSE_LEN, 0x8000);
/* Disconnect the channels */
- zt_send_cmd(wc, CMD_MSG_TRANS_CONNECT(wc->seq_num++, 0, chan1, chan2, 0, 0), CMD_MSG_TRANS_CONNECT_LEN, 0x9322);
+ dahdi_send_cmd(wc, CMD_MSG_TRANS_CONNECT(wc->seq_num++, 0, chan1, chan2, 0, 0), CMD_MSG_TRANS_CONNECT_LEN, 0x9322);
/* Remove the channels */
- zt_send_cmd(wc, CMD_MSG_DESTROY_CHANNEL(wc->seq_num++, chan1), CMD_MSG_DESTROY_CHANNEL_LEN, 0x0011);
- zt_send_cmd(wc, CMD_MSG_DESTROY_CHANNEL(wc->seq_num++, chan2), CMD_MSG_DESTROY_CHANNEL_LEN, 0x0011);
+ dahdi_send_cmd(wc, CMD_MSG_DESTROY_CHANNEL(wc->seq_num++, chan1), CMD_MSG_DESTROY_CHANNEL_LEN, 0x0011);
+ dahdi_send_cmd(wc, CMD_MSG_DESTROY_CHANNEL(wc->seq_num++, chan2), CMD_MSG_DESTROY_CHANNEL_LEN, 0x0011);
return 1;
}
@@ -1607,34 +1607,34 @@ static int __wcdte_setup_channels(struct wcdte *wc)
wc->seq_num = 6;
#ifndef USE_TEST_HW
- zt_send_cmd(wc, CMD_MSG_SET_ARM_CLK(wc->seq_num++), CMD_MSG_SET_ARM_CLK_LEN, 0x0411);
- zt_send_cmd(wc, CMD_MSG_SET_SPU_CLK(wc->seq_num++), CMD_MSG_SET_SPU_CLK_LEN, 0x0412);
+ dahdi_send_cmd(wc, CMD_MSG_SET_ARM_CLK(wc->seq_num++), CMD_MSG_SET_ARM_CLK_LEN, 0x0411);
+ dahdi_send_cmd(wc, CMD_MSG_SET_SPU_CLK(wc->seq_num++), CMD_MSG_SET_SPU_CLK_LEN, 0x0412);
#endif
#ifdef USE_TDM_CONFIG
- zt_send_cmd(wc, CMD_MSG_TDM_SELECT_BUS_MODE(wc->seq_num++), CMD_MSG_TDM_SELECT_BUS_MODE_LEN, 0x0417);
- zt_send_cmd(wc, CMD_MSG_TDM_ENABLE_BUS(wc->seq_num++), CMD_MSG_TDM_ENABLE_BUS_LEN, 0x0405);
- zt_send_cmd(wc, CMD_MSG_SUPVSR_SETUP_TDM_PARMS(wc->seq_num++, 0x03, 0x20, 0x00), CMD_MSG_SUPVSR_SETUP_TDM_PARMS_LEN, 0x0407);
- zt_send_cmd(wc, CMD_MSG_SUPVSR_SETUP_TDM_PARMS(wc->seq_num++, 0x04, 0x80, 0x04), CMD_MSG_SUPVSR_SETUP_TDM_PARMS_LEN, 0x0407);
- zt_send_cmd(wc, CMD_MSG_SUPVSR_SETUP_TDM_PARMS(wc->seq_num++, 0x05, 0x20, 0x08), CMD_MSG_SUPVSR_SETUP_TDM_PARMS_LEN, 0x0407);
- zt_send_cmd(wc, CMD_MSG_SUPVSR_SETUP_TDM_PARMS(wc->seq_num++, 0x06, 0x80, 0x0C), CMD_MSG_SUPVSR_SETUP_TDM_PARMS_LEN, 0x0407);
+ dahdi_send_cmd(wc, CMD_MSG_TDM_SELECT_BUS_MODE(wc->seq_num++), CMD_MSG_TDM_SELECT_BUS_MODE_LEN, 0x0417);
+ dahdi_send_cmd(wc, CMD_MSG_TDM_ENABLE_BUS(wc->seq_num++), CMD_MSG_TDM_ENABLE_BUS_LEN, 0x0405);
+ dahdi_send_cmd(wc, CMD_MSG_SUPVSR_SETUP_TDM_PARMS(wc->seq_num++, 0x03, 0x20, 0x00), CMD_MSG_SUPVSR_SETUP_TDM_PARMS_LEN, 0x0407);
+ dahdi_send_cmd(wc, CMD_MSG_SUPVSR_SETUP_TDM_PARMS(wc->seq_num++, 0x04, 0x80, 0x04), CMD_MSG_SUPVSR_SETUP_TDM_PARMS_LEN, 0x0407);
+ dahdi_send_cmd(wc, CMD_MSG_SUPVSR_SETUP_TDM_PARMS(wc->seq_num++, 0x05, 0x20, 0x08), CMD_MSG_SUPVSR_SETUP_TDM_PARMS_LEN, 0x0407);
+ dahdi_send_cmd(wc, CMD_MSG_SUPVSR_SETUP_TDM_PARMS(wc->seq_num++, 0x06, 0x80, 0x0C), CMD_MSG_SUPVSR_SETUP_TDM_PARMS_LEN, 0x0407);
#endif
- zt_send_cmd(wc, CMD_MSG_SET_ETH_HEADER(wc->seq_num++), CMD_MSG_SET_ETH_HEADER_LEN, 0x0100);
- zt_send_cmd(wc, CMD_MSG_IP_SERVICE_CONFIG(wc->seq_num++), CMD_MSG_IP_SERVICE_CONFIG_LEN, 0x0302);
- zt_send_cmd(wc, CMD_MSG_ARP_SERVICE_CONFIG(wc->seq_num++), CMD_MSG_ARP_SERVICE_CONFIG_LEN, 0x0105);
- zt_send_cmd(wc, CMD_MSG_ICMP_SERVICE_CONFIG(wc->seq_num++), CMD_MSG_ICMP_SERVICE_CONFIG_LEN, 0x0304);
+ dahdi_send_cmd(wc, CMD_MSG_SET_ETH_HEADER(wc->seq_num++), CMD_MSG_SET_ETH_HEADER_LEN, 0x0100);
+ dahdi_send_cmd(wc, CMD_MSG_IP_SERVICE_CONFIG(wc->seq_num++), CMD_MSG_IP_SERVICE_CONFIG_LEN, 0x0302);
+ dahdi_send_cmd(wc, CMD_MSG_ARP_SERVICE_CONFIG(wc->seq_num++), CMD_MSG_ARP_SERVICE_CONFIG_LEN, 0x0105);
+ dahdi_send_cmd(wc, CMD_MSG_ICMP_SERVICE_CONFIG(wc->seq_num++), CMD_MSG_ICMP_SERVICE_CONFIG_LEN, 0x0304);
#ifdef USE_TDM_CONFIG
- zt_send_cmd(wc, CMD_MSG_DEVICE_SET_COUNTRY_CODE(wc->seq_num++), CMD_MSG_DEVICE_SET_COUNTRY_CODE_LEN, 0x041B);
+ dahdi_send_cmd(wc, CMD_MSG_DEVICE_SET_COUNTRY_CODE(wc->seq_num++), CMD_MSG_DEVICE_SET_COUNTRY_CODE_LEN, 0x041B);
#endif
- zt_send_cmd(wc, CMD_MSG_SPU_FEATURES_CONTROL(wc->seq_num++, 0x02), CMD_MSG_SPU_FEATURES_CONTROL_LEN, 0x0013);
- zt_send_cmd(wc, CMD_MSG_IP_OPTIONS(wc->seq_num++), CMD_MSG_IP_OPTIONS_LEN, 0x0306);
- zt_send_cmd(wc, CMD_MSG_SPU_FEATURES_CONTROL(wc->seq_num++, 0x04), CMD_MSG_SPU_FEATURES_CONTROL_LEN, 0x0013);
+ dahdi_send_cmd(wc, CMD_MSG_SPU_FEATURES_CONTROL(wc->seq_num++, 0x02), CMD_MSG_SPU_FEATURES_CONTROL_LEN, 0x0013);
+ dahdi_send_cmd(wc, CMD_MSG_IP_OPTIONS(wc->seq_num++), CMD_MSG_IP_OPTIONS_LEN, 0x0306);
+ dahdi_send_cmd(wc, CMD_MSG_SPU_FEATURES_CONTROL(wc->seq_num++, 0x04), CMD_MSG_SPU_FEATURES_CONTROL_LEN, 0x0013);
#ifdef USE_TDM_CONFIG
- zt_send_cmd(wc, CMD_MSG_TDM_OPT(wc->seq_num++), CMD_MSG_TDM_OPT_LEN, 0x0435);
+ dahdi_send_cmd(wc, CMD_MSG_TDM_OPT(wc->seq_num++), CMD_MSG_TDM_OPT_LEN, 0x0435);
#endif
wc->timeout = HZ/10 + 1; /* 100msec */
@@ -1772,33 +1772,33 @@ static int __devinit wcdte_init_one(struct pci_dev *pdev, const struct pci_devic
if (!mode || strlen(mode) < 4) {
sprintf(wc->complexname, "G.729a / G.723.1");
- complexfmts = ZT_FORMAT_G729A | ZT_FORMAT_G723_1;
+ complexfmts = DAHDI_FORMAT_G729A | DAHDI_FORMAT_G723_1;
wc->numchannels = min_numchannels;
} else if (mode[3] == '9') { /* "G.729" */
sprintf(wc->complexname, "G.729a");
- complexfmts = ZT_FORMAT_G729A;
+ complexfmts = DAHDI_FORMAT_G729A;
wc->numchannels = g729_numchannels;
} else if (mode[3] == '3') { /* "G.723.1" */
sprintf(wc->complexname, "G.723.1");
- complexfmts = ZT_FORMAT_G723_1;
+ complexfmts = DAHDI_FORMAT_G723_1;
wc->numchannels = g723_numchannels;
} else {
sprintf(wc->complexname, "G.729a / G.723.1");
- complexfmts = ZT_FORMAT_G729A | ZT_FORMAT_G723_1;
+ complexfmts = DAHDI_FORMAT_G729A | DAHDI_FORMAT_G723_1;
wc->numchannels = min_numchannels;
}
- uencode = zt_transcoder_alloc(wc->numchannels);
- udecode = zt_transcoder_alloc(wc->numchannels);
+ uencode = dahdi_transcoder_alloc(wc->numchannels);
+ udecode = dahdi_transcoder_alloc(wc->numchannels);
encoders = vmalloc(sizeof(struct dte_state) * wc->numchannels);
decoders = vmalloc(sizeof(struct dte_state) * wc->numchannels);
memset(encoders, 0, sizeof(struct dte_state) * wc->numchannels);
memset(decoders, 0, sizeof(struct dte_state) * wc->numchannels);
if (!uencode || !udecode || !encoders || !decoders) {
if (uencode)
- zt_transcoder_free(uencode);
+ dahdi_transcoder_free(uencode);
if (udecode)
- zt_transcoder_free(udecode);
+ dahdi_transcoder_free(udecode);
if (encoders)
vfree(encoders);
if (decoders)
@@ -1809,7 +1809,7 @@ static int __devinit wcdte_init_one(struct pci_dev *pdev, const struct pci_devic
sprintf(uencode->name, "DTE Encoder");
udecode->srcfmts = uencode->dstfmts = complexfmts;
- udecode->dstfmts = uencode->srcfmts = ZT_FORMAT_ULAW | ZT_FORMAT_ALAW;
+ udecode->dstfmts = uencode->srcfmts = DAHDI_FORMAT_ULAW | DAHDI_FORMAT_ALAW;
udecode->operation = uencode->operation = dte_operation;
@@ -1825,8 +1825,8 @@ static int __devinit wcdte_init_one(struct pci_dev *pdev, const struct pci_devic
wc->uencode = uencode;
wc->udecode = udecode;
- zt_transcoder_register(uencode);
- zt_transcoder_register(udecode);
+ dahdi_transcoder_register(uencode);
+ dahdi_transcoder_register(udecode);
printk("Zaptel DTE (%s) Transcoder support LOADED (firm ver = %d.%d)\n", wc->complexname, dte_firmware_ver, dte_firmware_ver_minor);
@@ -1927,7 +1927,7 @@ static void __devexit wcdte_remove_one(struct pci_dev *pdev)
{
int i;
struct wcdte *wc = pci_get_drvdata(pdev);
- struct zt_transcoder_channel *ztc_en, *ztc_de;
+ struct dahdi_transcoder_channel *ztc_en, *ztc_de;
struct dte_state *st_en, *st_de;
if (wc) {
@@ -1949,10 +1949,10 @@ static void __devexit wcdte_remove_one(struct pci_dev *pdev)
}
}
- zt_transcoder_unregister(wc->udecode);
- zt_transcoder_unregister(wc->uencode);
- zt_transcoder_free(wc->uencode);
- zt_transcoder_free(wc->udecode);
+ dahdi_transcoder_unregister(wc->udecode);
+ dahdi_transcoder_unregister(wc->uencode);
+ dahdi_transcoder_free(wc->uencode);
+ dahdi_transcoder_free(wc->udecode);
vfree(wc->uencode->channels[0].pvt);
vfree(wc->udecode->channels[0].pvt);
diff --git a/drivers/dahdi/wctc4xxp/codec_test.c b/drivers/dahdi/wctc4xxp/codec_test.c
index 85a1d41..0afcebf 100644
--- a/drivers/dahdi/wctc4xxp/codec_test.c
+++ b/drivers/dahdi/wctc4xxp/codec_test.c
@@ -77,7 +77,7 @@ struct tcpvt {
int fd;
int fake;
int inuse;
- struct zt_transcode_header *hdr;
+ struct dahdi_transcode_header *hdr;
// struct ast_frame f;
};
@@ -96,7 +96,7 @@ struct tctest_info {
static int find_transcoders(struct tctest_info *tctest_info)
{
- struct zt_transcode_info info = { 0, };
+ struct dahdi_transcode_info info = { 0, };
int fd, res;
if ((fd = open("/dev/zap/transcode", O_RDWR)) < 0) {
@@ -105,8 +105,8 @@ static int find_transcoders(struct tctest_info *tctest_info)
}
tctest_info->total_chans = 0;
- info.op = ZT_TCOP_GETINFO;
- for (info.tcnum = 0; !(res = ioctl(fd, ZT_TRANSCODE_OP, &info)); info.tcnum++) {
+ info.op = DAHDI_TCOP_GETINFO;
+ for (info.tcnum = 0; !(res = ioctl(fd, DAHDI_TRANSCODE_OP, &info)); info.tcnum++) {
if (debug)
printf("Found transcoder %d, '%s' with %d channels.\n", info.tcnum, info.name, info.numchannels);
if ((info.tcnum % 2) == 0)
@@ -127,8 +127,8 @@ static int find_transcoders(struct tctest_info *tctest_info)
static int open_transcoder(struct tcpvt *ztp, int dest, int source)
{
int fd;
- unsigned int x = ZT_TCOP_ALLOCATE;
- struct zt_transcode_header *hdr;
+ unsigned int x = DAHDI_TCOP_ALLOCATE;
+ struct dahdi_transcode_header *hdr;
int flags;
if ((fd = open("/dev/zap/transcode", O_RDWR)) < 0)
@@ -146,7 +146,7 @@ static int open_transcoder(struct tcpvt *ztp, int dest, int source)
return -1;
}
- if (hdr->magic != ZT_TRANSCODE_MAGIC) {
+ if (hdr->magic != DAHDI_TRANSCODE_MAGIC) {
printf("Transcoder header (%08x) wasn't magic. Abandoning\n", hdr->magic);
munmap(hdr, sizeof(*hdr));
close(fd);
@@ -157,7 +157,7 @@ static int open_transcoder(struct tcpvt *ztp, int dest, int source)
hdr->srcfmt = source;
hdr->dstfmt = dest;
- if (ioctl(fd, ZT_TRANSCODE_OP, &x)) {
+ if (ioctl(fd, DAHDI_TRANSCODE_OP, &x)) {
printf("Unable to attach transcoder: %s\n", strerror(errno));
munmap(hdr, sizeof(*hdr));
close(fd);
@@ -176,8 +176,8 @@ static void close_transcoder(struct tcpvt *ztp)
{
unsigned int x;
- x = ZT_TCOP_RELEASE;
- if (ioctl(ztp->fd, ZT_TRANSCODE_OP, &x))
+ x = DAHDI_TCOP_RELEASE;
+ if (ioctl(ztp->fd, DAHDI_TRANSCODE_OP, &x))
printf("Failed to release transcoder channel: %s\n", strerror(errno));
munmap(ztp->hdr, sizeof(*ztp->hdr));
@@ -187,7 +187,7 @@ static void close_transcoder(struct tcpvt *ztp)
static int encode_packet(struct tcpvt *ztp, unsigned char *packet_in, unsigned char *packet_out)
{
- struct zt_transcode_header *hdr = ztp->hdr;
+ struct dahdi_transcode_header *hdr = ztp->hdr;
unsigned int x;
hdr->srcoffset = 0;
@@ -197,8 +197,8 @@ static int encode_packet(struct tcpvt *ztp, unsigned char *packet_in, unsigned c
hdr->dstoffset = AST_FRIENDLY_OFFSET;
- x = ZT_TCOP_TRANSCODE;
- if (ioctl(ztp->fd, ZT_TRANSCODE_OP, &x))
+ x = DAHDI_TCOP_TRANSCODE;
+ if (ioctl(ztp->fd, DAHDI_TRANSCODE_OP, &x))
printf("Failed to transcode: %s\n", strerror(errno));
usleep(20000);
diff --git a/drivers/dahdi/wctdm.c b/drivers/dahdi/wctdm.c
index 56db4b3..aa38945 100644
--- a/drivers/dahdi/wctdm.c
+++ b/drivers/dahdi/wctdm.c
@@ -198,7 +198,7 @@ enum battery_state {
struct wctdm {
struct pci_dev *dev;
char *variety;
- struct zt_span span;
+ struct dahdi_span span;
unsigned char ios;
int usecount;
unsigned int intcount;
@@ -255,7 +255,7 @@ struct wctdm {
dma_addr_t writedma;
volatile unsigned int *writechunk; /* Double-word aligned write memory */
volatile unsigned int *readchunk; /* Double-word aligned read memory */
- struct zt_chan chans[NUM_CARDS];
+ struct dahdi_chan chans[NUM_CARDS];
};
@@ -305,11 +305,11 @@ static inline void wctdm_transmitprep(struct wctdm *wc, unsigned char ints)
/* Write is at interrupt address. Start writing from normal offset */
writechunk = wc->writechunk;
else
- writechunk = wc->writechunk + ZT_CHUNKSIZE;
+ writechunk = wc->writechunk + DAHDI_CHUNKSIZE;
/* Calculate Transmission */
- zt_transmit(&wc->span);
+ dahdi_transmit(&wc->span);
- for (x=0;x<ZT_CHUNKSIZE;x++) {
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
/* Send a sample, as a 32-bit word */
writechunk[x] = 0;
#ifdef __BIG_ENDIAN
@@ -342,10 +342,10 @@ static inline void ring_check(struct wctdm *wc, int card)
short sample;
if (wc->modtype[card] != MOD_TYPE_FXO)
return;
- wc->mod[card].fxo.pegtimer += ZT_CHUNKSIZE;
- for (x=0;x<ZT_CHUNKSIZE;x++) {
+ wc->mod[card].fxo.pegtimer += DAHDI_CHUNKSIZE;
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
/* Look for pegging to indicate ringing */
- sample = ZT_XLAW(wc->chans[card].readchunk[x], (&(wc->chans[card])));
+ sample = DAHDI_XLAW(wc->chans[card].readchunk[x], (&(wc->chans[card])));
if ((sample > 10000) && (wc->mod[card].fxo.peg != 1)) {
if (debug > 1) printk("High peg!\n");
if ((wc->mod[card].fxo.pegtimer < PEGTIME) && (wc->mod[card].fxo.pegtimer > MINPEGTIME))
@@ -373,14 +373,14 @@ static inline void ring_check(struct wctdm *wc, int card)
if (debug)
printk("RING on %d/%d!\n", wc->span.spanno, card + 1);
if (!wc->mod[card].fxo.offhook)
- zt_hooksig(&wc->chans[card], ZT_RXSIG_RING);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_RING);
wc->mod[card].fxo.ring = 1;
}
if (wc->mod[card].fxo.ring && !wc->mod[card].fxo.pegcount) {
/* No more ring */
if (debug)
printk("NO RING on %d/%d!\n", wc->span.spanno, card + 1);
- zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_OFFHOOK);
wc->mod[card].fxo.ring = 0;
}
}
@@ -392,11 +392,11 @@ static inline void wctdm_receiveprep(struct wctdm *wc, unsigned char ints)
int x;
if (ints & 0x08)
- readchunk = wc->readchunk + ZT_CHUNKSIZE;
+ readchunk = wc->readchunk + DAHDI_CHUNKSIZE;
else
/* Read is at interrupt address. Valid data is available at normal offset */
readchunk = wc->readchunk;
- for (x=0;x<ZT_CHUNKSIZE;x++) {
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
#ifdef __BIG_ENDIAN
if (wc->cardflag & (1 << 3))
wc->chans[3].readchunk[x] = (readchunk[x]) & 0xff;
@@ -424,9 +424,9 @@ static inline void wctdm_receiveprep(struct wctdm *wc, unsigned char ints)
/* XXX We're wasting 8 taps. We should get closer :( */
for (x = 0; x < NUM_CARDS; x++) {
if (wc->cardflag & (1 << x))
- zt_ec_chunk(&wc->chans[x], wc->chans[x].readchunk, wc->chans[x].writechunk);
+ dahdi_ec_chunk(&wc->chans[x], wc->chans[x].readchunk, wc->chans[x].writechunk);
}
- zt_receive(&wc->span);
+ dahdi_receive(&wc->span);
}
static void wctdm_stop_dma(struct wctdm *wc);
@@ -782,7 +782,7 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
fxo->wasringing = 1;
if (debug)
printk("RING on %d/%d!\n", wc->span.spanno, card + 1);
- zt_hooksig(&wc->chans[card], ZT_RXSIG_RING);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_RING);
}
fxo->lastrdtx = res;
fxo->ringdebounce = 10;
@@ -791,7 +791,7 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
fxo->wasringing = 0;
if (debug)
printk("NO RING on %d/%d!\n", wc->span.spanno, card + 1);
- zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_OFFHOOK);
}
}
} else if (res && (fxo->battery == BATTERY_PRESENT)) {
@@ -801,22 +801,22 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
} else {
res = wc->reg0shadow[card];
if ((res & 0x60) && (fxo->battery == BATTERY_PRESENT)) {
- fxo->ringdebounce += (ZT_CHUNKSIZE * 16);
- if (fxo->ringdebounce >= ZT_CHUNKSIZE * ringdebounce) {
+ fxo->ringdebounce += (DAHDI_CHUNKSIZE * 16);
+ if (fxo->ringdebounce >= DAHDI_CHUNKSIZE * ringdebounce) {
if (!fxo->wasringing) {
fxo->wasringing = 1;
- zt_hooksig(&wc->chans[card], ZT_RXSIG_RING);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_RING);
if (debug)
printk("RING on %d/%d!\n", wc->span.spanno, card + 1);
}
- fxo->ringdebounce = ZT_CHUNKSIZE * ringdebounce;
+ fxo->ringdebounce = DAHDI_CHUNKSIZE * ringdebounce;
}
} else {
- fxo->ringdebounce -= ZT_CHUNKSIZE * 4;
+ fxo->ringdebounce -= DAHDI_CHUNKSIZE * 4;
if (fxo->ringdebounce <= 0) {
if (fxo->wasringing) {
fxo->wasringing = 0;
- zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_OFFHOOK);
if (debug)
printk("NO RING on %d/%d!\n", wc->span.spanno, card + 1);
}
@@ -851,7 +851,7 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
printk("NO BATTERY on %d/%d!\n", wc->span.spanno, card + 1);
#ifdef JAPAN
if (!wc->ohdebounce && wc->offhook) {
- zt_hooksig(&wc->chans[card], ZT_RXSIG_ONHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_ONHOOK);
if (debug)
printk("Signalled On Hook\n");
#ifdef ZERO_BATT_RING
@@ -859,7 +859,7 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
#endif
}
#else
- zt_hooksig(&wc->chans[card], ZT_RXSIG_ONHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_ONHOOK);
/* set the alarm timer, taking into account that part of its time
period has already passed while debouncing occurred */
fxo->battalarm = (battalarm - battdebounce) / MS_PER_CHECK_HOOK;
@@ -895,12 +895,12 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
#ifdef ZERO_BATT_RING
if (wc->onhook) {
wc->onhook = 0;
- zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_OFFHOOK);
if (debug)
printk("Signalled Off Hook\n");
}
#else
- zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_OFFHOOK);
#endif
/* set the alarm timer, taking into account that part of its time
period has already passed while debouncing occurred */
@@ -930,7 +930,7 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
if (--fxo->battalarm == 0) {
/* the alarm timer has expired, so update the battery alarm state
for this channel */
- zt_alarm_channel(&wc->chans[card], fxo->battery ? ZT_ALARM_NONE : ZT_ALARM_RED);
+ dahdi_alarm_channel(&wc->chans[card], fxo->battery ? DAHDI_ALARM_NONE : DAHDI_ALARM_RED);
}
}
@@ -942,7 +942,7 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
fxo->polarity,
fxo->lastpol);
if (fxo->polarity)
- zt_qevent_lock(&wc->chans[card], ZT_EVENT_POLARITY);
+ dahdi_qevent_lock(&wc->chans[card], DAHDI_EVENT_POLARITY);
fxo->polarity = fxo->lastpol;
}
}
@@ -968,7 +968,7 @@ static inline void wctdm_proslic_check_hook(struct wctdm *wc, int card)
#endif
} else {
if (wc->mod[card].fxs.debounce > 0) {
- wc->mod[card].fxs.debounce-= 16 * ZT_CHUNKSIZE;
+ wc->mod[card].fxs.debounce-= 16 * DAHDI_CHUNKSIZE;
#if 0
printk("Sustaining hook %d, %d\n", hook, wc->mod[card].fxs.debounce);
#endif
@@ -984,7 +984,7 @@ static inline void wctdm_proslic_check_hook(struct wctdm *wc, int card)
if (debug)
#endif
printk("wctdm: Card %d Going off hook\n", card);
- zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_OFFHOOK);
if (robust)
wctdm_init_proslic(wc, card, 1, 0, 1);
wc->mod[card].fxs.oldrxhook = 1;
@@ -995,7 +995,7 @@ static inline void wctdm_proslic_check_hook(struct wctdm *wc, int card)
if (debug)
#endif
printk("wctdm: Card %d Going on hook\n", card);
- zt_hooksig(&wc->chans[card], ZT_RXSIG_ONHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_ONHOOK);
wc->mod[card].fxs.oldrxhook = 0;
}
}
@@ -1053,7 +1053,7 @@ ZAP_IRQ_HANDLER(wctdm_interrupt)
wc->mod[x].fxs.idletxhookstate = 0x2;
} else {
if (wc->mod[x].fxs.ohttimer) {
- wc->mod[x].fxs.ohttimer-= ZT_CHUNKSIZE;
+ wc->mod[x].fxs.ohttimer-= DAHDI_CHUNKSIZE;
if (!wc->mod[x].fxs.ohttimer) {
if (reversepolarity)
wc->mod[x].fxs.idletxhookstate = 0x5; /* Switch to active */
@@ -1795,17 +1795,17 @@ static int wctdm_init_proslic(struct wctdm *wc, int card, int fast, int manual,
}
-static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data)
+static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long data)
{
struct wctdm_stats stats;
struct wctdm_regs regs;
struct wctdm_regop regop;
struct wctdm_echo_coefs echoregs;
- struct zt_hwgain hwgain;
+ struct dahdi_hwgain hwgain;
struct wctdm *wc = chan->pvt;
int x;
switch (cmd) {
- case ZT_ONHOOKTRANSFER:
+ case DAHDI_ONHOOKTRANSFER:
if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS)
return -EINVAL;
if (get_user(x, (int *)data))
@@ -1824,7 +1824,7 @@ static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
wctdm_setreg(wc, chan->chanpos - 1, 64, wc->mod[chan->chanpos - 1].fxs.lasttxhook);
}
break;
- case ZT_SETPOLARITY:
+ case DAHDI_SETPOLARITY:
if (get_user(x, (int *)data))
return -EFAULT;
if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS)
@@ -1909,8 +1909,8 @@ static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
}
break;
- case ZT_SET_HWGAIN:
- if (copy_from_user(&hwgain, (struct zt_hwgain*) data, sizeof(hwgain)))
+ case DAHDI_SET_HWGAIN:
+ if (copy_from_user(&hwgain, (struct dahdi_hwgain*) data, sizeof(hwgain)))
return -EFAULT;
wctdm_set_hwgain(wc, chan->chanpos-1, hwgain.newgain, hwgain.tx);
@@ -1926,7 +1926,7 @@ static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
}
-static int wctdm_open(struct zt_chan *chan)
+static int wctdm_open(struct dahdi_chan *chan)
{
struct wctdm *wc = chan->pvt;
if (!(wc->cardflag & (1 << (chan->chanpos - 1))))
@@ -1942,14 +1942,14 @@ static int wctdm_open(struct zt_chan *chan)
return 0;
}
-static int wctdm_watchdog(struct zt_span *span, int event)
+static int wctdm_watchdog(struct dahdi_span *span, int event)
{
printk("TDM: Restarting DMA\n");
wctdm_restart_dma(span->pvt);
return 0;
}
-static int wctdm_close(struct zt_chan *chan)
+static int wctdm_close(struct dahdi_chan *chan)
{
struct wctdm *wc = chan->pvt;
wc->usecount--;
@@ -1970,19 +1970,19 @@ static int wctdm_close(struct zt_chan *chan)
return 0;
}
-static int wctdm_hooksig(struct zt_chan *chan, zt_txsig_t txsig)
+static int wctdm_hooksig(struct dahdi_chan *chan, dahdi_txsig_t txsig)
{
struct wctdm *wc = chan->pvt;
int reg=0;
if (wc->modtype[chan->chanpos - 1] == MOD_TYPE_FXO) {
/* XXX Enable hooksig for FXO XXX */
switch(txsig) {
- case ZT_TXSIG_START:
- case ZT_TXSIG_OFFHOOK:
+ case DAHDI_TXSIG_START:
+ case DAHDI_TXSIG_OFFHOOK:
wc->mod[chan->chanpos - 1].fxo.offhook = 1;
wctdm_setreg(wc, chan->chanpos - 1, 5, 0x9);
break;
- case ZT_TXSIG_ONHOOK:
+ case DAHDI_TXSIG_ONHOOK:
wc->mod[chan->chanpos - 1].fxo.offhook = 0;
wctdm_setreg(wc, chan->chanpos - 1, 5, 0x8);
break;
@@ -1991,21 +1991,21 @@ static int wctdm_hooksig(struct zt_chan *chan, zt_txsig_t txsig)
}
} else {
switch(txsig) {
- case ZT_TXSIG_ONHOOK:
+ case DAHDI_TXSIG_ONHOOK:
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:
wc->mod[chan->chanpos-1].fxs.lasttxhook = wc->mod[chan->chanpos-1].fxs.idletxhookstate;
break;
- case ZT_SIG_FXOGS:
+ case DAHDI_SIG_FXOGS:
wc->mod[chan->chanpos-1].fxs.lasttxhook = 3;
break;
}
break;
- case ZT_TXSIG_OFFHOOK:
+ case DAHDI_TXSIG_OFFHOOK:
switch(chan->sig) {
- case ZT_SIG_EM:
+ case DAHDI_SIG_EM:
wc->mod[chan->chanpos-1].fxs.lasttxhook = 5;
break;
default:
@@ -2013,10 +2013,10 @@ static int wctdm_hooksig(struct zt_chan *chan, zt_txsig_t txsig)
break;
}
break;
- case ZT_TXSIG_START:
+ case DAHDI_TXSIG_START:
wc->mod[chan->chanpos-1].fxs.lasttxhook = 4;
break;
- case ZT_TXSIG_KEWL:
+ case DAHDI_TXSIG_KEWL:
wc->mod[chan->chanpos-1].fxs.lasttxhook = 0;
break;
default:
@@ -2045,13 +2045,13 @@ static int wctdm_initialize(struct wctdm *wc)
zap_copy_string(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype));
if (alawoverride) {
printk("ALAW override parameter detected. Device will be operating in ALAW\n");
- wc->span.deflaw = ZT_LAW_ALAW;
+ wc->span.deflaw = DAHDI_LAW_ALAW;
} else
- wc->span.deflaw = ZT_LAW_MULAW;
+ wc->span.deflaw = DAHDI_LAW_MULAW;
for (x = 0; x < NUM_CARDS; x++) {
sprintf(wc->chans[x].name, "WCTDM/%d/%d", wc->pos, x);
- wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM | ZT_SIG_CLEAR;
- wc->chans[x].sigcap |= ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF | ZT_SIG_CLEAR;
+ wc->chans[x].sigcap = DAHDI_SIG_FXOKS | DAHDI_SIG_FXOLS | DAHDI_SIG_FXOGS | DAHDI_SIG_SF | DAHDI_SIG_EM | DAHDI_SIG_CLEAR;
+ wc->chans[x].sigcap |= DAHDI_SIG_FXSKS | DAHDI_SIG_FXSLS | DAHDI_SIG_SF | DAHDI_SIG_CLEAR;
wc->chans[x].chanpos = x+1;
wc->chans[x].pvt = wc;
}
@@ -2061,13 +2061,13 @@ static int wctdm_initialize(struct wctdm *wc)
wc->span.irq = wc->dev->irq;
wc->span.open = wctdm_open;
wc->span.close = wctdm_close;
- wc->span.flags = ZT_FLAG_RBS;
+ wc->span.flags = DAHDI_FLAG_RBS;
wc->span.ioctl = wctdm_ioctl;
wc->span.watchdog = wctdm_watchdog;
init_waitqueue_head(&wc->span.maintq);
wc->span.pvt = wc;
- if (zt_register(&wc->span, 0)) {
+ if (dahdi_register(&wc->span, 0)) {
printk("Unable to register span with zaptel\n");
return -1;
}
@@ -2082,10 +2082,10 @@ static void wctdm_post_initialize(struct wctdm *wc)
for (x = 0; x < NUM_CARDS; x++) {
if (wc->cardflag & (1 << x)) {
if (wc->modtype[x] == MOD_TYPE_FXO)
- wc->chans[x].sigcap = ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF | ZT_SIG_CLEAR;
+ wc->chans[x].sigcap = DAHDI_SIG_FXSKS | DAHDI_SIG_FXSLS | DAHDI_SIG_SF | DAHDI_SIG_CLEAR;
else
- wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM | ZT_SIG_CLEAR;
- } else if (!(wc->chans[x].sigcap & ZT_SIG_BROKEN)) {
+ wc->chans[x].sigcap = DAHDI_SIG_FXOKS | DAHDI_SIG_FXOLS | DAHDI_SIG_FXOGS | DAHDI_SIG_SF | DAHDI_SIG_EM | DAHDI_SIG_CLEAR;
+ } else if (!(wc->chans[x].sigcap & DAHDI_SIG_BROKEN)) {
wc->chans[x].sigcap = 0;
}
}
@@ -2164,12 +2164,12 @@ static int wctdm_hardware_init(struct wctdm *wc)
/* Setup DMA Addresses */
outl(wc->writedma, wc->ioaddr + WC_DMAWS); /* Write start */
- outl(wc->writedma + ZT_CHUNKSIZE * 4 - 4, wc->ioaddr + WC_DMAWI); /* Middle (interrupt) */
- outl(wc->writedma + ZT_CHUNKSIZE * 8 - 4, wc->ioaddr + WC_DMAWE); /* End */
+ outl(wc->writedma + DAHDI_CHUNKSIZE * 4 - 4, wc->ioaddr + WC_DMAWI); /* Middle (interrupt) */
+ outl(wc->writedma + DAHDI_CHUNKSIZE * 8 - 4, wc->ioaddr + WC_DMAWE); /* End */
outl(wc->readdma, wc->ioaddr + WC_DMARS); /* Read start */
- outl(wc->readdma + ZT_CHUNKSIZE * 4 - 4, wc->ioaddr + WC_DMARI); /* Middle (interrupt) */
- outl(wc->readdma + ZT_CHUNKSIZE * 8 - 4, wc->ioaddr + WC_DMARE); /* End */
+ outl(wc->readdma + DAHDI_CHUNKSIZE * 4 - 4, wc->ioaddr + WC_DMARI); /* Middle (interrupt) */
+ outl(wc->readdma + DAHDI_CHUNKSIZE * 8 - 4, wc->ioaddr + WC_DMARE); /* End */
/* Clear interrupts */
outb(0xff, wc->ioaddr + WC_INTSTAT);
@@ -2203,7 +2203,7 @@ static int wctdm_hardware_init(struct wctdm *wc)
printk("Module %d: Installed -- MANUAL FXS\n",x);
} else {
printk("Module %d: FAILED FXS (%s)\n", x, fxshonormode ? fxo_modes[_opermode].name : "FCC");
- wc->chans[x].sigcap = __ZT_SIG_FXO | ZT_SIG_BROKEN;
+ wc->chans[x].sigcap = __DAHDI_SIG_FXO | DAHDI_SIG_BROKEN;
}
} else if (!(ret = wctdm_init_voicedaa(wc, x, 0, 0, sane))) {
wc->cardflag |= (1 << x);
@@ -2301,7 +2301,7 @@ static int __devinit wctdm_init_one(struct pci_dev *pdev, const struct pci_devic
/* Allocate enough memory for two zt chunks, receive and transmit. Each sample uses
32 bits. Allocate an extra set just for control too */
- wc->writechunk = pci_alloc_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, &wc->writedma);
+ wc->writechunk = pci_alloc_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, &wc->writedma);
if (!wc->writechunk) {
printk("wctdm: Unable to allocate DMA-able memory\n");
if (wc->freeregion)
@@ -2309,8 +2309,8 @@ static int __devinit wctdm_init_one(struct pci_dev *pdev, const struct pci_devic
return -ENOMEM;
}
- wc->readchunk = wc->writechunk + ZT_MAX_CHUNKSIZE * 2; /* in doublewords */
- wc->readdma = wc->writedma + ZT_MAX_CHUNKSIZE * 8; /* in bytes */
+ wc->readchunk = wc->writechunk + DAHDI_MAX_CHUNKSIZE * 2; /* in doublewords */
+ wc->readdma = wc->writedma + DAHDI_MAX_CHUNKSIZE * 8; /* in bytes */
if (wctdm_initialize(wc)) {
printk("wctdm: Unable to intialize FXS\n");
@@ -2321,7 +2321,7 @@ static int __devinit wctdm_init_one(struct pci_dev *pdev, const struct pci_devic
free_irq(pdev->irq, wc);
if (wc->freeregion)
release_region(wc->ioaddr, 0xff);
- pci_free_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)wc->writechunk, wc->writedma);
+ pci_free_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)wc->writechunk, wc->writedma);
kfree(wc);
return -EIO;
}
@@ -2336,7 +2336,7 @@ static int __devinit wctdm_init_one(struct pci_dev *pdev, const struct pci_devic
printk("wctdm: Unable to request IRQ %d\n", pdev->irq);
if (wc->freeregion)
release_region(wc->ioaddr, 0xff);
- pci_free_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)wc->writechunk, wc->writedma);
+ pci_free_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)wc->writechunk, wc->writedma);
pci_set_drvdata(pdev, NULL);
kfree(wc);
return -EIO;
@@ -2353,9 +2353,9 @@ static int __devinit wctdm_init_one(struct pci_dev *pdev, const struct pci_devic
free_irq(pdev->irq, wc);
if (wc->freeregion)
release_region(wc->ioaddr, 0xff);
- pci_free_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)wc->writechunk, wc->writedma);
+ pci_free_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)wc->writechunk, wc->writedma);
pci_set_drvdata(pdev, NULL);
- zt_unregister(&wc->span);
+ dahdi_unregister(&wc->span);
kfree(wc);
return -EIO;
@@ -2366,7 +2366,7 @@ static int __devinit wctdm_init_one(struct pci_dev *pdev, const struct pci_devic
/* Enable interrupts */
wctdm_enable_interrupts(wc);
/* Initialize Write/Buffers to all blank data */
- memset((void *)wc->writechunk,0,ZT_MAX_CHUNKSIZE * 2 * 2 * 4);
+ memset((void *)wc->writechunk,0,DAHDI_MAX_CHUNKSIZE * 2 * 2 * 4);
/* Start DMA */
wctdm_start_dma(wc);
@@ -2386,7 +2386,7 @@ static int __devinit wctdm_init_one(struct pci_dev *pdev, const struct pci_devic
static void wctdm_release(struct wctdm *wc)
{
- zt_unregister(&wc->span);
+ dahdi_unregister(&wc->span);
if (wc->freeregion)
release_region(wc->ioaddr, 0xff);
kfree(wc);
@@ -2406,7 +2406,7 @@ static void __devexit wctdm_remove_one(struct pci_dev *pdev)
wctdm_disable_interrupts(wc);
/* Immediately free resources */
- pci_free_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)wc->writechunk, wc->writedma);
+ pci_free_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)wc->writechunk, wc->writedma);
free_irq(pdev->irq, wc);
/* Reset PCI chip and registers */
diff --git a/drivers/dahdi/wctdm.h b/drivers/dahdi/wctdm.h
index 73703aa..144e838 100644
--- a/drivers/dahdi/wctdm.h
+++ b/drivers/dahdi/wctdm.h
@@ -60,10 +60,10 @@ struct wctdm_echo_coefs {
unsigned char coef8;
};
-#define WCTDM_GET_STATS _IOR (ZT_CODE, 60, struct wctdm_stats)
-#define WCTDM_GET_REGS _IOR (ZT_CODE, 61, struct wctdm_regs)
-#define WCTDM_SET_REG _IOW (ZT_CODE, 62, struct wctdm_regop)
-#define WCTDM_SET_ECHOTUNE _IOW (ZT_CODE, 63, struct wctdm_echo_coefs)
+#define WCTDM_GET_STATS _IOR (DAHDI_CODE, 60, struct wctdm_stats)
+#define WCTDM_GET_REGS _IOR (DAHDI_CODE, 61, struct wctdm_regs)
+#define WCTDM_SET_REG _IOW (DAHDI_CODE, 62, struct wctdm_regop)
+#define WCTDM_SET_ECHOTUNE _IOW (DAHDI_CODE, 63, struct wctdm_echo_coefs)
#endif /* _WCTDM_H */
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
index 4ca1353..b9c63fa 100644
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -666,10 +666,10 @@ static inline void wctdm_transmitprep(struct wctdm *wc, unsigned char *writechun
/* Calculate Transmission */
if (likely(wc->initialized)) {
- zt_transmit(&wc->span);
+ dahdi_transmit(&wc->span);
}
- for (x=0;x<ZT_CHUNKSIZE;x++) {
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
/* Send a sample, as a 32-bit word */
for (y=0;y < wc->cards;y++) {
if (!x) {
@@ -702,7 +702,7 @@ static inline void wctdm_transmitprep(struct wctdm *wc, unsigned char *writechun
cmd_dequeue_vpm150m(wc, writechunk, x);
}
#endif
- if (x < ZT_CHUNKSIZE - 1) {
+ if (x < DAHDI_CHUNKSIZE - 1) {
writechunk[EFRAME_SIZE] = wc->ctlreg;
writechunk[EFRAME_SIZE + 1] = wc->txident++;
#if 1
@@ -850,8 +850,8 @@ static inline void wctdm_receiveprep(struct wctdm *wc, unsigned char *readchunk)
BUG_ON(NULL == readchunk);
- for (x=0;x<ZT_CHUNKSIZE;x++) {
- if (x < ZT_CHUNKSIZE - 1) {
+ for (x=0;x<DAHDI_CHUNKSIZE;x++) {
+ if (x < DAHDI_CHUNKSIZE - 1) {
expected = wc->rxident+1;
wc->rxident = readchunk[EFRAME_SIZE + 1];
if (wc->rxident != expected) {
@@ -881,9 +881,9 @@ static inline void wctdm_receiveprep(struct wctdm *wc, unsigned char *readchunk)
if (likely(wc->initialized)) {
for (x=0;x<wc->type;x++) {
if (wc->cardflag & (1 << x))
- zt_ec_chunk(&wc->chans[x], wc->chans[x].readchunk, wc->chans[x].writechunk);
+ dahdi_ec_chunk(&wc->chans[x], wc->chans[x].readchunk, wc->chans[x].writechunk);
}
- zt_receive(&wc->span);
+ dahdi_receive(&wc->span);
}
/* Wake up anyone sleeping to read/write a new register */
wake_up_interruptible(&wc->regq);
@@ -1104,8 +1104,8 @@ static inline void wctdm_qrvdri_check_hook(struct wctdm *wc, int card)
{
b1 = wc->qrvhook[qrvcard + 2];
if (debug) printk("QRV channel %d rx state changed to %d\n",qrvcard,wc->qrvhook[qrvcard + 2]);
- zt_hooksig(&wc->chans[qrvcard],
- (b1) ? ZT_RXSIG_OFFHOOK : ZT_RXSIG_ONHOOK);
+ dahdi_hooksig(&wc->chans[qrvcard],
+ (b1) ? DAHDI_RXSIG_OFFHOOK : DAHDI_RXSIG_ONHOOK);
wc->qrvdebtime[card] = 0;
}
/* check for change in chan 1 */
@@ -1118,8 +1118,8 @@ if (debug) printk("QRV channel %d rx state changed to %d\n",qrvcard,wc->qrvhook[
{
b1 = wc->qrvhook[qrvcard + 3];
if (debug) printk("QRV channel %d rx state changed to %d\n",qrvcard + 1,wc->qrvhook[qrvcard + 3]);
- zt_hooksig(&wc->chans[qrvcard + 1],
- (b1) ? ZT_RXSIG_OFFHOOK : ZT_RXSIG_ONHOOK);
+ dahdi_hooksig(&wc->chans[qrvcard + 1],
+ (b1) ? DAHDI_RXSIG_OFFHOOK : DAHDI_RXSIG_ONHOOK);
wc->qrvdebtime[card] = 0;
}
return;
@@ -1152,7 +1152,7 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
fxo->wasringing = 1;
if (debug)
printk("RING on %d/%d!\n", wc->span.spanno, card + 1);
- zt_hooksig(&wc->chans[card], ZT_RXSIG_RING);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_RING);
}
fxo->lastrdtx = res;
fxo->ringdebounce = 10;
@@ -1161,7 +1161,7 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
fxo->wasringing = 0;
if (debug)
printk("NO RING on %d/%d!\n", wc->span.spanno, card + 1);
- zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_OFFHOOK);
}
}
} else if (res && (fxo->battery == BATTERY_PRESENT)) {
@@ -1171,22 +1171,22 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
} else {
res = wc->cmdq[card].isrshadow[0];
if ((res & 0x60) && (fxo->battery == BATTERY_PRESENT)) {
- fxo->ringdebounce += (ZT_CHUNKSIZE * 16);
- if (fxo->ringdebounce >= ZT_CHUNKSIZE * ringdebounce) {
+ fxo->ringdebounce += (DAHDI_CHUNKSIZE * 16);
+ if (fxo->ringdebounce >= DAHDI_CHUNKSIZE * ringdebounce) {
if (!fxo->wasringing) {
fxo->wasringing = 1;
- zt_hooksig(&wc->chans[card], ZT_RXSIG_RING);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_RING);
if (debug)
printk("RING on %d/%d!\n", wc->span.spanno, card + 1);
}
- fxo->ringdebounce = ZT_CHUNKSIZE * ringdebounce;
+ fxo->ringdebounce = DAHDI_CHUNKSIZE * ringdebounce;
}
} else {
- fxo->ringdebounce -= ZT_CHUNKSIZE * 4;
+ fxo->ringdebounce -= DAHDI_CHUNKSIZE * 4;
if (fxo->ringdebounce <= 0) {
if (fxo->wasringing) {
fxo->wasringing = 0;
- zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_OFFHOOK);
if (debug)
printk("NO RING on %d/%d!\n", wc->span.spanno, card + 1);
}
@@ -1229,7 +1229,7 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
printk("NO BATTERY on %d/%d!\n", wc->span.spanno, card + 1);
#ifdef JAPAN
if (!wc->ohdebounce && wc->offhook) {
- zt_hooksig(&wc->chans[card], ZT_RXSIG_ONHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_ONHOOK);
if (debug)
printk("Signalled On Hook\n");
#ifdef ZERO_BATT_RING
@@ -1237,7 +1237,7 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
#endif
}
#else
- zt_hooksig(&wc->chans[card], ZT_RXSIG_ONHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_ONHOOK);
/* set the alarm timer, taking into account that part of its time
period has already passed while debouncing occurred */
fxo->battalarm = (battalarm - battdebounce) / MS_PER_CHECK_HOOK;
@@ -1273,12 +1273,12 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
#ifdef ZERO_BATT_RING
if (wc->onhook) {
wc->onhook = 0;
- zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_OFFHOOK);
if (debug)
printk("Signalled Off Hook\n");
}
#else
- zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_OFFHOOK);
#endif
/* set the alarm timer, taking into account that part of its time
period has already passed while debouncing occurred */
@@ -1308,7 +1308,7 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
if (--fxo->battalarm == 0) {
/* the alarm timer has expired, so update the battery alarm state
for this channel */
- zt_alarm_channel(&wc->chans[card], fxo->battery ? ZT_ALARM_NONE : ZT_ALARM_RED);
+ dahdi_alarm_channel(&wc->chans[card], fxo->battery ? DAHDI_ALARM_NONE : DAHDI_ALARM_RED);
}
}
@@ -1321,7 +1321,7 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
fxo->polarity,
fxo->lastpol);
if (fxo->polarity)
- zt_qevent_lock(&wc->chans[card], ZT_EVENT_POLARITY);
+ dahdi_qevent_lock(&wc->chans[card], DAHDI_EVENT_POLARITY);
fxo->polarity = fxo->lastpol;
}
}
@@ -1348,7 +1348,7 @@ static inline void wctdm_proslic_check_hook(struct wctdm *wc, int card)
#endif
} else {
if (wc->mods[card].fxs.debounce > 0) {
- wc->mods[card].fxs.debounce-= 4 * ZT_CHUNKSIZE;
+ wc->mods[card].fxs.debounce-= 4 * DAHDI_CHUNKSIZE;
#if 0
printk("Sustaining hook %d, %d\n", hook, wc->mods[card].fxs.debounce);
#endif
@@ -1362,7 +1362,7 @@ static inline void wctdm_proslic_check_hook(struct wctdm *wc, int card)
/* Off hook */
if (debug & DEBUG_CARD)
printk("wctdm: Card %d Going off hook\n", card);
- zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_OFFHOOK);
if (robust)
wctdm_init_proslic(wc, card, 1, 0, 1);
wc->mods[card].fxs.oldrxhook = 1;
@@ -1371,7 +1371,7 @@ static inline void wctdm_proslic_check_hook(struct wctdm *wc, int card)
/* On hook */
if (debug & DEBUG_CARD)
printk("wctdm: Card %d Going on hook\n", card);
- zt_hooksig(&wc->chans[card], ZT_RXSIG_ONHOOK);
+ dahdi_hooksig(&wc->chans[card], DAHDI_RXSIG_ONHOOK);
wc->mods[card].fxs.oldrxhook = 0;
}
}
@@ -1402,7 +1402,7 @@ static inline void wctdm_vpm_check(struct wctdm *wc, int x)
#include "adt_lec.c"
-static int wctdm_echocan_with_params(struct zt_chan *chan, struct zt_echocanparams *ecp, struct zt_echocanparam *p)
+static int wctdm_echocan_with_params(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p)
{
struct wctdm *wc = chan->pvt;
@@ -1471,7 +1471,7 @@ static inline void wctdm_isr_misc(struct wctdm *wc)
wc->mods[x].fxs.idletxhookstate = 0x2; /* OHT mode when idle */
} else {
if (wc->mods[x].fxs.ohttimer) {
- wc->mods[x].fxs.ohttimer-= ZT_CHUNKSIZE;
+ wc->mods[x].fxs.ohttimer-= DAHDI_CHUNKSIZE;
if (!wc->mods[x].fxs.ohttimer) {
wc->mods[x].fxs.idletxhookstate = 0x1; /* Switch to active */
if (wc->mods[x].fxs.lasttxhook == 0x2) {
@@ -2256,7 +2256,7 @@ static int wctdm_init_qrvdri(struct wctdm *wc, int card)
return 0;
}
-static void qrv_dosetup(struct zt_chan *chan,struct wctdm *wc)
+static void qrv_dosetup(struct dahdi_chan *chan,struct wctdm *wc)
{
int qrvcard;
unsigned char r;
@@ -2315,22 +2315,22 @@ long l;
return;
}
-static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data)
+static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long data)
{
struct wctdm_stats stats;
struct wctdm_regs regs;
struct wctdm_regop regop;
struct wctdm_echo_coefs echoregs;
- struct zt_hwgain hwgain;
+ struct dahdi_hwgain hwgain;
struct wctdm *wc = chan->pvt;
int x;
union {
- struct zt_radio_stat s;
- struct zt_radio_param p;
+ struct dahdi_radio_stat s;
+ struct dahdi_radio_param p;
} stack;
switch (cmd) {
- case ZT_ONHOOKTRANSFER:
+ case DAHDI_ONHOOKTRANSFER:
if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS)
return -EINVAL;
if (get_user(x, (int *)data))
@@ -2420,8 +2420,8 @@ static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
}
break;
- case ZT_SET_HWGAIN:
- if (copy_from_user(&hwgain, (struct zt_hwgain*) data, sizeof(hwgain)))
+ case DAHDI_SET_HWGAIN:
+ if (copy_from_user(&hwgain, (struct dahdi_hwgain*) data, sizeof(hwgain)))
return -EFAULT;
wctdm_set_hwgain(wc, chan->chanpos-1, hwgain.newgain, hwgain.tx);
@@ -2431,19 +2431,19 @@ static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
chan->chanpos-1, hwgain.newgain, hwgain.tx ? "tx" : "rx");
break;
#ifdef VPM_SUPPORT
- case ZT_TONEDETECT:
+ case DAHDI_TONEDETECT:
if (get_user(x, (int *) data))
return -EFAULT;
if (!wc->vpm && !wc->vpm150m)
return -ENOSYS;
if ((wc->vpm || wc->vpm150m) && (x && !vpmdtmfsupport))
return -ENOSYS;
- if (x & ZT_TONEDETECT_ON) {
+ if (x & DAHDI_TONEDETECT_ON) {
set_bit(chan->chanpos - 1, &wc->dtmfmask);
} else {
clear_bit(chan->chanpos - 1, &wc->dtmfmask);
}
- if (x & ZT_TONEDETECT_MUTE) {
+ if (x & DAHDI_TONEDETECT_MUTE) {
if (wc->vpm150m) {
set_bit(chan->chanpos - 1, &wc->vpm150m->desireddtmfmutestate);
}
@@ -2454,25 +2454,25 @@ static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
}
return 0;
#endif
- case ZT_RADIO_GETPARAM:
+ case DAHDI_RADIO_GETPARAM:
if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_QRV)
return -ENOTTY;
- if (copy_from_user(&stack.p,(struct zt_radio_param *)data,sizeof(struct zt_radio_param))) return -EFAULT;
+ if (copy_from_user(&stack.p,(struct dahdi_radio_param *)data,sizeof(struct dahdi_radio_param))) return -EFAULT;
stack.p.data = 0; /* start with 0 value in output */
switch(stack.p.radpar) {
- case ZT_RADPAR_INVERTCOR:
+ case DAHDI_RADPAR_INVERTCOR:
if (wc->radmode[chan->chanpos - 1] & RADMODE_INVERTCOR)
stack.p.data = 1;
break;
- case ZT_RADPAR_IGNORECOR:
+ case DAHDI_RADPAR_IGNORECOR:
if (wc->radmode[chan->chanpos - 1] & RADMODE_IGNORECOR)
stack.p.data = 1;
break;
- case ZT_RADPAR_IGNORECT:
+ case DAHDI_RADPAR_IGNORECT:
if (wc->radmode[chan->chanpos - 1] & RADMODE_IGNORECT)
stack.p.data = 1;
break;
- case ZT_RADPAR_EXTRXTONE:
+ case DAHDI_RADPAR_EXTRXTONE:
stack.p.data = 0;
if (wc->radmode[chan->chanpos - 1] & RADMODE_EXTTONE)
{
@@ -2483,23 +2483,23 @@ static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
}
}
break;
- case ZT_RADPAR_DEBOUNCETIME:
+ case DAHDI_RADPAR_DEBOUNCETIME:
stack.p.data = wc->debouncetime[chan->chanpos - 1];
break;
- case ZT_RADPAR_RXGAIN:
+ case DAHDI_RADPAR_RXGAIN:
stack.p.data = wc->rxgain[chan->chanpos - 1] - 1199;
break;
- case ZT_RADPAR_TXGAIN:
+ case DAHDI_RADPAR_TXGAIN:
stack.p.data = wc->txgain[chan->chanpos - 1] - 3599;
break;
- case ZT_RADPAR_DEEMP:
+ case DAHDI_RADPAR_DEEMP:
stack.p.data = 0;
if (wc->radmode[chan->chanpos - 1] & RADMODE_DEEMP)
{
stack.p.data = 1;
}
break;
- case ZT_RADPAR_PREEMP:
+ case DAHDI_RADPAR_PREEMP:
stack.p.data = 0;
if (wc->radmode[chan->chanpos - 1] & RADMODE_PREEMP)
{
@@ -2509,32 +2509,32 @@ static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
default:
return -EINVAL;
}
- if (copy_to_user((struct zt_radio_param *)data,&stack.p,sizeof(struct zt_radio_param))) return -EFAULT;
+ if (copy_to_user((struct dahdi_radio_param *)data,&stack.p,sizeof(struct dahdi_radio_param))) return -EFAULT;
break;
- case ZT_RADIO_SETPARAM:
+ case DAHDI_RADIO_SETPARAM:
if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_QRV)
return -ENOTTY;
- if (copy_from_user(&stack.p,(struct zt_radio_param *)data,sizeof(struct zt_radio_param))) return -EFAULT;
+ if (copy_from_user(&stack.p,(struct dahdi_radio_param *)data,sizeof(struct dahdi_radio_param))) return -EFAULT;
switch(stack.p.radpar) {
- case ZT_RADPAR_INVERTCOR:
+ case DAHDI_RADPAR_INVERTCOR:
if (stack.p.data)
wc->radmode[chan->chanpos - 1] |= RADMODE_INVERTCOR;
else
wc->radmode[chan->chanpos - 1] &= ~RADMODE_INVERTCOR;
return 0;
- case ZT_RADPAR_IGNORECOR:
+ case DAHDI_RADPAR_IGNORECOR:
if (stack.p.data)
wc->radmode[chan->chanpos - 1] |= RADMODE_IGNORECOR;
else
wc->radmode[chan->chanpos - 1] &= ~RADMODE_IGNORECOR;
return 0;
- case ZT_RADPAR_IGNORECT:
+ case DAHDI_RADPAR_IGNORECT:
if (stack.p.data)
wc->radmode[chan->chanpos - 1] |= RADMODE_IGNORECT;
else
wc->radmode[chan->chanpos - 1] &= ~RADMODE_IGNORECT;
return 0;
- case ZT_RADPAR_EXTRXTONE:
+ case DAHDI_RADPAR_EXTRXTONE:
if (stack.p.data)
wc->radmode[chan->chanpos - 1] |= RADMODE_EXTTONE;
else
@@ -2544,10 +2544,10 @@ static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
else
wc->radmode[chan->chanpos - 1] &= ~RADMODE_EXTINVERT;
return 0;
- case ZT_RADPAR_DEBOUNCETIME:
+ case DAHDI_RADPAR_DEBOUNCETIME:
wc->debouncetime[chan->chanpos - 1] = stack.p.data;
return 0;
- case ZT_RADPAR_RXGAIN:
+ case DAHDI_RADPAR_RXGAIN:
/* if out of range */
if ((stack.p.data <= -1200) || (stack.p.data > 1552))
{
@@ -2555,7 +2555,7 @@ static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
}
wc->rxgain[chan->chanpos - 1] = stack.p.data + 1199;
break;
- case ZT_RADPAR_TXGAIN:
+ case DAHDI_RADPAR_TXGAIN:
/* if out of range */
if (wc->radmode[chan->chanpos -1] & RADMODE_PREEMP)
{
@@ -2573,14 +2573,14 @@ static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
}
wc->txgain[chan->chanpos - 1] = stack.p.data + 3599;
break;
- case ZT_RADPAR_DEEMP:
+ case DAHDI_RADPAR_DEEMP:
if (stack.p.data)
wc->radmode[chan->chanpos - 1] |= RADMODE_DEEMP;
else
wc->radmode[chan->chanpos - 1] &= ~RADMODE_DEEMP;
wc->rxgain[chan->chanpos - 1] = 1199;
break;
- case ZT_RADPAR_PREEMP:
+ case DAHDI_RADPAR_PREEMP:
if (stack.p.data)
wc->radmode[chan->chanpos - 1] |= RADMODE_PREEMP;
else
@@ -2598,7 +2598,7 @@ static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
return 0;
}
-static int wctdm_open(struct zt_chan *chan)
+static int wctdm_open(struct dahdi_chan *chan)
{
struct wctdm *wc = chan->pvt;
if (!(wc->cardflag & (1 << (chan->chanpos - 1))))
@@ -2614,13 +2614,13 @@ static int wctdm_open(struct zt_chan *chan)
return 0;
}
-static int wctdm_watchdog(struct zt_span *span, int event)
+static int wctdm_watchdog(struct dahdi_span *span, int event)
{
printk("TDM: Called watchdog\n");
return 0;
}
-static int wctdm_close(struct zt_chan *chan)
+static int wctdm_close(struct dahdi_chan *chan)
{
struct wctdm *wc = chan->pvt;
int x;
@@ -2658,18 +2658,18 @@ static int wctdm_close(struct zt_chan *chan)
return 0;
}
-static int wctdm_hooksig(struct zt_chan *chan, zt_txsig_t txsig)
+static int wctdm_hooksig(struct dahdi_chan *chan, dahdi_txsig_t txsig)
{
struct wctdm *wc = chan->pvt;
int reg=0,qrvcard;
if (wc->modtype[chan->chanpos - 1] == MOD_TYPE_QRV) {
qrvcard = (chan->chanpos - 1) & 0xfc;
switch(txsig) {
- case ZT_TXSIG_START:
- case ZT_TXSIG_OFFHOOK:
+ case DAHDI_TXSIG_START:
+ case DAHDI_TXSIG_OFFHOOK:
wc->qrvhook[chan->chanpos - 1] = 1;
break;
- case ZT_TXSIG_ONHOOK:
+ case DAHDI_TXSIG_ONHOOK:
wc->qrvhook[chan->chanpos - 1] = 0;
break;
default:
@@ -2682,13 +2682,13 @@ static int wctdm_hooksig(struct zt_chan *chan, zt_txsig_t txsig)
/* wctdm_setreg(wc, qrvcard, 3, reg); */
} else if (wc->modtype[chan->chanpos - 1] == MOD_TYPE_FXO) {
switch(txsig) {
- case ZT_TXSIG_START:
- case ZT_TXSIG_OFFHOOK:
+ case DAHDI_TXSIG_START:
+ case DAHDI_TXSIG_OFFHOOK:
wc->mods[chan->chanpos - 1].fxo.offhook = 1;
wc->sethook[chan->chanpos - 1] = CMD_WR(5, 0x9);
/* wctdm_setreg(wc, chan->chanpos - 1, 5, 0x9); */
break;
- case ZT_TXSIG_ONHOOK:
+ case DAHDI_TXSIG_ONHOOK:
wc->mods[chan->chanpos - 1].fxo.offhook = 0;
wc->sethook[chan->chanpos - 1] = CMD_WR(5, 0x8);
/* wctdm_setreg(wc, chan->chanpos - 1, 5, 0x8); */
@@ -2698,22 +2698,22 @@ static int wctdm_hooksig(struct zt_chan *chan, zt_txsig_t txsig)
}
} else {
switch(txsig) {
- case ZT_TXSIG_ONHOOK:
+ case DAHDI_TXSIG_ONHOOK:
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:
wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x10 |
wc->mods[chan->chanpos - 1].fxs.idletxhookstate;
break;
- case ZT_SIG_FXOGS:
+ case DAHDI_SIG_FXOGS:
wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x13;
break;
}
break;
- case ZT_TXSIG_OFFHOOK:
+ case DAHDI_TXSIG_OFFHOOK:
switch(chan->sig) {
- case ZT_SIG_EM:
+ case DAHDI_SIG_EM:
wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x15;
break;
default:
@@ -2722,10 +2722,10 @@ static int wctdm_hooksig(struct zt_chan *chan, zt_txsig_t txsig)
break;
}
break;
- case ZT_TXSIG_START:
+ case DAHDI_TXSIG_START:
wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x14;
break;
- case ZT_TXSIG_KEWL:
+ case DAHDI_TXSIG_KEWL:
wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x10;
break;
default:
@@ -2816,7 +2816,7 @@ static void wctdm_dacs_disconnect(struct wctdm *wc, int card)
}
}
-static int wctdm_dacs(struct zt_chan *dst, struct zt_chan *src)
+static int wctdm_dacs(struct dahdi_chan *dst, struct dahdi_chan *src)
{
struct wctdm *wc;
@@ -2852,13 +2852,13 @@ static int wctdm_initialize(struct wctdm *wc)
strncpy(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype) - 1);
if (alawoverride) {
printk("ALAW override parameter detected. Device will be operating in ALAW\n");
- wc->span.deflaw = ZT_LAW_ALAW;
+ wc->span.deflaw = DAHDI_LAW_ALAW;
} else
- wc->span.deflaw = ZT_LAW_MULAW;
+ wc->span.deflaw = DAHDI_LAW_MULAW;
for (x=0;x<wc->cards;x++) {
sprintf(wc->chans[x].name, "WCTDM/%d/%d", wc->pos, x);
- wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM | ZT_SIG_CLEAR;
- wc->chans[x].sigcap |= ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF | ZT_SIG_CLEAR;
+ wc->chans[x].sigcap = DAHDI_SIG_FXOKS | DAHDI_SIG_FXOLS | DAHDI_SIG_FXOGS | DAHDI_SIG_SF | DAHDI_SIG_EM | DAHDI_SIG_CLEAR;
+ wc->chans[x].sigcap |= DAHDI_SIG_FXSKS | DAHDI_SIG_FXSLS | DAHDI_SIG_SF | DAHDI_SIG_CLEAR;
wc->chans[x].chanpos = x+1;
wc->chans[x].pvt = wc;
}
@@ -2868,7 +2868,7 @@ static int wctdm_initialize(struct wctdm *wc)
wc->span.hooksig = wctdm_hooksig;
wc->span.open = wctdm_open;
wc->span.close = wctdm_close;
- wc->span.flags = ZT_FLAG_RBS;
+ wc->span.flags = DAHDI_FLAG_RBS;
wc->span.ioctl = wctdm_ioctl;
wc->span.watchdog = wctdm_watchdog;
wc->span.dacs= wctdm_dacs;
@@ -2889,12 +2889,12 @@ static void wctdm_post_initialize(struct wctdm *wc)
for (x = 0; x <wc->cards; x++) {
if (wc->cardflag & (1 << x)) {
if (wc->modtype[x] == MOD_TYPE_FXO)
- wc->chans[x].sigcap = ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF | ZT_SIG_CLEAR;
+ wc->chans[x].sigcap = DAHDI_SIG_FXSKS | DAHDI_SIG_FXSLS | DAHDI_SIG_SF | DAHDI_SIG_CLEAR;
else if (wc->modtype[x] == MOD_TYPE_FXS)
- wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM | ZT_SIG_CLEAR;
+ wc->chans[x].sigcap = DAHDI_SIG_FXOKS | DAHDI_SIG_FXOLS | DAHDI_SIG_FXOGS | DAHDI_SIG_SF | DAHDI_SIG_EM | DAHDI_SIG_CLEAR;
else if (wc->modtype[x] == MOD_TYPE_QRV)
- wc->chans[x].sigcap = ZT_SIG_SF | ZT_SIG_EM | ZT_SIG_CLEAR;
- } else if (!(wc->chans[x].sigcap & ZT_SIG_BROKEN)) {
+ wc->chans[x].sigcap = DAHDI_SIG_SF | DAHDI_SIG_EM | DAHDI_SIG_CLEAR;
+ } else if (!(wc->chans[x].sigcap & DAHDI_SIG_BROKEN)) {
wc->chans[x].sigcap = 0;
}
}
@@ -3044,7 +3044,7 @@ static void vpm150m_bh(struct work_struct *data)
printk("Channel %d: Detected DTMF tone %d of duration %d!!!\n", channel + 1, tone, duration);
if (test_bit(channel, &wc->dtmfmask) && (eventdata.toneEvent.ToneDuration > 0)) {
- struct zt_chan *chan = &wc->chans[channel];
+ struct dahdi_chan *chan = &wc->chans[channel];
if ((tone != EndofMFDigit) && (zaptone != 0)) {
vpm150m->curtone[channel] = tone;
@@ -3057,7 +3057,7 @@ static void vpm150m_bh(struct work_struct *data)
spin_lock_irqsave(&chan->lock, flags);
for (y = 0; y < chan->numbufs; y++) {
if ((chan->inreadbuf > -1) && (chan->readidx[y]))
- memset(chan->readbuf[chan->inreadbuf], ZT_XLAW(0, chan), chan->readidx[y]);
+ memset(chan->readbuf[chan->inreadbuf], DAHDI_XLAW(0, chan), chan->readidx[y]);
}
spin_unlock_irqrestore(&chan->lock, flags);
}
@@ -3065,12 +3065,12 @@ static void vpm150m_bh(struct work_struct *data)
if (debug & DEBUG_ECHOCAN)
printk("Queuing DTMFDOWN %c\n", zaptone);
set_bit(channel, &wc->dtmfactive);
- zt_qevent_lock(chan, (ZT_EVENT_DTMFDOWN | zaptone));
+ dahdi_qevent_lock(chan, (DAHDI_EVENT_DTMFDOWN | zaptone));
}
} else if ((tone == EndofMFDigit) && test_bit(channel, &wc->dtmfactive)) {
if (debug & DEBUG_ECHOCAN)
printk("Queuing DTMFUP %c\n", vpm150mtone_to_zaptone(vpm150m->curtone[channel]));
- zt_qevent_lock(chan, (ZT_EVENT_DTMFUP | vpm150mtone_to_zaptone(vpm150m->curtone[channel])));
+ dahdi_qevent_lock(chan, (DAHDI_EVENT_DTMFUP | vpm150mtone_to_zaptone(vpm150m->curtone[channel])));
clear_bit(channel, &wc->dtmfactive);
}
}
@@ -3682,7 +3682,7 @@ retry:
printk("Port %d: Installed -- MANUAL FXS\n",x + 1);
} else {
printk("Port %d: FAILED FXS (%s)\n", x + 1, fxshonormode ? fxo_modes[_opermode].name : "FCC");
- wc->chans[x].sigcap = ZT_SIG_BROKEN | __ZT_SIG_FXO;
+ wc->chans[x].sigcap = DAHDI_SIG_BROKEN | __DAHDI_SIG_FXO;
}
} else if (!(ret = wctdm_init_voicedaa(wc, x, 0, 0, sane))) {
wc->cardflag |= (1 << x);
@@ -3844,7 +3844,7 @@ retry:
wctdm_post_initialize(wc);
/* We should be ready for zaptel to come in now. */
- if (zt_register(&wc->span, 0)) {
+ if (dahdi_register(&wc->span, 0)) {
printk("Unable to register span with zaptel\n");
return -1;
}
@@ -3862,7 +3862,7 @@ static void wctdm_release(struct wctdm *wc)
int i;
if (wc->initialized) {
- zt_unregister(&wc->span);
+ dahdi_unregister(&wc->span);
}
voicebus_release(wc->vb);
diff --git a/drivers/dahdi/wctdm24xxp/wctdm24xxp.h b/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
index 87c8dee..dca7ae5 100644
--- a/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
+++ b/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
@@ -52,7 +52,7 @@
#define EFRAME_SIZE 108
#define ERING_SIZE 16 /* Maximum ring size */
#define EFRAME_GAP 20
-#define SFRAME_SIZE ((EFRAME_SIZE * ZT_CHUNKSIZE) + (EFRAME_GAP * (ZT_CHUNKSIZE - 1)))
+#define SFRAME_SIZE ((EFRAME_SIZE * DAHDI_CHUNKSIZE) + (EFRAME_GAP * (DAHDI_CHUNKSIZE - 1)))
#define MAX_ALARMS 10
@@ -184,7 +184,7 @@ enum battery_state {
struct wctdm {
char *variety;
char board_name[80];
- struct zt_span span;
+ struct dahdi_span span;
unsigned char ios;
unsigned int sdi;
int usecount;
@@ -266,7 +266,7 @@ struct wctdm {
#endif
#endif
struct voicebus *vb;
- struct zt_chan chans[NUM_CARDS];
+ struct dahdi_chan chans[NUM_CARDS];
int initialized;
};
diff --git a/drivers/dahdi/wcte11xp.c b/drivers/dahdi/wcte11xp.c
index db787dc..430d80a 100644
--- a/drivers/dahdi/wcte11xp.c
+++ b/drivers/dahdi/wcte11xp.c
@@ -177,11 +177,11 @@ struct t1 {
dma_addr_t writedma;
volatile unsigned char *writechunk; /* Double-word aligned write memory */
volatile unsigned char *readchunk; /* Double-word aligned read memory */
- unsigned char ec_chunk1[32][ZT_CHUNKSIZE];
- unsigned char ec_chunk2[32][ZT_CHUNKSIZE];
+ unsigned char ec_chunk1[32][DAHDI_CHUNKSIZE];
+ unsigned char ec_chunk2[32][DAHDI_CHUNKSIZE];
unsigned char tempo[33];
- struct zt_span span; /* Span */
- struct zt_chan chans[32]; /* Channels */
+ struct dahdi_span span; /* Span */
+ struct dahdi_chan chans[32]; /* Channels */
};
#define CANARY 0xca1e
@@ -229,7 +229,7 @@ static inline void __select_control(struct t1 *wc)
}
}
-static int t1xxp_open(struct zt_chan *chan)
+static int t1xxp_open(struct dahdi_chan *chan)
{
struct t1 *wc = chan->pvt;
if (wc->dead)
@@ -348,12 +348,12 @@ static inline void t1_framer_out(struct t1 *wc, const unsigned int addr, const u
static void t1xxp_release(struct t1 *wc)
{
- zt_unregister(&wc->span);
+ dahdi_unregister(&wc->span);
kfree(wc);
printk("Freed a Wildcard\n");
}
-static int t1xxp_close(struct zt_chan *chan)
+static int t1xxp_close(struct dahdi_chan *chan)
{
struct t1 *wc = chan->pvt;
wc->usecount--;
@@ -409,7 +409,7 @@ static void __t1xxp_set_clear(struct t1 *wc)
unsigned short val=0;
for (i=0;i<24;i++) {
j = (i/8);
- if (wc->span.chans[i].flags & ZT_FLAG_CLEAR)
+ if (wc->span.chans[i].flags & DAHDI_FLAG_CLEAR)
val |= 1 << (7 - (i % 8));
if ((i % 8)==7) {
if (debug > 1)
@@ -421,7 +421,7 @@ static void __t1xxp_set_clear(struct t1 *wc)
}
}
-static int t1xxp_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data)
+static int t1xxp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long data)
{
struct t4_regs regs;
int x;
@@ -450,28 +450,28 @@ static int t1xxp_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
return 0;
}
-static int t1xxp_maint(struct zt_span *span, int cmd)
+static int t1xxp_maint(struct dahdi_span *span, int cmd)
{
struct t1 *wc = span->pvt;
if (wc->spantype == TYPE_E1) {
switch(cmd) {
- case ZT_MAINT_NONE:
+ case DAHDI_MAINT_NONE:
printk("XXX Turn off local and remote loops E1 XXX\n");
break;
- case ZT_MAINT_LOCALLOOP:
+ case DAHDI_MAINT_LOCALLOOP:
printk("XXX Turn on local loopback E1 XXX\n");
break;
- case ZT_MAINT_REMOTELOOP:
+ case DAHDI_MAINT_REMOTELOOP:
printk("XXX Turn on remote loopback E1 XXX\n");
break;
- case ZT_MAINT_LOOPUP:
+ case DAHDI_MAINT_LOOPUP:
printk("XXX Send loopup code E1 XXX\n");
break;
- case ZT_MAINT_LOOPDOWN:
+ case DAHDI_MAINT_LOOPDOWN:
printk("XXX Send loopdown code E1 XXX\n");
break;
- case ZT_MAINT_LOOPSTOP:
+ case DAHDI_MAINT_LOOPSTOP:
printk("XXX Stop sending loop codes E1 XXX\n");
break;
default:
@@ -480,22 +480,22 @@ static int t1xxp_maint(struct zt_span *span, int cmd)
}
} else {
switch(cmd) {
- case ZT_MAINT_NONE:
+ case DAHDI_MAINT_NONE:
printk("XXX Turn off local and remote loops T1 XXX\n");
break;
- case ZT_MAINT_LOCALLOOP:
+ case DAHDI_MAINT_LOCALLOOP:
printk("XXX Turn on local loop and no remote loop XXX\n");
break;
- case ZT_MAINT_REMOTELOOP:
+ case DAHDI_MAINT_REMOTELOOP:
printk("XXX Turn on remote loopup XXX\n");
break;
- case ZT_MAINT_LOOPUP:
+ case DAHDI_MAINT_LOOPUP:
t1_framer_out(wc, 0x21, 0x50); /* FMR5: Nothing but RBS mode */
break;
- case ZT_MAINT_LOOPDOWN:
+ case DAHDI_MAINT_LOOPDOWN:
t1_framer_out(wc, 0x21, 0x60); /* FMR5: Nothing but RBS mode */
break;
- case ZT_MAINT_LOOPSTOP:
+ case DAHDI_MAINT_LOOPSTOP:
t1_framer_out(wc, 0x21, 0x40); /* FMR5: Nothing but RBS mode */
break;
default:
@@ -506,7 +506,7 @@ static int t1xxp_maint(struct zt_span *span, int cmd)
return 0;
}
-static int t1xxp_rbsbits(struct zt_chan *chan, int bits)
+static int t1xxp_rbsbits(struct dahdi_chan *chan, int bits)
{
u_char m,c;
int n,b;
@@ -530,7 +530,7 @@ static int t1xxp_rbsbits(struct zt_chan *chan, int bits)
wc->txsigs[b] = c;
/* output them to the chip */
__t1_framer_out(wc,0x71 + b,c);
- } else if (wc->span.lineconfig & ZT_CONFIG_D4) {
+ } else if (wc->span.lineconfig & DAHDI_CONFIG_D4) {
n = chan->chanpos - 1;
b = (n/4);
c = wc->txsigs[b];
@@ -541,7 +541,7 @@ static int t1xxp_rbsbits(struct zt_chan *chan, int bits)
/* output them to the chip */
__t1_framer_out(wc,0x70 + b,c);
__t1_framer_out(wc,0x70 + b + 6,c);
- } else if (wc->span.lineconfig & ZT_CONFIG_ESF) {
+ } else if (wc->span.lineconfig & DAHDI_CONFIG_ESF) {
n = chan->chanpos - 1;
b = (n/2);
c = wc->txsigs[b];
@@ -563,7 +563,7 @@ static void t1_check_sigbits(struct t1 *wc)
int a,i,rxs;
unsigned long flags;
- if (!(wc->span.flags & ZT_FLAG_RUNNING))
+ if (!(wc->span.flags & DAHDI_FLAG_RUNNING))
return;
spin_lock_irqsave(&wc->lock, flags);
@@ -573,55 +573,55 @@ static void t1_check_sigbits(struct t1 *wc)
a = __t1_framer_in(wc, 0x71 + i);
/* Get high channel in low bits */
rxs = (a & 0xf);
- if (!(wc->span.chans[i+16].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->span.chans[i+16].sig & DAHDI_SIG_CLEAR)) {
if (wc->span.chans[i+16].rxsig != rxs) {
spin_unlock_irqrestore(&wc->lock, flags);
- zt_rbsbits(&wc->span.chans[i+16], rxs);
+ dahdi_rbsbits(&wc->span.chans[i+16], rxs);
spin_lock_irqsave(&wc->lock, flags);
}
}
rxs = (a >> 4) & 0xf;
- if (!(wc->span.chans[i].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->span.chans[i].sig & DAHDI_SIG_CLEAR)) {
if (wc->span.chans[i].rxsig != rxs) {
spin_unlock_irqrestore(&wc->lock, flags);
- zt_rbsbits(&wc->span.chans[i], rxs);
+ dahdi_rbsbits(&wc->span.chans[i], rxs);
spin_lock_irqsave(&wc->lock, flags);
}
}
}
- } else if (wc->span.lineconfig & ZT_CONFIG_D4) {
+ } else if (wc->span.lineconfig & DAHDI_CONFIG_D4) {
for (i = 0; i < 24; i+=4) {
a = __t1_framer_in(wc, 0x70 + (i>>2));
/* Get high channel in low bits */
rxs = (a & 0x3) << 2;
- if (!(wc->span.chans[i+3].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->span.chans[i+3].sig & DAHDI_SIG_CLEAR)) {
if (wc->span.chans[i+3].rxsig != rxs) {
spin_unlock_irqrestore(&wc->lock, flags);
- zt_rbsbits(&wc->span.chans[i+3], rxs);
+ dahdi_rbsbits(&wc->span.chans[i+3], rxs);
spin_lock_irqsave(&wc->lock, flags);
}
}
rxs = (a & 0xc);
- if (!(wc->span.chans[i+2].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->span.chans[i+2].sig & DAHDI_SIG_CLEAR)) {
if (wc->span.chans[i+2].rxsig != rxs) {
spin_unlock_irqrestore(&wc->lock, flags);
- zt_rbsbits(&wc->span.chans[i+2], rxs);
+ dahdi_rbsbits(&wc->span.chans[i+2], rxs);
spin_lock_irqsave(&wc->lock, flags);
}
}
rxs = (a >> 2) & 0xc;
- if (!(wc->span.chans[i+1].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->span.chans[i+1].sig & DAHDI_SIG_CLEAR)) {
if (wc->span.chans[i+1].rxsig != rxs) {
spin_unlock_irqrestore(&wc->lock, flags);
- zt_rbsbits(&wc->span.chans[i+1], rxs);
+ dahdi_rbsbits(&wc->span.chans[i+1], rxs);
spin_lock_irqsave(&wc->lock, flags);
}
}
rxs = (a >> 4) & 0xc;
- if (!(wc->span.chans[i].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->span.chans[i].sig & DAHDI_SIG_CLEAR)) {
if (wc->span.chans[i].rxsig != rxs) {
spin_unlock_irqrestore(&wc->lock, flags);
- zt_rbsbits(&wc->span.chans[i], rxs);
+ dahdi_rbsbits(&wc->span.chans[i], rxs);
spin_lock_irqsave(&wc->lock, flags);
}
}
@@ -631,18 +631,18 @@ static void t1_check_sigbits(struct t1 *wc)
a = __t1_framer_in(wc, 0x70 + (i>>1));
/* Get high channel in low bits */
rxs = (a & 0xf);
- if (!(wc->span.chans[i+1].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->span.chans[i+1].sig & DAHDI_SIG_CLEAR)) {
if (wc->span.chans[i+1].rxsig != rxs) {
spin_unlock_irqrestore(&wc->lock, flags);
- zt_rbsbits(&wc->span.chans[i+1], rxs);
+ dahdi_rbsbits(&wc->span.chans[i+1], rxs);
spin_lock_irqsave(&wc->lock, flags);
}
}
rxs = (a >> 4) & 0xf;
- if (!(wc->span.chans[i].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->span.chans[i].sig & DAHDI_SIG_CLEAR)) {
if (wc->span.chans[i].rxsig != rxs) {
spin_unlock_irqrestore(&wc->lock, flags);
- zt_rbsbits(&wc->span.chans[i], rxs);
+ dahdi_rbsbits(&wc->span.chans[i], rxs);
spin_lock_irqsave(&wc->lock, flags);
}
}
@@ -730,14 +730,14 @@ static void __t1_configure_t1(struct t1 *wc, int lineconfig, int txlevel)
__t1_framer_out(wc, 0x1e, fmr2);
/* Configure line interface */
- if (lineconfig & ZT_CONFIG_AMI) {
+ if (lineconfig & DAHDI_CONFIG_AMI) {
line = "AMI";
fmr0 = 0xa0;
} else {
line = "B8ZS";
fmr0 = 0xf0;
}
- if (lineconfig & ZT_CONFIG_D4) {
+ if (lineconfig & DAHDI_CONFIG_D4) {
framing = "D4";
} else {
framing = "ESF";
@@ -801,7 +801,7 @@ static void __t1_configure_e1(struct t1 *wc, int lineconfig)
fmr2 |= 0x30;
if (loopback)
fmr2 |= 0x4;
- if (lineconfig & ZT_CONFIG_CRC4) {
+ if (lineconfig & DAHDI_CONFIG_CRC4) {
fmr1 |= 0x08; /* CRC4 transmit */
fmr2 |= 0xc0; /* CRC4 receive */
crc4 = "/CRC4";
@@ -810,14 +810,14 @@ static void __t1_configure_e1(struct t1 *wc, int lineconfig)
__t1_framer_out(wc, 0x1e, fmr2);
/* Configure line interface */
- if (lineconfig & ZT_CONFIG_AMI) {
+ if (lineconfig & DAHDI_CONFIG_AMI) {
line = "AMI";
fmr0 = 0xa0;
} else {
line = "HDB3";
fmr0 = 0xf0;
}
- if (lineconfig & ZT_CONFIG_CCS) {
+ if (lineconfig & DAHDI_CONFIG_CCS) {
framing = "CCS";
} else {
framing = "CAS";
@@ -866,9 +866,9 @@ static void __t1_configure_e1(struct t1 *wc, int lineconfig)
printk("TE110P: Span configured for %s/%s%s\n", framing, line, crc4);
}
-static void t1xxp_framer_start(struct t1 *wc, struct zt_span *span)
+static void t1xxp_framer_start(struct t1 *wc, struct dahdi_span *span)
{
- int alreadyrunning = wc->span.flags & ZT_FLAG_RUNNING;
+ int alreadyrunning = wc->span.flags & DAHDI_FLAG_RUNNING;
unsigned long flags;
spin_lock_irqsave(&wc->lock, flags);
@@ -881,25 +881,25 @@ static void t1xxp_framer_start(struct t1 *wc, struct zt_span *span)
}
if (!alreadyrunning)
- wc->span.flags |= ZT_FLAG_RUNNING;
+ wc->span.flags |= DAHDI_FLAG_RUNNING;
spin_unlock_irqrestore(&wc->lock, flags);
}
-static int t1xxp_startup(struct zt_span *span)
+static int t1xxp_startup(struct dahdi_span *span)
{
struct t1 *wc = span->pvt;
- int i,alreadyrunning = span->flags & ZT_FLAG_RUNNING;
+ int i,alreadyrunning = span->flags & DAHDI_FLAG_RUNNING;
/* initialize the start value for the entire chunk of last ec buffer */
for(i = 0; i < span->channels; i++)
{
memset(wc->ec_chunk1[i],
- ZT_LIN2X(0,&span->chans[i]),ZT_CHUNKSIZE);
+ DAHDI_LIN2X(0,&span->chans[i]),DAHDI_CHUNKSIZE);
memset(wc->ec_chunk2[i],
- ZT_LIN2X(0,&span->chans[i]),ZT_CHUNKSIZE);
+ DAHDI_LIN2X(0,&span->chans[i]),DAHDI_CHUNKSIZE);
}
/* Reset framer with proper parameters and start */
@@ -910,12 +910,12 @@ static int t1xxp_startup(struct zt_span *span)
/* Only if we're not already going */
t1xxp_enable_interrupts(wc);
t1xxp_start_dma(wc);
- span->flags |= ZT_FLAG_RUNNING;
+ span->flags |= DAHDI_FLAG_RUNNING;
}
return 0;
}
-static int t1xxp_shutdown(struct zt_span *span)
+static int t1xxp_shutdown(struct dahdi_span *span)
{
struct t1 *wc = span->pvt;
unsigned long flags;
@@ -924,17 +924,17 @@ static int t1xxp_shutdown(struct zt_span *span)
__t1_framer_out(wc, 0x46, 0x41); /* GCR: Interrupt on Activation/Deactivation of AIX, LOS */
__t1xxp_stop_dma(wc);
__t1xxp_disable_interrupts(wc);
- span->flags &= ~ZT_FLAG_RUNNING;
+ span->flags &= ~DAHDI_FLAG_RUNNING;
spin_unlock_irqrestore(&wc->lock, flags);
return 0;
}
-static int t1xxp_chanconfig(struct zt_chan *chan, int sigtype)
+static int t1xxp_chanconfig(struct dahdi_chan *chan, int sigtype)
{
struct t1 *wc = chan->pvt;
unsigned long flags;
- int alreadyrunning = chan->span->flags & ZT_FLAG_RUNNING;
+ int alreadyrunning = chan->span->flags & DAHDI_FLAG_RUNNING;
spin_lock_irqsave(&wc->lock, flags);
@@ -945,14 +945,14 @@ static int t1xxp_chanconfig(struct zt_chan *chan, int sigtype)
return 0;
}
-static int t1xxp_spanconfig(struct zt_span *span, struct zt_lineconfig *lc)
+static int t1xxp_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
{
struct t1 *wc = span->pvt;
/* Do we want to SYNC on receive or not */
wc->sync = lc->sync;
/* If already running, apply changes immediately */
- if (span->flags & ZT_FLAG_RUNNING)
+ if (span->flags & DAHDI_FLAG_RUNNING)
return t1xxp_startup(span);
return 0;
@@ -992,30 +992,30 @@ static int t1xxp_software_init(struct t1 *wc)
wc->span.channels = 32;
else
wc->span.channels = 31;
- wc->span.deflaw = ZT_LAW_ALAW;
+ wc->span.deflaw = DAHDI_LAW_ALAW;
wc->span.spantype = "E1";
- wc->span.linecompat = ZT_CONFIG_HDB3 | ZT_CONFIG_CCS | ZT_CONFIG_CRC4;
+ wc->span.linecompat = DAHDI_CONFIG_HDB3 | DAHDI_CONFIG_CCS | DAHDI_CONFIG_CRC4;
} else {
wc->span.channels = 24;
- wc->span.deflaw = ZT_LAW_MULAW;
+ wc->span.deflaw = DAHDI_LAW_MULAW;
wc->span.spantype = "T1";
- wc->span.linecompat = ZT_CONFIG_AMI | ZT_CONFIG_B8ZS | ZT_CONFIG_D4 | ZT_CONFIG_ESF;
+ wc->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_B8ZS | DAHDI_CONFIG_D4 | DAHDI_CONFIG_ESF;
}
wc->span.chans = wc->chans;
- wc->span.flags = ZT_FLAG_RBS;
+ wc->span.flags = DAHDI_FLAG_RBS;
wc->span.ioctl = t1xxp_ioctl;
wc->span.pvt = wc;
init_waitqueue_head(&wc->span.maintq);
for (x=0;x<wc->span.channels;x++) {
sprintf(wc->chans[x].name, "WCT1/%d/%d", wc->num, x + 1);
- wc->chans[x].sigcap = ZT_SIG_EM | ZT_SIG_CLEAR | ZT_SIG_EM_E1 |
- ZT_SIG_FXSLS | ZT_SIG_FXSGS | ZT_SIG_MTP2 |
- ZT_SIG_FXSKS | ZT_SIG_FXOLS | ZT_SIG_DACS_RBS |
- ZT_SIG_FXOGS | ZT_SIG_FXOKS | ZT_SIG_CAS | ZT_SIG_SF;
+ wc->chans[x].sigcap = DAHDI_SIG_EM | DAHDI_SIG_CLEAR | DAHDI_SIG_EM_E1 |
+ DAHDI_SIG_FXSLS | DAHDI_SIG_FXSGS | DAHDI_SIG_MTP2 |
+ DAHDI_SIG_FXSKS | DAHDI_SIG_FXOLS | DAHDI_SIG_DACS_RBS |
+ DAHDI_SIG_FXOGS | DAHDI_SIG_FXOKS | DAHDI_SIG_CAS | DAHDI_SIG_SF;
wc->chans[x].pvt = wc;
wc->chans[x].chanpos = x + 1;
}
- if (zt_register(&wc->span, 0)) {
+ if (dahdi_register(&wc->span, 0)) {
printk("Unable to register span with zaptel\n");
return -1;
}
@@ -1026,7 +1026,7 @@ static inline void __handle_leds(struct t1 *wc)
{
int oldreg;
- if (wc->span.alarms & (ZT_ALARM_RED | ZT_ALARM_BLUE)) {
+ if (wc->span.alarms & (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE)) {
/* Red/Blue alarm */
wc->blinktimer++;
#ifdef FANCY_ALARM
@@ -1052,7 +1052,7 @@ static inline void __handle_leds(struct t1 *wc)
wc->blinktimer = 0;
}
#endif
- } else if (wc->span.alarms & ZT_ALARM_YELLOW) {
+ } else if (wc->span.alarms & DAHDI_ALARM_YELLOW) {
/* Yellow Alarm */
if (!(wc->blinktimer % 2))
wc->ledtestreg = (wc->ledtestreg | BIT_LED1) & ~BIT_LED0;
@@ -1062,11 +1062,11 @@ static inline void __handle_leds(struct t1 *wc)
} else {
/* No Alarm */
oldreg = wc->ledtestreg;
- if (wc->span.maintstat != ZT_MAINT_NONE)
+ if (wc->span.maintstat != DAHDI_MAINT_NONE)
wc->ledtestreg |= BIT_TEST;
else
wc->ledtestreg &= ~BIT_TEST;
- if (wc->span.flags & ZT_FLAG_RUNNING)
+ if (wc->span.flags & DAHDI_FLAG_RUNNING)
wc->ledtestreg = (wc->ledtestreg | BIT_LED0) & ~BIT_LED1;
else
wc->ledtestreg = wc->ledtestreg & ~(BIT_LED0 | BIT_LED1);
@@ -1086,19 +1086,19 @@ static void t1xxp_transmitprep(struct t1 *wc, int ints)
txbuf = wc->writechunk;
} else {
/* Just finished sending second buffer, fill it now */
- txbuf = wc->writechunk + 32 * ZT_CHUNKSIZE;
+ txbuf = wc->writechunk + 32 * DAHDI_CHUNKSIZE;
}
- zt_transmit(&wc->span);
+ dahdi_transmit(&wc->span);
for (x=0;x<wc->offset;x++)
txbuf[x] = wc->tempo[x];
- for (y=0;y<ZT_CHUNKSIZE;y++) {
+ for (y=0;y<DAHDI_CHUNKSIZE;y++) {
for (x=0;x<wc->span.channels;x++) {
pos = y * 32 + wc->chanmap[x] + wc->offset;
/* Put channel number as outgoing data */
- if (pos < 32 * ZT_CHUNKSIZE)
+ if (pos < 32 * DAHDI_CHUNKSIZE)
txbuf[pos] = wc->chans[x].writechunk[y];
else
- wc->tempo[pos - 32 * ZT_CHUNKSIZE] = wc->chans[x].writechunk[y];
+ wc->tempo[pos - 32 * DAHDI_CHUNKSIZE] = wc->chans[x].writechunk[y];
}
}
}
@@ -1113,10 +1113,10 @@ static void t1xxp_receiveprep(struct t1 *wc, int ints)
if (ints & 0x04) {
/* Just received first buffer */
rxbuf = wc->readchunk;
- canary = (unsigned int *)(wc->readchunk + ZT_CHUNKSIZE * 64 - 4);
+ canary = (unsigned int *)(wc->readchunk + DAHDI_CHUNKSIZE * 64 - 4);
} else {
- rxbuf = wc->readchunk + ZT_CHUNKSIZE * 32;
- canary = (unsigned int *)(wc->readchunk + ZT_CHUNKSIZE * 32 - 4);
+ rxbuf = wc->readchunk + DAHDI_CHUNKSIZE * 32;
+ canary = (unsigned int *)(wc->readchunk + DAHDI_CHUNKSIZE * 32 - 4);
}
oldcan = *canary;
if (((oldcan & 0xffff0000) >> 16) != CANARY) {
@@ -1127,7 +1127,7 @@ static void t1xxp_receiveprep(struct t1 *wc, int ints)
if (debug) printk("Expecting bottom %d, got %d\n", wc->canary - 1, oldcan & 0xffff);
wc->span.irqmisses++;
}
- for (y=0;y<ZT_CHUNKSIZE;y++) {
+ for (y=0;y<DAHDI_CHUNKSIZE;y++) {
for (x=0;x<wc->span.channels;x++) {
/* XXX Optimize, remove * and + XXX */
/* Must map received channels into appropriate data */
@@ -1167,15 +1167,15 @@ static void t1xxp_receiveprep(struct t1 *wc, int ints)
}
}
/* Store the next canary */
- canary = (unsigned int *)(rxbuf + ZT_CHUNKSIZE * 32 - 4);
+ canary = (unsigned int *)(rxbuf + DAHDI_CHUNKSIZE * 32 - 4);
*canary = (wc->canary++) | (CANARY << 16);
for (x=0;x<wc->span.channels;x++) {
- zt_ec_chunk(&wc->chans[x], wc->chans[x].readchunk,
+ dahdi_ec_chunk(&wc->chans[x], wc->chans[x].readchunk,
wc->ec_chunk2[x]);
- memcpy(wc->ec_chunk2[x],wc->ec_chunk1[x],ZT_CHUNKSIZE);
- memcpy(wc->ec_chunk1[x],wc->chans[x].writechunk,ZT_CHUNKSIZE);
+ memcpy(wc->ec_chunk2[x],wc->ec_chunk1[x],DAHDI_CHUNKSIZE);
+ memcpy(wc->ec_chunk1[x],wc->chans[x].writechunk,DAHDI_CHUNKSIZE);
}
- zt_receive(&wc->span);
+ dahdi_receive(&wc->span);
}
static void t1_check_alarms(struct t1 *wc)
@@ -1185,7 +1185,7 @@ static void t1_check_alarms(struct t1 *wc)
int x,j;
unsigned long flags;
- if (!(wc->span.flags & ZT_FLAG_RUNNING))
+ if (!(wc->span.flags & DAHDI_FLAG_RUNNING))
return;
spin_lock_irqsave(&wc->lock, flags);
@@ -1200,7 +1200,7 @@ static void t1_check_alarms(struct t1 *wc)
alarms = 0;
/* And consider only carrier alarms */
- wc->span.alarms &= (ZT_ALARM_RED | ZT_ALARM_BLUE | ZT_ALARM_NOTOPEN);
+ wc->span.alarms &= (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE | DAHDI_ALARM_NOTOPEN);
if (wc->spantype == TYPE_E1) {
if (c & 0x04) {
@@ -1226,44 +1226,44 @@ static void t1_check_alarms(struct t1 *wc)
/* Detect loopup code if we're not sending one */
if ((!wc->span.mainttimer) && (d & 0x08)) {
/* Loop-up code detected */
- if ((wc->loopupcnt++ > 80) && (wc->span.maintstat != ZT_MAINT_REMOTELOOP)) {
+ if ((wc->loopupcnt++ > 80) && (wc->span.maintstat != DAHDI_MAINT_REMOTELOOP)) {
__t1_framer_out(wc, 0x36, 0x08); /* LIM0: Disable any local loop */
__t1_framer_out(wc, 0x37, 0xf6 ); /* LIM1: Enable remote loop */
- wc->span.maintstat = ZT_MAINT_REMOTELOOP;
+ wc->span.maintstat = DAHDI_MAINT_REMOTELOOP;
}
} else
wc->loopupcnt = 0;
/* Same for loopdown code */
if ((!wc->span.mainttimer) && (d & 0x10)) {
/* Loop-down code detected */
- if ((wc->loopdowncnt++ > 80) && (wc->span.maintstat == ZT_MAINT_REMOTELOOP)) {
+ if ((wc->loopdowncnt++ > 80) && (wc->span.maintstat == DAHDI_MAINT_REMOTELOOP)) {
__t1_framer_out(wc, 0x36, 0x08); /* LIM0: Disable any local loop */
__t1_framer_out(wc, 0x37, 0xf0 ); /* LIM1: Disable remote loop */
- wc->span.maintstat = ZT_MAINT_NONE;
+ wc->span.maintstat = DAHDI_MAINT_NONE;
}
} else
wc->loopdowncnt = 0;
}
- if (wc->span.lineconfig & ZT_CONFIG_NOTOPEN) {
+ if (wc->span.lineconfig & DAHDI_CONFIG_NOTOPEN) {
for (x=0,j=0;x < wc->span.channels;x++)
- if ((wc->span.chans[x].flags & ZT_FLAG_OPEN) ||
- (wc->span.chans[x].flags & ZT_FLAG_NETDEV))
+ if ((wc->span.chans[x].flags & DAHDI_FLAG_OPEN) ||
+ (wc->span.chans[x].flags & DAHDI_FLAG_NETDEV))
j++;
if (!j)
- alarms |= ZT_ALARM_NOTOPEN;
+ alarms |= DAHDI_ALARM_NOTOPEN;
}
if (c & 0xa0) {
if (wc->alarmcount >= alarmdebounce) {
if (!unchannelized)
- alarms |= ZT_ALARM_RED;
+ alarms |= DAHDI_ALARM_RED;
} else
wc->alarmcount++;
} else
wc->alarmcount = 0;
if (c & 0x4)
- alarms |= ZT_ALARM_BLUE;
+ alarms |= DAHDI_ALARM_BLUE;
if (((!wc->span.alarms) && alarms) ||
(wc->span.alarms && (!alarms)))
@@ -1271,9 +1271,9 @@ static void t1_check_alarms(struct t1 *wc)
/* Keep track of recovering */
if ((!alarms) && wc->span.alarms)
- wc->alarmtimer = ZT_ALARMSETTLE_TIME;
+ wc->alarmtimer = DAHDI_ALARMSETTLE_TIME;
if (wc->alarmtimer)
- alarms |= ZT_ALARM_RECOVER;
+ alarms |= DAHDI_ALARM_RECOVER;
/* If receiving alarms, go into Yellow alarm state */
if (alarms && !(wc->spanflags & FLAG_SENDINGYELLOW)) {
@@ -1299,12 +1299,12 @@ static void t1_check_alarms(struct t1 *wc)
/* Re-check the timing source when we enter/leave alarm, not withstanding
yellow alarm */
if ((c & 0x10) && !unchannelized)
- alarms |= ZT_ALARM_YELLOW;
+ alarms |= DAHDI_ALARM_YELLOW;
if (wc->span.mainttimer || wc->span.maintstat)
- alarms |= ZT_ALARM_LOOPBACK;
+ alarms |= DAHDI_ALARM_LOOPBACK;
wc->span.alarms = alarms;
spin_unlock_irqrestore(&wc->lock, flags);
- zt_alarm_notify(&wc->span);
+ dahdi_alarm_notify(&wc->span);
}
@@ -1315,9 +1315,9 @@ static void t1_do_counters(struct t1 *wc)
spin_lock_irqsave(&wc->lock, flags);
if (wc->alarmtimer) {
if (!--wc->alarmtimer) {
- wc->span.alarms &= ~(ZT_ALARM_RECOVER);
+ wc->span.alarms &= ~(DAHDI_ALARM_RECOVER);
spin_unlock_irqrestore(&wc->lock, flags);
- zt_alarm_notify(&wc->span);
+ dahdi_alarm_notify(&wc->span);
spin_lock_irqsave(&wc->lock, flags);
}
}
@@ -1419,15 +1419,15 @@ static int t1xxp_hardware_init(struct t1 *wc)
/* Start at writedma */
outl(wc->writedma, wc->ioaddr + WC_DMAWS); /* Write start */
/* First frame */
- outl(wc->writedma + ZT_CHUNKSIZE * 32 - 4, wc->ioaddr + WC_DMAWI); /* Middle (interrupt) */
+ outl(wc->writedma + DAHDI_CHUNKSIZE * 32 - 4, wc->ioaddr + WC_DMAWI); /* Middle (interrupt) */
/* Second frame */
- outl(wc->writedma + ZT_CHUNKSIZE * 32 * 2 - 4, wc->ioaddr + WC_DMAWE); /* End */
+ outl(wc->writedma + DAHDI_CHUNKSIZE * 32 * 2 - 4, wc->ioaddr + WC_DMAWE); /* End */
outl(wc->readdma, wc->ioaddr + WC_DMARS); /* Read start */
/* First frame */
- outl(wc->readdma + ZT_CHUNKSIZE * 32 - 4, wc->ioaddr + WC_DMARI); /* Middle (interrupt) */
+ outl(wc->readdma + DAHDI_CHUNKSIZE * 32 - 4, wc->ioaddr + WC_DMARI); /* Middle (interrupt) */
/* Second frame */
- outl(wc->readdma + ZT_CHUNKSIZE * 32 * 2 - 4, wc->ioaddr + WC_DMARE); /* End */
+ outl(wc->readdma + DAHDI_CHUNKSIZE * 32 * 2 - 4, wc->ioaddr + WC_DMARE); /* End */
if (debug) printk("Setting up DMA (write/read = %08lx/%08lx)\n", (long)wc->writedma, (long)wc->readdma);
@@ -1498,22 +1498,22 @@ static int __devinit t1xxp_init_one(struct pci_dev *pdev, const struct pci_devic
wc->writechunk =
/* 32 channels, Double-buffer, Read/Write */
- (unsigned char *)pci_alloc_consistent(pdev, ZT_MAX_CHUNKSIZE * 32 * 2 * 2, &wc->writedma);
+ (unsigned char *)pci_alloc_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 32 * 2 * 2, &wc->writedma);
if (!wc->writechunk) {
printk("wcte11xp: Unable to allocate DMA-able memory\n");
return -ENOMEM;
}
/* Read is after the whole write piece (in bytes) */
- wc->readchunk = wc->writechunk + ZT_CHUNKSIZE * 32 * 2;
+ wc->readchunk = wc->writechunk + DAHDI_CHUNKSIZE * 32 * 2;
/* Same thing... */
- wc->readdma = wc->writedma + ZT_CHUNKSIZE * 32 * 2;
+ wc->readdma = wc->writedma + DAHDI_CHUNKSIZE * 32 * 2;
/* Initialize Write/Buffers to all blank data */
- memset((void *)wc->writechunk,0x00,ZT_MAX_CHUNKSIZE * 2 * 2 * 32);
+ memset((void *)wc->writechunk,0x00,DAHDI_MAX_CHUNKSIZE * 2 * 2 * 32);
/* Initialize canary */
- canary = (unsigned int *)(wc->readchunk + ZT_CHUNKSIZE * 64 - 4);
+ canary = (unsigned int *)(wc->readchunk + DAHDI_CHUNKSIZE * 64 - 4);
*canary = (CANARY << 16) | (0xffff);
/* Enable bus mastering */
@@ -1568,7 +1568,7 @@ static void __devexit t1xxp_remove_one(struct pci_dev *pdev)
t1xxp_stop_stuff(wc);
/* Immediately free resources */
- pci_free_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 32 * 4, (void *)wc->writechunk, wc->writedma);
+ pci_free_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 32 * 4, (void *)wc->writechunk, wc->writedma);
free_irq(pdev->irq, wc);
/* Reset PCI chip and registers */
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c
index 0c5e840..0a4e9b2 100644
--- a/drivers/dahdi/wcte12xp/base.c
+++ b/drivers/dahdi/wcte12xp/base.c
@@ -144,7 +144,7 @@ static inline void cmd_dequeue(struct t1 *wc, volatile unsigned char *writechunk
/* Skip audio */
writechunk += 66;
/* Search for something waiting to transmit */
- if ((slot < 6) && (eframe) && (eframe < ZT_CHUNKSIZE - 1)) {
+ if ((slot < 6) && (eframe) && (eframe < DAHDI_CHUNKSIZE - 1)) {
/* only 6 useable cs slots per */
/* framer */
@@ -440,7 +440,7 @@ static void __t1xxp_set_clear(struct t1 *wc, int channo)
for (i = 0; i < 24; i++) {
j = (i / 8);
- if (wc->span.chans[i].flags & ZT_FLAG_CLEAR)
+ if (wc->span.chans[i].flags & DAHDI_FLAG_CLEAR)
val |= 1 << (7 - (i % 8));
if (((i % 8)==7) && /* write byte every 8 channels */
((channo < 0) || /* channo=-1 means all channels */
@@ -455,7 +455,7 @@ static void __t1xxp_set_clear(struct t1 *wc, int channo)
static void t1_release(struct t1 *wc)
{
- zt_unregister(&wc->span);
+ dahdi_unregister(&wc->span);
kfree(wc);
printk("Freed a Wildcard TE12xP\n");
}
@@ -528,14 +528,14 @@ static void t1_configure_t1(struct t1 *wc, int lineconfig, int txlevel)
t1_setreg(wc, 0x1e, fmr2);
/* Configure line interface */
- if (lineconfig & ZT_CONFIG_AMI) {
+ if (lineconfig & DAHDI_CONFIG_AMI) {
line = "AMI";
fmr0 = 0xa0;
} else {
line = "B8ZS";
fmr0 = 0xf0;
}
- if (lineconfig & ZT_CONFIG_D4) {
+ if (lineconfig & DAHDI_CONFIG_D4) {
framing = "D4";
} else {
framing = "ESF";
@@ -601,7 +601,7 @@ static void t1_configure_e1(struct t1 *wc, int lineconfig)
fmr2 |= 0x30;
if (loopback)
fmr2 |= 0x4;
- if (lineconfig & ZT_CONFIG_CRC4) {
+ if (lineconfig & DAHDI_CONFIG_CRC4) {
fmr1 |= 0x08; /* CRC4 transmit */
fmr2 |= 0xc0; /* CRC4 receive */
crc4 = "/CRC4";
@@ -610,14 +610,14 @@ static void t1_configure_e1(struct t1 *wc, int lineconfig)
t1_setreg(wc, 0x1e, fmr2);
/* Configure line interface */
- if (lineconfig & ZT_CONFIG_AMI) {
+ if (lineconfig & DAHDI_CONFIG_AMI) {
line = "AMI";
fmr0 = 0xa0;
} else {
line = "HDB3";
fmr0 = 0xf0;
}
- if (lineconfig & ZT_CONFIG_CCS) {
+ if (lineconfig & DAHDI_CONFIG_CCS) {
framing = "CCS";
} else {
framing = "CAS";
@@ -666,9 +666,9 @@ static void t1_configure_e1(struct t1 *wc, int lineconfig)
module_printk("Span configured for %s/%s%s\n", framing, line, crc4);
}
-static void t1xxp_framer_start(struct t1 *wc, struct zt_span *span)
+static void t1xxp_framer_start(struct t1 *wc, struct dahdi_span *span)
{
- int alreadyrunning = wc->span.flags & ZT_FLAG_RUNNING;
+ int alreadyrunning = wc->span.flags & DAHDI_FLAG_RUNNING;
unsigned long flags;
if (wc->spantype == TYPE_E1) { /* if this is an E1 card */
@@ -680,19 +680,19 @@ static void t1xxp_framer_start(struct t1 *wc, struct zt_span *span)
spin_lock_irqsave(&wc->reglock, flags);
if (!alreadyrunning)
- wc->span.flags |= ZT_FLAG_RUNNING;
+ wc->span.flags |= DAHDI_FLAG_RUNNING;
spin_unlock_irqrestore(&wc->reglock, flags);
}
-static int t1xxp_startup(struct zt_span *span)
+static int t1xxp_startup(struct dahdi_span *span)
{
struct t1 *wc = span->pvt;
int i;
/* initialize the start value for the entire chunk of last ec buffer */
for (i = 0; i < span->channels; i++) {
- memset(wc->ec_chunk1[i], ZT_LIN2X(0, &span->chans[i]), ZT_CHUNKSIZE);
- memset(wc->ec_chunk2[i], ZT_LIN2X(0, &span->chans[i]), ZT_CHUNKSIZE);
+ memset(wc->ec_chunk1[i], DAHDI_LIN2X(0, &span->chans[i]), DAHDI_CHUNKSIZE);
+ memset(wc->ec_chunk2[i], DAHDI_LIN2X(0, &span->chans[i]), DAHDI_CHUNKSIZE);
}
/* Reset framer with proper parameters and start */
@@ -702,22 +702,22 @@ static int t1xxp_startup(struct zt_span *span)
return 0;
}
-static int t1xxp_shutdown(struct zt_span *span)
+static int t1xxp_shutdown(struct dahdi_span *span)
{
struct t1 *wc = span->pvt;
unsigned long flags;
t1_setreg(wc, 0x46, 0x41); /* GCR: Interrupt on Activation/Deactivation of AIX, LOS */
spin_lock_irqsave(&wc->reglock, flags);
- span->flags &= ~ZT_FLAG_RUNNING;
+ span->flags &= ~DAHDI_FLAG_RUNNING;
spin_unlock_irqrestore(&wc->reglock, flags);
return 0;
}
-static int t1xxp_chanconfig(struct zt_chan *chan, int sigtype)
+static int t1xxp_chanconfig(struct dahdi_chan *chan, int sigtype)
{
struct t1 *wc = chan->pvt;
- int alreadyrunning = chan->span->flags & ZT_FLAG_RUNNING;
+ int alreadyrunning = chan->span->flags & DAHDI_FLAG_RUNNING;
if (alreadyrunning && (wc->spantype != TYPE_E1))
__t1xxp_set_clear(wc, chan->channo);
@@ -725,7 +725,7 @@ static int t1xxp_chanconfig(struct zt_chan *chan, int sigtype)
return 0;
}
-static int t1xxp_spanconfig(struct zt_span *span, struct zt_lineconfig *lc)
+static int t1xxp_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
{
struct t1 *wc = span->pvt;
@@ -737,13 +737,13 @@ static int t1xxp_spanconfig(struct zt_span *span, struct zt_lineconfig *lc)
wc->ctlreg &= ~0x80;
/* If already running, apply changes immediately */
- if (span->flags & ZT_FLAG_RUNNING)
+ if (span->flags & DAHDI_FLAG_RUNNING)
return t1xxp_startup(span);
return 0;
}
-static int t1xxp_rbsbits(struct zt_chan *chan, int bits)
+static int t1xxp_rbsbits(struct dahdi_chan *chan, int bits)
{
u_char m,c;
int n,b;
@@ -767,7 +767,7 @@ static int t1xxp_rbsbits(struct zt_chan *chan, int bits)
spin_unlock_irqrestore(&wc->reglock, flags);
/* output them to the chip */
t1_setreg_full(wc,0x71 + b,c,1,NOT_VPM);
- } else if (wc->span.lineconfig & ZT_CONFIG_D4) {
+ } else if (wc->span.lineconfig & DAHDI_CONFIG_D4) {
n = chan->chanpos - 1;
b = (n / 4);
spin_lock_irqsave(&wc->reglock, flags);
@@ -780,7 +780,7 @@ static int t1xxp_rbsbits(struct zt_chan *chan, int bits)
/* output them to the chip */
t1_setreg_full(wc,0x70 + b,c,1,NOT_VPM);
t1_setreg_full(wc,0x70 + b + 6,c,1,NOT_VPM);
- } else if (wc->span.lineconfig & ZT_CONFIG_ESF) {
+ } else if (wc->span.lineconfig & DAHDI_CONFIG_ESF) {
n = chan->chanpos - 1;
b = (n / 2);
spin_lock_irqsave(&wc->reglock, flags);
@@ -802,14 +802,14 @@ static inline void __t1_check_sigbits_reads(struct t1 *wc)
{
int i;
- if (!(wc->span.flags & ZT_FLAG_RUNNING))
+ if (!(wc->span.flags & DAHDI_FLAG_RUNNING))
return;
if (wc->spantype == TYPE_E1) {
for (i = 0; i < 15; i++) {
if (t1_getreg(wc, 0x71 + i, 1))
wc->isrreaderrors++;
}
- } else if (wc->span.lineconfig & ZT_CONFIG_D4) {
+ } else if (wc->span.lineconfig & DAHDI_CONFIG_D4) {
for (i = 0; i < 24; i+=4) {
if (t1_getreg(wc, 0x70 + (i >> 2), 1))
wc->isrreaderrors++;
@@ -826,7 +826,7 @@ static inline void __t1_check_sigbits(struct t1 *wc)
{
int a,i,rxs;
- if (!(wc->span.flags & ZT_FLAG_RUNNING))
+ if (!(wc->span.flags & DAHDI_FLAG_RUNNING))
return;
if (wc->spantype == TYPE_E1) {
for (i = 0; i < 15; i++) {
@@ -834,57 +834,57 @@ static inline void __t1_check_sigbits(struct t1 *wc)
if (a > -1) {
/* Get high channel in low bits */
rxs = (a & 0xf);
- if (!(wc->span.chans[i+16].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->span.chans[i+16].sig & DAHDI_SIG_CLEAR)) {
if (wc->span.chans[i+16].rxsig != rxs) {
spin_unlock(&wc->reglock);
- zt_rbsbits(&wc->span.chans[i+16], rxs);
+ dahdi_rbsbits(&wc->span.chans[i+16], rxs);
spin_lock(&wc->reglock);
}
}
rxs = (a >> 4) & 0xf;
- if (!(wc->span.chans[i].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->span.chans[i].sig & DAHDI_SIG_CLEAR)) {
if (wc->span.chans[i].rxsig != rxs) {
spin_unlock(&wc->reglock);
- zt_rbsbits(&wc->span.chans[i], rxs);
+ dahdi_rbsbits(&wc->span.chans[i], rxs);
spin_lock(&wc->reglock);
}
}
}
}
- } else if (wc->span.lineconfig & ZT_CONFIG_D4) {
+ } else if (wc->span.lineconfig & DAHDI_CONFIG_D4) {
for (i = 0; i < 24; i+=4) {
a = t1_getreg_isr(wc, 0x70 + (i>>2));
if (a > -1) {
/* Get high channel in low bits */
rxs = (a & 0x3) << 2;
- if (!(wc->span.chans[i+3].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->span.chans[i+3].sig & DAHDI_SIG_CLEAR)) {
if (wc->span.chans[i+3].rxsig != rxs) {
spin_unlock(&wc->reglock);
- zt_rbsbits(&wc->span.chans[i+3], rxs);
+ dahdi_rbsbits(&wc->span.chans[i+3], rxs);
spin_lock(&wc->reglock);
}
}
rxs = (a & 0xc);
- if (!(wc->span.chans[i+2].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->span.chans[i+2].sig & DAHDI_SIG_CLEAR)) {
if (wc->span.chans[i+2].rxsig != rxs) {
spin_unlock(&wc->reglock);
- zt_rbsbits(&wc->span.chans[i+2], rxs);
+ dahdi_rbsbits(&wc->span.chans[i+2], rxs);
spin_lock(&wc->reglock);
}
}
rxs = (a >> 2) & 0xc;
- if (!(wc->span.chans[i+1].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->span.chans[i+1].sig & DAHDI_SIG_CLEAR)) {
if (wc->span.chans[i+1].rxsig != rxs) {
spin_unlock(&wc->reglock);
- zt_rbsbits(&wc->span.chans[i+1], rxs);
+ dahdi_rbsbits(&wc->span.chans[i+1], rxs);
spin_lock(&wc->reglock);
}
}
rxs = (a >> 4) & 0xc;
- if (!(wc->span.chans[i].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->span.chans[i].sig & DAHDI_SIG_CLEAR)) {
if (wc->span.chans[i].rxsig != rxs) {
spin_unlock(&wc->reglock);
- zt_rbsbits(&wc->span.chans[i], rxs);
+ dahdi_rbsbits(&wc->span.chans[i], rxs);
spin_lock(&wc->reglock);
}
}
@@ -896,18 +896,18 @@ static inline void __t1_check_sigbits(struct t1 *wc)
if (a > -1) {
/* Get high channel in low bits */
rxs = (a & 0xf);
- if (!(wc->span.chans[i+1].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->span.chans[i+1].sig & DAHDI_SIG_CLEAR)) {
if (wc->span.chans[i+1].rxsig != rxs) {
spin_unlock(&wc->reglock);
- zt_rbsbits(&wc->span.chans[i+1], rxs);
+ dahdi_rbsbits(&wc->span.chans[i+1], rxs);
spin_lock(&wc->reglock);
}
}
rxs = (a >> 4) & 0xf;
- if (!(wc->span.chans[i].sig & ZT_SIG_CLEAR)) {
+ if (!(wc->span.chans[i].sig & DAHDI_SIG_CLEAR)) {
if (wc->span.chans[i].rxsig != rxs) {
spin_unlock(&wc->reglock);
- zt_rbsbits(&wc->span.chans[i], rxs);
+ dahdi_rbsbits(&wc->span.chans[i], rxs);
spin_lock(&wc->reglock);
}
}
@@ -916,28 +916,28 @@ static inline void __t1_check_sigbits(struct t1 *wc)
}
}
-static int t1xxp_maint(struct zt_span *span, int cmd)
+static int t1xxp_maint(struct dahdi_span *span, int cmd)
{
struct t1 *wc = span->pvt;
if (wc->spantype == TYPE_E1) {
switch (cmd) {
- case ZT_MAINT_NONE:
+ case DAHDI_MAINT_NONE:
module_printk("XXX Turn off local and remote loops E1 XXX\n");
break;
- case ZT_MAINT_LOCALLOOP:
+ case DAHDI_MAINT_LOCALLOOP:
module_printk("XXX Turn on local loopback E1 XXX\n");
break;
- case ZT_MAINT_REMOTELOOP:
+ case DAHDI_MAINT_REMOTELOOP:
module_printk("XXX Turn on remote loopback E1 XXX\n");
break;
- case ZT_MAINT_LOOPUP:
+ case DAHDI_MAINT_LOOPUP:
module_printk("XXX Send loopup code E1 XXX\n");
break;
- case ZT_MAINT_LOOPDOWN:
+ case DAHDI_MAINT_LOOPDOWN:
module_printk("XXX Send loopdown code E1 XXX\n");
break;
- case ZT_MAINT_LOOPSTOP:
+ case DAHDI_MAINT_LOOPSTOP:
module_printk("XXX Stop sending loop codes E1 XXX\n");
break;
default:
@@ -946,22 +946,22 @@ static int t1xxp_maint(struct zt_span *span, int cmd)
}
} else {
switch (cmd) {
- case ZT_MAINT_NONE:
+ case DAHDI_MAINT_NONE:
module_printk("XXX Turn off local and remote loops T1 XXX\n");
break;
- case ZT_MAINT_LOCALLOOP:
+ case DAHDI_MAINT_LOCALLOOP:
module_printk("XXX Turn on local loop and no remote loop XXX\n");
break;
- case ZT_MAINT_REMOTELOOP:
+ case DAHDI_MAINT_REMOTELOOP:
module_printk("XXX Turn on remote loopup XXX\n");
break;
- case ZT_MAINT_LOOPUP:
+ case DAHDI_MAINT_LOOPUP:
t1_setreg(wc, 0x21, 0x50); /* FMR5: Nothing but RBS mode */
break;
- case ZT_MAINT_LOOPDOWN:
+ case DAHDI_MAINT_LOOPDOWN:
t1_setreg(wc, 0x21, 0x60); /* FMR5: Nothing but RBS mode */
break;
- case ZT_MAINT_LOOPSTOP:
+ case DAHDI_MAINT_LOOPSTOP:
t1_setreg(wc, 0x21, 0x40); /* FMR5: Nothing but RBS mode */
break;
default:
@@ -973,7 +973,7 @@ static int t1xxp_maint(struct zt_span *span, int cmd)
return 0;
}
-static int t1xxp_open(struct zt_chan *chan)
+static int t1xxp_open(struct dahdi_chan *chan)
{
struct t1 *wc = chan->pvt;
@@ -990,7 +990,7 @@ static int t1xxp_open(struct zt_chan *chan)
return 0;
}
-static int t1xxp_close(struct zt_chan *chan)
+static int t1xxp_close(struct dahdi_chan *chan)
{
struct t1 *wc = chan->pvt;
@@ -1009,7 +1009,7 @@ static int t1xxp_close(struct zt_chan *chan)
return 0;
}
-static int t1xxp_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data)
+static int t1xxp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long data)
{
unsigned int x;
struct t1 *wc = chan->pvt;
@@ -1024,21 +1024,21 @@ static int t1xxp_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
return -ENOSYS;
break;
#ifdef VPM_SUPPORT
- case ZT_TONEDETECT:
+ case DAHDI_TONEDETECT:
if (get_user(x, (int *) data))
return -EFAULT;
if (!wc->vpm150m)
return -ENOSYS;
if (wc->vpm150m && (x && !vpmdtmfsupport))
return -ENOSYS;
- if (x & ZT_TONEDETECT_ON) {
+ if (x & DAHDI_TONEDETECT_ON) {
set_bit(chan->chanpos - 1, &wc->dtmfmask);
module_printk("turning on tone detection\n");
} else {
clear_bit(chan->chanpos - 1, &wc->dtmfmask);
module_printk("turning off tone detection\n");
}
- if (x & ZT_TONEDETECT_MUTE) {
+ if (x & DAHDI_TONEDETECT_MUTE) {
if(wc->vpm150m)
set_bit(chan->chanpos - 1, &wc->vpm150m->desireddtmfmutestate);
} else {
@@ -1057,7 +1057,7 @@ static int t1xxp_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
#include "adt_lec.c"
-static int t1xxp_echocan_with_params(struct zt_chan *chan, struct zt_echocanparams *ecp, struct zt_echocanparam *p)
+static int t1xxp_echocan_with_params(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p)
{
struct adt_lec_params params;
struct t1 *wc = chan->pvt;
@@ -1150,28 +1150,28 @@ static int t1_software_init(struct t1 *wc)
else
wc->span.channels = 31;
wc->span.spantype = "E1";
- wc->span.linecompat = ZT_CONFIG_HDB3 | ZT_CONFIG_CCS | ZT_CONFIG_CRC4;
- wc->span.deflaw = ZT_LAW_ALAW;
+ wc->span.linecompat = DAHDI_CONFIG_HDB3 | DAHDI_CONFIG_CCS | DAHDI_CONFIG_CRC4;
+ wc->span.deflaw = DAHDI_LAW_ALAW;
} else {
wc->span.channels = 24;
wc->span.spantype = "T1";
- wc->span.linecompat = ZT_CONFIG_AMI | ZT_CONFIG_B8ZS | ZT_CONFIG_D4 | ZT_CONFIG_ESF;
- wc->span.deflaw = ZT_LAW_MULAW;
+ wc->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_B8ZS | DAHDI_CONFIG_D4 | DAHDI_CONFIG_ESF;
+ wc->span.deflaw = DAHDI_LAW_MULAW;
}
wc->span.chans = wc->chans;
- wc->span.flags = ZT_FLAG_RBS;
+ wc->span.flags = DAHDI_FLAG_RBS;
wc->span.pvt = wc;
init_waitqueue_head(&wc->span.maintq);
for (x = 0; x < wc->span.channels; x++) {
sprintf(wc->chans[x].name, "WCT1/%d/%d", wc->num, x + 1);
- wc->chans[x].sigcap = ZT_SIG_EM | ZT_SIG_CLEAR | ZT_SIG_EM_E1 |
- ZT_SIG_FXSLS | ZT_SIG_FXSGS | ZT_SIG_MTP2 |
- ZT_SIG_FXSKS | ZT_SIG_FXOLS | ZT_SIG_DACS_RBS |
- ZT_SIG_FXOGS | ZT_SIG_FXOKS | ZT_SIG_CAS | ZT_SIG_SF;
+ wc->chans[x].sigcap = DAHDI_SIG_EM | DAHDI_SIG_CLEAR | DAHDI_SIG_EM_E1 |
+ DAHDI_SIG_FXSLS | DAHDI_SIG_FXSGS | DAHDI_SIG_MTP2 |
+ DAHDI_SIG_FXSKS | DAHDI_SIG_FXOLS | DAHDI_SIG_DACS_RBS |
+ DAHDI_SIG_FXOGS | DAHDI_SIG_FXOKS | DAHDI_SIG_CAS | DAHDI_SIG_SF;
wc->chans[x].pvt = wc;
wc->chans[x].chanpos = x + 1;
}
- if (zt_register(&wc->span, 0)) {
+ if (dahdi_register(&wc->span, 0)) {
module_printk("Unable to register span with Zaptel\n");
return -1;
}
@@ -1253,7 +1253,7 @@ static int t1_hardware_post_init(struct t1 *wc)
static inline void __t1_check_alarms_reads(struct t1 *wc)
{
- if (!(wc->span.flags & ZT_FLAG_RUNNING))
+ if (!(wc->span.flags & DAHDI_FLAG_RUNNING))
return;
if (t1_getreg(wc, 0x4c, 1))
@@ -1271,7 +1271,7 @@ static inline void __t1_check_alarms(struct t1 *wc)
int x,j;
unsigned char fmr4; /* must read this always */
- if (!(wc->span.flags & ZT_FLAG_RUNNING))
+ if (!(wc->span.flags & DAHDI_FLAG_RUNNING))
return;
c = t1_getreg_isr(wc, 0x4c);
@@ -1282,7 +1282,7 @@ static inline void __t1_check_alarms(struct t1 *wc)
alarms = 0;
/* And consider only carrier alarms */
- wc->span.alarms &= (ZT_ALARM_RED | ZT_ALARM_BLUE | ZT_ALARM_NOTOPEN);
+ wc->span.alarms &= (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE | DAHDI_ALARM_NOTOPEN);
if (wc->spantype == TYPE_E1) {
if (c & 0x04) {
@@ -1308,50 +1308,50 @@ static inline void __t1_check_alarms(struct t1 *wc)
/* Detect loopup code if we're not sending one */
if ((!wc->span.mainttimer) && (d & 0x08)) {
/* Loop-up code detected */
- if ((wc->loopupcnt++ > 80) && (wc->span.maintstat != ZT_MAINT_REMOTELOOP)) {
+ if ((wc->loopupcnt++ > 80) && (wc->span.maintstat != DAHDI_MAINT_REMOTELOOP)) {
t1_setreg_full(wc, 0x36, 0x08, 1, NOT_VPM); /* LIM0: Disable any local loop */
t1_setreg_full(wc, 0x37, 0xf6, 1, NOT_VPM); /* LIM1: Enable remote loop */
- wc->span.maintstat = ZT_MAINT_REMOTELOOP;
+ wc->span.maintstat = DAHDI_MAINT_REMOTELOOP;
}
} else
wc->loopupcnt = 0;
/* Same for loopdown code */
if ((!wc->span.mainttimer) && (d & 0x10)) {
/* Loop-down code detected */
- if ((wc->loopdowncnt++ > 80) && (wc->span.maintstat == ZT_MAINT_REMOTELOOP)) {
+ if ((wc->loopdowncnt++ > 80) && (wc->span.maintstat == DAHDI_MAINT_REMOTELOOP)) {
t1_setreg_full(wc, 0x36, 0x08, 1, NOT_VPM); /* LIM0: Disable any local loop */
t1_setreg_full(wc, 0x37, 0xf0, 1, NOT_VPM); /* LIM1: Disable remote loop */
- wc->span.maintstat = ZT_MAINT_NONE;
+ wc->span.maintstat = DAHDI_MAINT_NONE;
}
} else
wc->loopdowncnt = 0;
}
- if (wc->span.lineconfig & ZT_CONFIG_NOTOPEN) {
+ if (wc->span.lineconfig & DAHDI_CONFIG_NOTOPEN) {
for (x=0,j=0;x < wc->span.channels;x++)
- if ((wc->span.chans[x].flags & ZT_FLAG_OPEN) ||
- (wc->span.chans[x].flags & ZT_FLAG_NETDEV))
+ if ((wc->span.chans[x].flags & DAHDI_FLAG_OPEN) ||
+ (wc->span.chans[x].flags & DAHDI_FLAG_NETDEV))
j++;
if (!j)
- alarms |= ZT_ALARM_NOTOPEN;
+ alarms |= DAHDI_ALARM_NOTOPEN;
}
if (c & 0xa0) {
if (wc->alarmcount >= alarmdebounce) {
if (!unchannelized)
- alarms |= ZT_ALARM_RED;
+ alarms |= DAHDI_ALARM_RED;
} else
wc->alarmcount++;
} else
wc->alarmcount = 0;
if (c & 0x4)
- alarms |= ZT_ALARM_BLUE;
+ alarms |= DAHDI_ALARM_BLUE;
/* Keep track of recovering */
if ((!alarms) && wc->span.alarms)
- wc->alarmtimer = ZT_ALARMSETTLE_TIME;
+ wc->alarmtimer = DAHDI_ALARMSETTLE_TIME;
if (wc->alarmtimer)
- alarms |= ZT_ALARM_RECOVER;
+ alarms |= DAHDI_ALARM_RECOVER;
/* If receiving alarms, go into Yellow alarm state */
if (alarms && !wc->flags.sendingyellow) {
@@ -1368,18 +1368,18 @@ static inline void __t1_check_alarms(struct t1 *wc)
}
if ((c & 0x10) && !unchannelized)
- alarms |= ZT_ALARM_YELLOW;
+ alarms |= DAHDI_ALARM_YELLOW;
if (wc->span.mainttimer || wc->span.maintstat)
- alarms |= ZT_ALARM_LOOPBACK;
+ alarms |= DAHDI_ALARM_LOOPBACK;
wc->span.alarms = alarms;
spin_unlock(&wc->reglock);
- zt_alarm_notify(&wc->span);
+ dahdi_alarm_notify(&wc->span);
spin_lock(&wc->reglock);
}
static inline void __handle_leds(struct t1 *wc)
{
- if (wc->span.alarms & (ZT_ALARM_RED | ZT_ALARM_BLUE)) {
+ if (wc->span.alarms & (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE)) {
wc->blinktimer++;
if (wc->blinktimer == 160)
wc->ledtestreg = SET_LED_RED(wc->ledtestreg);
@@ -1387,18 +1387,18 @@ static inline void __handle_leds(struct t1 *wc)
wc->ledtestreg = UNSET_LED_REDGREEN(wc->ledtestreg);
wc->blinktimer = 0;
}
- } else if (wc->span.alarms & ZT_ALARM_YELLOW) {
+ } else if (wc->span.alarms & DAHDI_ALARM_YELLOW) {
wc->yellowtimer++;
if (!(wc->yellowtimer % 2))
wc->ledtestreg = SET_LED_RED(wc->ledtestreg);
else
wc->ledtestreg = SET_LED_GREEN(wc->ledtestreg);
} else {
- if (wc->span.maintstat != ZT_MAINT_NONE)
+ if (wc->span.maintstat != DAHDI_MAINT_NONE)
wc->ledtestreg = SET_LED_ORANGE(wc->ledtestreg);
else
wc->ledtestreg = UNSET_LED_ORANGE(wc->ledtestreg);
- if (wc->span.flags & ZT_FLAG_RUNNING)
+ if (wc->span.flags & DAHDI_FLAG_RUNNING)
wc->ledtestreg = SET_LED_GREEN(wc->ledtestreg);
else
wc->ledtestreg = UNSET_LED_REDGREEN(wc->ledtestreg);
@@ -1415,8 +1415,8 @@ static void __t1_do_counters(struct t1 *wc)
{
if (wc->alarmtimer) {
if (!--wc->alarmtimer) {
- wc->span.alarms &= ~(ZT_ALARM_RECOVER);
- zt_alarm_notify(&wc->span);
+ wc->span.alarms &= ~(DAHDI_ALARM_RECOVER);
+ dahdi_alarm_notify(&wc->span);
}
}
}
@@ -1464,11 +1464,11 @@ static inline void t1_transmitprep(struct t1 *wc, unsigned char* writechunk)
/* Calculate Transmission */
if (likely(wc->initialized)) {
spin_unlock(&wc->reglock);
- zt_transmit(&wc->span);
+ dahdi_transmit(&wc->span);
spin_lock(&wc->reglock);
}
- for (x = 0; x < ZT_CHUNKSIZE; x++) {
+ for (x = 0; x < DAHDI_CHUNKSIZE; x++) {
if (likely(wc->initialized)) {
for (chan = 0; chan < wc->span.channels; chan++)
writechunk[(chan+1)*2] = wc->chans[chan].writechunk[x];
@@ -1484,7 +1484,7 @@ static inline void t1_transmitprep(struct t1 *wc, unsigned char* writechunk)
}
#endif
- if (x < ZT_CHUNKSIZE - 1) {
+ if (x < DAHDI_CHUNKSIZE - 1) {
writechunk[EFRAME_SIZE] = wc->ctlreg;
writechunk[EFRAME_SIZE + 1] = wc->txident++;
}
@@ -1509,13 +1509,13 @@ static inline void t1_receiveprep(struct t1 *wc, unsigned char* readchunk)
int x,chan;
unsigned char expected;
- for (x = 0; x < ZT_CHUNKSIZE; x++) {
+ for (x = 0; x < DAHDI_CHUNKSIZE; x++) {
if (likely(wc->initialized)) {
for (chan = 0; chan < wc->span.channels; chan++) {
wc->chans[chan].readchunk[x]= readchunk[(chan+1)*2];
}
}
- if (x < ZT_CHUNKSIZE - 1) {
+ if (x < DAHDI_CHUNKSIZE - 1) {
expected = wc->rxident+1;
wc->rxident = readchunk[EFRAME_SIZE + 1];
wc->statreg = readchunk[EFRAME_SIZE + 2];
@@ -1538,11 +1538,11 @@ static inline void t1_receiveprep(struct t1 *wc, unsigned char* readchunk)
if (likely(wc->initialized)) {
spin_unlock(&wc->reglock);
for (x = 0; x < wc->span.channels; x++) {
- zt_ec_chunk(&wc->chans[x], wc->chans[x].readchunk, wc->ec_chunk2[x]);
- memcpy(wc->ec_chunk2[x],wc->ec_chunk1[x],ZT_CHUNKSIZE);
- memcpy(wc->ec_chunk1[x],wc->chans[x].writechunk,ZT_CHUNKSIZE);
+ dahdi_ec_chunk(&wc->chans[x], wc->chans[x].readchunk, wc->ec_chunk2[x]);
+ memcpy(wc->ec_chunk2[x],wc->ec_chunk1[x],DAHDI_CHUNKSIZE);
+ memcpy(wc->ec_chunk1[x],wc->chans[x].writechunk,DAHDI_CHUNKSIZE);
}
- zt_receive(&wc->span);
+ dahdi_receive(&wc->span);
spin_lock(&wc->reglock);
}
@@ -1637,7 +1637,7 @@ retry:
printk(KERN_NOTICE "%s: Restarting board initialization " \
"after increasing latency.\n", wc->name);
latency = voicebus_current_latency(wc->vb);
- zt_unregister(&wc->span);
+ dahdi_unregister(&wc->span);
voicebus_release(wc->vb);
wc->vb = NULL;
kfree(wc);
diff --git a/drivers/dahdi/wcte12xp/vpmadt032.c b/drivers/dahdi/wcte12xp/vpmadt032.c
index b22d322..835cdb5 100644
--- a/drivers/dahdi/wcte12xp/vpmadt032.c
+++ b/drivers/dahdi/wcte12xp/vpmadt032.c
@@ -508,7 +508,7 @@ static void vpm150m_echocan_bh(struct work_struct *data)
list_for_each_safe(task, next_task, &vpm150m->worklist) {
struct vpm150m_workentry *we = list_entry(task, struct vpm150m_workentry, list);
- struct zt_chan *chan = we->chan;
+ struct dahdi_chan *chan = we->chan;
int deflaw;
int res;
GPAK_AlgControlStat_t pstatus;
@@ -649,7 +649,7 @@ static void vpm150m_dtmf_bh(struct work_struct *data)
debug_printk(1, "Channel %d: Detected DTMF tone %d of duration %d\n", channel + 1, tone, duration);
if (test_bit(channel, &wc->dtmfmask) && (eventdata.toneEvent.ToneDuration > 0)) {
- struct zt_chan *chan = &wc->chans[channel];
+ struct dahdi_chan *chan = &wc->chans[channel];
module_printk("DTMF detected channel=%d tone=%d duration=%d\n", channel + 1, tone, duration);
@@ -664,18 +664,18 @@ static void vpm150m_dtmf_bh(struct work_struct *data)
spin_lock_irqsave(&chan->lock, flags);
for (y = 0; y < chan->numbufs; y++) {
if ((chan->inreadbuf > -1) && (chan->readidx[y]))
- memset(chan->readbuf[chan->inreadbuf], ZT_XLAW(0, chan), chan->readidx[y]);
+ memset(chan->readbuf[chan->inreadbuf], DAHDI_XLAW(0, chan), chan->readidx[y]);
}
spin_unlock_irqrestore(&chan->lock, flags);
}
if (!test_bit(channel, &wc->dtmfactive)) {
debug_printk(1,"Queuing DTMFDOWN %c\n", zaptone);
set_bit(channel, &wc->dtmfactive);
- zt_qevent_lock(chan, (ZT_EVENT_DTMFDOWN | zaptone));
+ dahdi_qevent_lock(chan, (DAHDI_EVENT_DTMFDOWN | zaptone));
}
} else if ((tone == EndofMFDigit) && test_bit(channel, &wc->dtmfactive)) {
debug_printk(1,"Queuing DTMFUP %c\n", vpm150mtone_to_zaptone(vpm150m->curtone[channel]));
- zt_qevent_lock(chan, (ZT_EVENT_DTMFUP | vpm150mtone_to_zaptone(vpm150m->curtone[channel])));
+ dahdi_qevent_lock(chan, (DAHDI_EVENT_DTMFUP | vpm150mtone_to_zaptone(vpm150m->curtone[channel])));
clear_bit(channel, &wc->dtmfactive);
}
}
diff --git a/drivers/dahdi/wcte12xp/vpmadt032.h b/drivers/dahdi/wcte12xp/vpmadt032.h
index e103e05..117b22e 100644
--- a/drivers/dahdi/wcte12xp/vpmadt032.h
+++ b/drivers/dahdi/wcte12xp/vpmadt032.h
@@ -105,7 +105,7 @@ struct vpm150m {
struct vpm150m_workentry {
struct list_head list;
struct t1 *wc; /* what card are we dealing with? */
- struct zt_chan *chan; /* what channels are we going to deal with? */
+ struct dahdi_chan *chan; /* what channels are we going to deal with? */
struct adt_lec_params params; /* how should we behave? */
};
diff --git a/drivers/dahdi/wcte12xp/wcte12xp.h b/drivers/dahdi/wcte12xp/wcte12xp.h
index aa6306b..4de98d6 100644
--- a/drivers/dahdi/wcte12xp/wcte12xp.h
+++ b/drivers/dahdi/wcte12xp/wcte12xp.h
@@ -50,7 +50,7 @@
#define EFRAME_SIZE 108
#define ERING_SIZE 16 /* Maximum ring size */
#define EFRAME_GAP 20
-#define SFRAME_SIZE ((EFRAME_SIZE * ZT_CHUNKSIZE) + (EFRAME_GAP * (ZT_CHUNKSIZE - 1)))
+#define SFRAME_SIZE ((EFRAME_SIZE * DAHDI_CHUNKSIZE) + (EFRAME_GAP * (DAHDI_CHUNKSIZE - 1)))
#define PCI_WINDOW_SIZE ((2 * 2 * 2 * SFRAME_SIZE) + (2 * ERING_SIZE * 4))
@@ -139,10 +139,10 @@ struct t1 {
int initialized;
int *chanmap;
unsigned char ledtestreg;
- unsigned char ec_chunk1[32][ZT_CHUNKSIZE];
- unsigned char ec_chunk2[32][ZT_CHUNKSIZE];
- struct zt_span span; /* Span */
- struct zt_chan chans[32]; /* Channels */
+ unsigned char ec_chunk1[32][DAHDI_CHUNKSIZE];
+ unsigned char ec_chunk2[32][DAHDI_CHUNKSIZE];
+ struct dahdi_span span; /* Span */
+ struct dahdi_chan chans[32]; /* Channels */
wait_queue_head_t regq;
struct cmdq cmdq;
struct command dummy; /* preallocate for dummy noop command */