summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp/xproto.c
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2008-10-16 17:40:22 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2008-10-16 17:40:22 +0000
commit12058f5c95e9dbfddea2c0dc8d1a9f32b6d431b5 (patch)
tree4a6a549a985c1a04e9b370fca3b2e8922228efad /drivers/dahdi/xpp/xproto.c
parentfdaba144813046745154ec3425705a80e2ca5eb6 (diff)
xpp: start migration from procfs to sysfs.
* Sysfs representation for XPDs: /sys/bus/xpds/devices/<bus>:<unit>:<subunit> * Astribanks sysfs directories now include the XPDs as subdirectories: e.g. /sys/bus/astribanks/devices/xbus-00/00:3:0 * procfs control interface deprecated: conditioned by OLD_PROC (defaults to off). Control functionality moved to sysfs: * xbus attributes: cls connector label status timing waitfor_xpds xbus_state * XPDs can have driver-specific attributes. Common attriubtes: blink chipregs span * PRI-specific attributes: pri_clocking pri_dchan pri_cas pri_alarms pri_layer1 pri_localloop pri_protocol * The Astribank attribute "xbus_state" is read/write. Reading it shows the current state of the Astribank. Writing "start" or "stop" allows a software equivalent of connect or disconnect respectively. * When an Astribank is ready it sends an "online" event. Whenever its not ready (e.g. at the time of disconnect) it sends an "offline" event. Use astribank_hook.sample to handle those. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5097 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/xpp/xproto.c')
-rw-r--r--drivers/dahdi/xpp/xproto.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/dahdi/xpp/xproto.c b/drivers/dahdi/xpp/xproto.c
index 72686e3..53b6fce 100644
--- a/drivers/dahdi/xpp/xproto.c
+++ b/drivers/dahdi/xpp/xproto.c
@@ -262,7 +262,7 @@ int xframe_receive(xbus_t *xbus, xframe_t *xframe)
FREE_RECV_XFRAME(xbus, xframe);
return -EPROTO;
}
- if(!XBUS_GET(xbus)) {
+ if(XBUS_IS(xbus, DISCONNECTED)) {
XBUS_DBG(GENERAL, xbus, "Dropped xframe. Is shutting down.\n");
return -ENODEV;
}
@@ -270,9 +270,12 @@ int xframe_receive(xbus_t *xbus, xframe_t *xframe)
/*
* We want to check that xframes do not mix PCM and other commands
*/
- if(XPACKET_IS_PCM((xpacket_t *)xframe->packets))
- xframe_receive_pcm(xbus, xframe);
- else {
+ if(XPACKET_IS_PCM((xpacket_t *)xframe->packets)) {
+ if(!XBUS_IS(xbus, READY))
+ FREE_RECV_XFRAME(xbus, xframe);
+ else
+ xframe_receive_pcm(xbus, xframe);
+ } else {
XBUS_COUNTER(xbus, RX_CMD)++;
ret = xframe_receive_cmd(xbus, xframe);
}
@@ -282,7 +285,6 @@ int xframe_receive(xbus_t *xbus, xframe_t *xframe)
now.tv_usec - tv_received.tv_usec;
if(usec > xbus->max_rx_process)
xbus->max_rx_process = usec;
- XBUS_PUT(xbus);
return ret;
}