[svn-commits] tzafrir: linux/trunk r7591 - /linux/trunk/drivers/dahdi/xpp/card_pri.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Sun Nov 15 15:43:01 CST 2009
Author: tzafrir
Date: Sun Nov 15 15:42:57 2009
New Revision: 7591
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7591
Log:
xpp: card_pri: force remote refresh on CAS
Send different values on alarm to make the remote party re-read state.
Modified:
linux/trunk/drivers/dahdi/xpp/card_pri.c
Modified: linux/trunk/drivers/dahdi/xpp/card_pri.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/card_pri.c?view=diff&rev=7591&r1=7590&r2=7591
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/card_pri.c (original)
+++ linux/trunk/drivers/dahdi/xpp/card_pri.c Sun Nov 15 15:42:57 2009
@@ -84,6 +84,7 @@
static int pri_shutdown(struct dahdi_span *span);
static int pri_rbsbits(struct dahdi_chan *chan, int bits);
static int pri_lineconfig(xpd_t *xpd, int lineconfig);
+static void send_idlebits(xpd_t *xpd, bool saveold);
#define PROC_REGISTER_FNAME "slics"
#ifdef OLD_PROC
@@ -1576,6 +1577,41 @@
return 0;
}
+static void send_idlebits(xpd_t *xpd, bool saveold)
+{
+ struct PRI_priv_data *priv;
+ byte save_rs[NUM_CAS_RS_E];
+ int i;
+
+ if (!SPAN_REGISTERED(xpd))
+ return;
+ priv = xpd->priv;
+ BUG_ON(!priv);
+ XPD_DBG(SIGNAL, xpd, "saveold=%d\n", saveold);
+ if (saveold)
+ memcpy(save_rs, priv->cas_ts_e, sizeof(save_rs));
+ for_each_line(xpd, i) {
+ struct dahdi_chan *chan = XPD_CHAN(xpd, i);
+
+ pri_rbsbits(chan, chan->idlebits);
+ }
+ if (saveold)
+ memcpy(priv->cas_ts_e, save_rs, sizeof(save_rs));
+}
+
+static void send_oldbits(xpd_t *xpd)
+{
+ struct PRI_priv_data *priv;
+ int i;
+
+ BUG_ON(!xpd);
+ priv = xpd->priv;
+ BUG_ON(!priv);
+ XPD_DBG(SIGNAL, xpd, "\n");
+ for (i = 0; i < cas_numregs(xpd); i++)
+ write_cas_reg(xpd, i , priv->cas_ts_e[i]);
+}
+
static int pri_rbsbits(struct dahdi_chan *chan, int bits)
{
xpd_t *xpd;
@@ -1835,6 +1871,12 @@
XPD_NOTICE(xpd, "Alarms: 0x%X (%s) => 0x%X (%s)\n",
xpd->span.alarms, str1,
alarms, str2);
+ if (priv->is_cas) {
+ if (alarms == DAHDI_ALARM_NONE)
+ send_oldbits(xpd);
+ else if (xpd->span.alarms == DAHDI_ALARM_NONE)
+ send_idlebits(xpd, 1);
+ }
xpd->span.alarms = alarms;
dahdi_alarm_notify(&xpd->span);
set_clocking(xpd);
More information about the svn-commits
mailing list