[dahdi-commits] sruffell: branch linux/sruffell/dahdi-linux-parallelload r7368 - /linux/team/...

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Fri Oct 9 10:31:49 CDT 2009


Author: sruffell
Date: Fri Oct  9 10:31:38 2009
New Revision: 7368

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7368
Log:
wip: Make the cardflag access atomic.

Modified:
    linux/team/sruffell/dahdi-linux-parallelload/drivers/dahdi/wctdm24xxp/base.c
    linux/team/sruffell/dahdi-linux-parallelload/drivers/dahdi/wctdm24xxp/wctdm24xxp.h

Modified: linux/team/sruffell/dahdi-linux-parallelload/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/dahdi-linux-parallelload/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=7368&r1=7367&r2=7368
==============================================================================
--- linux/team/sruffell/dahdi-linux-parallelload/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/team/sruffell/dahdi-linux-parallelload/drivers/dahdi/wctdm24xxp/base.c Fri Oct  9 10:31:38 2009
@@ -1050,7 +1050,7 @@
 	/* XXX We're wasting 8 taps.  We should get closer :( */
 	if (likely(wc->initialized)) {
 		for (x = 0; x < wc->desc->ports; x++) {
-			if (wc->cardflag & (1 << x))
+			if (test_bit(x, &wc->cardflag))
 				dahdi_ec_chunk(wc->chans[x], wc->chans[x]->readchunk, wc->chans[x]->writechunk);
 		}
 		dahdi_receive(&wc->span);
@@ -1797,7 +1797,7 @@
 	}
 
 	for (x=0;x<wc->cards;x++) {
-		if (wc->cardflag & (1 << x)) {
+		if (test_bit(x, &wc->cardflag)) {
 			if (wc->modtype[x] == MOD_TYPE_FXS) {
 				wctdm_isr_misc_fxs(wc, x);
 			} else if (wc->modtype[x] == MOD_TYPE_FXO) {
@@ -3036,7 +3036,7 @@
 	int channo = chan->chanpos - 1;
 	unsigned long flags;
 
-	if (!(wc->cardflag & (1 << (chan->chanpos - 1))))
+	if (!test_bit(chan->chanpos - 1, &wc->cardflag))
 		return -ENODEV;
 	
 	/* Reset the mwi indicators */
@@ -3336,7 +3336,7 @@
 
 	/* Finalize signalling  */
 	for (x = 0; x <wc->cards; x++) {
-		if (wc->cardflag & (1 << x)) {
+		if (test_bit(x, &wc->cardflag)) {
 			if (wc->modtype[x] == MOD_TYPE_FXO)
 				wc->chans[x]->sigcap = DAHDI_SIG_FXSKS | DAHDI_SIG_FXSLS | DAHDI_SIG_SF | DAHDI_SIG_CLEAR;
 			else if (wc->modtype[x] == MOD_TYPE_FXS)
@@ -3577,7 +3577,7 @@
 retry:
 	/* Init with Auto Calibration */
 	if (!(ret = wctdm_init_proslic(wc, x, 0, 0, sane))) {
-		wc->cardflag |= (1 << x);
+		set_bit(x, &wc->cardflag);
 		if (debug & DEBUG_CARD) {
 			readi = wctdm_getreg(wc,x,LOOP_I_LIMIT);
 			printk(KERN_DEBUG "Proslic module %d loop current is %dmA\n",x,
@@ -3590,7 +3590,7 @@
 			sane=1;
 			/* Init with Manual Calibration */
 			if (!wctdm_init_proslic(wc, x, 0, 1, sane)) {
-				wc->cardflag |= (1 << x);
+				set_bit(x, &wc->cardflag);
 			if (debug & DEBUG_CARD) {
 				readi = wctdm_getreg(wc,x,LOOP_I_LIMIT);
 				printk(KERN_DEBUG "Proslic module %d loop current is %dmA\n",x,
@@ -3603,11 +3603,11 @@
 				wc->chans[x]->sigcap = DAHDI_SIG_BROKEN | __DAHDI_SIG_FXO;
 			} 
 		} else if (!(ret = wctdm_init_voicedaa(wc, x, 0, 0, sane))) {
-			wc->cardflag |= (1 << x);
+			set_bit(x, &wc->cardflag);
 			wctdm_synchronize_cookie(wc, cookie);
 			printk(KERN_INFO "Port %d: Installed -- AUTO FXO (%s mode)\n",x + 1, fxo_modes[_opermode].name);
 		} else if (!wctdm_init_qrvdri(wc,x)) {
-			wc->cardflag |= 1 << x;
+			set_bit(x, &wc->cardflag);
 			wctdm_synchronize_cookie(wc, cookie);
 			printk(KERN_INFO "Port %d: Installed -- QRV DRI card\n",x + 1);
 		} else {
@@ -3634,7 +3634,7 @@
 				wctdm_synchronize_cookie(wc, cookie);
 				printk(KERN_NOTICE "Port %d: Not installed\n", x + 1);
 				wc->modtype[x] = MOD_TYPE_NONE;
-				wc->cardflag |= (1 << x);
+				set_bit(x, &wc->cardflag);
 			}
 		}
 	}

Modified: linux/team/sruffell/dahdi-linux-parallelload/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/dahdi-linux-parallelload/drivers/dahdi/wctdm24xxp/wctdm24xxp.h?view=diff&rev=7368&r1=7367&r2=7368
==============================================================================
--- linux/team/sruffell/dahdi-linux-parallelload/drivers/dahdi/wctdm24xxp/wctdm24xxp.h (original)
+++ linux/team/sruffell/dahdi-linux-parallelload/drivers/dahdi/wctdm24xxp/wctdm24xxp.h Fri Oct  9 10:31:38 2009
@@ -151,7 +151,7 @@
 	int flags[NUM_CARDS];
 	unsigned char ctlreg;
 	int cards;
-	int cardflag;		/* Bit-map of present cards */
+	unsigned long cardflag;		/* Bit-map of present cards */
  	int altcs[NUM_CARDS + NUM_EC];
 	char qrvhook[NUM_CARDS];
 	unsigned short qrvdebtime[NUM_CARDS];




More information about the dahdi-commits mailing list