summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Bailey <dbailey@digium.com>2009-01-22 15:42:38 +0000
committerDoug Bailey <dbailey@digium.com>2009-01-22 15:42:38 +0000
commit3403ce644e15dbfef32e5f267ef9fb09519fe104 (patch)
tree82937d46556a0b934f3488eb8fb573134ce8d1c0
parent2f4b075cdd270f1ce53ce796d8328426e55326ad (diff)
Change structure passed in DAHDI_VMWI ioctl call to make it so new VMWI types do not break the ioctl call
Remove FSK and RPAS from the VMWI types as no driver implemented them and the functionality is in chan_dahdi. (issue #14104) Reported by: alecdavis Patches: mwiioctl_structure_dahdi.diff4.txt uploaded by dbailey (license ) Tested by: alecdavis, dbailey git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5799 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/wctdm.c6
-rw-r--r--drivers/dahdi/wctdm24xxp/base.c2
-rw-r--r--include/dahdi/user.h10
3 files changed, 9 insertions, 9 deletions
diff --git a/drivers/dahdi/wctdm.c b/drivers/dahdi/wctdm.c
index cc32a9f..9d43833 100644
--- a/drivers/dahdi/wctdm.c
+++ b/drivers/dahdi/wctdm.c
@@ -1847,9 +1847,9 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
return -EFAULT;
if (wc->mod[chan->chanpos - 1].fxs.vmwisetting.messages){
- wc->mod[chan->chanpos - 1].fxs.vmwi_lrev = (wc->mod[chan->chanpos - 1].fxs.vmwisetting.linereverse)?1:0;
- wc->mod[chan->chanpos - 1].fxs.vmwi_hvdc = (wc->mod[chan->chanpos - 1].fxs.vmwisetting.hvdc)?1:0;
- wc->mod[chan->chanpos - 1].fxs.vmwi_hvac = (wc->mod[chan->chanpos - 1].fxs.vmwisetting.hvac)?1:0;
+ wc->mod[chan->chanpos - 1].fxs.vmwi_lrev = (wc->mod[chan->chanpos - 1].fxs.vmwisetting.vmwi_type & DAHDI_VMWI_LREV)?1:0;
+ wc->mod[chan->chanpos - 1].fxs.vmwi_hvdc = (wc->mod[chan->chanpos - 1].fxs.vmwisetting.vmwi_type & DAHDI_VMWI_HVDC)?1:0;
+ wc->mod[chan->chanpos - 1].fxs.vmwi_hvac = (wc->mod[chan->chanpos - 1].fxs.vmwisetting.vmwi_type & DAHDI_VMWI_HVAC)?1:0;
} else {
wc->mod[chan->chanpos - 1].fxs.vmwi_lrev = 0;
wc->mod[chan->chanpos - 1].fxs.vmwi_hvdc = 0;
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
index 847b9f4..0f87ea7 100644
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -2450,7 +2450,7 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
if (copy_from_user(&(wc->mods[chan->chanpos - 1].fxs.vmwisetting), (__user void *) data, sizeof(wc->mods[chan->chanpos - 1].fxs.vmwisetting)))
return -EFAULT;
- if (wc->mods[chan->chanpos - 1].fxs.vmwisetting.messages && wc->mods[chan->chanpos - 1].fxs.vmwisetting.linereverse){
+ if (wc->mods[chan->chanpos - 1].fxs.vmwisetting.messages && wc->mods[chan->chanpos - 1].fxs.vmwisetting.vmwi_type & DAHDI_VMWI_LREV){
wc->mods[chan->chanpos - 1].fxs.linereverse_mwi = 1;
} else {
wc->mods[chan->chanpos - 1].fxs.linereverse_mwi = 0;
diff --git a/include/dahdi/user.h b/include/dahdi/user.h
index a94ef38..8a06f5f 100644
--- a/include/dahdi/user.h
+++ b/include/dahdi/user.h
@@ -971,13 +971,13 @@ struct dahdi_hwgain {
*/
struct dahdi_vmwi_info {
unsigned int messages; /* Number of messages pending */
- unsigned char fsk; /* default FSK, */
- unsigned char rpas; /* Ring Pulse Alert Signal precedes the FSK spill */
- unsigned char linereverse; /* Line reversal message indicator */
- unsigned char hvdc; /* Line reversal message indicator */
- unsigned char hvac; /* Line reversal message indicator */
+ unsigned int vmwi_type;
};
+#define DAHDI_VMWI_LREV (1 << 0) /* Line Reversal */
+#define DAHDI_VMWI_HVDC (1 << 1) /* HV 90VDC */
+#define DAHDI_VMWI_HVAC (1 << 2) /* HV 90VAC Neon lamp */
+
/*
* VoiceMail Waiting Indication (VMWI) -- implemented by low-level driver.
* Value: number of waiting messages (hence 0: switch messages off).