[dahdi-commits] dahdi/linux.git branch "master" updated.
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Wed Apr 30 14:45:01 CDT 2014
branch "master" has been updated
via 15ff405dc80b3dcb2904c5ff1334defdb6b6d383 (commit)
via 5e24d501c585c53bae71ad28e5128d772b4446e2 (commit)
via 193c9e59a8c2b5f6a0519fa0c5bbe5766bea5e15 (commit)
via 606dd58a479172c4cb71dcad2def9d9b45be3b49 (commit)
from adfd0910b76183f421cb6875a66a8dd2e38994ca (commit)
Summary of changes:
drivers/dahdi/xpp/card_pri.c | 5 ++++-
drivers/dahdi/xpp/xbus-core.c | 8 ++++++++
drivers/dahdi/xpp/xbus-sysfs.c | 39 +++++++++++++++++++++++++++++++++++++++
3 files changed, 51 insertions(+), 1 deletion(-)
- Log -----------------------------------------------------------------
commit 15ff405dc80b3dcb2904c5ff1334defdb6b6d383
Author: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Date: Sun Apr 27 15:21:00 2014 +0300
xpp: pri: Fix more than a single CAS/R2 call
Fixes regression from bb63d03bbad48f798177dfce62a1ee392d736c57 (before
v2.7.0). This failed to set the PCM mask on a CAS span when
DAHDI_AUDIO_NOTIFY was not set.
As the first channel of each xbus would be enabled (for
synchronization), a single call may still have passed.
This patch sets the PCM mask on any CAS channel explicitly.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
diff --git a/drivers/dahdi/xpp/card_pri.c b/drivers/dahdi/xpp/card_pri.c
index f4a40bf..29b457b 100644
--- a/drivers/dahdi/xpp/card_pri.c
+++ b/drivers/dahdi/xpp/card_pri.c
@@ -524,9 +524,12 @@ static void PRI_card_pcm_recompute(xpd_t *xpd, xpp_line_t pcm_mask)
//XPD_DBG(SIGNAL, xpd, "pcm_mask=0x%X\n", pcm_mask);
/* Add/remove all the trivial cases */
pcm_mask |= PHONEDEV(xpd).offhook_state;
+ if (priv->is_cas)
+ pcm_mask |= BITMASK(PHONEDEV(xpd).channels);
for_each_line(xpd, i)
if (IS_SET(pcm_mask, i))
line_count++;
+ else
if (priv->is_cas) {
if (priv->pri_protocol == PRI_PROTO_E1) {
/* CAS: Don't send PCM to D-Channel */
commit 5e24d501c585c53bae71ad28e5128d772b4446e2
Author: Oron Peled <oron.peled at xorcom.com>
Date: Sun Apr 6 14:01:55 2014 -0400
xpp: prevent double dahdi un-registration
* It's currently harmless (just re-run the pre/post XPD registrations)
* But it's cleaner this way (as with xbus_register_dahdi_device())
Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
diff --git a/drivers/dahdi/xpp/xbus-core.c b/drivers/dahdi/xpp/xbus-core.c
index a7bb798..d5ad1ec 100644
--- a/drivers/dahdi/xpp/xbus-core.c
+++ b/drivers/dahdi/xpp/xbus-core.c
@@ -1040,6 +1040,13 @@ void xbus_unregister_dahdi_device(xbus_t *xbus)
XBUS_ERR(xbus, "dahdi_registration_mutex already taken\n");
return;
}
+ if (!xbus_is_registered(xbus)) {
+ /*
+ * Ignore duplicate unregistrations
+ */
+ XBUS_DBG(DEVICES, xbus, "Already unregistered to DAHDI\n");
+ goto err;
+ }
for (i = 0; i < MAX_XPDS; i++) {
xpd_t *xpd = xpd_of(xbus, i);
xpd_dahdi_preunregister(xpd);
@@ -1054,6 +1061,7 @@ void xbus_unregister_dahdi_device(xbus_t *xbus)
xpd_t *xpd = xpd_of(xbus, i);
xpd_dahdi_postunregister(xpd);
}
+err:
mutex_unlock(&dahdi_registration_mutex);
}
commit 193c9e59a8c2b5f6a0519fa0c5bbe5766bea5e15
Author: Oron Peled <oron.peled at xorcom.com>
Date: Mon Mar 17 12:35:39 2014 -0400
xpp: new xbus attribute: dahdi_registration
XPP devices have implicit support for device registration and
unregistration. Even though it is only used for the legacy (non-hotplug)
configuration case, we still prefer to make it explicit.
This attribute would later allow a simpler implementation of the user
space (xpp-specific) tool dahdi_registration.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
diff --git a/drivers/dahdi/xpp/xbus-sysfs.c b/drivers/dahdi/xpp/xbus-sysfs.c
index 24dcda2..c92ccb7 100644
--- a/drivers/dahdi/xpp/xbus-sysfs.c
+++ b/drivers/dahdi/xpp/xbus-sysfs.c
@@ -302,6 +302,42 @@ field##_show(struct device *dev, struct device_attribute *attr, char *buf) \
xbus_attr(connector, "%s\n");
xbus_attr(label, "%s\n");
+static DEVICE_ATTR_WRITER(dahdi_registration_store, dev, buf, count)
+{
+ xbus_t *xbus;
+ int dahdi_reg;
+ int ret;
+
+ xbus = dev_to_xbus(dev);
+ if (!xbus)
+ return -ENODEV;
+ ret = sscanf(buf, "%d", &dahdi_reg);
+ if (ret != 1)
+ return -EINVAL;
+ if (dahdi_reg) {
+ ret = xbus_register_dahdi_device(xbus);
+ if (ret < 0) {
+ XBUS_ERR(xbus,
+ "xbus_register_dahdi_device() failed (ret = %d)\n",
+ ret);
+ return ret;
+ }
+ } else {
+ xbus_unregister_dahdi_device(xbus);
+ }
+ return count;
+}
+
+static DEVICE_ATTR_READER(dahdi_registration_show, dev, buf)
+{
+ xbus_t *xbus;
+ int len;
+
+ xbus = dev_to_xbus(dev);
+ len = sprintf(buf, "%d\n", xbus_is_registered(xbus));
+ return len;
+}
+
static struct device_attribute xbus_dev_attrs[] = {
__ATTR_RO(connector),
__ATTR_RO(label),
@@ -316,6 +352,9 @@ static struct device_attribute xbus_dev_attrs[] = {
#ifdef SAMPLE_TICKS
__ATTR(samples, S_IWUSR | S_IRUGO, samples_show, samples_store),
#endif
+ __ATTR(dahdi_registration, S_IRUGO | S_IWUSR,
+ dahdi_registration_show,
+ dahdi_registration_store),
__ATTR_NULL,
};
commit 606dd58a479172c4cb71dcad2def9d9b45be3b49
Author: Oron Peled <oron.peled at xorcom.com>
Date: Mon Apr 7 07:05:50 2014 -0400
xpp: fix failed multi-PRI E1<->T1 transition
In an Astribank with >= 2 PRI ports, switching from E1 to T1 at run-time
may fail at the DAHDI_CHANCONFIG ioctl on the first channel in a span,
That is, on first run of dahdi_cfg, it fails on second span, on second:
it fails on third span, etc.
The code clears the D-channel information on the DAHDI_CHANCONFIG call
for the first channel in the span.
However The code tested for the global "channo" rather than the per-span
"chanpos" to check for the first channel in the span. This the test
failed.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
diff --git a/drivers/dahdi/xpp/card_pri.c b/drivers/dahdi/xpp/card_pri.c
index c586115..f4a40bf 100644
--- a/drivers/dahdi/xpp/card_pri.c
+++ b/drivers/dahdi/xpp/card_pri.c
@@ -1231,7 +1231,7 @@ static int pri_chanconfig(struct file *file, struct dahdi_chan *chan,
if (priv->pri_protocol != PRI_PROTO_E1 && priv->is_cas != 0)
set_mode_cas(xpd, 0);
} else {
- if (chan->channo == 1) {
+ if (chan->chanpos == 1) {
XPD_DBG(GENERAL, xpd,
"channel %d (%s) marked a not DChan\n",
chan->channo, chan->name);
-----------------------------------------------------------------------
--
dahdi/linux.git
More information about the dahdi-commits
mailing list