1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#ifndef ROCKER_DESC_H
18#define ROCKER_DESC_H
19
20#include "rocker_hw.h"
21
22typedef int (desc_ring_consume)(Rocker *r, DescInfo *info);
23
24uint16_t desc_buf_size(DescInfo *info);
25uint16_t desc_tlv_size(DescInfo *info);
26char *desc_get_buf(DescInfo *info, bool read_only);
27int desc_set_buf(DescInfo *info, size_t tlv_size);
28DescRing *desc_get_ring(DescInfo *info);
29
30int desc_ring_index(DescRing *ring);
31bool desc_ring_set_base_addr(DescRing *ring, uint64_t base_addr);
32uint64_t desc_ring_get_base_addr(DescRing *ring);
33bool desc_ring_set_size(DescRing *ring, uint32_t size);
34uint32_t desc_ring_get_size(DescRing *ring);
35bool desc_ring_set_head(DescRing *ring, uint32_t new);
36uint32_t desc_ring_get_head(DescRing *ring);
37uint32_t desc_ring_get_tail(DescRing *ring);
38void desc_ring_set_ctrl(DescRing *ring, uint32_t val);
39bool desc_ring_ret_credits(DescRing *ring, uint32_t credits);
40uint32_t desc_ring_get_credits(DescRing *ring);
41
42DescInfo *desc_ring_fetch_desc(DescRing *ring);
43bool desc_ring_post_desc(DescRing *ring, int status);
44
45void desc_ring_set_consume(DescRing *ring, desc_ring_consume *consume,
46 unsigned vector);
47unsigned desc_ring_get_msix_vector(DescRing *ring);
48DescRing *desc_ring_alloc(Rocker *r, int index);
49void desc_ring_free(DescRing *ring);
50void desc_ring_reset(DescRing *ring);
51
52#endif
53