stream_config_compat.h Source File

Reference Documentation

Platform
Intel® PAC
Napatech SmartNIC
Content Type
Reference Information
Capture Software Version
Link™ Capture Software 12.10
Napatech Software Suite: include/ntapi/stream_config_compat.h Source File
stream_config_compat.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (C) 2023 Napatech A/S.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Napatech A/S nor the
14  * names of its contributors may be used to endorse or promote products
15  * derived from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL NAPATECH A/S BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  *
29 
30  */
31 
32 /**
33  * @file
34  *
35  * This is the header file of the STREAMTYPE_CONFIG interface containing
36  * included for backward compatibility structures.
37  *
38  */
39 #ifndef __STREAM_CONFIG_COMPAT_H__
40 #define __STREAM_CONFIG_COMPAT_H__
41 
42 #if !defined(_NT_NTAPI_NO_COMPAT)
43 
44 /***********************************************************************************************/
45 /* Port settings version 0 */
46 /***********************************************************************************************/
47 #define NT_CONFIG_PARM_PORT_SETTINGS NT_CONFIG_PARM_PORT_COMPAT_0 //!< Port settings - version 0
48 
49 struct NtPortSettings_s {
50  int enable; //!< 0 = Disable interface, 1 = Enable interface. If disabled, the port will still be visible, but has status link down.
51 #ifndef DOXYGEN_IGNORE
52  // Not supported
53  int flow; //!< 0 = No flow control, 1 = Flow control
54 #endif
55  enum NtLinkMDI_e mdi; //!< MDI mode
56  enum NtLinkAutoNeg_e autoNegotiation; //!< Manual speed, Auto (ignored on optical NIM interfaces)
57  /**
58  * Array of manual port setting parameters
59  */
60  struct NtPortSettingsManual_s manual; //!< Ignored on optical NIM interfaces
61  /**
62  * Array of parameters to be advertised when autonegotiation is enabled
63  */
64  struct NtPortSettingsAdvertise_s advertise; //!< Ignored on optical NIM interfaces
65 
66  uint32_t minIFG; //!< The minimum inter-frame gap in steps of 10 ns. A specified value will be rounded up or down to the nearest HW-supported value, which depends on the link speed. The default minimum gap is 0 ns.
67  uint32_t maxIFG; //!< The maximum inter-frame gap in steps of 10 ns. A specified value will be rounded up or down to the nearest HW-supported value, which depends on the link speed. The default maximum gap is the maximum HW-supported value. Setting the maximum interframe gap to 0 ns, corresponds to disabling the check for maximum IFG.
68 
69  enum NtTxPower_e TxPower; //!< TX power state on read and command on write. Controls laser power on/off on fiber SFP, XFP, SFP+ and QSFP+ modules. Note that not all modules support enable/disable of the laser. An error code is returned if not supported.
70  int hostLoopback; //!< Host loopback position.\n
71  //!< Applying host loopback has the effect that data sent from the host is looped
72  //!< back to the host on the same port regardless of, if a NIM (Network Interface
73  //!< Module) has been plugged in, and if a physical loopback has been applied.
74  //!< The link will therefore be reported as up despite that no NIM is present
75  //!< or that no physical link is present.\n
76  //!< In general simultaneous host and line loopback is not allowed.\n
77  //!< The available loopback positions are adapter dependent and applying a loopback
78  //!< position that is not supported will result in a returned error code by the API
79  //!< function. In general only the following values @ref NtHostLoopback_e should be
80  //!< used.\n
81  //!< Applying loopback along with settings that require PHY setup changes or
82  //!< applying these settings when already in loopback mode represents a conflict
83  //!< and will not be carried out. A returned error code will indicate this. In order
84  //!< to avoid conflicts, it is in general recommended to enable loopback separately.\n
85  //!< When applying loopback special settings are used and for trispeed modules
86  //!< this means that the link speed is changed to maximum. The original settings
87  //!< are restored when loopback is removed.
88 };
89 
90 /***********************************************************************
91  * Config read and write port settings - NT_CONFIG_PARM_PORT_SETTINGS *
92  ***********************************************************************/
93 struct NtConfigPort_s {
94  uint8_t portNo; //!< Port number to read from
95  uint8_t Reserved1[3];
96  struct NtPortSettings_s data; //!< Port settings
97 };
98 
99 #define NtConfigReadPort_s NtConfigPort_s
100 
101 /***********************************************************************************************/
102 /* Port settings version 1 */
103 /***********************************************************************************************/
104 #define NT_CONFIG_PARM_PORT_SETTINGS_V1 NT_CONFIG_PARM_PORT_COMPAT_1 //!< Port settings - version 1
105 
106 struct NtPortSettings_v1_s {
107  int enable; //!< 0 = Disable interface, 1 = Enable interface. If disabled, the port will still be visible, but has status link down.
108 #ifndef DOXYGEN_IGNORE
109  // Not supported
110  int flow; //!< 0 = No flow control, 1 = Flow control
111 #endif
112  enum NtLinkMDI_e mdi; //!< MDI mode
113  enum NtLinkAutoNeg_e autoNegotiation; //!< Manual speed, Auto (ignored on optical NIM interfaces)
114  /**
115  * Array of manual port setting parameters
116  */
117  struct NtPortSettingsManual_s manual; //!< Ignored on optical NIM interfaces
118  /**
119  * Array of parameters to be advertised when autonegotiation is enabled
120  */
121  struct NtPortSettingsAdvertise_s advertise; //!< Ignored on optical NIM interfaces
122 
123  uint32_t minIFG; //!< Depending on the IfgMode parameter in ntservice.ini the minimum interframe-gap is either interpreted as 10 ns steps or bytes. If IfgMode is set to NS the value will be rounded up or down to the nearest HW-supported value, which depends on the link speed. The default minimum gap is 0 ns. If the IfgMode is set to BYTE the value is written directly to the HW.
124  uint32_t maxIFG; //!< Depending on the IfgMode parameter in ntservice.ini the maximum interframe-gap is either interpreted as 10 ns steps or bytes. If the IfgMode is set to NS the value will be rounded up or down to the nearest HW-supported value, which depends on the link speed. The default maximum gap is the maximum HW-supported value. If the IfgMode is set to BYTE the value will be written directly to the HW. Setting the maximum interframe gap to 0, corresponds to disabling the check for maximum IFG.
125 
126  enum NtTxPower_e TxPower; //!< TX power state on read and command on write. Controls laser power on/off on fiber SFP, XFP, SFP+ and QSFP+ modules. Note that not all modules support enable/disable of the laser. An error code is returned if not supported.
127  int hostLoopback; //!< Host loopback position.\n
128  //!< Applying host loopback has the effect that data sent from the host is looped
129  //!< back to the host on the same port regardless of, if a NIM (Network Interface
130  //!< Module) has been plugged in, and if a physical loopback has been applied.
131  //!< The link will therefore be reported as up despite that no NIM is present
132  //!< or that no physical link is present.\n
133  //!< In general simultaneous host and line loopback is not allowed.\n
134  //!< The available loopback positions are adapter dependent and applying a loopback
135  //!< position that is not supported will result in a returned error code by the API
136  //!< function. In general only the following values @ref NtHostLoopback_e should be
137  //!< used.\n
138  //!< Applying loopback along with settings that require PHY setup changes or
139  //!< applying these settings when already in loopback mode represents a conflict
140  //!< and will not be carried out. A returned error code will indicate this. In order
141  //!< to avoid conflicts, it is in general recommended to enable loopback separately.\n
142  //!< When applying loopback special settings are used and for trispeed modules
143  //!< this means that the link speed is changed to maximum. The original settings
144  //!< are restored when loopback is removed.
145 
146  int lineLoopback; //!< Line loopback position.\n
147  //!< Applying line loopback has the effect that data sent from the line is looped
148  //!< back to the line on the same port. This requires that a NIM (Network Interface
149  //!< Module) has been plugged in.
150  //!< The link will in general be reported as up and traffic can be received by
151  //!< the host but any traffic transmitted by the host will be replaced by the
152  //!< traffic looped back.
153  //!< In general simultaneous host and line loopback is NOT allowed.\n
154  //!< The available loopback positions are adapter dependent and applying a loopback
155  //!< position that is not supported will result in a returned error code by the API
156  //!< function. In general only the following values @ref NtLineLoopback_e should be
157  //!< used.\n
158  //!< Applying loopback along with settings that require PHY setup changes or
159  //!< applying these settings when already in loopback mode represents a conflict
160  //!< and will not be carried out. A returned error code will indicate this. In order
161  //!< to avoid conflicts, it is in general recommended to enable loopback separately.\n
162  //!< When applying loopback special settings are used and for trispeed modules
163  //!< this means that the link speed is changed to maximum. The original settings
164  //!< are restored when loopback is removed.
165  enum NtPortId_e PortId; //!< Port identification state.
166  //!< Turns the port identification feature on/off. An error code is returned if
167  //!< not supported.
168  //!< When enabled the port led will start to blink regardless if the link is up
169  //!< or the port receives data or not.
170  int wisModeEnable; //!< 0 = Wismode disabled on port, 1 = Enable Wismode enabled on port.
171 };
172 
173 /***********************************************************************
174  * Config read and write port settings - NT_CONFIG_PARM_PORT_SETTINGS_V1 *
175  ***********************************************************************/
176 struct NtConfigPort_v1_s {
177  uint8_t portNo; //!< Port number to read from
178  uint8_t Reserved1[3];
179  struct NtPortSettings_v1_s data; //!< Port settings
180 };
181 
182 #define NT_TIMESYNC_RESET_PTP_SYNC_STAT NT_TIMESYNC_RESET_COMPAT_0 //!< Deprecated. Use NT_TIMESYNC_RESET_TS_STATISTICS instead
183 
184 #endif /* _NT_NTAPI_NO_COMPAT */
185 #endif /* __STREAM_INFO_COMPAT_H__ */