summaryrefslogtreecommitdiff
path: root/drivers/dahdi/tor2.c
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-07-26 00:30:41 +0000
committerShaun Ruffell <sruffell@digium.com>2010-07-26 00:30:41 +0000
commit113b9311ebca9311befbd017eb27f6a25949e6a6 (patch)
tree57dc2f7e5a6c358c0a13eb4a8d0f7856b5e8077a /drivers/dahdi/tor2.c
parent8682c2a90bd996765326fb6477a2466b63530b73 (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/tor2.c')
-rw-r--r--drivers/dahdi/tor2.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/dahdi/tor2.c b/drivers/dahdi/tor2.c
index ee8ebe9..633369c 100644
--- a/drivers/dahdi/tor2.c
+++ b/drivers/dahdi/tor2.c
@@ -259,6 +259,18 @@ static int tor2_close(struct dahdi_chan *chan)
return 0;
}
+static const struct dahdi_span_ops tor2_span_ops = {
+ .spanconfig = tor2_spanconfig,
+ .chanconfig = tor2_chanconfig,
+ .startup = tor2_startup,
+ .shutdown = tor2_shutdown,
+ .rbsbits = tor2_rbsbits,
+ .maint = tor2_maint,
+ .open = tor2_open,
+ .close = tor2_close,
+ .ioctl = tor2_ioctl,
+};
+
static void init_spans(struct tor2 *tor)
{
int x, y, c;
@@ -274,14 +286,6 @@ static void init_spans(struct tor2 *tor)
snprintf(s->location, sizeof(s->location) - 1,
"PCI Bus %02d Slot %02d", tor->pci->bus->number, PCI_SLOT(tor->pci->devfn) + 1);
s->owner = THIS_MODULE;
- s->spanconfig = tor2_spanconfig;
- s->chanconfig = tor2_chanconfig;
- s->startup = tor2_startup;
- s->shutdown = tor2_shutdown;
- s->rbsbits = tor2_rbsbits;
- s->maint = tor2_maint;
- s->open = tor2_open;
- s->close = tor2_close;
if (tor->cardtype == TYPE_T1) {
s->channels = 24;
s->deflaw = DAHDI_LAW_MULAW;
@@ -295,7 +299,8 @@ static void init_spans(struct tor2 *tor)
}
s->chans = tor->chans[x];
s->flags = DAHDI_FLAG_RBS;
- s->ioctl = tor2_ioctl;
+ s->ops = &tor2_span_ops;
+
tor->tspans[x].tor = tor;
tor->tspans[x].span = x;
init_waitqueue_head(&s->maintq);