Compare commits

..

30 Commits

Author SHA1 Message Date
Tzafrir Cohen
8d1f17fc44 dahdi-modules: load and unloads the modules
A script that performs the module loading / unloading instead of the
init script.

Other functionality of the init script is performed by udev hooks. But
manual initiation of modules loading or unloading is still needed on
several occasions.

This script should help enable the removal of the init script from the
DAHDI package.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-11-05 18:11:57 +02:00
Oron Peled
404a67d089 xpp: improve handling of USB sluggishness
* Drop PCM during sluggish events:
  - Drop both rx/tx (was only tx)
  - Drop almost all pcm until sluggishness stops (used to drop only
    single pcm each time).
  - Renamed: "drop_next_pcm" -> "drop_pcm" (to match new semantics)
  - Still allow "keep alive" PCM so Astribank will not reset FXS high-voltage.
    The "sluggish_pcm_keepalive" parameter set the rate (1/50 by default)
  - Added rx/tx drop statistics counters
  - Removed "pcm_tx_drops" (replaced by new statistics counters)

* Also improved format of /proc/xpp/XBUS-*/xpp_usb:
  - Show cummulative number of sluggish events.
  - Clearly show range (in usec) of usb_tx_delay[]

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-11-02 10:49:42 +02:00
Russ Meyerriecks
fac77101fb wcb4xxp: Print serial number of gen 2 cards.
Now prints the serial number of the card to the kernel log for cards which
support this feature. This include the wcb23x and wcb43x series.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-10-27 09:54:43 -05:00
Russ Meyerriecks
80e0426dd6 wcb4xxp: Add support for wcb23x series
Adds support for Digium's new dual span wcb23x series cards. Also other minor
improvements for the new generation cards including the wcb23x and wcb43x

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-10-27 09:54:35 -05:00
Russ Meyerriecks
dd3c4ba015 wcb4xxp: Protect indirect register writes with sequence lock
A few of the indirect register writes to the A_ST_* indirect registers weren't
being protected by any kind of sequence lock. This could lead to potential race
conditions of two spans were configured simultaneously.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-10-23 16:25:59 -05:00
Russ Meyerriecks
92b645786d wcb4xxp: minor: Squelch initializing message on shutdown
The hw init function gets called on a module remove in order to reset the
hardware before shutdown. This was causing "Initializing zarlink echocan" to
print on shutdown which could be confusing.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-10-23 16:25:59 -05:00
Russ Meyerriecks
2cba62718f wcb4xxp: Remove "card sync source" logic
This logic was reading and printing the bri chips automatic selection of sync
source. We always use manual sync selection in the driver so this doesn't need
to exist.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-10-23 16:25:59 -05:00
Russ Meyerriecks
aa6a56863d octasic: Added slab.h include to fix ARM compile error
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-10-14 13:37:28 -05:00
Russ Meyerriecks
501222044c readme: Updated supported products section
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-10-14 13:30:28 -05:00
Shaun Ruffell
d5f13c5116 wctc4xxp: Clear packet error count when reloading firmware.
When the firmware is reloaded and reset, the packet error count is not.
This can create a condition where the firmware could report an error like
the following if a channel was closed without any new errors:

  wctc4xxp 0000:07:08.0: 18446744073709551597 errored receive packets

wcdte.packet_errors is also renamed to wcdte.reported_packet_errors to not
conflict with the packet_errors member of the descriptor lists.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-06-04 15:04:45 -05:00
Russ Meyerriecks
4df03284a8 wctc4xxp: Fix continuous "errored receive packets" with 2+ transcoders
In the case where two transcoders are loaded in a system and one transcoder
experiences an errored receive packet condition, the logic would ping pong the
error between the two cards, causing a runaway stream of errors in the kernel
log.

This fix moves the global error count var into the wcdte struct to allow for
per-card logic.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
2015-05-13 14:47:10 -05:00
Shaun Ruffell
8cd0823978 dahdi: Remove IRQF_DISABLED.
The IRQF_DISABLED flag was removed in 4.1 in commit
"genirq: Remove the deprecated 'IRQF_DISABLED' request_irq() flag entirely" [1].

By default all interrupt handlers are now run with interrupts disabled and
therefore should all be considered "fast interrupts". Any driver that was still
using the flag will now lock interrupts directly in the handler in case running
on an older kernel that is not disabling interrupts when running the handler.

[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d8bf368d0631d4bc2612d8bf2e4e8e74e620d0cc

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-05-13 14:45:01 -05:00
Shaun Ruffell
64a98af676 Remove DAHDI_IRQF_[SHARED|DISABLED] flags.
These flags are direct mappings to the IRQF_[SHARED|DISABLED] flags and no
longer need to be kept separate.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-05-13 14:45:01 -05:00
Shaun Ruffell
7ca082887a build_tools/make_version: Remove support for subversion working copies.
It has now been years since subversion has been used with this project. We can
go ahead and simplify the version script now.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-05-13 14:45:01 -05:00
Russ Meyerriecks
a008cc03b7 wcb4xxp: Add support for zarlink echocan
Introduces support for new series b43x cards which make use of the zarlink echo
canceller. Made as few changes to the b410 operation as possible, but the
critical region had some cleanups, so it may be a bit more performant.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-03-30 13:18:12 -05:00
John Sloan
ae5fa08abd wcxb: Fix "I/O error reported by firmware" followed by underruns
The cards affected include the TE131/3, TE235/435, A4B, and A8B.

Update all PCIe cards' firmware to increase the incoming and outgoing TDM FIFOs
to 16ms. The FIFOs will only be filled to a depth equal to the driver's latency
setting (ie. 3ms default). The total system latency is not effected. The
firmware and driver now also report the maximum DMA transaction time when in
DEBUG mode to aid in determining if the system is experiencing long PCIe
transactions (ie. TLP completion timeouts).

Decreased the maximum latency to from 20 to 12ms

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-03-30 13:18:12 -05:00
Tzafrir Cohen
6287954087 xpp: USB_FW*: fix incorrect chan num with 2FXS6FXO
New USB firmware that fix mis-reporting of the number of channels (or
rather: licenses) in the Astribank when a 2FXS6FXO module is used in
conjunction with another module.

USB_FW.hex: rev. 11452
USB_FW.201.hex: rev. 11453

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-03-30 16:02:48 +03:00
Tzafrir Cohen
b978e35636 README: use file time for reproducable build
https://bugs.debian.org/776622 asks to avoid using the build time in the
generated result to help make the build reproducable.

This fix uses the timestamp of README for generating the timestamp in
the footer of README.html.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-03-02 21:11:59 +02:00
Tzafrir Cohen
5c072d5bce xpp: module_refcount is back to int on 3.19
Commit d5db139ab3764640e0882a1746e7b9fdee33fd87 "module: make
module_refcount() a signed integer." included in 3.19 makes this
condition slightly more complex.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-03-02 21:11:57 +02:00
Shaun Ruffell
1559db9d1a dahdi: strnicmp() -> strncasecmp()
With commit (af3cd13501 "lib/string.c: remove strnicmp()") [1] dahdi can no
longer call strnicmp directly. strncasecmp was added into lib/string.c in kernel
version 2.6.22 so we'll map calls to strncasecmp to strnicmp for any kernel
before that.

This is necessary to compile against kernels >= 4.0.

[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=af3cd13501

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-03-02 21:09:19 +02:00
Shaun Ruffell
1cc0ad510a dahdi: Fix "void value not ignored..." error when compiling against kernel 4.0.
With commit (d1f1052c52 "device: Change dev_<level> logging functions to return
void") [1] in kernel version 4.0, DAHDI would fail to compile with the following
error:

  .../drivers/dahdi/dahdi-base.c:7150:2: error: void value not ignored as it ought to be
    dahdi_dev_dbg(ASSIGN, span_device(span),
    ^

Now ignore the dev_printk return value.

[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d1f1052c5204524

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2015-03-02 21:07:21 +02:00
Shaun Ruffell
4d86a8f3f6 dahdi: struct file.f_dentry macro was removed in kernel 3.19
This is necessary to build against kernel version 3.19 since commit
(78d28e651f97866d608d9b41 "kill f_dentry macro") [1]

[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=78d28e651

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-01-20 16:48:33 -06:00
Shaun Ruffell
e005030995 dahdi_dynamic: Release reference count on network device when destroying dynamic spans.
It was reported that for VLAN interfaces, failing to release this reference
count will prevent a system from rebooting properly, resulting in the need to
power cycle.

Reported-by: Assen Totin
Internal-Issue-ID: DAHLIN-343
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-01-20 16:47:55 -06:00
Tzafrir Cohen
ee691c23f4 xpp: firmware: a stray ^Z in FPGA_1161.201.hex 2014-11-17 18:00:51 +02:00
Tzafrir Cohen
9698657f7a xpp: firmware: 203 as alias to (newer) 201
Latest Astribank firmware (as of Rev. 11426 also supports some newer
hardware types, which will have the ID 203. Anyone installing this newer
version will now have 203 as an alias, but older versions will not have
it.
2014-11-17 17:55:47 +02:00
Tzafrir Cohen
79bf41ea8b xpp: FPGA_1161.201.hex: module types detection
New firmware that includes a better way to identify hardware modules
type that does not require multiplexers.

This is firmware file FPGA_1161.201.hex rev. 11426.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-11-05 20:08:47 +02:00
Shaun Ruffell
41b5353338 build_tools/dkms-helper: Use bash to process dkms-helper script.
Looks like there are some bashims in the script. Make this explicit in the
script until they can be taken out.

This fixes failures to run this script on Ubuntu when dash is the default shell.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-10-20 11:26:14 -05:00
Shaun Ruffell
378986841c dahdi: smp_mb_{before,after}_clear_bit -> smp_mb_{before,after}_atomic.
This is needed to compile against upstream Linux 3.18 since commit
"locking: Remove deprecated smp_mb__() barriers" [1].

[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2e39465abc4b7856a0ea6fcf4f

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-10-20 11:26:14 -05:00
Shaun Ruffell
b9a8000bbd dahdi: Fix failure to read / write on kernel 3.16+
Kernel version 3.16+, since upstream commit (7f7f25e82d54870d "replace checking
for ->read/->aio_read presence with check in ->f_mode" )[1], does not like it
when dahdi changes the set of allowed file operations on a file descriptor
outside of the context of an open() system call.

DAHDI changes the available file operations when a channel is opened by first
opening /dev/dahdi/channel and then calling the DAHDI_SPECIFY ioctl to bind it
to a particular DAHDI channel. Until DAHDI_SPECIFY is called there weren't any
read()/write() callbacks implemented and therefore after the initial open, the
kernel was setting not setting FMODE_CAN_{WRITE,READ} on the file descriptor
indicating that those operations were not allowed.

Now define empty shell functions on the general dahdi_fops so the vfs layer will
not mark a file descriptor as unwritteable or unreadable on open.

[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=7f7f25e82d54870df24d415a7007fbd327da027b

Internal-Issue-ID: DAHLIN-340
Reported-and-tested-by: Thomas B. Clark
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-09-17 16:29:16 -05:00
Michael Walton
eedb4bf944 dynamic: Prevent oops due to inverted compile flag
The logic on ENABLE_TASKELETS compiler flag was inverted causing an oops on
normal dahdi_cfg of a dynamic span.

Issue-id: https://issues.asterisk.org/jira/browse/DAHLIN-328

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
2014-08-15 14:58:47 -05:00
35 changed files with 16673 additions and 16116 deletions

View File

@@ -196,7 +196,8 @@ test:
docs: $(GENERATED_DOCS)
README.html: README
$(ASCIIDOC_CMD) -o $@ $<
date=`stat -c "%y" $<`
$(ASCIIDOC_CMD) -a revdate="$$date" -o $@ $<
dahdi-api.html: drivers/dahdi/dahdi-base.c
build_tools/kernel-doc --kernel $(KSRC) $^ >$@

15
README
View File

@@ -12,6 +12,16 @@ 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
@@ -34,6 +44,11 @@ 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

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -e

View File

@@ -2,119 +2,18 @@
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
# 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
VERSION=`git describe --tags --dirty=M 2> /dev/null | sed -e "s/^v\([0-9]\)/\1/"`
if [ $? -ne 0 ]; then
MODIFIED=""
if [ "`git ls-files -m | wc -l`" != "0" ]; then
MODIFIED="M"
fi
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}
# 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
# Use the directory information in the absence of any other version
# information

72
dahdi-modules Executable file
View File

@@ -0,0 +1,72 @@
#!/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

View File

@@ -98,7 +98,11 @@
#define chan_to_netdev(h) ((h)->hdlcnetdev->netdev)
/* macro-oni for determining a unit (channel) number */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
#define UNIT(file) MINOR(file->f_dentry->d_inode->i_rdev)
#else
#define UNIT(file) MINOR(file->f_path.dentry->d_inode->i_rdev)
#endif
EXPORT_SYMBOL(dahdi_transcode_fops);
EXPORT_SYMBOL(dahdi_init_tone_state);
@@ -10284,6 +10288,18 @@ MODULE_PARM_DESC(auto_assign_spans,
"channel numbers assigned by the driver. If 0, user space "
"will need to assign them via /sys/bus/dahdi_devices.");
static ssize_t dahdi_no_read(struct file *file, char __user *usrbuf,
size_t count, loff_t *ppos)
{
return -ENOSYS;
}
static ssize_t dahdi_no_write(struct file *file, const char __user *usrbuf,
size_t count, loff_t *ppos)
{
return -ENOSYS;
}
static const struct file_operations dahdi_fops = {
.owner = THIS_MODULE,
.open = dahdi_open,
@@ -10297,6 +10313,8 @@ static const struct file_operations dahdi_fops = {
.ioctl = dahdi_ioctl,
#endif
.poll = dahdi_poll,
.read = dahdi_no_read,
.write = dahdi_no_write,
};
static const struct file_operations dahdi_timer_fops = {
@@ -10311,6 +10329,8 @@ static const struct file_operations dahdi_timer_fops = {
.ioctl = dahdi_timer_ioctl,
#endif
.poll = dahdi_timer_poll,
.read = dahdi_no_read,
.write = dahdi_no_write,
};
/*

View File

@@ -201,7 +201,9 @@ static void dahdi_dynamic_sendmessage(struct dahdi_dynamic *d)
static void __dahdi_dynamic_run(void)
{
struct dahdi_dynamic *d;
#ifdef ENABLE_TASKLETS
struct dahdi_dynamic_driver *drv;
#endif
rcu_read_lock();
list_for_each_entry_rcu(d, &dspan_list, list) {
@@ -211,6 +213,13 @@ static void __dahdi_dynamic_run(void)
}
#ifdef ENABLE_TASKLETS
list_for_each_entry_rcu(drv, &driver_list, list) {
/* Flush any traffic still pending in the driver */
if (drv->flush) {
drv->flush();
}
}
#else
/* If tasklets are not enabled, the above section will be called in
* interrupt context and the flushing of each driver will be called in a
* separate tasklet that only handles that. This is necessary since some
@@ -221,13 +230,6 @@ static void __dahdi_dynamic_run(void)
*
*/
tasklet_hi_schedule(&dahdi_dynamic_flush_tlet);
#else
list_for_each_entry_rcu(drv, &driver_list, list) {
/* Flush any traffic still pending in the driver */
if (drv->flush) {
drv->flush();
}
}
#endif
rcu_read_unlock();
}

View File

@@ -266,6 +266,7 @@ static void ztdeth_destroy(struct dahdi_dynamic *dyn)
struct ztdeth *z = dyn->pvt;
unsigned long flags;
struct ztdeth *prev=NULL, *cur;
spin_lock_irqsave(&zlock, flags);
cur = zdevs;
while(cur) {
@@ -279,12 +280,14 @@ static void ztdeth_destroy(struct dahdi_dynamic *dyn)
prev = cur;
cur = cur->next;
}
spin_unlock_irqrestore(&zlock, flags);
if (cur == z) { /* Successfully removed */
dyn->pvt = NULL;
dev_put(z->dev);
printk(KERN_INFO "TDMoE: Removed interface for %s\n", z->span->name);
kfree(z);
}
spin_unlock_irqrestore(&zlock, flags);
}
static int ztdeth_create(struct dahdi_dynamic *dyn, const char *addr)

View File

@@ -31,14 +31,14 @@ VPMADT032_VERSION:=1.25.0
HX8_VERSION:=2.06
VPMOCT032_VERSION:=1.12.0
WCT820_VERSION:=1.76
TE133_VERSION:=780019
TE133_VERSION:=7a001e
TE134_VERSION:=780017
TE435_VERSION:=e0019
TE435_VERSION:=13001e
TE436_VERSION:=10017
A8A_VERSION:=1d0017
A8B_VERSION:=1d0019
A8B_VERSION:=1f001e
A4A_VERSION:=a0017
A4B_VERSION:=b0019
A4B_VERSION:=d001e
FIRMWARE_URL:=http://downloads.digium.com/pub/telephony/firmware/releases

View File

@@ -22,6 +22,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <dahdi/kernel.h>

View File

@@ -1784,7 +1784,8 @@ static int __devinit pciradio_init_one(struct pci_dev *pdev, const struct pci_de
}
if (request_irq(pdev->irq, pciradio_interrupt, DAHDI_IRQ_SHARED, "pciradio", rad)) {
if (request_irq(pdev->irq, pciradio_interrupt,
IRQF_SHARED, "pciradio", rad)) {
printk(KERN_NOTICE "pciradio: Unable to request IRQ %d\n", pdev->irq);
if (rad->freeregion)
release_region(rad->ioaddr, 0xff);

View File

@@ -543,7 +543,7 @@ static int __devinit tor2_probe(struct pci_dev *pdev, const struct pci_device_id
for (x = 0; x < 256; x++)
writel(0x7f7f7f7f, &tor->mem32[x]);
if (request_irq(tor->irq, tor2_intr, DAHDI_IRQ_SHARED_DISABLED, "tor2", tor)) {
if (request_irq(tor->irq, tor2_intr, IRQF_SHARED, "tor2", tor)) {
printk(KERN_ERR "Unable to request tormenta IRQ %d\n", tor->irq);
goto err_out_release_all;
}
@@ -1200,6 +1200,7 @@ DAHDI_IRQ_HANDLER(tor2_intr)
unsigned char c, rxc;
unsigned char abits, bbits;
struct tor2 *tor = (struct tor2 *) dev_id;
unsigned long flags;
/* make sure its a real interrupt for us */
if (!(readb(&tor->mem8[STATREG]) & INTACTIVE)) /* if not, just return */
@@ -1207,6 +1208,8 @@ DAHDI_IRQ_HANDLER(tor2_intr)
return IRQ_NONE;
}
local_irq_save(flags);
if (tor->cardtype == TYPE_E1) {
/* set outbit, interrupt enable, and ack interrupt */
writeb(OUTBIT | INTENA | INTACK | E1DIV | tor->master,
@@ -1504,6 +1507,8 @@ DAHDI_IRQ_HANDLER(tor2_intr)
else
/* clear OUTBIT and enable interrupts */
writeb(INTENA | tor->master, &tor->mem8[CTLREG]);
local_irq_restore(flags);
return IRQ_RETVAL(1);
}

View File

@@ -1885,7 +1885,7 @@ __voicebus_init(struct voicebus *vb, const char *board_name,
goto cleanup;
#if !defined(CONFIG_VOICEBUS_TIMER)
retval = request_irq(vb->pdev->irq, vb_isr, DAHDI_IRQ_SHARED,
retval = request_irq(vb->pdev->irq, vb_isr, IRQF_SHARED,
board_name, vb);
if (retval) {
dev_warn(&vb->pdev->dev, "Failed to request interrupt line.\n");

View File

@@ -3823,7 +3823,7 @@ static void wcaxx_back_out_gracefully(struct wcaxx *wc)
unsigned long flags;
clear_bit(INITIALIZED, &wc->bit_flags);
smp_mb__after_clear_bit();
smp_mb__after_atomic();
/* Make sure we're not on the card list anymore. */
mutex_lock(&card_list_lock);
@@ -3886,9 +3886,9 @@ static int wcaxx_check_firmware(struct wcaxx *wc)
u32 firmware_version;
const bool force_firmware = false;
const unsigned int A4A_VERSION = 0x0a0017;
const unsigned int A4B_VERSION = 0x0b0019;
const unsigned int A4B_VERSION = 0x0d001e;
const unsigned int A8A_VERSION = 0x1d0017;
const unsigned int A8B_VERSION = 0x1d0019;
const unsigned int A8B_VERSION = 0x1f001e;
if (wc->desc == &device_a8a) {
firmware_version = A8A_VERSION;

File diff suppressed because it is too large Load Diff

View File

@@ -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 comes from STIO1 */
#define V_ROUT_RX_STIO1 (0x3 << 6) /* channel data comes from STIO2 */
#define V_ROUT_RX_STIO2 (0x2 << 6) /* channel data from STIO2 */
#define V_ROUT_RX_STIO1 (0x3 << 6) /* channel data from STIO1 */
#define V_CH_SNUM_SHIFT (1)
#define V_CH_SNUM_MASK (31 << 1)
@@ -367,6 +367,16 @@
#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
@@ -385,7 +395,8 @@
struct b4xxp_span {
struct b4xxp *parent;
int port; /* which S/T port this span belongs to */
int port; /* virtual port */
int phy_port; /* physical port */
unsigned char writechunk[WCB4XXP_CHANNELS_PER_SPAN * DAHDI_CHUNKSIZE];
unsigned char readchunk[WCB4XXP_CHANNELS_PER_SPAN * DAHDI_CHUNKSIZE];
@@ -426,7 +437,9 @@ 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 */
QUADBRI_EVAL, /* HFC-4S CCD Eval. Board */
B430P, /* Digium B430P */
B230P /* Digium B230P */
};
/* This structure exists one per card */

View File

@@ -972,7 +972,7 @@ static int __devinit wcfxo_init_one(struct pci_dev *pdev, const struct pci_devic
/* Keep track of which device we are */
pci_set_drvdata(pdev, wc);
if (request_irq(pdev->irq, wcfxo_interrupt, DAHDI_IRQ_SHARED, "wcfxo", wc)) {
if (request_irq(pdev->irq, wcfxo_interrupt, IRQF_SHARED, "wcfxo", wc)) {
printk(KERN_NOTICE "wcfxo: Unable to request IRQ %d\n", pdev->irq);
if (wc->freeregion)
release_region(wc->ioaddr, 0xff);

View File

@@ -1174,6 +1174,8 @@ DAHDI_IRQ_HANDLER(t1xxp_interrupt)
if (!ints)
return IRQ_NONE;
local_irq_save(flags);
outb(ints, wc->ioaddr + WC_INTSTAT);
if (!wc->intcount) {
@@ -1188,13 +1190,13 @@ DAHDI_IRQ_HANDLER(t1xxp_interrupt)
t1xxp_receiveprep(wc, ints);
t1xxp_transmitprep(wc, ints);
}
spin_lock_irqsave(&wc->lock, flags);
spin_lock(&wc->lock);
#if 1
__handle_leds(wc);
#endif
spin_unlock_irqrestore(&wc->lock, flags);
spin_unlock(&wc->lock);
/* Count down timers */
t1xxp_do_counters(wc);
@@ -1220,6 +1222,8 @@ DAHDI_IRQ_HANDLER(t1xxp_interrupt)
if (ints & 0x20)
printk(KERN_INFO "PCI Target abort\n");
local_irq_restore(flags);
return IRQ_RETVAL(1);
}
@@ -1333,7 +1337,7 @@ static int __devinit t1xxp_init_one(struct pci_dev *pdev, const struct pci_devic
/* Keep track of which device we are */
pci_set_drvdata(pdev, wc);
if (request_irq(pdev->irq, t1xxp_interrupt, DAHDI_IRQ_SHARED_DISABLED, "t1xxp", wc)) {
if (request_irq(pdev->irq, t1xxp_interrupt, IRQF_SHARED, "t1xxp", wc)) {
printk(KERN_NOTICE "t1xxp: Unable to request IRQ %d\n", pdev->irq);
kfree(wc);
return -EIO;

View File

@@ -5334,7 +5334,7 @@ t4_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
#ifdef SUPPORT_GEN1
if (request_irq(pdev->irq, (wc->devtype->flags & FLAG_2NDGEN) ?
t4_interrupt_gen2 : t4_interrupt,
DAHDI_IRQ_SHARED,
IRQF_SHARED,
(wc->numspans == 8) ? "wct8xxp" :
(wc->numspans == 2) ? "wct2xxp" :
"wct4xxp",
@@ -5348,7 +5348,7 @@ t4_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
}
if (request_irq(pdev->irq, t4_interrupt_gen2,
DAHDI_IRQ_SHARED, "t4xxp", wc)) {
IRQF_SHARED, "t4xxp", wc)) {
#endif
dev_notice(&wc->dev->dev, "Unable to request IRQ %d\n",
pdev->irq);

View File

@@ -375,6 +375,7 @@ struct wcdte {
#endif
struct timer_list watchdog;
u16 open_channels;
unsigned long reported_packet_errors;
};
struct wcdte_netdev_priv {
@@ -2019,14 +2020,16 @@ wctc4xxp_disable_polling(struct wcdte *wc)
static void wctc4xxp_check_for_rx_errors(struct wcdte *wc)
{
static unsigned long last_errors = 0;
/* get_packet_errors() returns the accumulated total errors */
unsigned long errors = wctc4xxp_get_packet_errors(wc->rxd);
if (last_errors != errors) {
/* Print warning when the number of errors changes */
if (wc->reported_packet_errors != errors) {
if (printk_ratelimit()) {
dev_err(&wc->pdev->dev,
"%lu errored receive packets.\n",
errors - last_errors);
last_errors = errors;
errors - wc->reported_packet_errors);
wc->reported_packet_errors = errors;
}
}
}
@@ -3867,6 +3870,7 @@ static int wctc4xxp_reset_driver_state(struct wcdte *wc)
release_firmware(firmware);
spin_lock_irqsave(&wc->rxd->lock, flags);
wc->rxd->packet_errors = 0;
wc->reported_packet_errors = 0;
spin_unlock_irqrestore(&wc->rxd->lock, flags);
return res;
}
@@ -4105,7 +4109,7 @@ wctc4xxp_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_set_master(pdev);
pci_set_drvdata(pdev, wc);
res = request_irq(pdev->irq, wctc4xxp_interrupt,
DAHDI_IRQ_SHARED, wc->board_name, wc);
IRQF_SHARED, wc->board_name, wc);
if (res) {
dev_err(&wc->pdev->dev,
"Unable to request IRQ %d\n", pdev->irq);

View File

@@ -2684,7 +2684,8 @@ static int __devinit wctdm_init_one(struct pci_dev *pdev, const struct pci_devic
/* Keep track of which device we are */
pci_set_drvdata(pdev, wc);
if (request_irq(pdev->irq, wctdm_interrupt, DAHDI_IRQ_SHARED, "wctdm", wc)) {
if (request_irq(pdev->irq, wctdm_interrupt,
IRQF_SHARED, "wctdm", wc)) {
printk(KERN_NOTICE "wctdm: Unable to request IRQ %d\n", pdev->irq);
if (wc->freeregion)
release_region(wc->ioaddr, 0xff);

View File

@@ -1351,6 +1351,8 @@ DAHDI_IRQ_HANDLER(t1xxp_interrupt)
if (!ints)
return IRQ_NONE;
local_irq_save(flags);
outb(ints, wc->ioaddr + WC_INTSTAT);
if (!wc->intcount) {
@@ -1365,13 +1367,13 @@ DAHDI_IRQ_HANDLER(t1xxp_interrupt)
t1xxp_receiveprep(wc, ints);
t1xxp_transmitprep(wc, ints);
}
spin_lock_irqsave(&wc->lock, flags);
spin_lock(&wc->lock);
#if 1
__handle_leds(wc);
#endif
spin_unlock_irqrestore(&wc->lock, flags);
spin_unlock(&wc->lock);
/* Count down timers */
t1_do_counters(wc);
@@ -1398,6 +1400,7 @@ DAHDI_IRQ_HANDLER(t1xxp_interrupt)
if (ints & 0x20)
printk(KERN_NOTICE "PCI Target abort\n");
local_irq_restore(flags);
return IRQ_RETVAL(1);
}
@@ -1534,7 +1537,8 @@ static int __devinit t1xxp_init_one(struct pci_dev *pdev, const struct pci_devic
/* Keep track of which device we are */
pci_set_drvdata(pdev, wc);
if (request_irq(pdev->irq, t1xxp_interrupt, DAHDI_IRQ_SHARED_DISABLED, "wcte11xp", wc)) {
if (request_irq(pdev->irq, t1xxp_interrupt,
IRQF_SHARED, "wcte11xp", wc)) {
printk(KERN_NOTICE "wcte11xp: Unable to request IRQ %d\n", pdev->irq);
kfree(wc);
return -EIO;

View File

@@ -2110,7 +2110,7 @@ static int t1xxp_set_linemode(struct dahdi_span *span, enum spantypes linemode)
* them. */
clear_bit(INITIALIZED, &wc->bit_flags);
synchronize_irq(wc->vb.pdev->irq);
smp_mb__after_clear_bit();
smp_mb__after_atomic();
del_timer_sync(&wc->timer);
flush_workqueue(wc->wq);
@@ -3076,7 +3076,7 @@ static void __devexit te12xp_remove_one(struct pci_dev *pdev)
remove_sysfs_files(wc);
clear_bit(INITIALIZED, &wc->bit_flags);
smp_mb__after_clear_bit();
smp_mb__after_atomic();
del_timer_sync(&wc->timer);
flush_workqueue(wc->wq);

View File

@@ -45,7 +45,7 @@
static const char *TE133_FW_FILENAME = "dahdi-fw-te133.bin";
static const char *TE134_FW_FILENAME = "dahdi-fw-te134.bin";
static const u32 TE133_FW_VERSION = 0x780019;
static const u32 TE133_FW_VERSION = 0x7a001e;
static const u32 TE134_FW_VERSION = 0x780017;
#define WC_MAX_IFACES 8
@@ -1849,7 +1849,7 @@ static int t13x_set_linemode(struct dahdi_span *span, enum spantypes linemode)
clear_bit(INITIALIZED, &wc->bit_flags);
disable_irq(wc->xb.pdev->irq);
smp_mb__after_clear_bit();
smp_mb__after_atomic();
del_timer_sync(&wc->timer);
flush_workqueue(wc->wq);
@@ -2725,7 +2725,7 @@ static void __devexit te13xp_remove_one(struct pci_dev *pdev)
return;
clear_bit(INITIALIZED, &wc->bit_flags);
smp_mb__after_clear_bit();
smp_mb__after_atomic();
/* Quiesce DMA engine interrupts */
wcxb_stop(&wc->xb);

View File

@@ -66,7 +66,7 @@ static inline int delayed_work_pending(struct work_struct *work)
static const char *TE435_FW_FILENAME = "dahdi-fw-te435.bin";
static const char *TE436_FW_FILENAME = "dahdi-fw-te436.bin";
static const u32 TE435_VERSION = 0xe0019;
static const u32 TE435_VERSION = 0x13001e;
static const u32 TE436_VERSION = 0x10017;
/* #define RPC_RCLK */
@@ -3581,7 +3581,7 @@ static void __devexit t43x_remove_one(struct pci_dev *pdev)
return;
wc->not_ready = 1;
smp_mb__after_clear_bit();
smp_mb__after_atomic();
/* Stop everything */
wcxb_stop(&wc->xb);

View File

@@ -66,7 +66,6 @@
#define DRING_SIZE_MASK (DRING_SIZE-1)
#define DESC_EOR (1 << 0)
#define DESC_INT (1 << 1)
#define DESC_IO_ERROR (1 << 30)
#define DESC_OWN (1 << 31)
#define DESC_DEFAULT_STATUS 0xdeadbe00
#define DMA_CHAN_SIZE 128
@@ -358,45 +357,25 @@ static void _wcxb_reset_dring(struct wcxb *xb)
hdesc->control |= cpu_to_be32(DESC_EOR);
#ifdef DEBUG
xb->last_retry_count = 0;
xb->max_retry_count = 0;
xb->last_dma_time = 0;
xb->max_dma_time = 0;
#endif
iowrite32be(xb->hw_dring_phys, xb->membase + TDM_DRING_ADDR);
}
static void wcxb_handle_dma(struct wcxb *xb)
{
#ifdef DEBUG
bool did_retry_dma = false;
u8 retry;
#endif
struct wcxb_meta_desc *mdesc;
struct wcxb_hw_desc *tail = &(xb->hw_dring[xb->dma_tail]);
while (!(tail->control & cpu_to_be32(DESC_OWN))) {
u_char *frame;
if (tail->control & cpu_to_be32(DESC_IO_ERROR)) {
u32 ier;
unsigned long flags;
/* The firmware detected an error condition on the bus.
* Force an underrun by disabling the descriptor
* complete interrupt. When the driver processes the
* underrun it will reset the TDM engine. */
xb->flags.io_error = 1;
spin_lock_irqsave(&xb->lock, flags);
ier = ioread32be(xb->membase + IER);
iowrite32be(ier & ~DESC_COMPLETE, xb->membase + IER);
spin_unlock_irqrestore(&xb->lock, flags);
return;
}
#ifdef DEBUG
retry = be32_to_cpu(tail->status) & 0xff;
if (xb->last_retry_count != retry) {
xb->last_retry_count = retry;
did_retry_dma = true;
}
xb->last_retry_count =
((be32_to_cpu(tail->control) & 0x0000ff00) >> 8);
xb->last_dma_time = (be32_to_cpu(tail->status));
#endif
mdesc = &xb->meta_dring[xb->dma_tail];
@@ -420,9 +399,17 @@ static void wcxb_handle_dma(struct wcxb *xb)
}
#ifdef DEBUG
if (did_retry_dma) {
if (xb->last_retry_count > xb->max_retry_count) {
xb->max_retry_count = xb->last_retry_count;
dev_info(&xb->pdev->dev,
"DMA retries detected: %d\n", xb->last_retry_count);
"New DMA max retries detected: %d\n",
xb->max_retry_count);
}
if (xb->last_dma_time > xb->max_dma_time) {
xb->max_dma_time = xb->last_dma_time;
dev_info(&xb->pdev->dev,
"New DMA max transfer time detected: %d\n",
xb->max_dma_time);
}
#endif
}
@@ -451,14 +438,7 @@ static irqreturn_t _wcxb_isr(int irq, void *dev_id)
spin_lock(&xb->lock);
if (xb->flags.io_error) {
/* Since an IO error is not necessarily because
* the host could not keep up, we do not want to
* bump the latency. */
xb->flags.io_error = 0;
dev_warn(&xb->pdev->dev,
"IO error reported by firmware.\n");
} else if (!xb->flags.latency_locked) {
if (!xb->flags.latency_locked) {
/* bump latency */
xb->latency = min(xb->latency + 1,
@@ -705,7 +685,7 @@ int wcxb_init(struct wcxb *xb, const char *board_name, u32 int_mode)
xb->flags.have_msi = (int_mode) ? 0 : (0 == pci_enable_msi(pdev));
if (request_irq(pdev->irq, wcxb_isr,
(xb->flags.have_msi) ? 0 : DAHDI_IRQ_SHARED,
(xb->flags.have_msi) ? 0 : IRQF_SHARED,
board_name, xb)) {
dev_notice(&xb->pdev->dev, "Unable to request IRQ %d\n",
pdev->irq);

View File

@@ -24,7 +24,7 @@
#define __WCXB_H__
#define WCXB_DEFAULT_LATENCY 3U
#define WCXB_DEFAULT_MAXLATENCY 20U
#define WCXB_DEFAULT_MAXLATENCY 12U
#define WCXB_DMA_CHAN_SIZE 128
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
@@ -66,7 +66,7 @@ struct wcxb {
#ifdef WCXB_PCI_DEV_DOES_NOT_HAVE_IS_PCIE
u32 is_pcie:1;
#endif
u32 io_error:1;
u32 dma_ins:1;
} flags;
void __iomem *membase;
struct wcxb_meta_desc *meta_dring;
@@ -78,6 +78,9 @@ struct wcxb {
unsigned long framecount;
#ifdef DEBUG
u8 last_retry_count;
u8 max_retry_count;
u32 last_dma_time;
u32 max_dma_time;
#endif
};

View File

@@ -2399,11 +2399,11 @@ static DEVICE_ATTR_WRITER(pri_protocol_store, dev, buf, count)
buf, i);
return -EINVAL;
}
if (strnicmp(buf, "E1", 2) == 0)
if (strncasecmp(buf, "E1", 2) == 0)
new_protocol = PRI_PROTO_E1;
else if (strnicmp(buf, "T1", 2) == 0)
else if (strncasecmp(buf, "T1", 2) == 0)
new_protocol = PRI_PROTO_T1;
else if (strnicmp(buf, "J1", 2) == 0)
else if (strncasecmp(buf, "J1", 2) == 0)
new_protocol = PRI_PROTO_J1;
else {
XPD_NOTICE(xpd,

File diff suppressed because it is too large Load Diff

View File

@@ -20,7 +20,12 @@ install:
mkdir -p $(TARGET)
install $(SCRIPTS) $(TARGET)/
install -m 644 ../XppConfig.pm $(FIRMWARES) $(TARGET)/
if [ ! -r $(TARGET)/USB_FW.202.hex ]; then \
ln -s USB_FW.201.hex $(TARGET)/USB_FW.202.hex;\
for id in 202 203; do \
if [ ! -r $(TARGET)/USB_FW.$$id.hex ]; then \
ln -s USB_FW.201.hex $(TARGET)/USB_FW.$$id.hex;\
fi; \
done
if [ ! -r $(TARGET)/FPGA_1161.203.hex ]; then \
ln -s FPGA_1161.201.hex $(TARGET)/FPGA_1161.203.hex;\
fi

View File

@@ -1,5 +1,5 @@
#
# $Id: USB_FW.201.hex 10402 2012-02-15 15:34:50Z dima $
# $Id: USB_FW.201.hex 11453 2015-03-29 18:27:25Z dima $
#
:03004300021F0099
:03005300021F0089
@@ -27,7 +27,7 @@
:050FF6000300000000F3
:100F3C0041E0370041E0B60042E0B1000041E0384A
:100F4C0000021BE0850218E07943E0B30000004D7D
:0F0F5C00E03931303339354D202020202020005E
:0F0F5C00E03931313435314D2020202020200064
:101D71008B538A548955E5581558AE57700215573B
:101D81004E6014AB530555E555AA54700205541421
:081D9100F9ED12077780DF2253
@@ -164,7 +164,7 @@
:100B7E00AB45AA46A9477401120777E4F550E55034
:100B8E00C454F0AB45AA46A94790000112078985C7
:100B9E004858854959854A5A755B08121A95AB48CB
:100BAE00AA49A94A90000212074AFE5403FFEE54C6
:100BAE00AA49A94A90000212074AFE5407FFEE54C2
:100BBE0070F55124E0602924F0604B24F0605D2430
:100BCE00F0606F24406003020C5675410185184297
:100BDE00851943EF24FE600624FE703B801C801FA7

View File

@@ -1,5 +1,5 @@
#
# $Id: USB_FW.hex 10401 2012-02-15 15:30:24Z dima $
# $Id: USB_FW.hex 11452 2015-03-29 18:21:13Z dima $
#
:03004300021F0099
:03005300021F0089
@@ -27,7 +27,7 @@
:051EF1000300000000E9
:1011F50041E0370041E0B70042E0B2000041E0388D
:1012050000021BE0860218E07A43E0B40000004EBD
:10121500E03931303339354D502020202020200051
:10121500E03931313435314D502020202020200057
:101D9A008B518A528953E5561556AE557002155520
:101DAA004E6014AB510553E553AA52700205521402
:081DBA00F9ED12077180DF2230
@@ -165,7 +165,7 @@
:100B7800AB43AA44A9457401120771E4F54EE54E4A
:100B8800C454F0AB43AA44A94590000112078385D9
:100B98004656854757854858755908121A94AB46E2
:100BA800AA47A948900002120744FE5403FFEE54D6
:100BA800AA47A948900002120744FE5407FFEE54D2
:100BB80070F54F24E0602924F0604B24F0605D2438
:100BC800F0606F24406003020C50753F01851840A7
:100BD800851941EF24FE600624FE703B801C801FAF

View File

@@ -49,7 +49,9 @@ 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 drop a PCM frame");
"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 #)");
#include "dahdi_debug.h"
@@ -117,6 +119,8 @@ 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,
};
@@ -127,8 +131,14 @@ enum {
static struct xusb_counters {
char *name;
} xusb_counters[] = {
C_(RX_FRAMES), C_(TX_FRAMES), C_(RX_ERRORS), C_(TX_ERRORS),
C_(RCV_ZERO_LEN),};
C_(RX_FRAMES),
C_(TX_FRAMES),
C_(RX_ERRORS),
C_(TX_ERRORS),
C_(RX_DROPS),
C_(TX_DROPS),
C_(RCV_ZERO_LEN),
};
#undef C_
@@ -194,8 +204,7 @@ struct xusb {
unsigned int max_tx_delay;
uint usb_tx_delay[NUM_BUCKETS];
uint sluggish_debounce;
bool drop_next_pcm; /* due to sluggishness */
atomic_t pcm_tx_drops;
bool drop_pcm; /* due to sluggishness */
atomic_t usb_sluggish_count;
const char *manufacturer;
@@ -400,12 +409,23 @@ static int xframe_send_pcm(xbus_t *xbus, xframe_t *xframe)
BUG_ON(!xframe);
xusb = xusb_of(xbus);
BUG_ON(!xusb);
if (xusb->drop_next_pcm) {
FREE_SEND_XFRAME(xbus, xframe); /* return to pool */
xusb->drop_next_pcm = 0;
return -EIO;
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;
}
}
return do_send_xframe(xbus, xframe);
err:
FREE_SEND_XFRAME(xbus, xframe); /* return to pool */
return -EIO;
}
/*
@@ -674,7 +694,6 @@ 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;
@@ -878,7 +897,6 @@ 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;
@@ -888,12 +906,14 @@ static void xpp_send_callback(USB_PASS_CB(urb))
"Sluggish USB. Dropping next PCM frame "
"(pending_writes=%d)\n",
writes);
atomic_inc(&xusb->pcm_tx_drops);
xusb->drop_next_pcm = 1;
atomic_inc(&xusb->usb_sluggish_count);
xusb->drop_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)) {
@@ -956,6 +976,26 @@ 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:
@@ -1061,17 +1101,16 @@ 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[%d,%d,%d]: ", USEC_BUCKET,
BUCKET_START, NUM_BUCKETS);
seq_printf(sfile, "usb_tx_delay[%dus - %dus]: ",
USEC_BUCKET * BUCKET_START,
USEC_BUCKET * 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, "\nPCM_TX_DROPS: %5d (sluggish: %d)\n",
atomic_read(&xusb->pcm_tx_drops),
atomic_read(&xusb->usb_sluggish_count)
);
seq_printf(sfile, "\nSluggish events: %d\n",
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,

View File

@@ -80,7 +80,8 @@ static const xproto_table_t *xproto_table(xpd_type_t cardtype)
return xprotocol_tables[cardtype];
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) || \
LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
#define MODULE_REFCOUNT_FORMAT "%s refcount was %d\n"
#else
#define MODULE_REFCOUNT_FORMAT "%s refcount was %lu\n"

View File

@@ -76,10 +76,6 @@
#define HAVE_NET_DEVICE_OPS
#endif
#define DAHDI_IRQ_SHARED IRQF_SHARED
#define DAHDI_IRQ_DISABLED IRQF_DISABLED
#define DAHDI_IRQ_SHARED_DISABLED IRQF_SHARED | IRQF_DISABLED
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
# ifdef RHEL_RELEASE_VERSION
# if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5, 6)
@@ -1408,6 +1404,17 @@ static inline short dahdi_txtone_nextsample(struct dahdi_chan *ss)
/*! Maximum audio mask */
#define DAHDI_FORMAT_AUDIO_MASK ((1 << 16) - 1)
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
/* DAHDI only was using the xxx_clear_bit variants. */
#ifndef smp_mb__before_atomic
#define smp_mb__before_atomic smp_mb__before_clear_bit
#endif
#ifndef smp_mb__after_atomic
#define smp_mb__after_atomic smp_mb__after_clear_bit
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
#ifdef RHEL_RELEASE_VERSION
#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(6, 5)
@@ -1491,6 +1498,8 @@ void dahdi_pci_disable_link_state(struct pci_dev *pdev, int state);
#define list_first_entry(ptr, type, member) \
list_entry((ptr)->next, type, member)
#define strncasecmp strnicmp
#ifndef __packed
#define __packed __attribute__((packed))
#endif
@@ -1523,6 +1532,7 @@ static inline int strcasecmp(const char *s1, const char *s2)
#endif /* 2.6.27 */
#endif /* 2.6.31 */
#endif /* 3.10.0 */
#endif /* 3.16.0 */
#ifndef DEFINE_SPINLOCK
#define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED
@@ -1653,9 +1663,11 @@ struct mutex {
chan_printk(DEBUG, "-" #bits, chan, \
"%s: " fmt, __func__, ## __VA_ARGS__)))
#define dahdi_dev_dbg(bits, dev, fmt, ...) \
((void)((debug & (DAHDI_DBG_ ## bits)) && \
do { if (debug & (DAHDI_DBG_ ## bits)) { \
dev_printk(KERN_DEBUG, dev, \
"DBG-%s(%s): " fmt, #bits, __func__, ## __VA_ARGS__)))
"DBG-%s(%s): " fmt, #bits, __func__, ## __VA_ARGS__); \
} } while (0)
#endif /* DAHDI_PRINK_MACROS_USE_debug */
#endif /* _DAHDI_KERNEL_H */