summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/dahdi/wctdm24xxp/base.c5
-rw-r--r--include/dahdi/kernel.h16
2 files changed, 16 insertions, 5 deletions
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
index 8fac337..51fea10 100644
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -4401,11 +4401,6 @@ static const struct dahdi_span_ops wctdm24xxp_digital_span_ops = {
#endif
};
-static inline bool dahdi_is_digital_span(const struct dahdi_span *s)
-{
- return (s->linecompat > 0);
-}
-
static struct wctdm_chan *
wctdm_init_chan(struct wctdm *wc, struct wctdm_span *s, int chanoffset,
int channo, unsigned int card_position)
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index e2403c1..c392e64 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -1101,6 +1101,22 @@ static inline int dahdi_transmit(struct dahdi_span *span)
return ret;
}
+static inline int dahdi_is_digital_span(const struct dahdi_span *s)
+{
+ return (s->linecompat > 0);
+}
+
+static inline int dahdi_is_t1_span(const struct dahdi_span *s)
+{
+ return (s->linecompat & (DAHDI_CONFIG_D4 | DAHDI_CONFIG_ESF |
+ DAHDI_CONFIG_B8ZS)) > 0;
+}
+
+static inline int dahdi_is_e1_span(const struct dahdi_span *s)
+{
+ return dahdi_is_digital_span(s) && !dahdi_is_t1_span(s);
+}
+
/*! Abort the buffer currently being receive with event "event" */
void dahdi_hdlc_abort(struct dahdi_chan *ss, int event);