stream_info.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_info.h Source File
stream_info.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_INFO interface.
36  */
37 #ifndef __STREAM_INFO_H__
38 #define __STREAM_INFO_H__
39 
40 #if !defined(__NT_H__)
41  #error: My interface file is 'nt.h'. Please include that via #include "nt.h" directly.
42 #endif
43 
44 /** @addtogroup InfoStream
45  * @{
46  *
47  * Info streams are used to access system information. The info
48  * stream is read only.
49  *
50  * To open an info stream call @ref NT_InfoOpen. Once the info stream
51  * is open, the info read command needs to be set in the @ref NtInfo_t
52  * structure and depending on the info command an adapter number, port
53  * number or similar also needs to be set. Once the @ref NtInfo_t
54  * structure query is filled out, a call to @ref NT_InfoRead makes the
55  * system read out the requested data. When done, call @ref
56  * NT_InfoClose to close the stream.
57  *
58  * The info stream read commands currently supported are:
59  * @li <tt>System info</tt> - this includes the number of ports, adapters and sensors
60  * @li <tt>Adapter info</tt> - this includes the number of sensors, ports, PCI ID and bus ID
61  * @li <tt>Port info</tt> - this includes the port state, speed and duplex
62  * @li <tt>Sensor info</tt> - this includes the sensor type, name and value
63  * @li <tt>Host buffer info</tt> - this includes the NUMA node, size and feed
64  * @li <tt>Time sync info</tt> - this includes the time sync connector and time sync data
65  * @li <tt>Time sync external info</tt> - this includes the time sync information from a connected device
66  * @li <tt>Stream ID info</tt> - this includes the Stream ID.
67  * @li <tt>Product info</tt> - this includes the Product type, Product ID, Serial Number, PBA ID, AVR version, CPLD version and FPGA versions
68  * @li <tt>PTP info</tt> - this includes the PTP related information
69  *
70  * For an example of using the info stream see @ref info/info_example.c "info/info_example.c"
71  *
72  * @note The info stream is not thread-safe. If the same stream handle is to be used by multiple threads,
73  * it must be mutex protected in the application.
74  *
75  */
76 
77 /**
78  * Possible info stream read commands
79  */
81  NT_INFO_CMD_READ_UNKNOWN=0, //!< Unknown stream read command
82  NT_INFO_CMD_READ_SYSTEM, //!< System info - the number of ports, adapters and sensors
83  NT_INFO_CMD_READ_COMPAT_0, //!< Command for backward compatibility - defined in stream_info_compat.h
84  NT_INFO_CMD_READ_COMPAT_1, //!< Command for backward compatibility - defined in stream_info_compat.h
85  NT_INFO_CMD_READ_SENSOR, //!< Sensor info - the sensor type, name and value
86  NT_INFO_CMD_READ_COMPAT_3, //!< Command for backward compatibility - defined in stream_info_compat.h
87  NT_INFO_CMD_READ_STREAM, //!< Info about active streams in the system
88  NT_INFO_CMD_READ_COMPAT_2, //!< Command for backward compatibility - defined in stream_info_compat.h
89  NT_INFO_CMD_READ_COMPAT_5, //!< Command for backward compatibility - defined in stream_info_compat.h
90  NT_INFO_CMD_READ_COMPAT_4, //!< Command for backward compatibility - defined in stream_info_compat.h
91  NT_INFO_CMD_READ_COMPAT_6, //!< Command for backward compatibility - defined in stream_info_compat.h
92  NT_INFO_CMD_READ_HOSTBUFFER_V1, //!< Host buffer info - the NUMA node, size and feed
93  NT_INFO_CMD_READ_COMPAT_9, //!< Command for backward compatibility - defined in stream_info_compat.h
94  NT_INFO_CMD_READ_STREAMID, //!< Info about a stream ID
95  NT_INFO_CMD_READ_COMPAT_10, //!< Command for backward compatibility - defined in stream_info_compat.h
96  NT_INFO_CMD_READ_TIMESYNC_STATUS_EXT, //!< Time sync external status info - the time sync external status data
97  NT_INFO_CMD_READ_COMPAT_7, //!< Adapter info version 2 - the number of sensors, ports, PCI ID and bus ID
98  NT_INFO_CMD_READ_COMPAT_8, //!< Port info - the port state, speed and duplex
99  NT_INFO_CMD_READ_COMPAT_19, //!< Product information version 0 request command
100  NT_INFO_CMD_READ_COMPAT_11, //!< Adapter info version 3 - the number of sensors, ports, PCI ID and bus ID
101  NT_INFO_CMD_READ_COMPAT_12, //!< Port info version 3 - the port state, speed and duplex
102  NT_INFO_CMD_READ_COMPAT_15, //!< PTP info v1 PTP port status, PTP clock datasets and PTP configuration
103  NT_INFO_CMD_READ_COMPAT_23, //!< Filter usage info. Read filter usage information
104  NT_INFO_CMD_READ_COMPAT_21, //!< Time sync info version 3 - the time sync connector and time sync data
105  NT_INFO_CMD_READ_PATH_DELAY, //!< Port path delay
106  NT_INFO_CMD_READ_COMPAT_13, //!< Adapter info version 4 - the number of sensors, ports, PCI ID and bus ID
107  NT_INFO_CMD_READ_COMPAT_14, //!< Port info version 4 - the port state, speed and duplex
108  NT_INFO_CMD_READ_COMPAT_17, //!< Adapter info version 5 - the number of sensors, ports, PCI ID and bus ID
109  NT_INFO_CMD_READ_COMPAT_16, //!< Port info version 5 - the port state, speed and duplex
110  NT_INFO_CMD_READ_TIMESYNC_STAT, //!< Time sync statistics
111  NT_INFO_CMD_READ_PTP_V2, //!< PTP info v2 PTP port status, PTP clock data sets and PTP configuration
112  NT_INFO_CMD_READ_COMPAT_18, //!< Port info version 6 - the port state, speed and duplex
113 
114  NT_INFO_CMD_READ_ADAPTER_V6, //!< Adapter info version 6 - the number of sensors, ports, PCI ID and bus ID
115  NT_INFO_CMD_READ_COMPAT_20, //!< Port info version 7 - the port state, speed and duplex
116  NT_INFO_CMD_READ_COMPAT_22, //!< Product information version 1 request command
117  NT_INFO_CMD_READ_COMPAT_24, //!< Port info version 8 - the port state, speed and duplex
118  NT_INFO_CMD_READ_TIMESYNC_V4, //!< Time sync info version 4 - the time sync connector and time sync data
119  NT_INFO_CMD_READ_PRODUCT_INFO_V2, //!< Product information version 2 request command
120  NT_INFO_CMD_READ_FILTERUSAGE_V1, //!< Filter usage info. Read filter usage information
121  NT_INFO_CMD_READ_PROPERTY, //!< Property information request
122  NT_INFO_CMD_READ_PORT_V9, //!< Port info version 9 - the port state, speed and duplex
123 };
124 
125 /**
126  * This structure will return the system-wide information
127  */
129  uint8_t numNumaNodes; //!< The number of online NUMA nodes in the system
130  uint8_t Reserved1[3];
131  uint8_t numAdapters; //!< The number of adapters in the system
132  uint8_t Reserved2[3];
133  uint8_t numPorts; //!< The number of ports in the system
134  uint8_t Reserved3[3];
135  /**
136  * Version info
137  */
138  struct {
139  int32_t major; //!< The major release number
140  int32_t minor; //!< The minor release number
141  int32_t patch; //!< The major/minor patch release
142  int32_t tag; //!< The release tag number
143  } version;
144 };
145 
146 enum {
147  NT_AVR_NOT_VALID = 0, //!< No valid AVR data
148  NT_AVR_VALID_2 = 1, //!< Valid AVR data for mainboard and front board has been filled in the structure (Both index 0 and 1 has been filled with valid data)
149  NT_AVR_VALID_1 = 2, //!< Valid AVR data has been filled in the structure (Only index 0 has been filled with valid data)
150 };
151 
153  uint8_t valid; //!< Does this structure contain valid data (not all adapters use this structure)
154  struct {
155  uint8_t version_major; //!< The major version
156  uint8_t version_minor; //!< The minor version
157  uint8_t version_build; //!< The build number
158  } avr[2];
159 };
160 
161 union Ntpciid_u {
162  /**
163  * PCI ID can be read as:
164  * 32-bit value,
165  * 2 x 16-bit values defining
166  * device ID and
167  * vendor ID
168  */
169  struct Ntpciid_s {
170  uint16_t device; //!< The device ID, for example, NT20E in-line 0x64
171  uint16_t vendor; //!< The vendor ID, for example, Napatech 0x18F4
172  }s;
173  uint32_t value; //!< The PCI ID, for example, 0x18540064
174 };
175 
176 union Ntfpgaid_u {
177  struct {
178  uint32_t rev:8; //!< The FPGA revision
179  uint32_t ver:8; //!< The FPGA version
180  uint32_t product:16; //!< The FPGA product code
181  uint32_t item:12; //!< The FPGA item type (200 is FPGA, 201 is CPLD)
182  uint32_t build:10; //!< The build number - non-zero for R&D builds
183  uint32_t reserved:10;
184  }s;
185  uint64_t value; //!< The raw 64-bit FPGA ID
186 };
187 
188 /**
189  * Structure to hold information about WIS mode
190  */
192  int supported; //!< Is WIS mode supported by the adapter - 1 supported, 0: not supported
193  enum NtWISMode_e mode; //!< Is WIS mode enabled
194  uint32_t mask; //!< Wismode port enable mask -> bit 0 = port0, bit 1 = port 1 etc.
195 };
196 
197 /**
198  * Structure to hold information about global sync
199  */
201  int supported; //!< Is global sync supported.
202  uint32_t portEnableMask; //!< Enables coordinated time synchronized transmit on port bit mask
203  uint64_t timeSynchronizedTxOffset; //!< Time offset between time stamp in first frame and adapter time
204 };
205 
206 /**
207  * Structure to read SDRAM information
208  */
210  int present; //!< Is the SDRAM present
211  enum NtSdramSize_e size; //!< The physical SDRAM chip size
212 };
213 
214 /**
215  * Structure to read PCIe information
216  */
218  int pciGen; //!< PCI generation
219  int numLanes; //!< Number of PCI lanes
220  int numLanesSupported; //!< The number of lanes supported by the adapter
221  int maxPayloadSupported; //!< The maximum supported payload by the adapter
222  int maxPayload; //!< The negotiated maximum payload
223  uint32_t measuredRxThroughput; //!< RX PCI throughput
224  uint32_t measuredTxThroughput; //!< TX PCI throughput
225  uint32_t measuredCombinedRxThroughput; //!< Combined RX throughput
226  uint32_t measuredCombinedTxThroughput; //!< Combined RX throughput
227 };
228 
229 /**
230  * Adapter bonding information
231  */
232 typedef struct {
233  uint32_t bonded; //!< Has this adapter been bonded with another
234  uint8_t remoteAdapter; //!< The adapter this adapter is bonded with.
235  enum NtBondingType_e type; //!< Is the adapter master or slave
237 
238 
239 
240 /**
241  * This structure will return the adapter specific info version 6.
242  * Must be a mirror of NtInfoAdapter_v5_s with version 6 variables added
243  * to the bottom.
244  */
246  uint8_t numSensors; //!< The number of sensors on this adapter
247  uint8_t Reserved1[3];
248  uint8_t numLevel1Sensors; //!< The number of level 1 sensors on this adapter
249  uint8_t Reserved2[3];
250  uint8_t portOffset; //!< The port numbers of this adapter start at this port offset
251  uint8_t Reserved3[3];
252  uint8_t numPorts; //!< The number of ports on this adapter
253  uint8_t Reserved4[3];
254  uint8_t numPhysicalAdapters; //!< The number of physical adapters grouped in this logical adapter
255  uint8_t Reserved5[3];
256  uint32_t numHostBuffersRx; //!< The number of RX host buffers on this adapter
257  uint32_t numHostBuffersTx; //!< The number of TX host buffers on this adapter
258  uint32_t numTsConnectors; //!< The number of time sync connectors on this adapter
259  enum NtAdapterType_e adapterType; //!< The adapter type
260  enum NtProductType_e productType; //!< The product line type
261  enum NtProfileType_e profile; //!< The profile the adapter is using
262  uint32_t supportedProfilesBitmask; //!< The profiles supported by the adapter - the value is represented as a bitmask of @ref NtProfileType_e values
263  uint32_t adapterFeatures; //!< The features supported by the adapter - the value is represented as a bitmask of @ref NtFeatureType_e values
264  enum NtProductFamily_e productFamily; //!< The product family
265  char name[128]; //!< The adapter name
266  char serialNo[50]; //!< The adapter serial number
267  /**
268  * AVR version for Gen2 adapters:
269  * avr[0] = Main board AVR,
270  * avr[1] = Front board AVR
271  */
273 
274  /**
275  * The bus ID of the device
276  */
277  union Ntbusid_v6_u {
278  struct Ntbusid_v6_s {
279  uint32_t function:3; //!< The PCI function number
280  uint32_t device:5; //!< The PCI device number
281  uint32_t bus:8; //!< The PCI bus number
282  uint32_t domain:16; //!< The PCI domain number
283  }s;
284  uint32_t value; //!< The domain, bus, device and function as a 32-bit value
285  } busid;
286  /**
287  * PCI ID is read as:
288  * 32-bit value,
289  * 2 x 16-bit values defining
290  * device ID and
291  * vendor ID
292  */
293  union Ntpciid_u pciid;
294  struct NtInfoPCIeInfo_s pciInfo; //!< Information about the PCI bus.
295  /**
296  * The FPGA ID of the image currently running on the adapter.
297  * The format is: item-product-version-revision-build.
298  * For example, 200-9114-40-01-1023.
299  */
300  union Ntfpgaid_u fpgaid;
301  struct NtInfoSDRAMInfo_s sdramInfo; //!< The SDRAM information
302  uint32_t extendedDescriptor; //!< The extended descriptor in use by RX - if 0 then no extended is used
303  uint32_t supportedExtendedDescriptorsBitmask; //!< Bitmask of supported extended descriptors, for example, if bit 7 is set then extended descriptor 7 is supported, and if bit 8 it set then extended descriptor 8 is supported
304  enum NtPacketDescriptorType_e descriptorType; //!< The descriptor type used
305  enum NtTimestampType_e timestampType; //!< The time stamp type used by the adapter
306  enum NtTimestampMethod_e timestampMethod; //!< The time stamp method (SOF/EOF) used by the adapter
307  enum NtTxTimingMethod_e txTiming; //!< The TX timing
308  struct NtInfoWis_v1_s wisMode; //!< Wis mode status
309  enum NtTimestampInjectOffsetMode_e tsInjectModeOffset; //!< Time stamp injection offset mode
310  struct NtInfoGlobalSync_s globalSync; //!< Global sync status
311  NtInfoBondingInfo_t bondingInfo; //!< Adapter Bonding status
312  enum NtFeatureLevel_e featureLevel; //!< Adapter/FPGA feature level
313  uint16_t customId; //!< Custom identification number
314 };
315 
317  NT_PORT_FEATURE_DMA_TRANSMIT=1LL<<0, //!< The port is able to perform DMA transmit. Ports that do not have this bit set will only be able to transmit at a limited rate
318  NT_PORT_FEATURE_HARDSLICE_AT_MAXFRAMESIZE=1LL<<1, //!< The port will hard slice packets when they exceed the maximum frame size
319  NT_PORT_FEATURE_IPV4_TX_CHECKSUM_CALC=1LL<<2, //!< The port can calculate the IPv4 checksum on transmit
320  NT_PORT_FEATURE_UDP_TX_CHECKSUM_CALC=1LL<<3, //!< The port can calculate the UDP checksum on transmit
321  NT_PORT_FEATURE_TCP_TX_CHECKSUM_CALC=1LL<<4, //!< The port can calculate the TCP checksum on transmit
322  NT_PORT_FEATURE_INJECT_TX_TS=1LL<<5, //!< The port can inject a time stamp when transmitting packets
323  NT_PORT_FEATURE_TIMED_TX=1LL<<6, //!< The port can transmit timed using the time stamps in each packet
324  NT_PORT_FEATURE_BYPASS=1LL<<7, //!< The port has bypass functionality
325  NT_PORT_FEATURE_DISABLE=1LL<<8, //!< The port can be disabled
326  NT_PORT_FEATURE_64BIT_TIMESTAMP=1LL<<9, //!< The port has 64-bit time stamp support
327  NT_PORT_FEATURE_RX_ONLY=1LL<<10, //!< The port can only be used to receive data. No transmit capabilities.
328  NT_PORT_FEATURE_TX_REPLICATE=1LL<<11, //!< The port can replicate the TX traffic of another port
329  NT_PORT_FEATURE_FCS_TX_CHECKSUM_CALC=1LL<<12 //!< The port can calculate the FCS checksum on transmit
330 };
331 
333  NT_NIM_UNKNOWN = 0x00, //!< Nim type is unknown
334  NT_NIM_GBIC = 0x01, //!< Nim type = GBIC
335  NT_NIM_FIXED = 0x02, //!< Nim type = FIXED
336  NT_NIM_SFP_SFP_PLUS = 0x03, //!< Nim type = SFP/SFP+
337  NT_NIM_300_PIN_XBI = 0x04, //!< Nim type = 300 pin XBI
338  NT_NIM_XEN_PAK = 0x05, //!< Nim type = XEN-PAK
339  NT_NIM_XFP = 0x06, //!< Nim type = XFP
340  NT_NIM_XFF = 0x07, //!< Nim type = XFF
341  NT_NIM_XFP_E = 0x08, //!< Nim type = XFP-E
342  NT_NIM_XPAK = 0x09, //!< Nim type = XPAK
343  NT_NIM_X2 = 0x0A, //!< Nim type = X2
344  NT_NIM_DWDM = 0x0B, //!< Nim type = DWDM
345  NT_NIM_QSFP = 0x0C, //!< Nim type = QSFP
346  NT_NIM_QSFP_PLUS = 0x0D, //!< Nim type = QSFP+
347  NT_NIM_QSFP28 = 0x11, //!< Nim type = QSFP28
348  NT_NIM_CFP4 = 0x12, //!< Nim type = CFP4
349 };
350 
352  NT_PORT_IFG_BYTE_MODE=1LL<<0, //!< The port is configured to run in IFG BYTE mode
353 };
354 
356  uint32_t halfDuplexMask; //!< The available half duplex (use @ref NtLinkSpeed_e as the bitmask)
357  uint32_t fullDuplexMask; //!< The available full duplex (use @ref NtLinkSpeed_e as the bitmask)
358  uint32_t speed; //!< The available speed (use @ref NtLinkSpeed_e as the bitmask)
359  uint32_t mdi; //!< The available MDI mode (use @ref NtLinkMDI_e as the bitmask)
360  uint32_t AutoNeg; //!< The available link mode (use @ref NtLinkAutoNeg_e as the bitmask)
361  uint32_t duplex;
362  uint16_t minTxPktSize; //!< The minimum transmit packet size, see also @ref NtRMON1Counters_s::undersizePkts
363  uint16_t maxTxPktSize; //!< The maximum transmit packet size
364  uint32_t featureMask; //!< The feature mask of the port
365 };
366 
368  uint16_t sm; //!< NIM link length (in meters) supported SM (9um). A value of 0xFFFF indicates that the length is >= 65535 m
369  uint16_t ebw; //!< NIM link length (in meters) supported EBW (50um)
370  uint16_t mm50; //!< NIM link length (in meters) supported MM (50um)
371  uint16_t mm62; //!< NIM link length (in meters) supported MM (62.5um)
372  uint16_t copper; //!< NIM link length (in meters) supported copper
373 };
374 
375 /*
376  * Bypass port information
377  */
378 struct NtBypassPortInfo_s { //!< Read-only information about bypass port states
379  uint8_t bypassPortsetNo; //!< Portset (portpair) membership - within an adapter
380  uint8_t Reserved1[3];
381  enum NtBypassTrigger_e bypassTriggerModes; //!< Bypass triggers that affect this port state using @ref NtBypassTrigger_e
382  enum NtBypassPortState_e currentBypassPortState; //!< Current (live) bypass port state using @ref NtBypassPortState_e
383  enum NtBypassPortState_e onInitBypassPortState; //!< onInit bypass port state using @ref NtBypassPortState_e
384  enum NtBypassPortState_e onPowerFailBypassPortState; //!< onPowerFail bypass port state using @ref NtBypassPortState_e
385  enum NtBypassPortState_e onWatchdogFailBypassPortState; //!< onWatchdogFail bypass port state using @ref NtBypassPortState_e
386  uint32_t bypassPortWatchdogTimeout; //!< Watchdog timeout (msec)
387  uint32_t bypassPortWatchdogTimeRemaining; //!< Watchdog remaining time before timeout (msec)
388 };
389 
390 
391 
392 /**
393  * This structure will return the port specific information version 7.
394  * Must be a mirror of NtInfoPort_v8_s with version 9 variables added
395  * to the bottom.
396  */
398  enum NtPortType_e type; //!< The interface type
399  enum NtLinkState_e state; //!< The port up or down
400  enum NtLinkSpeed_e speed; //!< The interface speed
401  enum NtLinkDuplex_e duplex; //!< The duplex mode
402  int32_t flow; //!< 0 = no flow control, 1 = flow control
403  enum NtLinkMDI_e mdi; //!< 1 = auto, 2 = MDI, 4 = MDIX
404  uint8_t macAddress[6]; //!< The MAC address of the interface
405  uint16_t maxFrameSize; //!< The current maximum frame size
406  /**
407  * Capabilities reflect what the port is capable of, that is, what speed/duplex is possible. For example,
408  * if only 100 M full duplex is available, the capabilities would
409  * show:
410  * halfDuplexMask=0.
411  * fullDuplexMask=NT_LINK_SPEED_100M.
412  * Other capabilities are min/max transmit sizes.
413  */
414  struct NtLinkCapabilities_s capabilities; //!< The link capabilities
415  uint8_t adapterNo; //!< The adapter that has the port
416  uint8_t Reserved1[3];
417  uint8_t numSensors; //!< The number of sensors on this port
418  uint8_t Reserved2[3];
419  uint8_t numLevel1Sensors; //!< Number of level 1 sensors on this port
420  uint8_t Reserved3[3];
421  uint8_t numLevel2Sensors; //!< Number of level 2 sensors on this port
422  uint8_t Reserved4[3];
423 
424  /**
425  * NIM model information
426  */
427  enum NtNimIdentifier_e nim_id; //!< NIM identifier
428  uint8_t vendor_name[17]; //!< NIM Vendor name
429  uint8_t product_no[17]; //!< NIM product number
430  uint8_t serial_no[17]; //!< NIM serial number
431  uint8_t date[9]; //!< NIM vendors manufacturing date
432  uint8_t revision[5]; //!< NIM vendor revision
433  uint8_t power_level_req; //!< NIM required power level
434  uint8_t power_level_curr; //!< NIM current power level
435  struct NtNIMLinkLength_s link_length;
436  /**
437  * Adapter information
438  */
439  struct NtInfoAdapter_v6_s adapterInfo; // Adapter information
440  /**
441  * Bypass port information
442  */
443  struct NtBypassPortInfo_s bypass; // Bypass port information
444  uint32_t statusMask; //!< Adapter status mask holds information on how the port is configured at startup
445  NtPortFec_t fecState; //!< The state of Forward Error Correction if applicable
446  uint64_t nextPktNs; //!< Time till next package will be transmitted in ns.
447  uint64_t maxPktDelayedNs; //!< Max time pkts were late in being transmitted
448 };
449 
450 
451 
452 
453 
454 
455 /**
456 This structure will return the sensor specific information
457 
458 The units used for the fields: value, valueLowest, valueHighest, limitLow and
459 limitHigh depend on the type field. See @ref NtSensorType_e.
460 
461 For the limitLow and limitHigh fields the following applies:\n
462 If the sensor is located in a NIM (Network Interface Module), the limits are read
463 from the NIM module via the DMI (Diagnostic Monitoring Interface) from the alarm
464 and warning threshholds section, and the units are changed to internal representation.
465 Only the alarm threshholds are used and are read only once during initialization.
466 The limits cannot be changed.
467 
468 The value field is updated internally on a regular basis and is also based on a
469 value read from the NIM which is also changed to internal representation.
470 
471 Not all NIM types support DMI data, and its presence must be determined by reading an
472 option flag. In general, a NIM can read out: temperature, supply voltage,
473 TX bias, TX optical power and RX optical power but not all NIM types support all
474 5 values.
475 
476 If external calibration is used (most NIM use internal calibration), both the
477 current value and the threshold values are subjected to the specified calibration
478 along with the change to internal calibration.
479 */
480 typedef struct NtInfoSensor_s {
481  enum NtSensorSource_e source; //!< The source of the sensor (port or adapter on which the sensor resides)
482  uint32_t sourceIndex; //!< The source index - the adapter number for adapter sensors and port number for port sensors
483  uint32_t sensorIndex; //!< The sensor index within the source index (sensor number on the adapter or sensor number on the port)
484  enum NtSensorType_e type; //!< The sensor type
485  enum NtSensorSubType_e subType; //!< The sensor subtype (if applicable)
486  enum NtSensorState_e state; //!< The current state (normal or alarm)
487  int32_t value; //!< The current value
488  int32_t valueLowest; //!< The lowest value registered
489  int32_t valueHighest; //!< The highest value registered
490  int32_t limitLow; //!< The minimum sensor value before an alarm is triggered
491  int32_t limitHigh; //!< The maximum sensor value before an alarm is triggered
492  char name[50]; //!< The sensor name
493  enum NtAdapterType_e adapterType; //!< The adapter type where the sensor resides
495 
496 
497 /**
498  * StreamID specific information
499  */
501  int useCount; //!< Set to the number of streams using this stream ID
502  int numHostBuffers; //!< The amount of hostbuffers currently in use by this stream ID
503  enum NtStreamIdState_e state; //!< The current state of the stream ID
504  uint64_t minHostBufferSize; //!< The minimum hostbuffer size this stream ID requires
505  uint8_t numaNode; //!< The NUMA node on which this stream ID resides
506 };
507 
508 /**
509  * Host buffer specific information
510  */
512  uint8_t numaNode; //!< The NUMA node on which the host buffer resides
513  uint8_t Reserved1[3];
514  uint64_t size; //!< The size of the host buffer in bytes
515  uint32_t feed; //!< The feed index per adapter and type
516 };
517 
518 
519 /**
520  * Structure to hold information about currently active streams
521  */
523  int streamIDList[256]; //!< Holds all the stream IDs currently created in the system
524  uint32_t count; //!< The number of stream IDs from the stream ID list
525 //
526 
527 };
528 
529 
530 /**
531  * Structure to hold the sampled timestamps and status
532  */
534  enum NtTimeSyncSamplingSrcStatus_e sampledStatus; //!< Status of sampled timestamp (valid/invalid)
535  uint64_t sampledTime; //!< The sampled adapter time in ns since 1/1 1970 (unix epoch). if NATIVE timestamp format is configured, the epoch is user defined)
536  enum NtTimeSyncSamplingSrcStatus_e externalStatus; //!< Status of external reference timestamp (available/unavailable)
537  uint64_t externalTime; //!< The sampled external time in ns since 1/1 1970 (unix epoch). if NATIVE timestamp format is configured, the epoch is user defined)
538 };
539 
540 
541 /**
542  * Time syncronization specific info
543  */
544 #define NT_TIME_SYNC_CLOCK_RATE_ADJ_UNKNOWN 1000000000 //!< Used for timeSyncClockRateAdjustment and timeSyncOSClockRateAdjustment parameters to indicate that no clock rate adjustment is retrievable
545 
547  uint32_t timeSyncSupported; //!< Is time sync supported by this adapter
548  uint32_t ptpSupported; //!< Is PTP time sync available on this adapter
549 
550  NtTimeSyncConnectorSetting_t timeSyncConnectorExt1; //!< Timesync connector Ext1 setting
551  NtTimeSyncConnectorSetting_t timeSyncConnectorInt1; //!< Timesync connector Int1 setting
552  NtTimeSyncConnectorSetting_t timeSyncConnectorInt2; //!< Timesync connector Int2 setting
553  enum NtTimeSyncReference_e tsRefPrio[4]; //!< Timesync source reference priority list
554  enum NtTimeSyncReference_e timeRef; //!< The current time reference
555  enum NtTimeSyncFreqReference_e tsFreqRefPrio[4]; //!< Timesync frequency reference priority list
556  enum NtTimeSyncFreqReference_e freqRef; //!< The current frequency reference
557  uint32_t timeSyncNTTSInSyncLimit; //!< The configured NT-TS in-sync limit
558  uint32_t timeSyncOSInSyncLimit; //!< The configured OS in-sync limit
559  uint32_t timeSyncPPSInSyncLimit; //!< The configured PPS in-sync limit
560  uint32_t timeSyncPTPInSyncLimit; //!< The configured PTP in-sync limit
561  enum NtTimeSyncInSyncStatus_e timeSyncInSyncStatus; //!< The timestamp clock time in-sync/out-of-sync status
562  enum NtTimeSyncConStatus_e timeSyncCurrentConStatus; //!< The current time sync connector status
563  enum NtTimeSyncPpsStatus_e timeSyncPpsEnable; //!< The time sync PPS enable. Activated by an application
564  enum NtTimeSyncPpsSyncMode_e timeSyncPpsSyncMode; //!< When current timeref is PpsIn, this is the sync mode status
565  uint32_t timeSyncClockAdjustmentMode; //!< The time sync timestamp clock adjustment mode
566  /* timeSyncClockAdjustmentMode 2 only */
567  uint32_t timeSyncHardReset; //!< If hard reset of clock is allowed (time jumps)
568  /* timeSyncClockAdjustmentMode 1 only */
569  uint32_t timeSyncTimeJumpThreshold; //!< The time sync time jump threshold in seconds
570 
571  uint32_t timeSyncTimeOffset; //!< The time sync offset in nanoseconds. Used for NT-TS and PPS caple delay compensation
572  uint64_t timeSyncPpsSampled; //!< The sampled PPS time. In ns since 1/1 1970 (unix epoch). if NATIVE timestamp format is configured, the epoch is user defined). Note that timeSyncPpsEnable must be true for this parameter to become valid
573  int64_t timeSyncTimeSkew; //!< The time skew in ns (0 if not syncing to a time reference)
574  uint32_t highFrequencySampling; //!< The high frequency sampling status
575  struct NtInfoTimeSyncSample_s sample[NT_TIMESYNC_SAMPLING_CNT]; //!< Timestamp sample sets. @ref NtTimeSyncSamplingSrc_e
576  uint64_t timeSyncCpuTsc[2]; //!< When TS sampling is app initiated through an event write, these values are cpu tsc values before and after the ts sampling
577 
578  int64_t timeSyncClockRateAdjustment; //!< The current clock rate adjustment imposed on the TS clock to synchronize to the referenced clock in nanoseconds per second. This is only supported on newer Gen2 adapters (FPGA version must be 46 or above)
579 
580  /* Server OS clock synchronization to TS clock */
581  uint32_t timeSyncAdapterToOSSyncEnabled; //!< Non-zero if this adapter is configured to synchronize the server OS clock
582  int64_t timeSyncOSClockOffset; //!< The latest read OS clock offset to the adapter TS clock
583  int64_t timeSyncOSClockRateAdjustment; //!< The current clock rate adjustment imposed on the server OS clock to synchronize to the adapter TS clock.
584 };
585 
586 /**
587  * Time synchronization NT-TS remote info
588  */
590  uint32_t infoValid; //!< The information is valid if infoValid != 0
591  uint32_t extDevSyncSignalOk; //!< The status of the external synchronization signal (1 if ok, otherwise 0) (Only used if the external device is a NT-TSU)
592  uint32_t extDevInSync; //!< The external device is in sync (1 if in sync, otherwise 0) (Only used if the external device is a NT-TSU or a NT-TSE)
593  uint32_t extDevTimeOfDayOk; //!< The external device delivers valid Time Of Day information (1 if valid, otherwise 0) (Only used if the external device is a NT-TSU or a NT-TSE) For the NT-TSU this indicates if the serial time stream is available. For the NT-TSE this field indicates if the Ethernet connection is up.
594  uint32_t extDevOsModeSyncEnabled; //!< The external device is synching to the OS time (1 if synching, otherwise 0) Only used if the external device is an adapter.
595  uint32_t extDevOsModeInSync; //!< The external device is in synchronization to the OS time (1 if in sync, otherwise 0) Only used if the external device is an adapter.
596  uint32_t extDevIsMaster; //!< The External device is master (1 if the external device is a NTTSU or NTTSE, otherwise 0)
597  uint32_t extAdapterIsMaster; //!< An external Adapter is master (1 if the external device is an adapter, otherwise 0)
598  uint32_t extDevMasterID; //!< Master ID of the external device
599 };
600 
601 
602 
603 /**
604  * Time synchronization statistics
605  * support level
606  */
608  NT_TIMESYNC_STATISTICS_NO_SUPPORT = 0, //!< Not supported
609  NT_TIMESYNC_STATISTICS_PTP_ONLY = 1, //!< When using older FPGAs on PTP adapters, then PTP will be supported only
610  NT_TIMESYNC_STATISTICS_FULL_SUPPORT = 2 //!< Full supported. All protocols and failover/fallback are supported
611 };
612 
613 /**
614  * Overall Time synchronization performance statistics
615  * and time sync event counters
616  */
618  enum NtTsStatSupport_e supported; //!< Specifies the level of which this feature is supported by the adapter.
619  uint64_t ts; //!< The adapter time when retrieved in ns since 1/1 1970 (unix epoch). if NATIVE timestamp format is configured, the epoch is user defined)
620  uint64_t samples; //!< The number of skew samples this statistics report is based on
621  int64_t skew; //!< The last recorded clock skew used to adjust the clock
622  int64_t min; //!< The minimum clock skew measured
623  int64_t max; //!< The maximum clock skew measured
624  int64_t mean; //!< The calculate mean clock skew
625  int64_t jitter; //!< The peak to peak jitter measured
626  uint64_t secSinceReset; //!< Time elapsed since last reset in seconds (using the OS time)
627  double stdDevSqr; //!< The calculated standard deviation square
628  /* Timesync event counters */
629  uint64_t signalLostCnt; //!< The number of signal lost events that has occured since last reset
630  uint64_t syncLostCnt; //!< The number of out-of-sync events (or synchronization lost events) that has occured since last reset
631  uint64_t hardResetCnt; //!< The number of clock hard reset events that has occured since last reset (including the application triggered)
632 };
633 
634 
635 /**
636  * NT_INFO_CMD_READ_SYSTEM specific data
637  */
639  struct NtInfoSystem_s data; //!< System data
640 };
641 
642 /**
643  * NT_INFO_CMD_READ_ADAPTER_V6 specific data.
644  * The adapterNo must be initialized for the relevant adapter.
645  */
647  uint8_t adapterNo; //!< The adapter to query
648  uint8_t Reserved1[3];
649  struct NtInfoAdapter_v6_s data; //!< The adapter data
650 };
651 
652 /**
653  * NT_INFO_CMD_READ_PORT_V9 specific data.
654  * The portNo must be initialized for the relevant port.
655  */
657  uint8_t portNo; //!< The port to query
658  uint8_t Reserved1[3];
659  struct NtInfoPort_v9_s data; //!< The port data
660 };
661 
662 
663 /**
664  * NT_INFO_CMD_READ_SENSOR specific data.
665  * The group, adapterNo/portNo and grpIndex must be initialized for the relevant sensor.
666  * For example, to read sensor 2 from port 4, do the following:
667  * info.u.cmd = NT_INFO_CMD_READ_SENSOR;
668  * info.u.sensor.source = NT_SENSOR_SOURCE_PORT;
669  * info.u.sensor.sourceIndex= 4;
670  * info.u.sensor.sensorIndex = 2;
671  * NT_ReadInfo(h, &info);
672  */
674  enum NtSensorSource_e source; //!< The source of the sensor - either a port or adapter sensor
675  uint32_t sourceIndex; //!< The source index - either adapter number or port number on which the sensor resides
676  uint32_t sensorIndex; //!< The sensor index within the source index, for example, 2 for sensor 2 on port 4
677  struct NtInfoSensor_s data; //!< The sensor data
678 };
679 
680 /**
681  * NT_INFO_CMD_READ_HOSTBUFFER_V1 specific data.
682  * The adapterNo, hostBufferNo and hostBufferType must be initialized for the relevant adapter, host buffer number and host buffer type.
683  */
685  uint8_t adapterNo; //!< The adapter to query
686  uint8_t Reserved1[3];
687  uint32_t hostBufferNo; //!< The host buffer to query
688  enum NtNetHostBufferType_e hostBufferType; //!< The host buffer type, that is, CAPTURE or TX
689  struct NtInfoHostBuffer_v1_s data; //!< The host buffer data
690 };
691 
692 /**
693  * NT_INFO_CMD_READ_STREAM specific data.
694  * Returning information about streams. Currently only the list of active streams is supported.
695  */
697 //
698 
699  struct NtInfoStreams_s data;
700 };
701 
702 /**
703  * NT_INFO_CMD_READ_STREAMID specific data.
704  * Returning information about a streamID.
705  */
707  int streamId; //!< The streamID to query
708  struct NtInfoStreamId_s data; //!< The streamID data
709 };
710 
711 /**
712  * NT_INFO_CMD_READ_TIMESYNC_V4 specific data.
713  * The adapterNo must be initialized for the relevant adapter.
714  */
716  uint8_t adapterNo; //!< The adapter to query
717  uint8_t Reserved1[2];
718  struct NtInfoTimeSync_v4_s data; //!< The time sync data
719 };
720 
721 /**
722  * NT_INFO_CMD_READ_TIMESYNC_STAT specific data.
723  * The adapterNo must be initialized for the relevant adapter.
724  */
726  uint8_t adapterNo; //!< The adapter to query
727  uint8_t Reserved1[2];
728  struct NtInfoTimeSyncStatistics_s data; //!< The time sync data
729 };
730 
731 
732 /**
733  * NT_INFO_CMD_READ_TIMESYNC_EXT_STATUS specific data.
734  * The adapterNo must be initialized for the relevant adapter.
735  */
737  uint8_t adapterNo; //!< The adapter to query
738  uint8_t Reserved1[3];
739  struct NtInfoTimeSyncStatusExt_s data; //!< The time sync data
740 };
741 
742 
743 
744 /**
745  * IEEE 1588 PTP network protocol identifier
746  */
748  NT_PTP_NETW_PROTOCOL_NA = 0, //!< invalid protocol ID
749  NT_PTP_NETW_PROTOCOL_IPV4_UDP = 1, //!< IPv4/UDP protocol
750  NT_PTP_NETW_PROTOCOL_IPV6_UDP = 2, //!< IPv6/UDP protocol
751  NT_PTP_NETW_PROTOCOL_IEEE802_3 = 3, //!< IEEE 802.3 or Layer 2 protocol
752  NT_PTP_NETW_PROTOCOL_DEVICENET = 4, //!< DeviceNet
753  NT_PTP_NETW_PROTOCOL_CONTROLNET = 5, //!< ControlNet
755 };
756 
757 /**
758  * IEEE 1588 PTP: Filter to be applied to calculated
759  * offset values before feed to PI controller
760  */
762  NT_PTP_FILTER_NONE = 0, //!< No filter
763  NT_PTP_FILTER_MIN = 1, //!< Minimum filter
764  NT_PTP_FILTER_PDV = 2 //!< PDV filter
765 };
766 
767 /**
768  * IEEE 1588 PTP time source identifier
769  */
771  NT_PTP_TIMESOURCE_NA = 0, //!< Invalid
772  NT_PTP_TIMESOURCE_ATOMIC = 0x10, //!< Time source is an atomic clock
773  NT_PTP_TIMESOURCE_GPS = 0x20, //!< Time source is GPS
774  NT_PTP_TIMESOURCE_TER_RADIO = 0x30, //!< Time source is terrestrial radio
775  NT_PTP_TIMESOURCE_PTP = 0x40, //!< Time source is PTP (external to the domain)
776  NT_PTP_TIMESOURCE_NTP = 0x50, //!< Time source is NTP
777  NT_PTP_TIMESOURCE_HAND_SET = 0x60, //!< Time source is hand set
778  NT_PTP_TIMESOURCE_OTHER = 0x90, //!< Any other time source
779  NT_PTP_TIMESOURCE_OSCILLATOR = 0xA0 //!< Time source is free running oscillator
780 };
781 
782 /**
783  * IEEE 1588 PTP propagation delay measurement mechanism identifier
784  */
786  NT_PTP_DELAY_MECHANISM_NA = 0x00, //!< Invalid
787  NT_PTP_DELAY_MECHANISM_E2E = 0x01, //!< End-to-End or delay request-response mechanism
788  NT_PTP_DELAY_MECHANISM_P2P = 0x02, //!< Peer-to-Peer or peer delay mechanism
789  NT_PTP_DELAY_MECHANISM_DISABLED = 0xFE //!< no propagation delay mechanism implemented
790 };
791 
792 
793 /**
794  * Timestamp structure used for PTP information request
795  * Number of seconds since configured Epoch (if PTP timescale, this is TAI time)
796  */
798  uint32_t sec; //!< Number of seconds and nano seconds since Epoch
799  uint32_t nsec;
800 };
801 
802 /**
803  * Rx and Tx port statistics for the PTP ethernet port
804  */
806  // Do not change the order
807  uint32_t txGoodBytes; //!< Number of Good bytes transmitted.
808  uint32_t txGoodBroadcast; //!< Number of Good Broadcast frames transmitted.
809  uint32_t txGoodMulticast; //!< Number of Good Multicast frames transmitted.
810  uint32_t txGoodUnicast; //!< Number of Good Unicast frames transmitted.
811  uint32_t rxGoodBytes; //!< Number of Good bytes received.
812  uint32_t rxGoodBroadcast; //!< Number of Good Broadcast frames received.
813  uint32_t rxGoodMulticast; //!< Number of Good Multicast frames received.
814  uint32_t rxGoodUnicast; //!< Number of Good Unicast frames received.
815  uint32_t rxGoodLegalLength; //!< Number of Good legal length received with errors received.
816  uint32_t rxFragmented; //!< Number of Fragmented frames received.
817  uint32_t rxJabber; //!< Number of Jabber frames received.
818  uint32_t rxBadBytes; //!< Number of Bad bytes received.
819  uint32_t rxDiscarded; //!< Number of Discarded frames received.
820 };
821 
822 /**
823  * IEEE 1588 PTP clock type
824  */
826  NT_PTP_CLOCK_TYPE_ORDINARY = 0, //!< Ordinary clock slave or master
827  NT_PTP_CLOCK_TYPE_BOUNDARY = 1, //!< Boundary clock
828  NT_PTP_CLOCK_TYPE_P2P_TRANSPARENT = 2, //!< Peer-to-Peer transparent clock
829  NT_PTP_CLOCK_TYPE_E2E_TRANSPARENT = 3, //!< End-to-End transparent clock
830  NT_PTP_CLOCK_TYPE_MANAGEMENT = 4 //!< Management node
831 };
832 
833 /**
834  * Information structure for PTP port
835  */
836 struct NtPTPPort_s {
837  /* Clock description */
838  enum NtPTPClockType_e clockType; //!< Ordinary, boundary or transparent clock
839  uint8_t physicalLayerProtocol[65]; //!< Ethernet IEEE 802.3
840  int16_t physicalAddressLen; //!< Length of physical address
841  uint8_t physicalAdress[6]; //!< Physical address
842  uint8_t protocolAddress[33]; //!< ex. IPv4:10.10.10.50 or Layer2:00:0D:E9:33:22:11
843  uint8_t manufacturerId[3]; //!< Manufacturer identification
844  uint8_t productDescription[129]; //!< Product description
845  uint8_t revisionData[129]; //!< Product revision
846  uint8_t userDescr[129]; //!< User description
847  uint8_t profileId[6]; //!< Configured PTP profile
848  /* PTP ethernet port configuration/status */
849  /* and filter config */
850  enum NtLinkSpeed_e linkSpeed; //!< Current link speed on PTP ethernet port
851  enum NtPTPNetProt_e ptpNetProt; //!< Configured PTP network protocol
852  enum NtPTPFilter_e ptpFilter; //!< Configured PTP filter
853  enum NtPTPProfile_e ptpProfile; //!< The PTP profile configured on this adapter
854  uint32_t ipAddress; //!< IP address
855  uint32_t ipSubmask; //!< IP subnet mask
856  uint32_t ipGateway; //!< IP gateway
857  bool dhcp; //!< DHCP enabled
858  uint16_t vlanId; //!< Configured Vlan Id
859  uint16_t vlanPrio; //!< Configured Vlan priority
860 };
861 
862 
863 
864 /**
865  * IEEE 1588 PTP clock quality
866  */
868  uint8_t clkClass; //!< Clock class
869  uint8_t clkAccuracy; //!< Clock accuracy
870  uint16_t clkVariance; //!< Clock variance
871 };
872 
873 /**
874  * IEEE 1588 PTP Default Data Set
875  */
877  /* Const values */
878  bool twoStepFlag; //!< One or two step clock
879  uint8_t clockId[8]; //!< Clock Id
880  uint16_t NumPorts; //!< Number of ports
881  struct NtPTPclkQuality_s clkQuality; //!< Clock quality
882  /* From configuration of clock */
883  uint8_t priority1; //!< Master priority1 for BMC
884  uint8_t priority2; //!< Master priority2 for BMC
885  uint8_t domain; //!< PTP domain operating in
886  bool slaveOnly; //!< Slave-only identifier
887 };
888 
889 /**
890  * IEEE 1588 PTP Current Data Set
891  */
893  uint16_t stepsRemoved; //!< Steps removed information for BMC
894  int64_t offsFromMaster; //!< Current offset from master
895  int64_t meanPathDelay; //!< Current mean path delay
896 };
897 
898 /**
899  * IEEE 1588 PTP Parent Data Set
900  */
902  uint8_t parentPortId[8]; //!< Parent port identifier
903  bool parentStat; //!< Is observed variance and observed phase change measured
904  uint16_t observedOffsScaledLogVariance; //!< Observed offset variance of the parent clock, measured by this clock
905  int32_t observedPhaseChangeRate; //!< Observed phase change rate of the parent clock, measured by this clock
906  struct NtPTPclkQuality_s gmQuality; //!< Grand Master clock quality
907  uint8_t gmId[8]; //!< Grand Master clock Id
908  uint8_t gmPriority1; //!< Grand Master priority 1
909  uint8_t gmPriority2; //!< Grand Master priority 2
910 
911  /* Proprietary extension */
912  union {
913  struct {
914  uint8_t grandmasterId; //!< Power profile Grand master ID
915  uint32_t grandmasterTimeInaccuracy; //!< Power profile grand master time inacuuracy
916  uint32_t networkTimeInaccuracy; //!< Power profile network time inaccuracy
917  uint8_t keyField; //!< Alternate time offset indicator tlv keyField
918  uint32_t currentOffset; //!< Alternate time offset indicator tlv currentOffset
919  uint32_t jumpSeconds; //!< Alternate time offset indicator tlv jumpSeconds
920  uint64_t timeOfNextJump; //!< Alternate time offset indicator tlv timeOfNextJump
921  char displayName[10]; //!< Alternate time offset indicator tlv displayName
922  } power;
923  struct {
924  uint32_t IPv4_Addr; //!< IP address of Unicast grand master
925  uint8_t ssm_ql; //!< Telecom profile SSM quality level
926  uint8_t priority; //!< The configured priority of current grand master
927  } telecom;
928  } profile; //!< information received on Announce depending on PTP profile used
929 };
930 
931 /**
932  * IEEE 1588 PTP Time Properties Data Set
933  */
935  int16_t currentUtcOffset; //!< Current UTC offset used. This may be from GM or configured if currUtcOffsValid is false
936  bool currUtcOffsValid; //!< Is current UTC offset specified by GM valid
937  bool leap59; //!< True if last minute of current UTC day is 59 sec
938  bool leap61; //!< True if last minute of current UTC day is 61 sec
939  bool timeTraceable; //!< True if timescale and current UTC offset is traceable to a primary source
940  bool frequencyTraceable; //!< True if the frequency determining the timescale is traceable to a primary source
941  bool ptpTimescale; //!< True if GM timescale is PTP
942  enum NtPTPTimeSource_e timeSource; //!< Identifies the source used by the GM
943 };
944 
945 
946 /**
947  * IEEE 1588 PTP Port Data Set
948  */
950  uint8_t portId[8]; //!< Port Identity
951  enum NtPTPPortState_e state; //!< Current PTP port state
952  int64_t peerMeanPathDelay; //!< If using Peer-to-Peer delay mechanism this is the measured P2P propagation delay for this port
953  uint8_t versionNumber; //!< PTP version number of this port
954  /* Configuration */
955  int8_t logMinDelReqInt; //!< Current minimum delay request interval (when E2E used)
956  int8_t logAnnoInt; //!< Current mean announce interval
957  uint8_t announceReceiptTimeout; //!< Configured announce receipt timeout multiplier
958  int8_t logSyncInt; //!< Configured sync interval used in master mode
959  enum NtPTPDelayMech_e delayMechanism; //!< Configured propagation delay mechanism
960  int8_t logMinPDelayReqInt; //!< Configured minimum peer delay request interval (when P2P used)
961 };
962 
963 /**
964  * IEEE 1588 PTP all Data Sets
965  */
967  struct NtPTPdefaultDs_s defaultDs; //!< Default Data Set
968  struct NtPTPcurrentDs_s currentDs; //!< Current Data Set
969  struct NtPTPparentDs_s parentDs; //!< Parent Data Set
970  struct NtPTPtimePropertiesDs_s timePropDs; //!< Time Property Data Set
971  struct NtPTPportDs_s portDs; //!< Port Data Set
972 };
973 
975  int32_t PTPDelayAsymmetry; //!< PTP Delay asymmetry compensation parameter in ns
976 };
977 
978 
979 
980 /**
981  * PTP information structure
982  */
984  bool enabled; //!< Is PTP stack configured to be used (slave, master or ptp pps sampling)
985  struct NtPTPTimestamp_s ts; //!< Timestamp at this info retrieval
986  struct NtPTPPort_s ptpPort; //!< PTP port information structure
987  struct NtPTPDataSets_s ptpDataSets; //!< PTP data sets (according to IEEE1588-2008 spec.)
988  struct NtPTPPortStat_s ptpPortStat; //!< PTP ethernet port statistics
989  struct NtPTPImplCfg_s ptpImplCfg; //!< PTP implementation configuration settings
990 };
991 
992 /**
993  * NT_INFO_CMD_READ_PTP_V2 specific data.
994  */
996  uint8_t adapterNo; //!< The adapter to query
997  uint8_t Reserved1[2];
998  struct NtInfoPTP_v2_s data; //!< Query PTP information structure
999 };
1000 
1001 
1002 
1003 
1010 };
1011 
1012 /**
1013  * Structure to read product information
1014  */
1015 typedef struct NtInfoProductInfo_v2_s {
1016  enum NtProductInfoType_e infoType; //!< Information from Gen 1, Gen 2, NTBPE or Gen 3 adapter
1017  char ProductId[32]; //!< Product ID (P/N)
1018  char SerialNo[2][32]; //!< Serial number (only index 0 used on Gen 1 otherwise 0 = main, 1 = front)
1019  char PbaId[2][32]; //!< PBA ID (only index 0 used on Gen 1 otherwise 0 = main, 1 = front)
1020  char AvrId[2][32]; //!< AVR version (only on Gen 2)
1021  char CpldVersion[32]; //!< CPLD Version
1022  char fpgaId1[40]; //!< FPGA Image #0 ID
1023  char fpgaId2[40]; //!< FPGA Image #1 ID
1024  uint16_t customId; //!< Custom ID
1025  uint8_t userId[8]; //!< User ID
1027 
1028 
1029 /**
1030  * Product info
1031  */
1033  uint8_t adapterNo; //!< Adapter number to query for product information
1034  NtInfoProductInfo_v2_t data; //!< Product Information returned
1035 };
1036 
1037 
1038 /**
1039  * Structure to read NTPL filter usage for gen. 3 adapters
1040  */
1041 typedef struct NtInfoFilterUsage3ga_s {
1042  int32_t sizeCount; //!< Number of frame length filters used
1043  int32_t protocolCount; //!< Number of protocol filters used
1044  int32_t errorCount; //!< Number of error filters used
1045  int32_t patternCount; //!< Number of data filters used
1046  int32_t dynOffsetCount; //!< Number of dynamic offsets used
1047  int32_t group4PlusCount; //!< Number of group filters used combining 4 patterns with 4 different dynamic offsets
1048  int32_t group8Count; //!< Number of group filters used combining 8 patterns with 2 different dynamic offsets
1049  int32_t ipmatchCount; //!< Number of IP match filters used
1050  int32_t ipmatchListOuter; //!< Number of IP match list outer resources used
1051  int32_t ipmatchListInner; //!< Number of IP match list inner resources used
1053 
1054 /**
1055  * Structure to read NTPL filter usage for gen. 4 adapters
1056  */
1057 typedef struct NtInfoFilterUsage4ga_s {
1058  uint32_t categorizerFunctionCount; //!< Number of categorizer functions used
1059  uint32_t sizeCount; //!< Number of frame length comparators used
1060  uint32_t patternExtractorCount; //!< Number of data extractors used
1061  uint32_t patternCompareCount; //!< Number of data comparators used
1062  uint32_t keyMatchCAMUsage; //!< CAM usage in percent
1063  uint32_t keyMatchTCAMUsage; //!< TCAM usage in percent
1065 
1066 typedef struct NtInfoFilterUsage_v1_s {
1067  enum NtAdapterFpgaArchGeneration_e generation; //!< Adapter generation
1068  union {
1071  } u;
1073 
1074 /**
1075  * Filter usage command
1076  */
1078  uint8_t adapterNo; //!< Adapter number to query for filter usage
1079  uint8_t Reserved1[3];
1080  uint32_t ntplId; //!< Ntpl ID to query. 0 will retrieve total usage
1081  NtInfoFilterUsage_v1_t data; //!< Filter usage information returned
1082 };
1083 
1084 /**
1085  * Path delay status codes
1086  */
1088  NT_PATH_DELAY_SUCCESS = 0x0, //!< Returned delay includes both
1089  //!< adapter and NIM contributions.
1090  NT_PATH_DELAY_NOT_SUPPORTED = 0x1, //!< The adapter or NIM is not supported;
1091  //!< the returned delay is set to zero.
1092  NT_PATH_DELAY_LINK_DOWN = 0x2, //!< The link is down;
1093  //!< the returned delay is set to zero.
1094  NT_PATH_DELAY_UNKNOWN_NIM = 0x4, //!< The NIM module is unknown; returned
1095  //!< delay pertains to the adapter/FPGA.
1096 };
1097 
1098 /**
1099  * Structure used for returning port path delay information
1100  */
1101 typedef struct NtInfoPortPathDelay_s {
1102  enum NtPathDelayStatus_e status; //!< status code
1103  int32_t delay; //!< The delay
1105 
1106 /**
1107  * Port path delay command structure
1108  */
1109 #define NT_PATH_DELAY_RX_DIR 0
1110 #define NT_PATH_DELAY_TX_DIR 1
1112  uint8_t portNo; //!< logical port number on which to query path delay
1113  uint8_t direction; //!< NT_PATH_DELAY_RX_DIR or NT_PATH_DELAY_TX_DIR.
1114  uint8_t Reserved1[2];
1115  NtInfoPortPathDelayInfo_t data; //!< Delay information (returned to caller)
1116 };
1117 
1122 };
1123 
1124 typedef struct NtInfoPropertyValue_s {
1125  enum NtPropertyType_e type;
1126  union {
1127  int i;
1128  uint64_t u;
1129  char s[120];
1130  } u;
1132 
1133 /**
1134  * Property request command
1135  */
1137  char path[120];
1139 };
1140 
1141 
1142 /* Include commands for backward compatibility */
1143 #if !defined(_NT_NTAPI_NO_COMPAT)
1144 #include "stream_info_compat.h"
1145 #endif
1146 
1147 
1148 /**
1149  * Read command structure. Query used for info via NT_InfoRead().
1150  */
1151 typedef struct NtInfo_s {
1152  enum NtInfoCmd_e cmd; //!< Info stream command
1153  /**
1154  * Union of data structures for each info stream command
1155  */
1156  union NtInfo_u {
1157  struct NtInfoCmdSystem_s system; //!< NT_INFO_CMD_READ_SYSTEM specific data
1158  struct NtInfoCmdAdapter_v6_s adapter_v6; //!< NT_INFO_CMD_READ_ADAPTER specific data version 5
1159  struct NtInfoCmdSensor_s sensor; //!< NT_INFO_CMD_READ_SENSOR specific data
1160  struct NtInfoCmdHostBuffer_v1_s hostBuffer_v1; //!< NT_INFO_CMD_READ_HOSTBUFFER specific data version 1
1161  struct NtInfoCmdStream_s stream; //!< NT_INFO_CMD_READ_STREAM specific data
1162  struct NtInfoCmdTimeSync_v4_s timeSync_v4; //!< NT_INFO_CMD_READ_TIMESYNC specific data version 4
1163  struct NtInfoCmdTimeSyncStatusExt_s timeSyncExt; //!< NT_INFO_CMD_READ_TIMESYNC_EXT_STATUS specific data
1164  struct NtInfoCmdPort_v9_s port_v9; //!< NT_INFO_CMD_READ_PORT_V9 specific data
1165  struct NtInfoCmdstreamID_s streamID; //!< NT_INFO_CMD_READ_STREAMID specific data
1166  struct NtInfoReadProductInfo_v2_s productInfo_v2;//!< NT_INFO_CMD_READ_PRODUCTINFO specific data version 2
1167  struct NtInfoCmdPTP_v2_s ptp_v2; //!< NT_INFO_CMD_READ_PTP_V2 specific data
1168  struct NtInfoCmdFilterUsage_v1_s filterUsage_v1;//!< NT_INFO_CMD_READ_FILTERUSAGE_V1 specific data
1169  struct NtInfoCmdPortPathDelay_s pathDelay; //!< NT_INFO_CMD_READ_PATH_DELAY specific data
1170  struct NtInfoCmdTimeSyncStat_s timeSyncStat; //!< NT_INFO_CMD_READ_TIMESYNC_STAT specific data
1171  struct NtInfoProperty_s property; //!< NT_INFO_CMD_READ_PROPERTY specific data
1172 #if !defined(_NT_NTAPI_NO_COMPAT)
1173  /* Commands for backward compatibility */
1174  struct NtInfoCmdTimeSync_v1_s timeSync_v1; //!< NT_INFO_CMD_READ_TIMESYNC specific data version 1
1175  struct NtInfoCmdTimeSync_v2_s timeSync_v2; //!< NT_INFO_CMD_READ_TIMESYNC specific data version 2
1176  struct NtInfoCmdTimeSync_v3_s timeSync_v3; //!< NT_INFO_CMD_READ_TIMESYNC specific data version 3
1177  struct NtInfoCmdAdapter_s adapter; //!< NT_INFO_CMD_READ_ADAPTER specific data
1178  struct NtInfoCmdAdapter_v1_s adapter_v1; //!< NT_INFO_CMD_READ_ADAPTER specific data version 1
1179  struct NtInfoCmdPort_s port; //!< NT_INFO_CMD_READ_PORT specific data
1180  struct NtInfoCmdPort_v1_s port_v1; //!< NT_INFO_CMD_READ_PORT_V1 specific data
1181  struct NtInfoCmdTimeSync_s timeSync; //!< NT_INFO_CMD_READ_TIMESYNC specific data
1182  struct NtInfoCmdHostBuffer_s hostBuffer; //!< NT_INFO_CMD_READ_HOSTBUFFER specific data
1183  struct NtInfoCmdAdapter_v2_s adapter_v2; //!< NT_INFO_CMD_READ_ADAPTER specific data version 2
1184  struct NtInfoCmdPort_v2_s port_v2; //!< NT_INFO_CMD_READ_PORT_V2 specific data
1185  struct NtInfoCmdPTP_s ptp; //!< NT_INFO_CMD_READ_PTP specific data
1186  struct NtInfoCmdAdapter_v3_s adapter_v3; //!< NT_INFO_CMD_READ_ADAPTER specific data version 3
1187  struct NtInfoCmdPort_v3_s port_v3; //!< NT_INFO_CMD_READ_PORT_V3 specific data
1188  struct NtInfoCmdAdapter_v4_s adapter_v4; //!< NT_INFO_CMD_READ_ADAPTER_V4 specific data version 4
1189  struct NtInfoCmdPort_v4_s port_v4; //!< NT_INFO_CMD_READ_PORT_V4 specific data
1190  struct NtInfoCmdPTP_v1_s ptp_v1; //!< NT_INFO_CMD_READ_PTP_V1 specific data
1191  struct NtInfoCmdPort_v5_s port_v5; //!< NT_INFO_CMD_READ_PORT_V5 specific data
1192  struct NtInfoCmdAdapter_v5_s adapter_v5; //!< NT_INFO_CMD_READ_ADAPTER specific data version 5
1193  struct NtInfoCmdPort_v6_s port_v6; //!< NT_INFO_CMD_READ_PORT_V6 specific data
1194  struct NtInfoReadProductInfo_s productInfo;//!< NT_INFO_CMD_READ_PRODUCTINFO specific data
1195  struct NtInfoCmdPort_v7_s port_v7; //!< NT_INFO_CMD_READ_PORT_V6 specific data
1196  struct NtInfoReadProductInfo_v1_s productInfo_v1;//!< NT_INFO_CMD_READ_PRODUCTINFO specific data version 1
1197  struct NtInfoCmdFilterUsage_s filterUsage; //!< NT_INFO_CMD_READ_FILTERUSAGE specific data
1198  struct NtInfoCmdPort_v8_s port_v8; //!< NT_INFO_CMD_READ_PORT_V8 specific data
1199 #endif
1200  } u;
1201 } NtInfo_t;
1202 
1203 /**
1204  * Info stream handle
1205  */
1206 typedef struct NtInfoStream_s* NtInfoStream_t;
1207 
1208 /**
1209  * @brief Opens an info stream
1210  *
1211  * This function is called to retrieve a handle to an info stream
1212  *
1213  * @param[out] hStream Reference to an NtInfoStream_t stream pointer
1214  * @param[in] name The stream friendly name - used in, for example, logging statements
1215  *
1216  * @retval 0 Success
1217  * @retval !=0 Error
1218  */
1219 int NT_InfoOpen(NtInfoStream_t *hStream, const char *name);
1220 
1221 /**
1222  * @brief Reads data from an info stream
1223  *
1224  * Returns system stream data
1225  *
1226  * @param[in] hStream NtSystemStream_t handle
1227  * @param[in,out] info The info structure containing query info, which serves as an output buffer for data
1228  *
1229  * @retval 0 Success
1230  * @retval !=0 Error
1231  */
1232 int NT_InfoRead(NtInfoStream_t hStream, NtInfo_t *info);
1233 
1234 /**
1235  * @brief Closes an info stream
1236  *
1237  * This function is called to close an info stream
1238  *
1239  * @param[in] hStream Reference to an NtInfoStream_t stream pointer
1240  *
1241  * @retval 0 Success
1242  * @retval !=0 Error
1243  */
1244 int NT_InfoClose(NtInfoStream_t hStream);
1245 
1246 /** @} */
1247 
1248 #endif // __STREAM_INFO_H__