summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-01-03 18:25:56 +0000
committerShaun Ruffell <sruffell@digium.com>2011-01-03 18:25:56 +0000
commit0c409bba72005ca55ee5ed602e0f81d856bfe352 (patch)
tree55b30899788c0ac82b63e9834838b36a012e9db0 /include
parent1ff6b6647aad596eb794c145e12972ba4865bdcc (diff)
dahdi_dynamic: Pass the dahdi_dynamic to create/destroy functions.
This allows the pvt member to be set under lock without holding the lock through the call to create destroy. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9578 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'include')
-rw-r--r--include/dahdi/kernel.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index ff818e8..ce503d9 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -986,6 +986,25 @@ struct dahdi_transcoder {
#define DAHDI_WATCHSTATE_FAILED 3
+struct dahdi_dynamic {
+ char addr[40];
+ char dname[20];
+ int err;
+ struct kref kref;
+ long rxjif;
+ unsigned short txcnt;
+ unsigned short rxcnt;
+ struct dahdi_span span;
+ struct dahdi_chan *chans[256];
+ struct dahdi_dynamic_driver *driver;
+ void *pvt;
+ int timing;
+ int master;
+ unsigned char *msgbuf;
+
+ struct list_head list;
+};
+
struct dahdi_dynamic_driver {
/*! Driver name (e.g. Eth) */
const char *name;
@@ -994,13 +1013,13 @@ struct dahdi_dynamic_driver {
const char *desc;
/*! Create a new transmission pipe */
- void *(*create)(struct dahdi_span *span, const char *address);
+ int (*create)(struct dahdi_dynamic *d, const char *address);
/*! Destroy a created transmission pipe */
- void (*destroy)(void *tpipe);
+ void (*destroy)(struct dahdi_dynamic *d);
/*! Transmit a given message */
- void (*transmit)(void *tpipe, unsigned char *msg, int msglen);
+ void (*transmit)(struct dahdi_dynamic *d, u8 *msg, size_t msglen);
/*! Flush any pending messages */
int (*flush)(void);