blob: 6992c45457a4e54cb95fa245c4741622cd2c897e [file] [log] [blame]
Kyle Swenson8d8f6542021-03-15 11:02:55 -06001/* $Id: dqueue.h,v 1.1.2.2 2001/02/08 12:25:43 armin Exp $ */
2
3#ifndef _DIVA_USER_MODE_IDI_DATA_QUEUE_H__
4#define _DIVA_USER_MODE_IDI_DATA_QUEUE_H__
5
6#define DIVA_UM_IDI_MAX_MSGS 64
7
8typedef struct _diva_um_idi_data_queue {
9 int segments;
10 int max_length;
11 int read;
12 int write;
13 int count;
14 int segment_pending;
15 void *data[DIVA_UM_IDI_MAX_MSGS];
16 int length[DIVA_UM_IDI_MAX_MSGS];
17} diva_um_idi_data_queue_t;
18
19int diva_data_q_init(diva_um_idi_data_queue_t *q,
20 int max_length, int max_segments);
21int diva_data_q_finit(diva_um_idi_data_queue_t *q);
22int diva_data_q_get_max_length(const diva_um_idi_data_queue_t *q);
23void *diva_data_q_get_segment4write(diva_um_idi_data_queue_t *q);
24void diva_data_q_ack_segment4write(diva_um_idi_data_queue_t *q,
25 int length);
26const void *diva_data_q_get_segment4read(const diva_um_idi_data_queue_t *
27 q);
28int diva_data_q_get_segment_length(const diva_um_idi_data_queue_t *q);
29void diva_data_q_ack_segment4read(diva_um_idi_data_queue_t *q);
30
31#endif