1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2008-2017 Cisco Systems, Inc. All rights reserved.
3 * Copyright 2007 Nuova Systems, Inc. All rights reserved.
14 /* Completion queue control */
16 uint64_t ring_base; /* 0x00 */
17 uint32_t ring_size; /* 0x08 */
19 uint32_t flow_control_enable; /* 0x10 */
21 uint32_t color_enable; /* 0x18 */
23 uint32_t cq_head; /* 0x20 */
25 uint32_t cq_tail; /* 0x28 */
27 uint32_t cq_tail_color; /* 0x30 */
29 uint32_t interrupt_enable; /* 0x38 */
31 uint32_t cq_entry_enable; /* 0x40 */
33 uint32_t cq_message_enable; /* 0x48 */
35 uint32_t interrupt_offset; /* 0x50 */
37 uint64_t cq_message_addr; /* 0x58 */
42 struct vnic_rx_bytes_counter {
43 unsigned int small_pkt_bytes_cnt;
44 unsigned int large_pkt_bytes_cnt;
50 struct vnic_dev *vdev;
51 struct vnic_cq_ctrl __iomem *ctrl; /* memory-mapped */
52 struct vnic_dev_ring ring;
53 unsigned int to_clean;
54 unsigned int last_color;
55 unsigned int interrupt_offset;
57 struct vnic_rx_bytes_counter pkt_size_counter;
58 unsigned int cur_rx_coal_timeval;
59 unsigned int tobe_rx_coal_timeval;
64 void vnic_cq_free(struct vnic_cq *cq);
65 int vnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, unsigned int index,
66 unsigned int socket_id,
67 unsigned int desc_count, unsigned int desc_size);
68 void vnic_cq_init(struct vnic_cq *cq, unsigned int flow_control_enable,
69 unsigned int color_enable, unsigned int cq_head, unsigned int cq_tail,
70 unsigned int cq_tail_color, unsigned int interrupt_enable,
71 unsigned int cq_entry_enable, unsigned int message_enable,
72 unsigned int interrupt_offset, uint64_t message_addr);
73 void vnic_cq_clean(struct vnic_cq *cq);
74 int vnic_cq_mem_size(struct vnic_cq *cq, unsigned int desc_count,
75 unsigned int desc_size);
77 #endif /* _VNIC_CQ_H_ */