1d81734caSHemant Agrawal /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) 25b22cf74SShreyansh Jain * 35b22cf74SShreyansh Jain * Copyright 2010-2012 Freescale Semiconductor, Inc. 45b22cf74SShreyansh Jain * All rights reserved. 55b22cf74SShreyansh Jain * 65b22cf74SShreyansh Jain */ 75b22cf74SShreyansh Jain 85b22cf74SShreyansh Jain #ifndef __NETCFG_H 95b22cf74SShreyansh Jain #define __NETCFG_H 105b22cf74SShreyansh Jain 115b22cf74SShreyansh Jain #include <fman.h> 125b22cf74SShreyansh Jain 131094dd94SDavid Marchand #include <rte_compat.h> 141094dd94SDavid Marchand 155b22cf74SShreyansh Jain /* Configuration information related to a specific ethernet port */ 165b22cf74SShreyansh Jain struct fm_eth_port_cfg { 175b22cf74SShreyansh Jain /**< A list of PCD FQ ranges, obtained from FMC configuration */ 185b22cf74SShreyansh Jain struct list_head *list; 195b22cf74SShreyansh Jain /**< The "Rx default" FQID, obtained from FMC configuration */ 205b22cf74SShreyansh Jain uint32_t rx_def; 215b22cf74SShreyansh Jain /**< Other interface details are in the fman driver interface */ 225b22cf74SShreyansh Jain struct fman_if *fman_if; 235b22cf74SShreyansh Jain }; 245b22cf74SShreyansh Jain 255b22cf74SShreyansh Jain struct netcfg_info { 265b22cf74SShreyansh Jain uint8_t num_ethports; 275b22cf74SShreyansh Jain /**< Number of ports */ 28013b4c52SBruce Richardson struct fm_eth_port_cfg port_cfg[]; 295b22cf74SShreyansh Jain /**< Variable structure array of size num_ethports */ 305b22cf74SShreyansh Jain }; 315b22cf74SShreyansh Jain 325b22cf74SShreyansh Jain struct interface_info { 335b22cf74SShreyansh Jain char *name; 346d13ea8eSOlivier Matz struct rte_ether_addr mac_addr; 356d13ea8eSOlivier Matz struct rte_ether_addr peer_mac; 365b22cf74SShreyansh Jain int mac_present; 375b22cf74SShreyansh Jain int fman_enabled_mac_interface; 385b22cf74SShreyansh Jain }; 395b22cf74SShreyansh Jain 405b22cf74SShreyansh Jain struct netcfg_interface { 415b22cf74SShreyansh Jain uint8_t numof_netcfg_interface; 425b22cf74SShreyansh Jain uint8_t numof_fman_enabled_macless; 43013b4c52SBruce Richardson struct interface_info interface_info[]; 445b22cf74SShreyansh Jain }; 455b22cf74SShreyansh Jain 465b22cf74SShreyansh Jain /* pcd_file: FMC netpcd XML ("policy") file, that contains PCD information. 475b22cf74SShreyansh Jain * cfg_file: FMC config XML file 485b22cf74SShreyansh Jain * Returns the configuration information in newly allocated memory. 495b22cf74SShreyansh Jain */ 501e0f9b07SHemant Agrawal __rte_internal 515b22cf74SShreyansh Jain struct netcfg_info *netcfg_acquire(void); 525b22cf74SShreyansh Jain 535b22cf74SShreyansh Jain /* cfg_ptr: configuration information pointer. 545b22cf74SShreyansh Jain * Frees the resources allocated by the configuration layer. 555b22cf74SShreyansh Jain */ 561e0f9b07SHemant Agrawal __rte_internal 575b22cf74SShreyansh Jain void netcfg_release(struct netcfg_info *cfg_ptr); 585b22cf74SShreyansh Jain 595b22cf74SShreyansh Jain #ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER 605b22cf74SShreyansh Jain /* cfg_ptr: configuration information pointer. 615b22cf74SShreyansh Jain * This function dumps configuration data to stdout. 625b22cf74SShreyansh Jain */ 63*a8794e39SHemant Agrawal void dump_netcfg(struct netcfg_info *cfg_ptr, FILE *f); 645b22cf74SShreyansh Jain #endif 655b22cf74SShreyansh Jain 665b22cf74SShreyansh Jain #endif /* __NETCFG_H */ 67