diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-02-07 20:58:46 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-02-07 20:58:46 +0000 |
commit | 8953e09799d8995e3667e5766a362d282700af20 (patch) | |
tree | 8ce49c141cdccd5b1398979e809a3bdeeff0e9d8 /xpp/card_global.c | |
parent | 237daca586a95a8f46c5e3326acf9015a004bf1b (diff) |
xpp driver rev. 3332:
* Reverse polarity and power denial detection.
* A short led flash at registration time.
* Add a real version of the xpp modules to them (independent of the Zaptel
version).
* Update our line status even when not registered.
* Fixed a false SIG_CHANGED when inserting or removing cable to FXO.
* Fixed compilation fixes for 2.6.20 (Bug #8982)
* A cleaner fix for the bool changes of 2.6.19 .
* Automatically detect echo_can_state_t at debug time.
* Automaitcally set XPP_DEBUGFS (depending on debugfs) at compile time.
* Bug-fixes to zaptel-helper.
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@2113 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/card_global.c')
-rw-r--r-- | xpp/card_global.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/xpp/card_global.c b/xpp/card_global.c index 17e94ef..c2c7022 100644 --- a/xpp/card_global.c +++ b/xpp/card_global.c @@ -30,7 +30,7 @@ static const char rcsid[] = "$Id$"; -DEF_PARM(charp,initdir, "/usr/share/zaptel", "The directory of card initialization scripts"); +DEF_PARM(charp,initdir, "/usr/share/zaptel", 0600, "The directory of card initialization scripts"); extern int print_dbg; static bool pcm_valid(xpd_t *xpd, xpacket_t *pack); @@ -226,27 +226,32 @@ HANDLER_DEF(GLOBAL, SYNC_REPLY) HANDLER_DEF(GLOBAL, ERROR_CODE) { - byte errorcode = RPACKET_FIELD(pack, GLOBAL, ERROR_CODE, errorcode); - reg_cmd_t *bad_cmd; - char xpdname[XPD_NAMELEN]; + byte errorcode = RPACKET_FIELD(pack, GLOBAL, ERROR_CODE, errorcode); + reg_cmd_t *bad_cmd; + char tmp_xpdname[XPD_NAMELEN]; + static long rate_limit; BUG_ON(!xbus); + if((rate_limit++ % 5003) > 200) + return 0; if(!xpd) { int xpd_num = XPD_NUM(pack->addr); - snprintf(xpdname, XPD_NAMELEN, "#%d", xpd_num); + snprintf(tmp_xpdname, XPD_NAMELEN, "#%d", xpd_num); } else { - snprintf(xpdname, XPD_NAMELEN, "%s", xpd->xpdname); + snprintf(tmp_xpdname, XPD_NAMELEN, "%s", xpd->xpdname); } - if(!printk_ratelimit()) - return 0; - NOTICE("%s/%s: %s CODE = 0x%X\n", xbus->busname, xpdname, cmd->name, errorcode); + NOTICE("%s/%s: FIRMWARE: %s CODE = 0x%X (rate_limit=%ld)\n", + xbus->busname, tmp_xpdname, cmd->name, errorcode, rate_limit); switch(errorcode) { case 1: bad_cmd = &RPACKET_FIELD(pack, GLOBAL, ERROR_CODE, info.bad_spi_cmd); - dump_packet("BAD_SPI_CMD", pack, 1); + dump_packet("FIRMWARE: BAD_SPI_CMD", pack, 1); + break; + case 0xAB: + dump_packet("FIRMWARE: BAD_PACKET_LEN", pack, 1); break; default: - NOTICE("%s/%s: %s UNKNOWN CODE = 0x%X\n", xbus->busname, xpdname, cmd->name, errorcode); + NOTICE("%s/%s: FIRMWARE: %s UNKNOWN CODE = 0x%X\n", xbus->busname, tmp_xpdname, cmd->name, errorcode); dump_packet("PACKET", pack, 1); } /* |