summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRussell Bryant <russell@digium.com>2008-08-03 15:42:46 +0000
committerRussell Bryant <russell@digium.com>2008-08-03 15:42:46 +0000
commit99bb77154edc3511ce751829fcc948de59793dc4 (patch)
tree295a3ecde4aed3fb7e28470efa4ec8c9f1e85187 /include
parent210e1ee25783d7be083220b0690bd37c4a7a99c0 (diff)
Rework the table of signalling bits for signalling types and hook states
in dahdi_rbs_sethook() to a much more readable and less error prone format. In passing, get rid of the dahdi_txsig_t typedef, and fix uses of it throughout the tree. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4679 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'include')
-rw-r--r--include/dahdi/kernel.h10
-rw-r--r--include/dahdi/user.h7
2 files changed, 13 insertions, 4 deletions
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index 1fe579b..911db1f 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -419,12 +419,14 @@ int dahdi_register_chardev(struct dahdi_chardev *dev);
int dahdi_unregister_chardev(struct dahdi_chardev *dev);
/*! \brief defines for transmit signalling */
-typedef enum {
+enum dahdi_txsig {
DAHDI_TXSIG_ONHOOK, /*!< On hook */
DAHDI_TXSIG_OFFHOOK, /*!< Off hook */
DAHDI_TXSIG_START, /*!< Start / Ring */
- DAHDI_TXSIG_KEWL /*!< Drop battery if possible */
-} dahdi_txsig_t;
+ DAHDI_TXSIG_KEWL, /*!< Drop battery if possible */
+ /*! Leave this as the last entry */
+ DAHDI_TXSIG_TOTAL,
+};
typedef enum {
DAHDI_RXSIG_ONHOOK,
@@ -575,7 +577,7 @@ struct dahdi_span {
generate ring, etc directly) then you can just specify a
sethook function, and we'll call you with appropriate hook states
to set. Still set the DAHDI_FLAG_RBS in this case as well */
- int (*hooksig)(struct dahdi_chan *chan, dahdi_txsig_t hookstate);
+ int (*hooksig)(struct dahdi_chan *chan, enum dahdi_txsig hookstate);
/*! Option 3: If you can't use sig bits, you can write a function
which handles the individual hook states */
diff --git a/include/dahdi/user.h b/include/dahdi/user.h
index fcddb68..c5d431e 100644
--- a/include/dahdi/user.h
+++ b/include/dahdi/user.h
@@ -91,6 +91,13 @@
#define DAHDI_CBIT (1 << 1)
#define DAHDI_DBIT (1 << 0)
+#define DAHDI_BITS_ABCD (DAHDI_ABIT | DAHDI_BBIT | DAHDI_CBIT | DAHDI_DBIT)
+#define DAHDI_BITS_ABD (DAHDI_ABIT | DAHDI_BBIT | DAHDI_DBIT)
+#define DAHDI_BITS_ACD (DAHDI_ABIT | DAHDI_CBIT | DAHDI_DBIT)
+#define DAHDI_BITS_BCD (DAHDI_BBIT | DAHDI_CBIT | DAHDI_DBIT)
+#define DAHDI_BITS_AC (DAHDI_ABIT | DAHDI_CBIT)
+#define DAHDI_BITS_BD (DAHDI_BBIT | DAHDI_DBIT)
+
#define DAHDI_MAJOR 196
#define DAHDI_MAX_BLOCKSIZE 8192