summaryrefslogtreecommitdiff
path: root/drivers/dahdi/wct4xxp/vpm450m.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dahdi/wct4xxp/vpm450m.c')
-rw-r--r--drivers/dahdi/wct4xxp/vpm450m.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/dahdi/wct4xxp/vpm450m.c b/drivers/dahdi/wct4xxp/vpm450m.c
index 64e55a7..867ea1c 100644
--- a/drivers/dahdi/wct4xxp/vpm450m.c
+++ b/drivers/dahdi/wct4xxp/vpm450m.c
@@ -422,6 +422,7 @@ struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans, const struct f
tOCT6100_GET_INSTANCE_SIZE InstanceSize;
tOCT6100_CHANNEL_OPEN *ChannelOpen;
UINT32 ulResult;
+ const unsigned int mask = (8 == numspans) ? 0x7 : 0x3;
unsigned int sout_stream, rout_stream;
struct vpm450m *vpm450m;
int x,y,law;
@@ -527,7 +528,7 @@ struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans, const struct f
* therefore, the lower 2 bits tell us which span this
* timeslot/channel
*/
- if (isalaw[x & 0x07])
+ if (isalaw[x & mask])
law = cOCT6100_PCM_A_LAW;
else
law = cOCT6100_PCM_U_LAW;