summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/dahdi/kernel.h94
1 files changed, 50 insertions, 44 deletions
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index ab2551b..4c17bfa 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -750,38 +750,7 @@ struct dahdi_count {
#define DAHDI_FLAG_MTP2 DAHDI_FLAG(MTP2)
#define DAHDI_FLAG_HDLC56 DAHDI_FLAG(HDLC56)
-struct dahdi_span {
- spinlock_t lock;
- struct module *owner; /*!< Which module is exporting this span. */
- char name[40]; /*!< Span name */
- char desc[80]; /*!< Span description */
- const char *spantype; /*!< span type in text form */
- const char *manufacturer; /*!< span's device manufacturer */
- char devicetype[80]; /*!< span's device type */
- char location[40]; /*!< span device's location in system */
- int deflaw; /*!< Default law (DAHDI_MULAW or DAHDI_ALAW) */
- int alarms; /*!< Pending alarms on span */
- unsigned long flags;
- int irq; /*!< IRQ for this span's hardware */
- int lbo; /*!< Span Line-Buildout */
- int lineconfig; /*!< Span line configuration */
- int linecompat; /*!< Span line compatibility */
- int channels; /*!< Number of channels in span */
- int txlevel; /*!< Tx level */
- int rxlevel; /*!< Rx level */
- int syncsrc; /*!< current sync src (gets copied here) */
- struct dahdi_count count; /*!< Performance and Error counters */
-
- int maintstat; /*!< Maintenance state */
- wait_queue_head_t maintq; /*!< Maintenance queue */
- int mainttimer; /*!< Maintenance timer */
-
- int irqmisses; /*!< Interrupt misses */
-
- int timingslips; /*!< Clock slips */
-
- struct dahdi_chan **chans; /*!< Member channel structures */
-
+struct dahdi_span_ops {
/* ==== Span Callback Operations ==== */
/*! Req: Set the requested chunk size. This is the unit in which you must
report results for conferencing, etc */
@@ -803,7 +772,6 @@ struct dahdi_span {
/*! Opt: send sync to spans */
int (*sync_tick)(struct dahdi_span *span, int is_master);
#endif
-
/* ==== Channel Callback Operations ==== */
/*! Opt: Set signalling type (if appropriate) */
int (*chanconfig)(struct dahdi_chan *chan, int sigtype);
@@ -817,10 +785,6 @@ struct dahdi_span {
/*! Opt: IOCTL */
int (*ioctl)(struct dahdi_chan *chan, unsigned int cmd, unsigned long data);
- /*! Opt: Provide echo cancellation on a channel */
- int (*echocan_create)(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp,
- struct dahdi_echocanparam *p, struct dahdi_echocan_state **ec);
-
/* Okay, now we get to the signalling. You have several options: */
/* Option 1: If you're a T1 like interface, you can just provide a
@@ -841,24 +805,66 @@ struct dahdi_span {
which handles the individual hook states */
int (*sethook)(struct dahdi_chan *chan, int hookstate);
- /*! Opt: Dacs the contents of chan2 into chan1 if possible */
- int (*dacs)(struct dahdi_chan *chan1, struct dahdi_chan *chan2);
-
/*! Opt: Used to tell an onboard HDLC controller that there is data ready to transmit */
void (*hdlc_hard_xmit)(struct dahdi_chan *chan);
+ /*! If the watchdog detects no received data, it will call the
+ watchdog routine */
+ int (*watchdog)(struct dahdi_span *span, int cause);
+
#ifdef DAHDI_AUDIO_NOTIFY
/*! Opt: audio is used, don't optimize out */
int (*audio_notify)(struct dahdi_chan *chan, int yes);
#endif
+ /*! Opt: Dacs the contents of chan2 into chan1 if possible */
+ int (*dacs)(struct dahdi_chan *chan1, struct dahdi_chan *chan2);
+
+ /*! Opt: Provide echo cancellation on a channel */
+ int (*echocan_create)(struct dahdi_chan *chan,
+ struct dahdi_echocanparams *ecp,
+ struct dahdi_echocanparam *p,
+ struct dahdi_echocan_state **ec);
+};
+
+struct dahdi_span {
+ spinlock_t lock;
+ struct module *owner; /*!< Which module is exporting this span. */
+ char name[40]; /*!< Span name */
+ char desc[80]; /*!< Span description */
+ const char *spantype; /*!< span type in text form */
+ const char *manufacturer; /*!< span's device manufacturer */
+ char devicetype[80]; /*!< span's device type */
+ char location[40]; /*!< span device's location in system */
+ int deflaw; /*!< Default law (DAHDI_MULAW or DAHDI_ALAW) */
+ int alarms; /*!< Pending alarms on span */
+ unsigned long flags;
+ int irq; /*!< IRQ for this span's hardware */
+ int lbo; /*!< Span Line-Buildout */
+ int lineconfig; /*!< Span line configuration */
+ int linecompat; /*!< Span line compatibility */
+ int channels; /*!< Number of channels in span */
+ int txlevel; /*!< Tx level */
+ int rxlevel; /*!< Rx level */
+ int syncsrc; /*!< current sync src (gets copied here) */
+ struct dahdi_count count; /*!< Performance and Error counters */
+
+ int maintstat; /*!< Maintenance state */
+ wait_queue_head_t maintq; /*!< Maintenance queue */
+ int mainttimer; /*!< Maintenance timer */
+
+ int irqmisses; /*!< Interrupt misses */
+ int timingslips; /*!< Clock slips */
+
+ struct dahdi_chan **chans; /*!< Member channel structures */
+
+ const struct dahdi_span_ops *ops; /*!< span callbacks. */
+
/* Used by DAHDI only -- no user servicable parts inside */
int spanno; /*!< Span number for DAHDI */
int offset; /*!< Offset within a given card */
- int lastalarms; /*!< Previous alarms */
- /*! If the watchdog detects no received data, it will call the
- watchdog routine */
- int (*watchdog)(struct dahdi_span *span, int cause);
+ int lastalarms; /*!< Previous alarms */
+
#ifdef CONFIG_DAHDI_WATCHDOG
int watchcounter;
int watchstate;