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