File: xframe_queue.h

package info (click to toggle)
dahdi-linux 1%3A2.6.1%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,212 kB
  • sloc: ansic: 119,954; perl: 1,397; sh: 914; makefile: 489
file content (35 lines) | stat: -rw-r--r-- 1,010 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef	XFRAME_QUEUE_H
#define	XFRAME_QUEUE_H

#include <linux/list.h>
#include <linux/spinlock.h>
#include "xdefs.h"

#define	XFRAME_QUEUE_MARGIN	10

struct xframe_queue {
	struct list_head	head;
	bool			disabled;
	unsigned int		count;
	unsigned int		max_count;
	unsigned int		steady_state_count;
	spinlock_t		lock;
	const char		*name;
	void			*priv;
	/* statistics */
	unsigned int		worst_count;
	unsigned int		overflows;
	unsigned long		worst_lag_usec;	/* since xframe creation */
};

void xframe_queue_init(struct xframe_queue *q,
	unsigned int steady_state_count, unsigned int max_count,
	const char *name, void *priv);
__must_check bool xframe_enqueue(struct xframe_queue *q, xframe_t *xframe);
__must_check xframe_t *xframe_dequeue(struct xframe_queue *q);
void xframe_queue_clearstats(struct xframe_queue *q);
void xframe_queue_disable(struct xframe_queue *q, bool disabled);
void xframe_queue_clear(struct xframe_queue *q);
uint xframe_queue_count(struct xframe_queue *q);

#endif	/* XFRAME_QUEUE_ */