summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-04-16 18:16:29 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-04-16 18:16:29 +0000
commit856ec38e3accde2e39e1db7a0530bf04b5ec4f39 (patch)
tree564e84c61b1374032fe9b8636fdbb321595f46a5
parenta95c64e8b0ba9d2aa6584c3c3a2c70425be4b125 (diff)
xpp fxs: Ignore registers of disabled SLICs
From xpp rev. 6979 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6377 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/xpp/card_fxs.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/dahdi/xpp/card_fxs.c b/drivers/dahdi/xpp/card_fxs.c
index b79dbe7..3673d8b 100644
--- a/drivers/dahdi/xpp/card_fxs.c
+++ b/drivers/dahdi/xpp/card_fxs.c
@@ -100,6 +100,7 @@ enum fxs_state {
#define REG_BATTERY_BATSL BIT(1) /* Battery Feed Select */
#define REG_LOOPCLOSURE 0x44 /* 68 - Loop Closure/Ring Trip Detect Status */
+#define REG_LOOPCLOSURE_ZERO 0xF8 /* Loop Closure zero bits. */
#define REG_LOOPCLOSURE_LCR BIT(0) /* Loop Closure Detect Indicator. */
/*---------------- FXS Protocol Commands ----------------------------------*/
@@ -1307,11 +1308,17 @@ static int FXS_card_register_reply(xbus_t *xbus, xpd_t *xpd, reg_cmd_t *info)
xpp_line_t mask = BIT(info->portnum);
xpp_line_t offhook;
- offhook = (val & REG_LOOPCLOSURE_LCR) ? mask : 0;
- LINE_DBG(SIGNAL, xpd, info->portnum,
- "REG_LOOPCLOSURE: dataL=0x%X (offhook=0x%X mask=0x%X\n",
- val, offhook, mask);
- process_hookstate(xpd, offhook, mask);
+ /*
+ * Validate reply. Non-existing/disabled ports
+ * will reply with 0xFF. Ignore these.
+ */
+ if((val & REG_LOOPCLOSURE_ZERO) == 0) {
+ offhook = (val & REG_LOOPCLOSURE_LCR) ? mask : 0;
+ LINE_DBG(SIGNAL, xpd, info->portnum,
+ "REG_LOOPCLOSURE: dataL=0x%X (offhook=0x%X mask=0x%X\n",
+ val, offhook, mask);
+ process_hookstate(xpd, offhook, mask);
+ }
} else {
#if 0
XPD_NOTICE(xpd, "Spurious register reply(ignored): %s reg_num=0x%X, dataL=0x%X dataH=0x%X\n",