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 #include <rte_common.h> 10 11 #define ARK_PKT_DIR_INIT_VAL 0x0110 12 13 typedef void *ark_pkt_dir_t; 14 15 16 /* The packet director is an internal Arkville hardware module for 17 * directing packet data in non-typical flows, such as testing. 18 * This module is *not* intended for end-user manipulation, hence 19 * there is minimal documentation. 20 */ 21 22 /* 23 * This is an overlay structures to a memory mapped FPGA device. These 24 * structs will never be instantiated in ram memory 25 */ 26 struct __rte_packed_begin ark_pkt_dir_regs { 27 uint32_t ctrl; 28 uint32_t status; 29 uint32_t stall_cnt; 30 } __rte_packed_end; 31 32 struct ark_pkt_dir_inst { 33 volatile struct ark_pkt_dir_regs *regs; 34 }; 35 36 ark_pkt_dir_t ark_pktdir_init(void *base); 37 void ark_pktdir_uninit(ark_pkt_dir_t handle); 38 void ark_pktdir_setup(ark_pkt_dir_t handle, uint32_t v); 39 uint32_t ark_pktdir_stall_cnt(ark_pkt_dir_t handle); 40 uint32_t ark_pktdir_status(ark_pkt_dir_t handle); 41 42 #endif 43