1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) 2 * 3 * Copyright 2010-2012 Freescale Semiconductor, Inc. 4 * All rights reserved. 5 * 6 */ 7 8 #ifndef __NETCFG_H 9 #define __NETCFG_H 10 11 #include <fman.h> 12 13 #include <rte_compat.h> 14 15 /* Configuration information related to a specific ethernet port */ 16 struct fm_eth_port_cfg { 17 /**< A list of PCD FQ ranges, obtained from FMC configuration */ 18 struct list_head *list; 19 /**< The "Rx default" FQID, obtained from FMC configuration */ 20 uint32_t rx_def; 21 /**< Other interface details are in the fman driver interface */ 22 struct fman_if *fman_if; 23 }; 24 25 struct netcfg_info { 26 uint8_t num_ethports; 27 /**< Number of ports */ 28 struct fm_eth_port_cfg port_cfg[]; 29 /**< Variable structure array of size num_ethports */ 30 }; 31 32 struct interface_info { 33 char *name; 34 struct rte_ether_addr mac_addr; 35 struct rte_ether_addr peer_mac; 36 int mac_present; 37 int fman_enabled_mac_interface; 38 }; 39 40 struct netcfg_interface { 41 uint8_t numof_netcfg_interface; 42 uint8_t numof_fman_enabled_macless; 43 struct interface_info interface_info[]; 44 }; 45 46 /* pcd_file: FMC netpcd XML ("policy") file, that contains PCD information. 47 * cfg_file: FMC config XML file 48 * Returns the configuration information in newly allocated memory. 49 */ 50 __rte_internal 51 struct netcfg_info *netcfg_acquire(void); 52 53 /* cfg_ptr: configuration information pointer. 54 * Frees the resources allocated by the configuration layer. 55 */ 56 __rte_internal 57 void netcfg_release(struct netcfg_info *cfg_ptr); 58 59 #ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER 60 /* cfg_ptr: configuration information pointer. 61 * This function dumps configuration data to stdout. 62 */ 63 void dump_netcfg(struct netcfg_info *cfg_ptr, FILE *f); 64 #endif 65 66 #endif /* __NETCFG_H */ 67