diff --git a/CMakeLists.txt b/CMakeLists.txt index 391626f1..5c06cfe5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,12 +60,12 @@ set(PNET_MAX_CR 2 set(PNET_MAX_SLOTS 5 CACHE STRING "Per API. Should be > 1 to allow at least one I/O module") set(PNET_MAX_SUBSLOTS 3 - CACHE STRING "Per slot (DAP requires 2 + PNET_MAX_PORT)") + CACHE STRING "Per slot (DAP requires 2 + PNET_NUMBER_OF_PHYSICAL_PORTS)") set(PNET_MAX_CHANNELS 1 CACHE STRING "Per sub-slot. Used for diagnosis") set(PNET_MAX_DFP_IOCR 2 CACHE STRING "Allowed values are 0 (zero) or 2") -set(PNET_MAX_PORT 1 +set(PNET_NUMBER_OF_PHYSICAL_PORTS 1 CACHE STRING "Number of physical ports") set(PNET_MAX_LOG_BOOK_ENTRIES 16 CACHE STRING "") diff --git a/doc/multiple_ports.rst b/doc/multiple_ports.rst index 293619b9..595880df 100644 --- a/doc/multiple_ports.rst +++ b/doc/multiple_ports.rst @@ -99,10 +99,10 @@ To run p-net and the sample application with multiple ports a couple of things need to be done. Note that the settings described in the following sections are changed by running ``ccmake .`` in the build folder. ``options.h`` will be regenerated. Another way to set the options is to -set them on the cmake command line (-DPNET_MAX_PORT=2 -DPNET_MAX_SUBSLOTS=4). +set them on the cmake command line (-DPNET_NUMBER_OF_PHYSICAL_PORTS=2 -DPNET_MAX_SUBSLOTS=4). -Reconfigure setting ``PNET_MAX_PORT`` to the actual number of physical ports available in the system. -For this example ``PNET_MAX_PORT`` shall be set to 2. +Reconfigure setting ``PNET_NUMBER_OF_PHYSICAL_PORTS`` to the actual number of physical ports available in the system. +For this example ``PNET_NUMBER_OF_PHYSICAL_PORTS`` shall be set to 2. Reconfigure setting ``PNET_MAX_SUBSLOTS``. Each additional port will require an additional subslot. For this example the ``PNET_MAX_SUBSLOTS`` should be be set to 4. diff --git a/include/pnet_api.h b/include/pnet_api.h index c22c0692..5c71399c 100644 --- a/include/pnet_api.h +++ b/include/pnet_api.h @@ -1170,24 +1170,12 @@ typedef struct pnet_ethaddr #define PNET_LLDP_PORT_ID_MAX_SIZE \ (PNET_STATION_NAME_MAX_SIZE + PNET_PORT_NAME_MAX_SIZE) -/** - * Network interface - */ -typedef struct pnet_netif -{ - char if_name[PNET_INTERFACE_NAME_MAX_SIZE]; /**< Terminated string */ - pnet_ethaddr_t eth_addr; /**< Interface MAC address */ -} pnet_netif_t; - /** * Physical Port Configuration */ typedef struct pnet_port_cfg { - pnet_netif_t phy_port; - char port_name[PNET_PORT_NAME_MAX_SIZE]; /**< Terminated string */ - uint16_t rtclass_2_status; - uint16_t rtclass_3_status; + const char * netif_name; } pnet_port_cfg_t; /** @@ -1213,10 +1201,10 @@ typedef struct pnet_ip_cfg */ typedef struct pnet_if_cfg { - pnet_netif_t main_port; /**< Main (DAP) network interface. */ + const char * main_netif_name; /**< Main (DAP) network interface. */ pnet_ip_cfg_t ip_cfg; /**< IP Settings for main network interface */ - pnet_port_cfg_t ports[PNET_MAX_PORT]; /**< Physical ports (DAP ports) */ + pnet_port_cfg_t physical_ports[PNET_NUMBER_OF_PHYSICAL_PORTS]; } pnet_if_cfg_t; /** diff --git a/options.h.in b/options.h.in index fa400557..334d589e 100644 --- a/options.h.in +++ b/options.h.in @@ -112,9 +112,9 @@ #define PNET_MAX_DFP_IOCR @PNET_MAX_DFP_IOCR@ #endif -#if !defined (PNET_MAX_PORT) +#if !defined (PNET_NUMBER_OF_PHYSICAL_PORTS) /** 2 for media redundancy. Currently only 1 is supported. */ -#define PNET_MAX_PORT @PNET_MAX_PORT@ +#define PNET_NUMBER_OF_PHYSICAL_PORTS @PNET_NUMBER_OF_PHYSICAL_PORTS@ #endif #if !defined (PNET_MAX_LOG_BOOK_ENTRIES) diff --git a/sample_app/GSDML-V2.4-RT-Labs-P-Net-Sample-App-20210202.xml b/sample_app/GSDML-V2.4-RT-Labs-P-Net-Sample-App-20210202.xml index 7963a105..abc24a1e 100644 --- a/sample_app/GSDML-V2.4-RT-Labs-P-Net-Sample-App-20210202.xml +++ b/sample_app/GSDML-V2.4-RT-Labs-P-Net-Sample-App-20210202.xml @@ -66,7 +66,7 @@ Current list works for Raspberry Pi, Linksys usb/ethernet dongle and xmc sample