From 113b9311ebca9311befbd017eb27f6a25949e6a6 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 26 Jul 2010 00:30:41 +0000 Subject: 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 --- drivers/dahdi/wct1xxp.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'drivers/dahdi/wct1xxp.c') diff --git a/drivers/dahdi/wct1xxp.c b/drivers/dahdi/wct1xxp.c index 30d6457..80392c8 100644 --- a/drivers/dahdi/wct1xxp.c +++ b/drivers/dahdi/wct1xxp.c @@ -745,6 +745,19 @@ static int t1xxp_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc return 0; } + +static const struct dahdi_span_ops t1xxp_span_ops = { + .spanconfig = t1xxp_spanconfig, + .chanconfig = t1xxp_chanconfig, + .startup = t1xxp_startup, + .shutdown = t1xxp_shutdown, + .rbsbits = t1xxp_rbsbits, + .maint = t1xxp_maint, + .open = t1xxp_open, + .close = t1xxp_close, + .ioctl = t1xxp_ioctl, +}; + static int t1xxp_software_init(struct t1xxp *wc) { int x; @@ -765,18 +778,9 @@ static int t1xxp_software_init(struct t1xxp *wc) 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.owner = THIS_MODULE; - 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; wc->span.chans = wc->chans; wc->span.flags = DAHDI_FLAG_RBS; - wc->span.ioctl = t1xxp_ioctl; if (wc->ise1) { wc->span.channels = 31; wc->span.deflaw = DAHDI_LAW_ALAW; @@ -798,6 +802,7 @@ static int t1xxp_software_init(struct t1xxp *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; -- cgit v1.2.3