summaryrefslogtreecommitdiff
path: root/xpp/card_global.c
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-02-27 06:14:18 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-02-27 06:14:18 +0000
commit75a1b90515aa90729ba32cb9698a6db53e19cdd4 (patch)
tree2fbd3fc7760e0326d61150659f619446b4b71e48 /xpp/card_global.c
parentd2bc5edd30ddb4258feca767eb6cd5d2bc96ad30 (diff)
Xorcom rev. 3491:
* Version of xpp modules is set from xpp/.version, rather than "unknown". * Astribank devices are now initialized in parallel: faster startup when there are multiple Astribanks. * Re-added support for the old format of /proc/xpp/sync write: (echo N 0 > /proc/xpp/sync ) . The new format (SYNC=NN) is preffered. * Firmware update to fix a PCM issue. * Fixed a build issue with kernel 2.6.8 . * Fixed missing initialization in Zaptel::Xpp::Xbus . * genzaptelconf will now set FXS ports as LS by default. To set them as KS, use fxs_default_start=ks in /etc/default/zaptel / /etc/sysconfig/zaptel (Also a workaround for #7755 ). * Groundwork for sync from zaptel master span: if zaptel is built with ZAPTEL_SYNC_TIC (see zaptel/team/tzafrir/sync ), xpp will report its drift from the zaptel sync master. * USB firmware update: had bad lines checksums (and fxload did not report). * fpga_load can now better report bad hex file checksum ;-) . git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@2239 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/card_global.c')
-rw-r--r--xpp/card_global.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/xpp/card_global.c b/xpp/card_global.c
index c2c7022..0f2acb9 100644
--- a/xpp/card_global.c
+++ b/xpp/card_global.c
@@ -59,6 +59,9 @@ static void global_packet_dump(const char *msg, xpacket_t *pack);
return ret;
}
+/*
+ * The XPD parameter is totaly ignored by the driver and firmware as well.
+ */
/* 0x19 */ HOSTCMD(GLOBAL, SYNC_SOURCE, bool setit, bool is_master)
{
xframe_t *xframe;
@@ -66,14 +69,14 @@ static void global_packet_dump(const char *msg, xpacket_t *pack);
byte mask = 0;
BUG_ON(!xbus);
- BUG_ON(!xpd);
if(is_master)
mask |= BIT(0);
if(!setit)
mask |= BIT(1);
- DBG("SYNC_SOURCE %s setit=%s is_master=%s (mask=0x%X)\n",
- xpd->xpdname, (setit)?"yes":"no", (is_master)?"yes":"no", mask);
- XFRAME_NEW(xframe, pack, xbus, GLOBAL, SYNC_SOURCE, xpd->id);
+ DBG("%s: setit=%s is_master=%s\n",
+ xbus->busname,
+ (setit)?"yes":"no", (is_master)?"yes":"no");
+ XFRAME_NEW(xframe, pack, xbus, GLOBAL, SYNC_SOURCE, 0);
RPACKET_FIELD(pack, GLOBAL, SYNC_SOURCE, mask) = mask;
xframe_send(xbus, xframe);
return 0;
@@ -94,7 +97,6 @@ HANDLER_DEF(GLOBAL, DEV_DESC)
xpp_line_t line_status = RPACKET_FIELD(pack, GLOBAL, DEV_DESC, line_status);
xpd_addr_t xpd_addr = RPACKET_FIELD(pack, GLOBAL, DEV_DESC, addr);
struct card_desc_struct *card_desc;
- unsigned long flags;
BUG_ON(!xbus);
if((card_desc = kmalloc(sizeof(struct card_desc_struct), GFP_ATOMIC)) == NULL) {
@@ -108,22 +110,10 @@ HANDLER_DEF(GLOBAL, DEV_DESC)
card_desc->type = type;
card_desc->rev = rev;
card_desc->xpd_addr = xpd_addr;
+ card_desc->line_status = line_status;
DBG("%s: xpd=%d-%d type=%d rev=%d line_status=0x%04X\n",
xbus->busname, xpd_addr.unit, xpd_addr.subunit, type, rev, line_status);
- spin_lock_irqsave(&xbus->lock, flags);
- if(type == XPD_TYPE_NOMODULE)
- XBUS_COUNTER(xbus, DEV_DESC_EMPTY)++;
- else
- XBUS_COUNTER(xbus, DEV_DESC_FULL)++;
- atomic_inc(&xbus->count_poll_answers);
- list_add_tail(&card_desc->card_list, &xbus->poll_results);
- spin_unlock_irqrestore(&xbus->lock, flags);
- /*
- * wake_up only after exiting our critical section.
- * We suspect that otherwise a spinlock nesting may occur
- * and cause a panic (if spinlock debugging is compiled in).
- */
- wake_up(&xbus->wait_for_polls);
+ xbus_poller_notify(xbus, card_desc);
return 0;
}
@@ -219,8 +209,11 @@ HANDLER_DEF(GLOBAL, SYNC_REPLY)
NOTICE("%s: received %s for non-existing xpd: addr=0x%02X\n", __FUNCTION__, cmd->name, xpd_num);
return -EPROTO;
}
- DBG("%s/%s: SYNC_REPLY: 0x%X %s\n", xpd->xbus->busname, xpd->xpdname,
- mask, (setit) ? "SET SYNC MASTER" : "");
+ DBG("%s/%s: mask=0x%X %s\n",
+ xpd->xbus->busname, xpd->xpdname,
+ mask,
+ (setit) ? "SET SYNC MASTER" : "");
+ dump_packet("SYNC_REPLY", pack, 1);
return 0;
}