NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release

Detailed Description

Macros

#define NVPPS_GETVERSION   _IOR('p', 0x1, struct nvpps_version *)
 Get NVPPS driver and API version information. More...
 
#define NVPPS_GETPARAMS   _IOR('p', 0x2, struct nvpps_params *)
 Get current NVPPS driver configuration parameters. More...
 
#define NVPPS_SETPARAMS   _IOW('p', 0x3, struct nvpps_params *)
 Set NVPPS driver configuration parameters. More...
 
#define NVPPS_GETEVENT   _IOR('p', 0x4, struct nvpps_timeevent *)
 Get precision timestamped PPS event data. More...
 
#define NVPPS_GETTIMESTAMP   _IOWR('p', 0x5, struct nvpps_timestamp_struct *)
 Get kernel and hardware PTP timestamps. More...
 

Macro Definition Documentation

◆ NVPPS_GETEVENT

#define NVPPS_GETEVENT   _IOR('p', 0x4, struct nvpps_timeevent *)

Get precision timestamped PPS event data.

Behaviour of IOCTL and user expectations:

  • Returns high-precision timestamps correlated between PTP and TSC domains
  • Event number (evt_nb) increments for each captured event
  • TSC timestamp value interpretation depends on tsc_mode setting
  • PTP timestamps are in nanoseconds since epoch
  • IRQ latency measurement included for timing analysis
  • Secondary PTP timestamp available on supported platforms
  • If failure to read concurrent time from PTP interface will result in corresponding value being set as 0
Parameters
[out]eventPointer to struct nvpps_timeevent where event data will be stored. The memory for this structure shall be allocated by the caller.
Returns
  • 0 for success
  • -EFAULT if user pointer is invalid
Precondition
  • Device file must be opened successfully
  • Valid configuration must be set via NVPPS_SETPARAMS
  • PPS signal source must be connected (for GPIO mode)
  • PTP client & server daemon should be running on primary & secondary network interfaces This is needed because only after starting PTP client & server dameons on primary & secondary interfaces respectively, the tegra network drivers register its interface to read concurrent PTP-TSC timestamps of the PTP network interface. If this IOCTL is excersized before starting the PTP dameons, then the timestamp fields will be set to 0 values and an error msg to indicate PTP is not running on Primary and/or secondary network interface is shown in the kernel dmesg log.
Postcondition
None


Usage considerations

  • Allowed context for the IOCTL call
    • Signal handler: No
    • Thread-safe: Yes (each file descriptor maintains separate event queue)
    • Re-entrant: Yes
    • Async/Sync: Sync (blocking) or Async (non-blocking with poll/select)
  • Required privileges:
    • Caller must be part of group nvpps
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA

Definition at line 203 of file nvpps_ioctl.h.

◆ NVPPS_GETPARAMS

#define NVPPS_GETPARAMS   _IOR('p', 0x2, struct nvpps_params *)

Get current NVPPS driver configuration parameters.

Behaviour of IOCTL and user expectations:

  • Returns the current event mode (GPIO or Timer based)
  • Returns the current TSC mode (nanoseconds or counter values)
Parameters
[out]paramsPointer to struct nvpps_params where current configuration will be stored. The memory for this structure shall be allocated by the caller.
Returns
  • 0 for success
  • -EFAULT if user pointer is invalid
Precondition
Device file must be opened successfully
Postcondition
None


Usage considerations

  • Allowed context for the IOCTL call
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges:
    • Caller must be part of group nvpps
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

Definition at line 98 of file nvpps_ioctl.h.

◆ NVPPS_GETTIMESTAMP

#define NVPPS_GETTIMESTAMP   _IOWR('p', 0x5, struct nvpps_timestamp_struct *)

Get kernel and hardware PTP timestamps.

Behaviour of IOCTL and user expectations:

  • Provides timestamps of kernel clock and hardware PTP clock
  • Supports multiple clock sources via clockid parameter
  • Hardware PTP timestamp represents the actual PTP clock time in Primary PTP interface
  • Kernel timestamp represents corresponding system MONOTONIC or REALTIME time based on clockid passed
  • Extra fields reserved for future extensions
Parameters
[in,out]timestampPointer to struct nvpps_timestamp_struct. Input: clockid field must be set to desired clock source Identifier Output: kernel_ts and hw_ptp_ts fields populated with timestamps The memory for this structure shall be allocated by the caller.
Returns
  • 0 for success
  • -EFAULT if user pointer is invalid
  • -EINVAL if clockid is invalid or unsupported
  • -ERANGE if timestamp values exceed representable range
  • -ve value if anyother error from Kernel calls
Precondition
  • Device file must be opened successfully
  • PTP hardware must be initialized and available
  • Valid values for clockid (CLOCK_MONOTONIC or CLOCK_REALTIME) must be specified
  • PTP client daemon should be running on primary interfaces. This is needed because only after starting PTP client daemon on the primary PTP interface the tegra network driver registers its interface to read PTP time from primary PTP interface. If this IOCTL is excersized before starting the PTP client daemon, then the value returned in PTP timestamp field will be set to 0 and an error msg is shown in the kernel dmesg log.
Postcondition
None


Usage considerations

  • Allowed context for the IOCTL call
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges:
    • Caller must be part of group nvpps
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA

Definition at line 260 of file nvpps_ioctl.h.

◆ NVPPS_GETVERSION

#define NVPPS_GETVERSION   _IOR('p', 0x1, struct nvpps_version *)

Get NVPPS driver and API version information.

Behaviour of IOCTL and user expectations:

  • This IOCTL returns both driver version and API version information
  • Driver version indicates the implementation version
  • API version indicates the interface compatibility level
  • Version information is read-only and constant for a given driver build
Parameters
[out]versionPointer to struct nvpps_version where version information will be stored. The memory for this structure shall be allocated by the caller.
Returns
  • 0 for success
  • -EFAULT if user pointer is invalid
Precondition
Device file must be opened successfully
Postcondition
None


Usage considerations

  • Allowed context for the IOCTL call
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges:
    • Caller must be part of group nvpps
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

Definition at line 58 of file nvpps_ioctl.h.

◆ NVPPS_SETPARAMS

#define NVPPS_SETPARAMS   _IOW('p', 0x3, struct nvpps_params *)

Set NVPPS driver configuration parameters.

Behaviour of IOCTL and user expectations:

  • Sets the event mode: NVPPS_MODE_GPIO (0x01) or NVPPS_MODE_TIMER (0x02)
  • Sets the TSC mode: NVPPS_TSC_NSEC (0) or NVPPS_TSC_COUNTER (1)
  • Invalid mode requests will be rejected
  • GPIO mode requires valid GPIO pin configuration in device tree
Parameters
[in]paramsPointer to struct nvpps_params containing desired configuration to be set. The memory for this structure shall be allocated and initialized by the caller.
Returns
  • 0 for success
  • -EFAULT if user pointer is invalid
  • -EINVAL for invalid parameter values
  • -ERANGE in Timer mode case, if there is overflow when calculating next timeout
  • -ve value for anyother error from kernel calls eg: devm_request_irq
Precondition
  • Device file must be opened successfully
  • No active PPS event capture should be in progress
Postcondition
  • It is recommended to ensure that at least one full event generation cycle has completed before invoking NVPPS_SETPARAMS again, in order to prevent loss of timestamp capture events


Usage considerations

  • Allowed context for the IOCTL call
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No (configuration changes are serialized)
    • Async/Sync: Sync
  • Required privileges:
    • Caller must be part of group nvpps
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

Definition at line 147 of file nvpps_ioctl.h.