diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2009-08-19 16:44:31 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2009-08-19 16:44:31 +0000 |
commit | 8326c1faa72044e72fd4095cd9f8eec960633a7b (patch) | |
tree | 62d4ca06887064d91296dfd06d959b6b3c0295b4 /drivers/dahdi/wct4xxp/base.c | |
parent | 0fa9e7ca9203ba1bcf29e39c85f6b7dbedda4629 (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/wct4xxp/base.c')
-rw-r--r-- | drivers/dahdi/wct4xxp/base.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c index 96fabde..63a3bfc 100644 --- a/drivers/dahdi/wct4xxp/base.c +++ b/drivers/dahdi/wct4xxp/base.c @@ -1585,6 +1585,24 @@ static int t4_close(struct dahdi_chan *chan) return 0; } +static void set_span_devicetype(struct t4 *wc) +{ + int x; + struct t4_span *ts; + + for (x = 0; x < wc->numspans; x++) { + ts = wc->tspans[x]; + dahdi_copy_string(ts->span.devicetype, wc->variety, sizeof(ts->span.devicetype)); + if (wc->vpm == T4_VPM_PRESENT) { + if (!wc->vpm450m) + strncat(ts->span.devicetype, " (VPM400M)", sizeof(ts->span.devicetype) - 1); + else + strncat(ts->span.devicetype, (wc->numspans > 2) ? " (VPMOCT128)" : " (VPMOCT064)", + sizeof(ts->span.devicetype) - 1); + } + } +} + /* The number of cards we have seen with each possible 'order' switch setting. */ @@ -1606,14 +1624,6 @@ static void init_spans(struct t4 *wc) snprintf(ts->span.desc, sizeof(ts->span.desc) - 1, "T%dXXP (PCI) Card %d Span %d", wc->numspans, wc->num, x+1); ts->span.manufacturer = "Digium"; - dahdi_copy_string(ts->span.devicetype, wc->variety, sizeof(ts->span.devicetype)); - if (wc->vpm == T4_VPM_PRESENT) { - if (!wc->vpm450m) - strncat(ts->span.devicetype, " with VPM400M", sizeof(ts->span.devicetype) - 1); - else - strncat(ts->span.devicetype, (wc->numspans > 2) ? " with VPMOCT128" : " with VPMOCT064", - sizeof(ts->span.devicetype) - 1); - } if (order_index[wc->order] == 1) snprintf(ts->span.location, sizeof(ts->span.location) - 1, "Board ID Switch %d", wc->order); else @@ -1685,6 +1695,7 @@ static void init_spans(struct t4 *wc) } } } + set_span_devicetype(wc); } static void t4_serial_setup(struct t4 *wc, int unit) @@ -2153,6 +2164,8 @@ static int t4_startup(struct dahdi_span *span) t4_vpm450_init(wc); wc->dmactrl |= wc->vpm; t4_pci_out(wc, WC_DMACTRL, wc->dmactrl); + if (wc->vpm) + set_span_devicetype(wc); } #endif printk(KERN_INFO "Completed startup!\n"); |