summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp/xbus-pcm.c
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-11-04 21:45:55 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-11-04 21:45:55 +0000
commit303b8aadf67449b6633bac29135e2e8134fb8a97 (patch)
treeb4817a27c4f917e93958f67b65c3dfb3fc17d48c /drivers/dahdi/xpp/xbus-pcm.c
parent8326c1faa72044e72fd4095cd9f8eec960633a7b (diff)
T1 CAS support in the xpp "pri" module
Merged revisions 7244-7245,7266,7276,7457 via svnmerge from http://svn.digium.com/svn/dahdi/linux/trunk ........ r7244 | tzafrir | 2009-09-29 18:23:13 +0200 (Tue, 29 Sep 2009) | 5 lines xpp: make card_hooksig an optional card method. Done in preperation for T1 CAS support, as the PRI module will use RBS instead. ........ r7245 | tzafrir | 2009-09-29 18:45:15 +0200 (Tue, 29 Sep 2009) | 2 lines xpp: refactor pcm mask handling. ........ r7266 | tzafrir | 2009-09-30 00:43:05 +0200 (Wed, 30 Sep 2009) | 2 lines xpp: T1 CAS support ........ r7276 | tzafrir | 2009-09-30 15:49:48 +0200 (Wed, 30 Sep 2009) | 2 lines xpp: PRI PIC firmware: T1-CAS fixes ........ r7457 | tzafrir | 2009-11-03 22:24:13 +0200 (Tue, 03 Nov 2009) | 4 lines xpp: More E1/T1 CAS fixes. Mostly connect/disconnect xpp revs: mostly 7458, 7466 ........ git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.2@7485 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/xpp/xbus-pcm.c')
-rw-r--r--drivers/dahdi/xpp/xbus-pcm.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/dahdi/xpp/xbus-pcm.c b/drivers/dahdi/xpp/xbus-pcm.c
index 99f9c03..81efba0 100644
--- a/drivers/dahdi/xpp/xbus-pcm.c
+++ b/drivers/dahdi/xpp/xbus-pcm.c
@@ -605,6 +605,17 @@ void elect_syncer(const char *msg)
}
/*
+ * This function should be called with the xpd already locked
+ */
+void update_wanted_pcm_mask(xpd_t *xpd, xpp_line_t new_mask, uint new_pcm_len)
+{
+ xpd->pcm_len = new_pcm_len;
+ xpd->wanted_pcm_mask = new_mask;
+ XPD_DBG(SIGNAL, xpd, "pcm_len=%d wanted_pcm_mask=0x%X\n",
+ xpd->pcm_len, xpd->wanted_pcm_mask);
+}
+
+/*
* This function is used by FXS/FXO. The pcm_mask argument signifies
* channels which should be *added* to the automatic calculation.
* Normally, this argument is 0.
@@ -614,6 +625,7 @@ void generic_card_pcm_recompute(xbus_t *xbus, xpd_t *xpd, xpp_line_t pcm_mask)
int i;
int line_count = 0;
unsigned long flags;
+ uint pcm_len;
spin_lock_irqsave(&xpd->lock_recompute_pcm, flags);
//XPD_DBG(SIGNAL, xpd, "pcm_mask=0x%X\n", pcm_mask);
@@ -633,12 +645,10 @@ void generic_card_pcm_recompute(xbus_t *xbus, xpd_t *xpd, xpp_line_t pcm_mask)
pcm_mask = BIT(0);
line_count = 1;
}
- xpd->pcm_len = (line_count)
+ pcm_len = (line_count)
? RPACKET_HEADERSIZE + sizeof(xpp_line_t) + line_count * DAHDI_CHUNKSIZE
: 0L;
- xpd->wanted_pcm_mask = pcm_mask;
- XPD_DBG(SIGNAL, xpd, "pcm_len=%d wanted_pcm_mask=0x%X\n",
- xpd->pcm_len, xpd->wanted_pcm_mask);
+ update_wanted_pcm_mask(xpd, pcm_mask, pcm_len);
spin_unlock_irqrestore(&xpd->lock_recompute_pcm, flags);
}
@@ -1258,6 +1268,7 @@ EXPORT_SYMBOL(elect_syncer);
#ifdef DAHDI_SYNC_TICK
EXPORT_SYMBOL(dahdi_sync_tick);
#endif
+EXPORT_SYMBOL(update_wanted_pcm_mask);
EXPORT_SYMBOL(generic_card_pcm_recompute);
EXPORT_SYMBOL(generic_card_pcm_tospan);
EXPORT_SYMBOL(generic_card_pcm_fromspan);