summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2010-07-19 13:28:02 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2010-07-19 13:28:02 +0000
commitf947b9086a0045f249ef1e95cc62d08b52aefb8c (patch)
tree40b59f9170ebf7395f674aecdbdeaaa70cd741f9
parentaab6c824fa9d6d9951c0ee89612c22276bb034ff (diff)
FXS - fix VMWI compatibility mode:
* If we have vmwi_ioctl=N, we should initialize the vmwi_type of all channels. We initialize it to HVAC * Fix a regression, where curly braces around empty if()'s were removed. * Also fix the VMWI_TYPE() macro, so it actually uses the 3'rd parameter. (this didn't cause damage yet, as we only used HVAC so far) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8943 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/xpp/card_fxs.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/dahdi/xpp/card_fxs.c b/drivers/dahdi/xpp/card_fxs.c
index be62469..cbafab0 100644
--- a/drivers/dahdi/xpp/card_fxs.c
+++ b/drivers/dahdi/xpp/card_fxs.c
@@ -50,7 +50,7 @@ static DEF_PARM_BOOL(vmwi_ioctl, 1, 0644, "Asterisk support VMWI notification vi
#endif
#define VMWI_TYPE(priv, pos, type) \
- ((priv)->vmwisetting[pos].vmwi_type & DAHDI_VMWI_HVAC)
+ ((priv)->vmwisetting[pos].vmwi_type & DAHDI_VMWI_ ## type)
#define VMWI_NEON(priv, pos) VMWI_TYPE(priv, pos, HVAC)
#define LINES_DIGI_OUT 2
@@ -515,6 +515,10 @@ static int FXS_card_dahdi_preregistration(xpd_t *xpd, bool on)
cur_chan->chanpos = i + 1;
cur_chan->pvt = xpd;
cur_chan->sigcap = FXS_DEFAULT_SIGCAP;
+ if (!vmwi_ioctl) {
+ /* Old asterisk, assume default VMWI type */
+ priv->vmwisetting[i].vmwi_type = DAHDI_VMWI_HVAC;
+ }
}
for_each_line(xpd, i) {
MARK_ON(priv, i, LED_GREEN);
@@ -797,10 +801,12 @@ static int set_vmwi(xpd_t *xpd, int pos, unsigned long arg)
"%s: VMWI(hvdc) is not implemented yet. Ignored.\n",
__func__);
}
- if (VMWI_TYPE(priv, pos, HVAC))
- /* VMWI_NEON */
- if (priv->vmwisetting[pos].vmwi_type == 0)
- /* Disable VMWI */
+ if (VMWI_TYPE(priv, pos, HVAC)) {
+ ; /* VMWI_NEON */
+ }
+ if (priv->vmwisetting[pos].vmwi_type == 0) {
+ ; /* Disable VMWI */
+ }
priv->vmwisetting[pos] = vmwisetting;
set_vm_led_mode(xpd->xbus, xpd, pos, xpd->msg_waiting[pos]);
return 0;