1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2018 Netronome Systems, Inc. 3 * All rights reserved. 4 */ 5 6 #ifndef NFP_RESOURCE_H 7 #define NFP_RESOURCE_H 8 9 #include "nfp_cpp.h" 10 11 #define NFP_RESOURCE_NFP_NFFW "nfp.nffw" 12 #define NFP_RESOURCE_NFP_HWINFO "nfp.info" 13 #define NFP_RESOURCE_NSP "nfp.sp" 14 15 /** 16 * Opaque handle to a NFP Resource 17 */ 18 struct nfp_resource; 19 20 struct nfp_resource *nfp_resource_acquire(struct nfp_cpp *cpp, 21 const char *name); 22 23 /** 24 * Release a NFP Resource, and free the handle 25 * @param[in] res NFP Resource handle 26 */ 27 void nfp_resource_release(struct nfp_resource *res); 28 29 /** 30 * Return the CPP ID of a NFP Resource 31 * @param[in] res NFP Resource handle 32 * @return CPP ID of the NFP Resource 33 */ 34 uint32_t nfp_resource_cpp_id(const struct nfp_resource *res); 35 36 /** 37 * Return the name of a NFP Resource 38 * @param[in] res NFP Resource handle 39 * @return Name of the NFP Resource 40 */ 41 const char *nfp_resource_name(const struct nfp_resource *res); 42 43 /** 44 * Return the target address of a NFP Resource 45 * @param[in] res NFP Resource handle 46 * @return Address of the NFP Resource 47 */ 48 uint64_t nfp_resource_address(const struct nfp_resource *res); 49 50 uint64_t nfp_resource_size(const struct nfp_resource *res); 51 52 #endif /* NFP_RESOURCE_H */ 53