summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp/card_global.c
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-03-01 13:56:23 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-03-01 13:56:23 +0000
commit7e6e55bbdcd0224bf07de8dd47e4f7a92e7d097f (patch)
tree34c04ea112c9587bbad7e0593119c09a53c43466 /drivers/dahdi/xpp/card_global.c
parentac9297570200f1f21dff01043baabdba90516722 (diff)
New XPP code: xpp rev 6795:
* Fix cases where the command_queue overflowed during initialization. - Also add a 'command_queue_length' parameter to xpp.ko * More migrations to sysfs: - Add a 'transport' attribute to our astribank devices which points to the usb device we use. E.g: /sys/bus/astribanks/devices/xbus-00/transport is symlinked to ../../../../../../devices/pci0000:00/0000:00:10.4/usb5/5-4 - Move /proc/xpp/XBUS-??/XPD-??/span to /sys/bus/xpds/devices/??:?:?/span - Migrate from /proc/xpp/sync to: /sys/bus/astribanks/drivers/xppdrv/sync - New 'offhook' attribute in: /sys/bus/xpds/devices/??:?:?/offhook * PRI: change the "timing" priority to match the convention used by other PRI cards -- I.e: lower numbers (not 0) have higher priority. * FXO: - Power denial: create two module parameters instead of hard-coded constants (power_denial_safezone, power_denial_minlen). For sites that get non-standard power-denial signals from central office on offhook. - Don't hangup on power-denial, just notify Dahdi and wait for - Fix caller-id detection for the case central office sends it before first ring without any indication before. Asterisk's desicion. * USB_FW.hex: - Fixes cases where firmware loading would fail. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6046 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/xpp/card_global.c')
-rw-r--r--drivers/dahdi/xpp/card_global.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/dahdi/xpp/card_global.c b/drivers/dahdi/xpp/card_global.c
index 438a800..cd43d4c 100644
--- a/drivers/dahdi/xpp/card_global.c
+++ b/drivers/dahdi/xpp/card_global.c
@@ -484,6 +484,12 @@ int xpp_register_request(xbus_t *xbus, xpd_t *xpd, xportno_t portno,
dump_reg_cmd("REG_REQ", 1, xbus, xpd->addr.unit, reg_cmd->portnum, reg_cmd);
dump_packet("REG_REQ", pack, 1);
}
+ if(!xframe->usec_towait) { /* default processing time of SPI */
+ if(subreg)
+ xframe->usec_towait = 2000;
+ else
+ xframe->usec_towait = 1000;
+ }
ret = send_cmd_frame(xbus, xframe);
return ret;
}
@@ -693,34 +699,24 @@ HANDLER_DEF(GLOBAL, SYNC_REPLY)
HANDLER_DEF(GLOBAL, ERROR_CODE)
{
- byte errorcode;
char tmp_name[TMP_NAME_LEN];
static long rate_limit;
- const char *msg;
- const static char *fw_messages[] = {
- [1] = "Packet too short",
- [2] = "Len field is too small",
- [3] = "Premature packet end",
- [4] = "Invalid op code",
- [5] = "Invalid packet len",
- [6] = "SPI fifo full",
- };
+ byte category_code;
+ byte errorbits;
BUG_ON(!xbus);
if((rate_limit++ % 5003) > 200)
return 0;
- errorcode = RPACKET_FIELD(pack, GLOBAL, ERROR_CODE, errorcode);
- msg = (errorcode < ARRAY_SIZE(fw_messages))
- ? fw_messages[errorcode]
- : "UNKNOWN CODE";
+ category_code = RPACKET_FIELD(pack, GLOBAL, ERROR_CODE, category_code);
+ errorbits = RPACKET_FIELD(pack, GLOBAL, ERROR_CODE, errorbits);
if(!xpd) {
snprintf(tmp_name, TMP_NAME_LEN, "%s(%1d%1d)", xbus->busname,
XPACKET_ADDR_UNIT(pack), XPACKET_ADDR_SUBUNIT(pack));
} else {
snprintf(tmp_name, TMP_NAME_LEN, "%s/%s", xbus->busname, xpd->xpdname);
}
- NOTICE("%s: FIRMWARE: %s CODE = 0x%X (%s) (rate_limit=%ld)\n",
- tmp_name, cmd->name, errorcode, msg, rate_limit);
+ NOTICE("%s: FIRMWARE %s: category=%d errorbits=0x%02X (rate_limit=%ld)\n",
+ tmp_name, cmd->name, category_code, errorbits, rate_limit);
dump_packet("FIRMWARE: ", pack, 1);
/*
* FIXME: Should implement an error recovery plan