xref: /dpdk/drivers/net/ark/ark_pktdir.h (revision 68a03efeed657e6e05f281479b33b51102797e15)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2015-2018 Atomic Rules LLC
3  */
4 
5 #ifndef _ARK_PKTDIR_H_
6 #define _ARK_PKTDIR_H_
7 
8 #include <stdint.h>
9 
10 #define ARK_PKT_DIR_INIT_VAL 0x0110
11 
12 typedef void *ark_pkt_dir_t;
13 
14 
15 /* The packet director is an internal Arkville hardware module for
16  * directing packet data in non-typical flows, such as testing.
17  * This module is *not* intended for end-user manipulation, hence
18  * there is minimal documentation.
19  */
20 
21 /*
22  * This is an overlay structures to a memory mapped FPGA device.  These
23  * structs will never be instantiated in ram memory
24  */
25 struct ark_pkt_dir_regs {
26 	uint32_t ctrl;
27 	uint32_t status;
28 	uint32_t stall_cnt;
29 } __rte_packed;
30 
31 struct ark_pkt_dir_inst {
32 	volatile struct ark_pkt_dir_regs *regs;
33 };
34 
35 ark_pkt_dir_t ark_pktdir_init(void *base);
36 void ark_pktdir_uninit(ark_pkt_dir_t handle);
37 void ark_pktdir_setup(ark_pkt_dir_t handle, uint32_t v);
38 uint32_t ark_pktdir_stall_cnt(ark_pkt_dir_t handle);
39 uint32_t ark_pktdir_status(ark_pkt_dir_t handle);
40 
41 #endif
42