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 #include <argp.h> 13 14 /* Configuration information related to a specific ethernet port */ 15 struct fm_eth_port_cfg { 16 /**< A list of PCD FQ ranges, obtained from FMC configuration */ 17 struct list_head *list; 18 /**< The "Rx default" FQID, obtained from FMC configuration */ 19 uint32_t rx_def; 20 /**< Other interface details are in the fman driver interface */ 21 struct fman_if *fman_if; 22 }; 23 24 struct netcfg_info { 25 uint8_t num_ethports; 26 /**< Number of ports */ 27 struct fm_eth_port_cfg port_cfg[0]; 28 /**< Variable structure array of size num_ethports */ 29 }; 30 31 struct interface_info { 32 char *name; 33 struct rte_ether_addr mac_addr; 34 struct rte_ether_addr peer_mac; 35 int mac_present; 36 int fman_enabled_mac_interface; 37 }; 38 39 struct netcfg_interface { 40 uint8_t numof_netcfg_interface; 41 uint8_t numof_fman_enabled_macless; 42 struct interface_info interface_info[0]; 43 }; 44 45 /* pcd_file: FMC netpcd XML ("policy") file, that contains PCD information. 46 * cfg_file: FMC config XML file 47 * Returns the configuration information in newly allocated memory. 48 */ 49 struct netcfg_info *netcfg_acquire(void); 50 51 /* cfg_ptr: configuration information pointer. 52 * Frees the resources allocated by the configuration layer. 53 */ 54 void netcfg_release(struct netcfg_info *cfg_ptr); 55 56 #ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER 57 /* cfg_ptr: configuration information pointer. 58 * This function dumps configuration data to stdout. 59 */ 60 void dump_netcfg(struct netcfg_info *cfg_ptr); 61 #endif 62 63 #endif /* __NETCFG_H */ 64