Compare commits

...

8 Commits

Author SHA1 Message Date
Shaun Ruffell
c1d867b8b7 dahdi: Fix previous CentOS 6.5 commit.
The previous commit from earlier today to fix the backport of PDE_DATA was
wrong in that it would not then process the other defines for older kernels if
it detected it was running on a redhat release.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
(cherry picked from commit 71c003ba49)
2013-12-03 09:36:40 -06:00
Shaun Ruffell
1ff5629078 dahdi: CentOS 6.5 backported PDE_DATA definition.
This will fix the "error: redefinition of 'PDE_DATA'" error when compiling.

Internal-Issue-ID: DAHLIN-330
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
(cherry picked from commit 5ec9d756aa)
2013-12-03 09:36:40 -06:00
Russ Meyerriecks
ce3f1f2650 wcte13xp: Workaround rare nmi on modprobe on select systems
With certain pci controllers that support pci hotplug, during the reset
sequence of the fpga, the host controller can get confused about the state of
the card and throw an nmi.

Known affected systems:
 HP proliant DL160 & DL360p
 Dell poweredge R520
 Super Micro X7SPA-HF

This patch attempts to work around that by removing the fpga reset sequence
from the driver startup, then setting various control registers to known
starting state values.

This patch removes the field upgradeable firmware logic temporarily for the
te133 card to prevent fpga reset.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2013-08-16 15:28:24 -05:00
Oron Peled
2ad4dc555f xpp: fix waitfor_xpds race at startup
* If userspace would run
    modprobe xpp_usb && cat /sys/bus/astribanks/devices/xbus-00/waitfor_xpds
  it would return immediately rather than wait for the Astribank to
  initialize.
* We sometimes managed to read before getting the reply from the
  astribank.
* Now we don't trust unit count at such an early stage.
* Instread we wait for the Astribank to reach a stable state (READY or FAIL)
  before finish waiting for this astribank.

Internal-Issue-ID: Xorcom-1502
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2013-07-30 15:04:00 +03:00
Shaun Ruffell
0469efb733 build_tools/make_version: Fix typo in build_tools/make_version.
The make_version script would test for a .version file in the proper location,
but then would not properly read it. Since make_version is always reading the
.version script correctly now, the Makefile can be slightly simpilfied and
always defer to it.

This has no user impact since build_tools/make_version was never used to read
the .version file previously but will allow external scripts to use the
make_version script.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2013-06-26 14:32:15 -05:00
Oron Peled
8ea23535dc sysfs: bugfix: shorten too long file names
* In old kernels (e.g: 2.6.18) sysfs file names must be shorter
  then KOBJ_NAME_LEN.

* Longer names are truncated and this leads to duplicate names
  which fails device_register()
  Examples: "dahdi!channels!10!10" is truncated to "dahdi!channels!10!1"

* The fix shorten the names and make them fixed length. Example:
            "dahdi!chan!010!010"

* It seems no current userspace tools rely on that name or on
  /dev/dahdi/channels .

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2013-06-23 22:12:33 +03:00
Russ Meyerriecks
431571b5fc wcte13xp: Start the span in unconfigured, instead of red state
This was causing inconsistancies with dahdi_scan showing an "UNCONFIGURED" span
in the "RED" state.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2013-06-14 14:55:37 -05:00
Shaun Ruffell
ab927f796b dahdi: Do not set rxbufpolicy when opening dahdi net device.
This fixes a regression introduced in 2.7.0 in commit
(da8b96d725 "dahdi: Remove unused 'rxbufpolicy'
and 'rxdisable' from dahdi_chan.") when CONFIG_DAHDI_NET is defined in
include/dahdi/dahdi_config.h.

rxbufpolicy was always hardcoded to immediate policy and was removed from the
channel structure. There is no longer any need to set it in dahdi_net_open.

Reported-by: Dave Fullerton <dfullertasterisk@shorelinecontainer.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2013-06-11 10:25:10 -05:00
8 changed files with 48 additions and 24 deletions

View File

@@ -64,11 +64,7 @@ ASCIIDOC_CMD:=$(ASCIIDOC) -n -a toc -a toclevels=4
GENERATED_DOCS:=README.html
ifneq ($(wildcard .version),)
DAHDIVERSION:=$(shell cat .version)
else
DAHDIVERSION:=$(shell build_tools/make_version . dahdi/linux)
endif
DAHDIVERSION:=$(shell build_tools/make_version . dahdi/linux)
all: modules

6
README
View File

@@ -646,8 +646,10 @@ or dynamically through the udev system.
* /dev/dahdi/ctl (196:0) - a general device file for various information and
control operations on the DAHDI channels.
* /dev/dahdi/channels/N/M - A device file for channel M in span N
(M is chanpos - numbering relative to the current span).
* /dev/dahdi/chan/N/M - A device file for channel M in span N
- Both N and M are zero padded 3 digit numbers
- Both N and M start at 001
- M is chanpos - numbering relative to the current span.
* /dev/dahdi/NNN (196:NNN) - for NNN in the range 1-249. A device file for
DAHDI channel NNN. It can be used to read data from the channel
and write data to the channel. It is not generated by default but may

View File

@@ -1,7 +1,7 @@
#!/bin/sh
if [ -f ${1}/.version ]; then
cat ${1}.version
cat ${1}/.version
elif [ -f ${1}/.svnrevision ]; then
echo SVN-`cat ${1}/.svnbranch`-r`cat ${1}/.svnrevision`
elif [ -d ${1}/.svn ]; then

View File

@@ -1964,7 +1964,6 @@ static int dahdi_net_open(struct net_device *dev)
return -EINVAL;
}
ms->txbufpolicy = DAHDI_POLICY_IMMEDIATE;
ms->rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
res = dahdi_reallocbufs(ms, DAHDI_DEFAULT_MTU_MRU, DAHDI_DEFAULT_NUM_BUFS);
if (res)

View File

@@ -247,7 +247,7 @@ int chan_sysfs_create(struct dahdi_chan *chan)
/*
* FIXME: the name cannot be longer than KOBJ_NAME_LEN
*/
dev_set_name(dev, "dahdi!channels!%d!%d", span->spanno, chan->chanpos);
dev_set_name(dev, "dahdi!chan!%03d!%03d", span->spanno, chan->chanpos);
dev_set_drvdata(dev, chan);
dev->release = chan_release;
res = device_register(dev);

View File

@@ -2839,6 +2839,11 @@ static int t13x_check_firmware(struct t13x *wc)
if (force_firmware) {
dev_info(&wc->dev->dev,
"force_firmware module parameter is set. Forcing firmware load, regardless of version\n");
} else if (is_pcie(wc)) {
dev_info(&wc->dev->dev,
"Firmware %x is running, but we require %x. ERROR: This version of dahdi temporarily disabled field upgradeable firmware. Please upgrade your dahdi revision.\n",
version, FIRMWARE_VERSION);
return -EIO;
} else {
dev_info(&wc->dev->dev,
"Firmware %x is running, but we require %x\n",
@@ -2903,6 +2908,26 @@ cleanup:
return res;
}
static void soft_reset_fpga(struct t13x *wc)
{
/* digium_gpo */
iowrite32be(0x0, wc->membase);
/* xps_intc */
iowrite32be(0x0, wc->membase + 0x300);
iowrite32be(0x0, wc->membase + 0x308);
iowrite32be(0x0, wc->membase + 0x310);
iowrite32be(0x0, wc->membase + 0x31C);
/* xps_spi_config_flash */
iowrite32be(0xA, wc->membase + 0x200);
/* tdm engine */
iowrite32be(0x0, wc->membase + 0x2000);
iowrite32be(0x0, wc->membase + 0x2000);
iowrite32be(0x0, wc->membase + 0x2000);
}
static int __devinit te13xp_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
@@ -2979,10 +3004,7 @@ static int __devinit te13xp_init_one(struct pci_dev *pdev,
dev_info(&wc->dev->dev, "Unable to request regions\n");
/* Reset entire fpga */
pci_save_state(pdev);
iowrite32be(0xe00, wc->membase + TDM_CONTROL);
msleep(2000);
pci_restore_state(pdev);
soft_reset_fpga(wc);
/* Enable writes to fpga status register */
iowrite32be(0, wc->membase + 0x04);
@@ -3053,7 +3075,7 @@ static int __devinit te13xp_init_one(struct pci_dev *pdev,
list_add_tail(&wc->span.device_node, &wc->ddev->spans);
/* Span is in red alarm by default */
wc->span.alarms = DAHDI_ALARM_RED;
wc->span.alarms = DAHDI_ALARM_NONE;
res = dahdi_register_device(wc->ddev, &wc->dev->dev);
if (res) {

View File

@@ -1592,8 +1592,6 @@ static bool xpds_done(xbus_t *xbus)
{
if (XBUS_IS(xbus, FAIL))
return 1; /* Nothing to wait for */
if (!XBUS_IS(xbus, RECVD_DESC))
return 1; /* We are not in the initialization phase */
if (xbus->worker.xpds_init_done)
return 1; /* All good */
/* Keep waiting */
@@ -1622,14 +1620,9 @@ int waitfor_xpds(xbus_t *xbus, char *buf)
len = -ENODEV;
goto out;
}
if (worker->num_units == 0) {
XBUS_ERR(xbus, "No cards. Skipping.\n");
goto out;
}
XBUS_DBG(DEVICES, xbus,
"Waiting for card init of %d XPD's max %d seconds (%p)\n",
worker->num_units, INITIALIZATION_TIMEOUT / HZ,
&worker->wait_for_xpd_initialization);
"Waiting for card init of XPDs max %d seconds\n",
INITIALIZATION_TIMEOUT / HZ);
ret =
wait_event_interruptible_timeout(worker->
wait_for_xpd_initialization,

View File

@@ -1402,6 +1402,8 @@ static inline short dahdi_txtone_nextsample(struct dahdi_chan *ss)
#define DAHDI_FORMAT_AUDIO_MASK ((1 << 16) - 1)
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
#ifdef RHEL_RELEASE_VERSION
#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(6, 5)
#ifdef CONFIG_PROC_FS
#include <linux/proc_fs.h>
static inline void *PDE_DATA(const struct inode *inode)
@@ -1409,6 +1411,16 @@ static inline void *PDE_DATA(const struct inode *inode)
return PDE(inode)->data;
}
#endif
#endif
#else
#ifdef CONFIG_PROC_FS
#include <linux/proc_fs.h>
static inline void *PDE_DATA(const struct inode *inode)
{
return PDE(inode)->data;
}
#endif
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
#define KERN_CONT ""
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)