1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) 2 * 3 * Copyright 2013-2016 Freescale Semiconductor Inc. 4 * Copyright 2016-2017 NXP 5 * 6 */ 7 #ifndef __FSL_DPBP_H 8 #define __FSL_DPBP_H 9 10 #include <rte_compat.h> 11 12 /* 13 * Data Path Buffer Pool API 14 * Contains initialization APIs and runtime control APIs for DPBP 15 */ 16 17 struct fsl_mc_io; 18 19 __rte_internal 20 int dpbp_open(struct fsl_mc_io *mc_io, 21 uint32_t cmd_flags, 22 int dpbp_id, 23 uint16_t *token); 24 25 int dpbp_close(struct fsl_mc_io *mc_io, 26 uint32_t cmd_flags, 27 uint16_t token); 28 29 /** 30 * struct dpbp_cfg - Structure representing DPBP configuration 31 * @options: place holder 32 */ 33 struct dpbp_cfg { 34 uint32_t options; 35 }; 36 37 int dpbp_create(struct fsl_mc_io *mc_io, 38 uint16_t dprc_token, 39 uint32_t cmd_flags, 40 const struct dpbp_cfg *cfg, 41 uint32_t *obj_id); 42 43 int dpbp_destroy(struct fsl_mc_io *mc_io, 44 uint16_t dprc_token, 45 uint32_t cmd_flags, 46 uint32_t obj_id); 47 48 __rte_internal 49 int dpbp_enable(struct fsl_mc_io *mc_io, 50 uint32_t cmd_flags, 51 uint16_t token); 52 53 __rte_internal 54 int dpbp_disable(struct fsl_mc_io *mc_io, 55 uint32_t cmd_flags, 56 uint16_t token); 57 58 int dpbp_is_enabled(struct fsl_mc_io *mc_io, 59 uint32_t cmd_flags, 60 uint16_t token, 61 int *en); 62 63 __rte_internal 64 int dpbp_reset(struct fsl_mc_io *mc_io, 65 uint32_t cmd_flags, 66 uint16_t token); 67 68 /** 69 * struct dpbp_attr - Structure representing DPBP attributes 70 * @id: DPBP object ID 71 * @bpid: Hardware buffer pool ID; should be used as an argument in 72 * acquire/release operations on buffers 73 */ 74 struct dpbp_attr { 75 int id; 76 uint16_t bpid; 77 }; 78 79 __rte_internal 80 int dpbp_get_attributes(struct fsl_mc_io *mc_io, 81 uint32_t cmd_flags, 82 uint16_t token, 83 struct dpbp_attr *attr); 84 85 /** 86 * DPBP notifications options 87 */ 88 89 /** 90 * BPSCN write will attempt to allocate into a cache (coherent write) 91 */ 92 #define DPBP_NOTIF_OPT_COHERENT_WRITE 0x00000001 93 int dpbp_get_api_version(struct fsl_mc_io *mc_io, 94 uint32_t cmd_flags, 95 uint16_t *major_ver, 96 uint16_t *minor_ver); 97 98 __rte_internal 99 int dpbp_get_num_free_bufs(struct fsl_mc_io *mc_io, 100 uint32_t cmd_flags, 101 uint16_t token, 102 uint32_t *num_free_bufs); 103 104 #endif /* __FSL_DPBP_H */ 105