summaryrefslogtreecommitdiff
path: root/drivers/dahdi/wcte12xp/base.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2009-08-19 16:44:31 +0000
committerKevin P. Fleming <kpfleming@digium.com>2009-08-19 16:44:31 +0000
commit8326c1faa72044e72fd4095cd9f8eec960633a7b (patch)
tree62d4ca06887064d91296dfd06d959b6b3c0295b4 /drivers/dahdi/wcte12xp/base.c
parent0fa9e7ca9203ba1bcf29e39c85f6b7dbedda4629 (diff)
Merged revisions 7038 via svnmerge from
https://origsvn.digium.com/svn/dahdi/linux/trunk ........ r7038 | kpfleming | 2009-08-19 11:40:13 -0500 (Wed, 19 Aug 2009) | 9 lines Ensure that dahdi_scan correctly reports VPM presence. The wct4xxp driver (for the dual/quad span T1/E1 cards) and the wcte12xp driver (for the single span VoiceBus-based T1/E1 cards) did not properly update the 'devicetype' field reported by dahdi_scan when a VPM was found during the card startup process. As a result, dahdi_scan did not show that a VPM was present on the card, even if it was. ........ git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.2@7039 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wcte12xp/base.c')
-rw-r--r--drivers/dahdi/wcte12xp/base.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c
index 7dd8cde..2f16b3a 100644
--- a/drivers/dahdi/wcte12xp/base.c
+++ b/drivers/dahdi/wcte12xp/base.c
@@ -1191,6 +1191,16 @@ static void echocan_free(struct dahdi_chan *chan, struct dahdi_echocan_state *ec
vpmadt032_echocan_free(wc->vpmadt032, chan, ec);
}
+static void set_span_devicetype(struct t1 *wc)
+{
+ strncpy(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype) - 1);
+
+#if defined(VPM_SUPPORT)
+ if (wc->vpmadt032)
+ strncat(wc->span.devicetype, " (VPMADT032)", sizeof(wc->span.devicetype) - 1);
+#endif
+}
+
static int t1_software_init(struct t1 *wc)
{
int x;
@@ -1216,12 +1226,7 @@ static int t1_software_init(struct t1 *wc)
sprintf(wc->span.name, "WCT1/%d", num);
snprintf(wc->span.desc, sizeof(wc->span.desc) - 1, "%s Card %d", wc->variety, num);
wc->span.manufacturer = "Digium";
- strncpy(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype) - 1);
-
-#if defined(VPM_SUPPORT)
- if (wc->vpmadt032)
- strncat(wc->span.devicetype, " with VPMADT032", sizeof(wc->span.devicetype) - 1);
-#endif
+ set_span_devicetype(wc);
snprintf(wc->span.location, sizeof(wc->span.location) - 1,
"PCI Bus %02d Slot %02d", dev->bus->number, PCI_SLOT(dev->devfn) + 1);
@@ -1395,6 +1400,7 @@ static int t1_hardware_post_init(struct t1 *wc)
config_vpmadt032(wc->vpmadt032);
+ set_span_devicetype(wc);
module_printk("VPM present and operational (Firmware version %x)\n", wc->vpmadt032->version);
wc->ctlreg |= 0x10; /* turn on vpm (RX audio from vpm module) */
if (vpmtsisupport) {