summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2012-05-23 12:20:23 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2012-05-23 12:20:23 +0000
commitfa1d3ba9465064f7a1551fe7369525d8b355861d (patch)
treee69ab4124842248fc84b8534dd05ebe90a091cfb /include
parent45a4b3459991f23fc17240886d1435d67ff2e89c (diff)
convert span->spantype to enumerated type
* This is a minimal convertion -- everything compiles and looks OK. * We print a warning for spans registering without a spantype. * Low-level drivers may later want (but not required) to fold their internal representations to this canonical representation -- it will save code and make it more readable. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10683 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'include')
-rw-r--r--include/dahdi/kernel.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index 9922f11..d1f8631 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -792,6 +792,21 @@ struct dahdi_count {
#define DAHDI_FLAG_TXUNDERRUN DAHDI_FLAG(TXUNDERRUN)
#define DAHDI_FLAG_RXOVERRUN DAHDI_FLAG(RXOVERRUN)
+enum spantypes {
+ SPANTYPE_INVALID = 0,
+ SPANTYPE_ANALOG_FXS,
+ SPANTYPE_ANALOG_FXO,
+ SPANTYPE_ANALOG_MIXED,
+ SPANTYPE_DIGITAL_E1,
+ SPANTYPE_DIGITAL_T1,
+ SPANTYPE_DIGITAL_J1,
+ SPANTYPE_DIGITAL_BRI_NT,
+ SPANTYPE_DIGITAL_BRI_TE,
+ SPANTYPE_DIGITAL_BRI_SOFT,
+};
+const char *dahdi_spantype2str(enum spantypes st);
+enum spantypes dahdi_str2spantype(const char *name);
+
struct file;
struct dahdi_span_ops {
@@ -890,7 +905,7 @@ struct dahdi_span_ops {
/*! Called when the spantype / linemode is changed before the span is
* assigned a number. */
- int (*set_spantype)(struct dahdi_span *span, const char *spantype);
+ int (*set_spantype)(struct dahdi_span *span, enum spantypes st);
};
/**
@@ -921,7 +936,7 @@ struct dahdi_span {
spinlock_t lock;
char name[40]; /*!< Span name */
char desc[80]; /*!< Span description */
- const char *spantype; /*!< span type in text form */
+ enum spantypes spantype; /*!< span type */
int deflaw; /*!< Default law (DAHDI_MULAW or DAHDI_ALAW) */
int alarms; /*!< Pending alarms on span */
unsigned long flags;