diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-10-16 17:40:22 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-10-16 17:40:22 +0000 |
commit | 12058f5c95e9dbfddea2c0dc8d1a9f32b6d431b5 (patch) | |
tree | 4a6a549a985c1a04e9b370fca3b2e8922228efad /drivers/dahdi/xpp/mmapdrv.c | |
parent | fdaba144813046745154ec3425705a80e2ca5eb6 (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/mmapdrv.c')
-rw-r--r-- | drivers/dahdi/xpp/mmapdrv.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/dahdi/xpp/mmapdrv.c b/drivers/dahdi/xpp/mmapdrv.c index c3ce708..22b9a2b 100644 --- a/drivers/dahdi/xpp/mmapdrv.c +++ b/drivers/dahdi/xpp/mmapdrv.c @@ -113,7 +113,7 @@ static irqreturn_t xpp_mmap_rx_irq(int irq, void *dev_id) if (unlikely(disconnecting)) return IRQ_HANDLED; - xbus = get_xbus(global_xbus->num); + xbus = xbus_num(global_xbus->num); BUG_ON(!xbus); if(!XBUS_GET(xbus)) { if (printk_ratelimit()) @@ -186,7 +186,6 @@ free: out: if (in_use) XBUS_PUT(xbus); - put_xbus(xbus); #ifdef DEBUG_VIA_GPIO rx_intr_counter++; #endif @@ -230,11 +229,10 @@ static irqreturn_t xpp_mmap_tx_irq(int irq, void *dev_id) spin_unlock_irqrestore(&tx_ready_lock, flags); xbus = (xbus_t *)xframe->priv; BUG_ON(!xbus); - xbus = get_xbus(xbus->num); + xbus = xbus_num(xbus->num); BUG_ON(!xbus); send_buffer(xframe->packets, XFRAME_LEN(xframe)); FREE_SEND_XFRAME(xbus, xframe); - put_xbus(xbus); update_counter(&tx_counter, &tv1); return IRQ_HANDLED; } @@ -532,7 +530,7 @@ static int __init xpp_mmap_init(void) ret = -ENOMEM; goto fail_xbus; } - strncpy(global_xbus->location, "mmap", XBUS_DESCLEN); + strncpy(global_xbus->connector, "mmap", XBUS_DESCLEN); strncpy(global_xbus->label, "mmap:0", LABEL_SIZE); xframe_queue_init(&txpool, 10, 200, "mmap_txpool", global_xbus); @@ -575,10 +573,10 @@ static void __exit xpp_mmap_exit(void) xbus_t *xbus; DBG(GENERAL, "\n"); disconnecting = 1; - xbus = get_xbus(global_xbus->num); + xbus = xbus_num(global_xbus->num); remove_proc_entry("xpp_mmap", xbus->proc_xbus_dir); xframe_queue_clear(&txpool); - xbus_disconnect(xbus); /* xbus_disconnect() calls put_xbus() */ + xbus_disconnect(xbus); kmem_cache_destroy(xframe_cache); release_region((resource_size_t)FPGA_BASE_ADDR, 8); |