diff options
author | Shaun Ruffell <sruffell@digium.com> | 2010-02-26 16:40:41 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2010-02-26 16:40:41 +0000 |
commit | 2f87293c69d2a4f9957c431646ec55c44675e217 (patch) | |
tree | bb8af0cbd063a8f1bc2aaa8c5c8bae4b8aae9a4c /drivers/dahdi/voicebus/voicebus.h | |
parent | 2e9c5b03752de6db1cb54cc6da43d648c83165b6 (diff) |
voicebus: Only use the slab debug facilities if CONFIG_SLAB_DEBUG is defined.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8119 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/voicebus/voicebus.h')
-rw-r--r-- | drivers/dahdi/voicebus/voicebus.h | 55 |
1 files changed, 51 insertions, 4 deletions
diff --git a/drivers/dahdi/voicebus/voicebus.h b/drivers/dahdi/voicebus/voicebus.h index a58e4ca..149b4d0 100644 --- a/drivers/dahdi/voicebus/voicebus.h +++ b/drivers/dahdi/voicebus/voicebus.h @@ -84,6 +84,13 @@ struct voicebus_descriptor_list { unsigned int padding; }; +/* Bit definitions for struct voicebus.flags */ +#define VOICEBUS_STOP 1 +#define VOICEBUS_STOPPED 2 +#define VOICEBUS_LATENCY_LOCKED 3 +#define VOICEBUS_NORMAL_MODE 4 +#define VOICEBUS_USERMODE 5 + /** * struct voicebus - Represents physical interface to voicebus card. * @@ -125,7 +132,8 @@ struct voicebus { #endif }; -int voicebus_init(struct voicebus *vb, const char *board_name); +int __voicebus_init(struct voicebus *vb, const char *board_name, + int normal_mode); void voicebus_release(struct voicebus *vb); int voicebus_start(struct voicebus *vb); int voicebus_stop(struct voicebus *vb); @@ -133,8 +141,47 @@ void voicebus_free(struct voicebus *vb, struct vbb *vbb); int voicebus_transmit(struct voicebus *vb, struct vbb *vbb); int voicebus_set_minlatency(struct voicebus *vb, unsigned int milliseconds); int voicebus_current_latency(struct voicebus *vb); -void voicebus_lock_latency(struct voicebus *vb); -void voicebus_unlock_latency(struct voicebus *vb); -int voicebus_is_latency_locked(const struct voicebus *vb); +static inline int voicebus_init(struct voicebus *vb, const char *board_name) +{ + return __voicebus_init(vb, board_name, 1); +} + +static inline int +voicebus_no_idle_init(struct voicebus *vb, const char *board_name) +{ + return __voicebus_init(vb, board_name, 0); +} + +/** + * voicebus_lock_latency() - Do not increase the latency during underruns. + * + */ +static inline void voicebus_lock_latency(struct voicebus *vb) +{ + set_bit(VOICEBUS_LATENCY_LOCKED, &vb->flags); +} + +/** + * voicebus_unlock_latency() - Bump up the latency during underruns. + * + */ +static inline void voicebus_unlock_latency(struct voicebus *vb) +{ + clear_bit(VOICEBUS_LATENCY_LOCKED, &vb->flags); +} + +/** + * voicebus_is_latency_locked() - Return 1 if latency is currently locked. + * + */ +static inline int voicebus_is_latency_locked(const struct voicebus *vb) +{ + return test_bit(VOICEBUS_LATENCY_LOCKED, &vb->flags); +} + +static inline void voicebus_set_normal_mode(struct voicebus *vb) +{ + set_bit(VOICEBUS_NORMAL_MODE, &vb->flags); +} #endif /* __VOICEBUS_H__ */ |