Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48032024a3 | ||
|
|
62d7a00fdc | ||
|
|
5aaaaf9d2f | ||
|
|
f56b748f73 | ||
|
|
4305b44108 | ||
|
|
b6fe19cff5 | ||
|
|
108b0641aa | ||
|
|
368d8bec4b | ||
|
|
799753aefd | ||
|
|
a3da9f1d03 | ||
|
|
701f633e0d | ||
|
|
9d62e703fe | ||
|
|
6dd89a7ae5 | ||
|
|
0981935d5c | ||
|
|
cf057d4b0e | ||
|
|
9769028667 | ||
|
|
4f0cf5fb98 | ||
|
|
c4356304e5 | ||
|
|
54893b93aa |
15
README
15
README
@@ -12,16 +12,6 @@ Supported Hardware
|
||||
------------------
|
||||
Digital Cards
|
||||
~~~~~~~~~~~~~
|
||||
- wcte43x:
|
||||
* Digium TE435: PCI express quad-port T1/E1/J1
|
||||
* Digium TE436: PCI quad-port T1/E1/J1
|
||||
* Digium TE235: PCI express dual-port T1/E1/J1
|
||||
* Digium TE236: PCI dual-port T1/E1/J1
|
||||
- wcte13xp:
|
||||
* Digium TE131: PCI express single-port T1/E1/J1
|
||||
* Digium TE133: PCI express single-port T1/E1/J1 with echocan
|
||||
* Digium TE132: PCI single-port T1/E1/J1
|
||||
* Digium TE134: PCI single-port T1/E1/J1 with echocan
|
||||
- wct4xxp:
|
||||
* Digium TE205P/TE207P/TE210P/TE212P: PCI dual-port T1/E1/J1
|
||||
* Digium TE405P/TE407P/TE410P/TE412P: PCI quad-port T1/E1/J1
|
||||
@@ -44,11 +34,6 @@ Digital Cards
|
||||
|
||||
Analog Cards
|
||||
~~~~~~~~~~~~
|
||||
- wcaxx:
|
||||
* Digium A8A: PCI up to 8 mixed FXS/FXO ports
|
||||
* Digium A8B: PCI express up to 8 mixed FXS/FXO ports
|
||||
* Digium A4A: PCI up to 4 mixed FXS/FXO ports
|
||||
* Digium A4B: PCI express up to 4 mixed FXS/FXO ports
|
||||
- wctdm24xxp:
|
||||
* Digium TDM2400P/AEX2400: up to 24 analog ports
|
||||
* Digium TDM800P/AEX800: up to 8 analog ports
|
||||
|
||||
@@ -2,18 +2,119 @@
|
||||
|
||||
if [ -f ${1}/.version ]; then
|
||||
cat ${1}/.version
|
||||
elif [ -f ${1}/.svnrevision ]; then
|
||||
echo SVN-`cat ${1}/.svnbranch`-r`cat ${1}/.svnrevision`
|
||||
elif [ -d ${1}/.svn ]; then
|
||||
PARTS=`LANG=C svn info ${1} | grep URL | awk '{print $2;}' | sed -e s:^.*/svn/${2}/:: | sed -e 's:/: :g'`
|
||||
BRANCH=0
|
||||
TEAM=0
|
||||
|
||||
REV=`svnversion -c ${1} | cut -d: -f2`
|
||||
|
||||
if [ "${PARTS}" = "trunk" ]
|
||||
then
|
||||
echo SVN-'trunk'-r${REV}
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for PART in $PARTS
|
||||
do
|
||||
if [ ${BRANCH} != 0 ]
|
||||
then
|
||||
RESULT="${RESULT}-${PART}"
|
||||
break
|
||||
fi
|
||||
|
||||
if [ ${TEAM} != 0 ]
|
||||
then
|
||||
RESULT="${RESULT}-${PART}"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "${PART}" = "branches" ]
|
||||
then
|
||||
BRANCH=1
|
||||
RESULT="branch"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "${PART}" = "tags" ]
|
||||
then
|
||||
BRANCH=1
|
||||
RESULT="tag"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "${PART}" = "team" ]
|
||||
then
|
||||
TEAM=1
|
||||
continue
|
||||
fi
|
||||
done
|
||||
|
||||
echo SVN-${RESULT##-}-r${REV}
|
||||
elif [ -d ${1}/.git ]; then
|
||||
VERSION=`git describe --tags --dirty=M 2> /dev/null | sed -e "s/^v\([0-9]\)/\1/"`
|
||||
if [ $? -ne 0 ]; then
|
||||
MODIFIED=""
|
||||
# If the first log commit messages indicates that this is checked into
|
||||
# subversion, we'll just use the SVN- form of the revision.
|
||||
MODIFIED=""
|
||||
SVN_REV=`git log --pretty=full -1 | grep -F "git-svn-id:" | sed -e "s/.*\@\([^\s]*\)\s.*/\1/g"`
|
||||
if [ -z "$SVN_REV" ]; then
|
||||
VERSION=`git describe --tags --dirty=M 2> /dev/null | sed -e "s/^v\([0-9]\)/\1/"`
|
||||
if [ $? -ne 0 ]; then
|
||||
if [ "`git ls-files -m | wc -l`" != "0" ]; then
|
||||
MODIFIED="M"
|
||||
fi
|
||||
# Some older versions of git do not support all the above
|
||||
# options.
|
||||
VERSION=GIT-`git rev-parse --short --verify HEAD`${MODIFIED}
|
||||
fi
|
||||
echo ${VERSION}
|
||||
else
|
||||
PARTS=`LANG=C git log --pretty=full | grep -F "git-svn-id:" | head -1 | awk '{print $2;}' | sed -e s:^.*/svn/$2/:: | sed -e 's:/: :g' | sed -e 's/@.*$//g'`
|
||||
BRANCH=0
|
||||
TEAM=0
|
||||
|
||||
if [ "`git ls-files -m | wc -l`" != "0" ]; then
|
||||
MODIFIED="M"
|
||||
fi
|
||||
# Some older versions of git do not support all the above
|
||||
# options.
|
||||
VERSION=GIT-`git rev-parse --short --verify HEAD`${MODIFIED}
|
||||
|
||||
if [ "${PARTS}" = "trunk" ]; then
|
||||
echo SVN-'trunk'-r${SVN_REV}${MODIFIED}
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for PART in $PARTS
|
||||
do
|
||||
if [ ${BRANCH} != 0 ]; then
|
||||
RESULT="${RESULT}-${PART}"
|
||||
break
|
||||
fi
|
||||
|
||||
if [ ${TEAM} != 0 ]; then
|
||||
RESULT="${RESULT}-${PART}"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "${PART}" = "branches" ]; then
|
||||
BRANCH=1
|
||||
RESULT="branch"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "${PART}" = "tags" ]; then
|
||||
BRANCH=1
|
||||
RESULT="tag"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "${PART}" = "team" ]; then
|
||||
TEAM=1
|
||||
continue
|
||||
fi
|
||||
done
|
||||
|
||||
echo SVN-${RESULT##-}-r${SVN_REV}${MODIFIED}
|
||||
fi
|
||||
echo ${VERSION}
|
||||
else
|
||||
# Use the directory information in the absence of any other version
|
||||
# information
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
MODULES="dahdi"
|
||||
DAHDI_MODULES_FILE="/etc/dahdi/modules"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
$0: loads / unloads DAHDI kernel modules
|
||||
|
||||
Usage: $0 <load|unload>
|
||||
|
||||
* load: Loads all modules listed in /etc/dahdi/modules (one per line)
|
||||
* unload: Unloads the DAHDI modules (all the modules that are dependencies
|
||||
of $MODULES).
|
||||
EOF
|
||||
}
|
||||
|
||||
# recursively unload a module and its dependencies, if possible.
|
||||
# where's modprobe -r when you need it?
|
||||
# inputs: module to unload.
|
||||
# returns: the result from
|
||||
unload_module() {
|
||||
module="$1"
|
||||
line=`lsmod 2>/dev/null | grep "^$1 "`
|
||||
if [ "$line" = '' ]; then return; fi # module was not loaded
|
||||
|
||||
set -- $line
|
||||
# $1: the original module, $2: size, $3: refcount, $4: deps list
|
||||
mods=`echo $4 | tr , ' '`
|
||||
ec_modules=""
|
||||
# xpp_usb keeps the xpds below busy if an xpp hardware is
|
||||
# connected. Hence must be removed before them:
|
||||
case "$module" in xpd_*) mods="xpp_usb $mods";; esac
|
||||
|
||||
for mod in $mods; do
|
||||
case "$mod" in
|
||||
dahdi_echocan_*)
|
||||
ec_modules="$mod $ec_modules"
|
||||
;;
|
||||
*)
|
||||
# run in a subshell, so it won't step over our vars:
|
||||
(unload_module $mod)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
# Now that all the other dependencies are unloaded, we can unload the
|
||||
# dahdi_echocan modules. The drivers that register spans may keep
|
||||
# references on the echocan modules before they are unloaded.
|
||||
for mod in $ec_modules; do
|
||||
(unload_module $mod)
|
||||
done
|
||||
rmmod $module
|
||||
}
|
||||
|
||||
unload_modules() {
|
||||
for module in "$@"; do
|
||||
unload_module $module
|
||||
done
|
||||
}
|
||||
|
||||
load_modules() {
|
||||
modules=`sed -e 's/#.*$//' $DAHDI_MODULES_FILE 2>/dev/null`
|
||||
for line in $modules; do
|
||||
modprobe $line
|
||||
done
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
load) load_modules "$@";;
|
||||
unload) unload_modules $MODULES;;
|
||||
*) usage;;
|
||||
esac
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include <dahdi/kernel.h>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -248,8 +248,8 @@
|
||||
#define V_ROUT_TX_STIO2 (0x3 << 6) /* output data to STIO2 */
|
||||
#define V_ROUT_RX_DIS (0x0 << 6) /* disabled, input data ignored */
|
||||
#define V_ROUT_RX_LOOP (0x1 << 6) /* internally looped, input data ignored */
|
||||
#define V_ROUT_RX_STIO2 (0x2 << 6) /* channel data from STIO2 */
|
||||
#define V_ROUT_RX_STIO1 (0x3 << 6) /* channel data from STIO1 */
|
||||
#define V_ROUT_RX_STIO2 (0x2 << 6) /* channel data comes from STIO1 */
|
||||
#define V_ROUT_RX_STIO1 (0x3 << 6) /* channel data comes from STIO2 */
|
||||
|
||||
#define V_CH_SNUM_SHIFT (1)
|
||||
#define V_CH_SNUM_MASK (31 << 1)
|
||||
@@ -367,16 +367,6 @@
|
||||
#define V_B2_RX_EN (1 << 1) /* 1=enable B2 RX */
|
||||
#define V_ST_TRI (1 << 6) /* 1=tristate S/T output buffer */
|
||||
|
||||
/* User Flash Manager */
|
||||
#define UFM_PROGRAM (1<<0)
|
||||
#define UFM_ERASE (1<<1)
|
||||
#define UFM_DRSHIFT (1<<2)
|
||||
#define UFM_DRDIN (1<<3)
|
||||
#define UFM_DRCLK (1<<4)
|
||||
#define UFM_ARSHIFT (1<<5)
|
||||
#define UFM_ARDIN (1<<6)
|
||||
#define UFM_ARCLK (1<<7)
|
||||
|
||||
#define NUM_REGS 0xff
|
||||
#define NUM_PCI 12
|
||||
|
||||
@@ -395,8 +385,7 @@
|
||||
|
||||
struct b4xxp_span {
|
||||
struct b4xxp *parent;
|
||||
int port; /* virtual port */
|
||||
int phy_port; /* physical port */
|
||||
int port; /* which S/T port this span belongs to */
|
||||
|
||||
unsigned char writechunk[WCB4XXP_CHANNELS_PER_SPAN * DAHDI_CHUNKSIZE];
|
||||
unsigned char readchunk[WCB4XXP_CHANNELS_PER_SPAN * DAHDI_CHUNKSIZE];
|
||||
@@ -437,9 +426,7 @@ enum cards_ids { /* Cards ==> Brand & Model */
|
||||
BN4S0, /* Beronet BN4S0 */
|
||||
BN8S0, /* BeroNet BN8S0 */
|
||||
BSWYX_SX2, /* Swyx 4xS0 SX2 QuadBri */
|
||||
QUADBRI_EVAL, /* HFC-4S CCD Eval. Board */
|
||||
B430P, /* Digium B430P */
|
||||
B230P /* Digium B230P */
|
||||
QUADBRI_EVAL /* HFC-4S CCD Eval. Board */
|
||||
};
|
||||
|
||||
/* This structure exists one per card */
|
||||
|
||||
@@ -49,9 +49,7 @@ static DEF_PARM(int, debug, 0, 0644, "Print DBG statements");
|
||||
static DEF_PARM(int, usb1, 0, 0644, "Allow using USB 1.1 interfaces");
|
||||
static DEF_PARM(uint, tx_sluggish, 2000, 0644, "A sluggish transmit (usec)");
|
||||
static DEF_PARM(uint, drop_pcm_after, 6, 0644,
|
||||
"Number of consecutive tx_sluggish to start dropping PCM");
|
||||
static DEF_PARM(uint, sluggish_pcm_keepalive, 50, 0644,
|
||||
"During sluggish -- Keep-alive PCM (1 every #)");
|
||||
"Number of consecutive tx_sluggish to drop a PCM frame");
|
||||
|
||||
#include "dahdi_debug.h"
|
||||
|
||||
@@ -119,8 +117,6 @@ enum {
|
||||
XUSB_N_TX_FRAMES,
|
||||
XUSB_N_RX_ERRORS,
|
||||
XUSB_N_TX_ERRORS,
|
||||
XUSB_N_RX_DROPS,
|
||||
XUSB_N_TX_DROPS,
|
||||
XUSB_N_RCV_ZERO_LEN,
|
||||
};
|
||||
|
||||
@@ -131,14 +127,8 @@ enum {
|
||||
static struct xusb_counters {
|
||||
char *name;
|
||||
} xusb_counters[] = {
|
||||
C_(RX_FRAMES),
|
||||
C_(TX_FRAMES),
|
||||
C_(RX_ERRORS),
|
||||
C_(TX_ERRORS),
|
||||
C_(RX_DROPS),
|
||||
C_(TX_DROPS),
|
||||
C_(RCV_ZERO_LEN),
|
||||
};
|
||||
C_(RX_FRAMES), C_(TX_FRAMES), C_(RX_ERRORS), C_(TX_ERRORS),
|
||||
C_(RCV_ZERO_LEN),};
|
||||
|
||||
#undef C_
|
||||
|
||||
@@ -204,7 +194,8 @@ struct xusb {
|
||||
unsigned int max_tx_delay;
|
||||
uint usb_tx_delay[NUM_BUCKETS];
|
||||
uint sluggish_debounce;
|
||||
bool drop_pcm; /* due to sluggishness */
|
||||
bool drop_next_pcm; /* due to sluggishness */
|
||||
atomic_t pcm_tx_drops;
|
||||
atomic_t usb_sluggish_count;
|
||||
|
||||
const char *manufacturer;
|
||||
@@ -409,23 +400,12 @@ static int xframe_send_pcm(xbus_t *xbus, xframe_t *xframe)
|
||||
BUG_ON(!xframe);
|
||||
xusb = xusb_of(xbus);
|
||||
BUG_ON(!xusb);
|
||||
if (xusb->drop_pcm) {
|
||||
static int rate_limit;
|
||||
|
||||
if ((rate_limit++ % 1000) == 0)
|
||||
XUSB_ERR(xusb, "Sluggish USB: drop tx-pcm (%d)\n",
|
||||
rate_limit);
|
||||
/* Let trickle of TX-PCM, so Astribank will not reset */
|
||||
if (sluggish_pcm_keepalive &&
|
||||
((rate_limit % sluggish_pcm_keepalive) != 0)) {
|
||||
XUSB_COUNTER(xusb, TX_DROPS)++;
|
||||
goto err;
|
||||
}
|
||||
if (xusb->drop_next_pcm) {
|
||||
FREE_SEND_XFRAME(xbus, xframe); /* return to pool */
|
||||
xusb->drop_next_pcm = 0;
|
||||
return -EIO;
|
||||
}
|
||||
return do_send_xframe(xbus, xframe);
|
||||
err:
|
||||
FREE_SEND_XFRAME(xbus, xframe); /* return to pool */
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -694,6 +674,7 @@ static int xusb_probe(struct usb_interface *interface,
|
||||
sema_init(&xusb->sem, 1);
|
||||
atomic_set(&xusb->pending_writes, 0);
|
||||
atomic_set(&xusb->pending_reads, 0);
|
||||
atomic_set(&xusb->pcm_tx_drops, 0);
|
||||
atomic_set(&xusb->usb_sluggish_count, 0);
|
||||
xusb->udev = udev;
|
||||
xusb->interface = interface;
|
||||
@@ -897,6 +878,7 @@ static void xpp_send_callback(USB_PASS_CB(urb))
|
||||
i = NUM_BUCKETS - 1;
|
||||
xusb->usb_tx_delay[i]++;
|
||||
if (unlikely(usec > tx_sluggish)) {
|
||||
atomic_inc(&xusb->usb_sluggish_count);
|
||||
if (xusb->sluggish_debounce++ > drop_pcm_after) {
|
||||
static int rate_limit;
|
||||
|
||||
@@ -906,14 +888,12 @@ static void xpp_send_callback(USB_PASS_CB(urb))
|
||||
"Sluggish USB. Dropping next PCM frame "
|
||||
"(pending_writes=%d)\n",
|
||||
writes);
|
||||
atomic_inc(&xusb->usb_sluggish_count);
|
||||
xusb->drop_pcm = 1;
|
||||
atomic_inc(&xusb->pcm_tx_drops);
|
||||
xusb->drop_next_pcm = 1;
|
||||
xusb->sluggish_debounce = 0;
|
||||
}
|
||||
} else {
|
||||
} else
|
||||
xusb->sluggish_debounce = 0;
|
||||
xusb->drop_pcm = 0;
|
||||
}
|
||||
/* sync/async unlink faults aren't errors */
|
||||
if (urb->status
|
||||
&& !(urb->status == -ENOENT || urb->status == -ECONNRESET)) {
|
||||
@@ -976,26 +956,6 @@ static void xpp_receive_callback(USB_PASS_CB(urb))
|
||||
// if (debug)
|
||||
// dump_xframe("USB_FRAME_RECEIVE", xbus, xframe, debug);
|
||||
XUSB_COUNTER(xusb, RX_FRAMES)++;
|
||||
if (xusb->drop_pcm) {
|
||||
/* some protocol analysis */
|
||||
static int rate_limit;
|
||||
xpacket_t *pack = (xpacket_t *)(xframe->packets);
|
||||
bool is_pcm = XPACKET_IS_PCM(pack);
|
||||
|
||||
if (is_pcm) {
|
||||
if ((rate_limit++ % 1000) == 0)
|
||||
XUSB_ERR(xusb,
|
||||
"Sluggish USB: drop rx-pcm (%d)\n",
|
||||
rate_limit);
|
||||
/* Let trickle of RX-PCM, so Astribank will not reset */
|
||||
if (sluggish_pcm_keepalive &&
|
||||
((rate_limit % sluggish_pcm_keepalive)
|
||||
!= 0)) {
|
||||
XUSB_COUNTER(xusb, RX_DROPS)++;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Send UP */
|
||||
xbus_receive_xframe(xbus, xframe);
|
||||
end:
|
||||
@@ -1101,16 +1061,17 @@ static int xusb_read_proc_show(struct seq_file *sfile, void *data)
|
||||
stamp_last_pcm_read, accumulate_diff);
|
||||
#endif
|
||||
memcpy(usb_tx_delay, xusb->usb_tx_delay, sizeof(usb_tx_delay));
|
||||
seq_printf(sfile, "usb_tx_delay[%dus - %dus]: ",
|
||||
USEC_BUCKET * BUCKET_START,
|
||||
USEC_BUCKET * NUM_BUCKETS);
|
||||
seq_printf(sfile, "usb_tx_delay[%d,%d,%d]: ", USEC_BUCKET,
|
||||
BUCKET_START, NUM_BUCKETS);
|
||||
for (i = BUCKET_START; i < NUM_BUCKETS; i++) {
|
||||
seq_printf(sfile, "%6d ", usb_tx_delay[i]);
|
||||
if (i == mark_limit)
|
||||
seq_printf(sfile, "| ");
|
||||
}
|
||||
seq_printf(sfile, "\nSluggish events: %d\n",
|
||||
atomic_read(&xusb->usb_sluggish_count));
|
||||
seq_printf(sfile, "\nPCM_TX_DROPS: %5d (sluggish: %d)\n",
|
||||
atomic_read(&xusb->pcm_tx_drops),
|
||||
atomic_read(&xusb->usb_sluggish_count)
|
||||
);
|
||||
seq_printf(sfile, "\nCOUNTERS:\n");
|
||||
for (i = 0; i < XUSB_COUNTER_MAX; i++) {
|
||||
seq_printf(sfile, "\t%-15s = %d\n", xusb_counters[i].name,
|
||||
|
||||
Reference in New Issue
Block a user