[svn-commits] sruffell: linux/trunk r9827 - /linux/trunk/drivers/dahdi/wctdm24xxp/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Mar 15 14:06:11 CDT 2011


Author: sruffell
Date: Tue Mar 15 14:06:05 2011
New Revision: 9827

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9827
Log:
wctdm24xxp: Fix regression with LEDS on TDM410.

r9720 disabled the LEDs on the front panel of the TDM410. This commit
restores the behavior and clarify which part of the TDM410 eframes
control the LED operation.

(closes issue #18939)

Signed-off-by: Shaun Ruffell <sruffell at digium.com>

Modified:
    linux/trunk/drivers/dahdi/wctdm24xxp/base.c
    linux/trunk/drivers/dahdi/wctdm24xxp/wctdm24xxp.h

Modified: linux/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=9827&r1=9826&r2=9827
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/base.c Tue Mar 15 14:06:05 2011
@@ -898,12 +898,8 @@
 		if (x < DAHDI_CHUNKSIZE - 1) {
 			eframe[EFRAME_SIZE] = wc->ctlreg;
 			eframe[EFRAME_SIZE + 1] = wc->txident++;
-
-			if ((wc->desc->ports == 4) && ((wc->ctlreg & 0x10))) {
-				eframe[EFRAME_SIZE + 2] = 0;
-				for (y = 0; y < 4; y++)
-					eframe[EFRAME_SIZE + 2] |= (1 << y);
-			}
+			if (4 == wc->desc->ports)
+				eframe[EFRAME_SIZE + 2] = wc->tdm410leds;
 		}
 		eframe += (EFRAME_SIZE + EFRAME_GAP);
 	}
@@ -4510,6 +4506,21 @@
 
 #endif /* CONFIG_VOICEBUS_SYSFS */
 
+static void wctdm_set_tdm410_leds(struct wctdm *wc)
+{
+	int i;
+
+	if (4 != wc->desc->ports)
+		return;
+
+	wc->tdm410leds = 0; /* all on by default */
+	for (i = 0; i < wc->desc->ports; ++i) {
+		/* Turn off the LED for any module that isn't installed. */
+		if (MOD_TYPE_NONE == wc->modtype[i])
+			wc->tdm410leds |= (1 << i);
+	}
+}
+
 #ifdef USE_ASYNC_INIT
 struct async_data {
 	struct pci_dev *pdev;
@@ -4651,6 +4662,8 @@
 
 	/* Now track down what modules are installed */
 	wctdm_identify_modules(wc);
+
+	wctdm_set_tdm410_leds(wc);
 
 	if (fatal_signal_pending(current)) {
 		wctdm_back_out_gracefully(wc);

Modified: linux/trunk/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/wctdm24xxp.h?view=diff&rev=9827&r1=9826&r2=9827
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/wctdm24xxp.h (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/wctdm24xxp.h Tue Mar 15 14:06:05 2011
@@ -164,7 +164,8 @@
 	unsigned char rxident;
 
 	int flags[NUM_MODULES];			/* bitmap of board-specific + module-specific flags */
-	unsigned char ctlreg;			/* FIXME: something to do with VPM? */
+	u8 ctlreg;
+	u8 tdm410leds;
 
 	int mods_per_board;			/* maximum number of modules for this board */
 	int digi_mods;				/* number of digital modules present */




More information about the svn-commits mailing list