[dahdi-commits] dbailey: linux/trunk r5746 - in /linux/trunk: drivers/dahdi/ drivers/dahdi/wc...

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Mon Jan 19 12:18:12 CST 2009


Author: dbailey
Date: Mon Jan 19 12:18:12 2009
New Revision: 5746

URL: http://svn.digium.com/svn-view/dahdi?view=rev&rev=5746
Log:
Add mask for portion of DAHDI_VMWI ioctl call that carries the number of messages pending. 
Remove magic number from code. 

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

Modified: linux/trunk/drivers/dahdi/wctdm.c
URL: http://svn.digium.com/svn-view/dahdi/linux/trunk/drivers/dahdi/wctdm.c?view=diff&rev=5746&r1=5745&r2=5746
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm.c (original)
+++ linux/trunk/drivers/dahdi/wctdm.c Mon Jan 19 12:18:12 2009
@@ -1848,8 +1848,8 @@
 		if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS)
 			return -EINVAL;
 
-		wc->mod[chan->chanpos - 1].fxs.vmwimessages = (x & 255);
-		wc->mod[chan->chanpos - 1].fxs.mwisendtype = (x & ~255);
+		wc->mod[chan->chanpos - 1].fxs.vmwimessages = (x &  DAHDI_VMWI_NUMBER_MASK);
+		wc->mod[chan->chanpos - 1].fxs.mwisendtype = (x & ~ DAHDI_VMWI_NUMBER_MASK);
 		if (wc->mod[chan->chanpos - 1].fxs.vmwimessages){
 			x = wc->mod[chan->chanpos - 1].fxs.mwisendtype;
 			wc->mod[chan->chanpos - 1].fxs.vmwi_lrev = (x & DAHDI_VMWI_LREV)?1:0;

Modified: linux/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svn.digium.com/svn-view/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=5746&r1=5745&r2=5746
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/base.c Mon Jan 19 12:18:12 2009
@@ -2453,8 +2453,8 @@
 		if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS)
 			return -EINVAL;
 
-		wc->mods[chan->chanpos - 1].fxs.vmwimessages = (x & 255);
-		wc->mods[chan->chanpos - 1].fxs.mwisendtype = (x & ~255);
+		wc->mods[chan->chanpos - 1].fxs.vmwimessages = (x & DAHDI_VMWI_NUMBER_MASK);
+		wc->mods[chan->chanpos - 1].fxs.mwisendtype = (x & ~DAHDI_VMWI_NUMBER_MASK);
 		if (wc->mods[chan->chanpos - 1].fxs.vmwimessages){
 			x = wc->mods[chan->chanpos - 1].fxs.mwisendtype;
 			wc->mods[chan->chanpos - 1].fxs.vmwilinereverse= (x & DAHDI_VMWI_LREV)?1:0;

Modified: linux/trunk/include/dahdi/user.h
URL: http://svn.digium.com/svn-view/dahdi/linux/trunk/include/dahdi/user.h?view=diff&rev=5746&r1=5745&r2=5746
==============================================================================
--- linux/trunk/include/dahdi/user.h (original)
+++ linux/trunk/include/dahdi/user.h Mon Jan 19 12:18:12 2009
@@ -972,6 +972,7 @@
  */
 #define DAHDI_VMWI			_IOWR(DAHDI_CODE, 94, int)
 
+#define DAHDI_VMWI_NUMBER_MASK (0xffff)	/* Number of messages pending for VMWI */
 #define DAHDI_VMWI_FSK 	(1 << 16)	/* default FSK, no Ring Pulse Alert Signal*/
 #define DAHDI_VMWI_RPAS	(1 << 17)	/* Ring Pulse Alert Signal then FSK */
 #define DAHDI_VMWI_LREV	(1 << 18)	/* Line Reversal */




More information about the dahdi-commits mailing list