diff options
author | Shaun Ruffell <sruffell@digium.com> | 2010-07-26 00:30:41 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2010-07-26 00:30:41 +0000 |
commit | 113b9311ebca9311befbd017eb27f6a25949e6a6 (patch) | |
tree | 57dc2f7e5a6c358c0a13eb4a8d0f7856b5e8077a /drivers/dahdi/wcte11xp.c | |
parent | 8682c2a90bd996765326fb6477a2466b63530b73 (diff) |
dahdi: Move the callbacks in dahdi_span into its own structure.
Part of preparation for adding additional callbacks to allow board
drivers to advertise and support gathering pre-echocan data from hardware
echocans.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8985 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wcte11xp.c')
-rw-r--r-- | drivers/dahdi/wcte11xp.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/dahdi/wcte11xp.c b/drivers/dahdi/wcte11xp.c index 32d4f5b..ec73cbf 100644 --- a/drivers/dahdi/wcte11xp.c +++ b/drivers/dahdi/wcte11xp.c @@ -955,6 +955,18 @@ static int t1xxp_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc return 0; } +static const struct dahdi_span_ops t1xxp_span_ops = { + .startup = t1xxp_startup, + .shutdown = t1xxp_shutdown, + .rbsbits = t1xxp_rbsbits, + .maint = t1xxp_maint, + .open = t1xxp_open, + .close = t1xxp_close, + .spanconfig = t1xxp_spanconfig, + .chanconfig = t1xxp_chanconfig, + .ioctl = t1xxp_ioctl, +}; + static int t1xxp_software_init(struct t1 *wc) { int x; @@ -976,15 +988,7 @@ static int t1xxp_software_init(struct t1 *wc) dahdi_copy_string(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype)); snprintf(wc->span.location, sizeof(wc->span.location) - 1, "PCI Bus %02d Slot %02d", wc->dev->bus->number, PCI_SLOT(wc->dev->devfn) + 1); - wc->span.spanconfig = t1xxp_spanconfig; - wc->span.chanconfig = t1xxp_chanconfig; wc->span.irq = wc->dev->irq; - wc->span.startup = t1xxp_startup; - wc->span.shutdown = t1xxp_shutdown; - wc->span.rbsbits = t1xxp_rbsbits; - wc->span.maint = t1xxp_maint; - wc->span.open = t1xxp_open; - wc->span.close = t1xxp_close; if (wc->spantype == TYPE_E1) { if (unchannelized) wc->span.channels = 32; @@ -1001,7 +1005,6 @@ static int t1xxp_software_init(struct t1 *wc) } wc->span.chans = wc->chans; wc->span.flags = DAHDI_FLAG_RBS; - wc->span.ioctl = t1xxp_ioctl; init_waitqueue_head(&wc->span.maintq); for (x=0;x<wc->span.channels;x++) { sprintf(wc->chans[x]->name, "WCT1/%d/%d", wc->num, x + 1); @@ -1012,6 +1015,7 @@ static int t1xxp_software_init(struct t1 *wc) wc->chans[x]->pvt = wc; wc->chans[x]->chanpos = x + 1; } + wc->span.ops = &t1xxp_span_ops; if (dahdi_register(&wc->span, 0)) { printk(KERN_NOTICE "Unable to register span with DAHDI\n"); return -1; |