summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp/card_pri.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
commit9e8885a50b7923c9a9b7456bbf2ecc61923c8734 (patch)
tree57dc2f7e5a6c358c0a13eb4a8d0f7856b5e8077a /drivers/dahdi/xpp/card_pri.c
parent5fd3fdc1cea7af8b1c46bbf2a5edd0c6fe2d3e54 (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/xpp/card_pri.c')
-rw-r--r--drivers/dahdi/xpp/card_pri.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/drivers/dahdi/xpp/card_pri.c b/drivers/dahdi/xpp/card_pri.c
index 53cd8d5..1003188 100644
--- a/drivers/dahdi/xpp/card_pri.c
+++ b/drivers/dahdi/xpp/card_pri.c
@@ -1273,6 +1273,29 @@ static int pri_audio_notify(struct dahdi_chan *chan, int on)
}
#endif
+static const struct dahdi_span_ops PRI_span_ops = {
+ .spanconfig = pri_spanconfig,
+ .chanconfig = pri_chanconfig,
+ .startup = pri_startup,
+ .shutdown = pri_shutdown,
+ .rbsbits = pri_rbsbits,
+ .open = xpp_open,
+ .close = xpp_close,
+ .hooksig = xpp_hooksig, /* Only with RBS bits */
+ .ioctl = xpp_ioctl,
+ .maint = xpp_maint,
+#ifdef DAHDI_SYNC_TICK
+ .sync_tick = dahdi_sync_tick,
+#endif
+#ifdef CONFIG_DAHDI_WATCHDOG
+ .watchdog = xpp_watchdog,
+#endif
+
+#ifdef DAHDI_AUDIO_NOTIFY
+ .audio_notify = pri_audio_notify,
+#endif
+};
+
static int PRI_card_dahdi_preregistration(xpd_t *xpd, bool on)
{
xbus_t *xbus;
@@ -1312,14 +1335,8 @@ static int PRI_card_dahdi_preregistration(xpd_t *xpd, bool on)
cur_chan->flags &= ~DAHDI_FLAG_HDLC;
}
}
- xpd->span.spanconfig = pri_spanconfig;
- xpd->span.chanconfig = pri_chanconfig;
- xpd->span.startup = pri_startup;
- xpd->span.shutdown = pri_shutdown;
- xpd->span.rbsbits = pri_rbsbits;
-#ifdef DAHDI_AUDIO_NOTIFY
- xpd->span.audio_notify = pri_audio_notify;
-#endif
+ xpd->offhook_state = xpd->wanted_pcm_mask;
+ xpd->span.ops = &PRI_span_ops;
return 0;
}