NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
Common Definitions

Detailed Description

Common definitions and declarations for NVIDIA DRIVE® Update.

Macros

#define DU_UID_COMMON   (0U)
 Drive Update unit ids. More...
 
#define DU_UID_TRANSPORT   (1U)
 Defines the DU-Transport unit id. More...
 
#define DU_UID_LINK   (2U)
 Defines the DU-Link unit id. More...
 
#define DU_UID_TII   (3U)
 Defines the DU-TII unit id. More...
 
#define DU_UID_MASTER   (4U)
 Defines the DU-Master unit id. More...
 
#define DU_UID_BHC   (5U)
 Defines the DU-BHC unit id. More...
 
#define DU_UID_RPE   (6U)
 Defines the DU-RPE unit id. More...
 
#define DU_UID_CCHECK   (7U)
 Defines the DU-CCHECK unit id. More...
 
#define DU_UID_AUTH   (8U)
 Defines the DU-AUTH unit id. More...
 
#define DU_UID_CONTENT   (9U)
 Defines the DU content provider unit id. More...
 
#define DU_UID_DECOMP   (10U)
 Defines the DU-DECOMP unit id. More...
 
#define DU_ECODE(uid, suid, err)   DU_ERR_CODE(uid, suid, err)
 Helper macro to define a unique error code, in which uid is the unit id, suid is the sub-unit id and err is an integer code. More...
 
#define DU_ERR_UID_OFFSET   (24U)
 Offset of UID in DU_ERR_CODE. More...
 
#define DU_ERR_UID_MASK   ((uint32_t) 0xFFU)
 Mask of UID in DU_ERR_CODE. More...
 
#define DU_ERR_SUID_OFFSET   (20U)
 Offset of SUID in DU_ERR_CODE. More...
 
#define DU_ERR_SUID_MASK   ((uint32_t) 0xFU)
 Mask of SUID in DU_ERR_CODE. More...
 
#define DU_ERR_MASK   ((uint32_t) 0xFFFFFU)
 Mask of ERR in DU_ERR_CODE. More...
 
#define DU_ERR_CODE(uid, suid, err)
 Generates a unique error code. More...
 
#define DU_ECODE_GET_UID(rcode)   (((rcode) >> 24U) & 0xFFU)
 Gets the unit id. More...
 
#define DU_ECODE_GET_SUID(rcode)   (((rcode) >> 20U) & 0xFU)
 Gets the sub-unit. More...
 
#define DU_ECODE_GET_ERR(rcode)   ((rcode) & 0xFFFFFU)
 Gets the integer error code. More...
 
#define DU_OK   (DU_RCODE)(0U)
 Defines the success code. More...
 
#define DUCOMMON_ECODE(err)   DU_ECODE(DU_UID_COMMON, 0U, (err))
 
#define DUCOMMON_ERR_GENERIC   DUCOMMON_ECODE(1U)
 
#define DUCOMMON_ERR_INVALID_ARGUMENT   DUCOMMON_ECODE(2U)
 
#define DUCOMMON_ERR_NOT_FOUND   DUCOMMON_ECODE(3U)
 
#define DUCOMMON_ERR_BUFFER_TOO_SMALL   DUCOMMON_ECODE(4U)
 
#define DUCOMMON_ERR_SYNTAX   DUCOMMON_ECODE(5U)
 
#define DU_STR_LONG_BUF_SIZE   (128U)
 Defines the default long string buffer size. More...
 
#define DU_STR_SHORT_BUF_SIZE   (32U)
 Defines the default short string buffer size. More...
 
#define DU_PATH_MAX   (512U)
 Defines the max path size. More...
 
#define DU_MAX_CMD_LEN   (512U)
 Defines the max command length. More...
 
#define DU_1KB   (1024U)
 Defines the buffer size of 1KB. More...
 
#define DU_2KB   (2U * DU_1KB)
 Defines the buffer size of 2KB. More...
 
#define DU_4KB   (4U * DU_1KB)
 Defines the buffer size of 4KB. More...
 
#define DU_8KB   (8U * DU_1KB)
 Defines the buffer size of 8KB. More...
 
#define DU_16KB   (16U * DU_1KB)
 Defines the buffer size of 16KB. More...
 
#define DU_32KB   (32U * DU_1KB)
 Defines the buffer size of 32KB. More...
 
#define DU_64KB   (64U * DU_1KB)
 Defines the buffer size of 64KB. More...
 
#define DU_128KB   (128U * DU_1KB)
 Defines the buffer size of 128KB. More...
 
#define DU_256KB   (256U * DU_1KB)
 Defines the buffer size of 256KB. More...
 
#define DU_512KB   (512U * DU_1KB)
 Defines the buffer size of 512KB. More...
 
#define DU_1MB   (1024U * DU_1KB)
 Defines the buffer size of 1MB. More...
 
#define DU_RUNLEVEL_STR_MAX_SIZE   (16U)
 Defines the max size of the run level string. More...
 

Typedefs

typedef uint32_t DU_RCODE
 Drive Update error codes. More...
 
typedef enum DU_RUN_LEVEL DU_RUN_LEVEL
 Defines the run level. More...
 

Enumerations

enum  DU_RUN_LEVEL {
  RL_DORMANT = 0U,
  RL_MONITOR,
  RL_TELECAST,
  RL_XFER,
  RL_BG_APPLY,
  RL_FULL_APPLY,
  RL_UNRESTRICTED,
  RL_INVALID
}
 Defines the run level. More...
 

Macro Definition Documentation

◆ DU_128KB

#define DU_128KB   (128U * DU_1KB)

Defines the buffer size of 128KB.

Definition at line 149 of file ducommon.h.

◆ DU_16KB

#define DU_16KB   (16U * DU_1KB)

Defines the buffer size of 16KB.

Definition at line 143 of file ducommon.h.

◆ DU_1KB

#define DU_1KB   (1024U)

Defines the buffer size of 1KB.

Definition at line 135 of file ducommon.h.

◆ DU_1MB

#define DU_1MB   (1024U * DU_1KB)

Defines the buffer size of 1MB.

Definition at line 155 of file ducommon.h.

◆ DU_256KB

#define DU_256KB   (256U * DU_1KB)

Defines the buffer size of 256KB.

Definition at line 151 of file ducommon.h.

◆ DU_2KB

#define DU_2KB   (2U * DU_1KB)

Defines the buffer size of 2KB.

Definition at line 137 of file ducommon.h.

◆ DU_32KB

#define DU_32KB   (32U * DU_1KB)

Defines the buffer size of 32KB.

Definition at line 145 of file ducommon.h.

◆ DU_4KB

#define DU_4KB   (4U * DU_1KB)

Defines the buffer size of 4KB.

Definition at line 139 of file ducommon.h.

◆ DU_512KB

#define DU_512KB   (512U * DU_1KB)

Defines the buffer size of 512KB.

Definition at line 153 of file ducommon.h.

◆ DU_64KB

#define DU_64KB   (64U * DU_1KB)

Defines the buffer size of 64KB.

Definition at line 147 of file ducommon.h.

◆ DU_8KB

#define DU_8KB   (8U * DU_1KB)

Defines the buffer size of 8KB.

Definition at line 141 of file ducommon.h.

◆ DU_ECODE

#define DU_ECODE (   uid,
  suid,
  err 
)    DU_ERR_CODE(uid, suid, err)

Helper macro to define a unique error code, in which uid is the unit id, suid is the sub-unit id and err is an integer code.

Definition at line 80 of file ducommon.h.

◆ DU_ECODE_GET_ERR

#define DU_ECODE_GET_ERR (   rcode)    ((rcode) & 0xFFFFFU)

Gets the integer error code.

Definition at line 108 of file ducommon.h.

◆ DU_ECODE_GET_SUID

#define DU_ECODE_GET_SUID (   rcode)    (((rcode) >> 20U) & 0xFU)

Gets the sub-unit.

Definition at line 106 of file ducommon.h.

◆ DU_ECODE_GET_UID

#define DU_ECODE_GET_UID (   rcode)    (((rcode) >> 24U) & 0xFFU)

Gets the unit id.

Definition at line 104 of file ducommon.h.

◆ DU_ERR_CODE

#define DU_ERR_CODE (   uid,
  suid,
  err 
)
Value:
((err) & DU_ERR_MASK))

Generates a unique error code.

Definition at line 98 of file ducommon.h.

◆ DU_ERR_MASK

#define DU_ERR_MASK   ((uint32_t) 0xFFFFFU)

Mask of ERR in DU_ERR_CODE.

Definition at line 95 of file ducommon.h.

◆ DU_ERR_SUID_MASK

#define DU_ERR_SUID_MASK   ((uint32_t) 0xFU)

Mask of SUID in DU_ERR_CODE.

Definition at line 92 of file ducommon.h.

◆ DU_ERR_SUID_OFFSET

#define DU_ERR_SUID_OFFSET   (20U)

Offset of SUID in DU_ERR_CODE.

Definition at line 89 of file ducommon.h.

◆ DU_ERR_UID_MASK

#define DU_ERR_UID_MASK   ((uint32_t) 0xFFU)

Mask of UID in DU_ERR_CODE.

Definition at line 86 of file ducommon.h.

◆ DU_ERR_UID_OFFSET

#define DU_ERR_UID_OFFSET   (24U)

Offset of UID in DU_ERR_CODE.

Definition at line 83 of file ducommon.h.

◆ DU_MAX_CMD_LEN

#define DU_MAX_CMD_LEN   (512U)

Defines the max command length.

Definition at line 132 of file ducommon.h.

◆ DU_OK

#define DU_OK   (DU_RCODE)(0U)

Defines the success code.

Definition at line 111 of file ducommon.h.

◆ DU_PATH_MAX

#define DU_PATH_MAX   (512U)

Defines the max path size.

Definition at line 129 of file ducommon.h.

◆ DU_RUNLEVEL_STR_MAX_SIZE

#define DU_RUNLEVEL_STR_MAX_SIZE   (16U)

Defines the max size of the run level string.

Definition at line 206 of file ducommon.h.

◆ DU_STR_LONG_BUF_SIZE

#define DU_STR_LONG_BUF_SIZE   (128U)

Defines the default long string buffer size.

Definition at line 123 of file ducommon.h.

◆ DU_STR_SHORT_BUF_SIZE

#define DU_STR_SHORT_BUF_SIZE   (32U)

Defines the default short string buffer size.

Definition at line 126 of file ducommon.h.

◆ DU_UID_AUTH

#define DU_UID_AUTH   (8U)

Defines the DU-AUTH unit id.

Definition at line 60 of file ducommon.h.

◆ DU_UID_BHC

#define DU_UID_BHC   (5U)

Defines the DU-BHC unit id.

Definition at line 54 of file ducommon.h.

◆ DU_UID_CCHECK

#define DU_UID_CCHECK   (7U)

Defines the DU-CCHECK unit id.

Definition at line 58 of file ducommon.h.

◆ DU_UID_COMMON

#define DU_UID_COMMON   (0U)

Drive Update unit ids.

The unit id can be used to generate a unique error code for each unit. The range of the unit id is from 0 to 255, in which 0-127 are reserved by DRIVE Update's released units, and 128-255 can be used by the plug-ins implemented by the user.

Defines the common code unit id.

Definition at line 44 of file ducommon.h.

◆ DU_UID_CONTENT

#define DU_UID_CONTENT   (9U)

Defines the DU content provider unit id.

Definition at line 62 of file ducommon.h.

◆ DU_UID_DECOMP

#define DU_UID_DECOMP   (10U)

Defines the DU-DECOMP unit id.

Definition at line 64 of file ducommon.h.

◆ DU_UID_LINK

#define DU_UID_LINK   (2U)

Defines the DU-Link unit id.

Definition at line 48 of file ducommon.h.

◆ DU_UID_MASTER

#define DU_UID_MASTER   (4U)

Defines the DU-Master unit id.

Definition at line 52 of file ducommon.h.

◆ DU_UID_RPE

#define DU_UID_RPE   (6U)

Defines the DU-RPE unit id.

Definition at line 56 of file ducommon.h.

◆ DU_UID_TII

#define DU_UID_TII   (3U)

Defines the DU-TII unit id.

Definition at line 50 of file ducommon.h.

◆ DU_UID_TRANSPORT

#define DU_UID_TRANSPORT   (1U)

Defines the DU-Transport unit id.

Definition at line 46 of file ducommon.h.

◆ DUCOMMON_ECODE

#define DUCOMMON_ECODE (   err)    DU_ECODE(DU_UID_COMMON, 0U, (err))

Definition at line 114 of file ducommon.h.

◆ DUCOMMON_ERR_BUFFER_TOO_SMALL

#define DUCOMMON_ERR_BUFFER_TOO_SMALL   DUCOMMON_ECODE(4U)

Definition at line 119 of file ducommon.h.

◆ DUCOMMON_ERR_GENERIC

#define DUCOMMON_ERR_GENERIC   DUCOMMON_ECODE(1U)

Definition at line 116 of file ducommon.h.

◆ DUCOMMON_ERR_INVALID_ARGUMENT

#define DUCOMMON_ERR_INVALID_ARGUMENT   DUCOMMON_ECODE(2U)

Definition at line 117 of file ducommon.h.

◆ DUCOMMON_ERR_NOT_FOUND

#define DUCOMMON_ERR_NOT_FOUND   DUCOMMON_ECODE(3U)

Definition at line 118 of file ducommon.h.

◆ DUCOMMON_ERR_SYNTAX

#define DUCOMMON_ERR_SYNTAX   DUCOMMON_ECODE(5U)

Definition at line 120 of file ducommon.h.

Typedef Documentation

◆ DU_RCODE

typedef uint32_t DU_RCODE

Drive Update error codes.

The error code type is defined as an unsigned 32-bit integer. There are two classes of error codes: common codes and unit specific codes. The common error codes can be applied to multiple units, while the unit specific error codes is applied to one certain unit only.

Definition at line 74 of file ducommon.h.

◆ DU_RUN_LEVEL

typedef enum DU_RUN_LEVEL DU_RUN_LEVEL

Defines the run level.

Enumeration Type Documentation

◆ DU_RUN_LEVEL

Defines the run level.

Enumerator
RL_DORMANT 

Dormant run level (default).

No connectivity or any activity allowed. The only command that can be issued in this runlevel is a transition to a higher runlevel.

RL_MONITOR 

Monitor run level.

Allowed for connection to the cloud, checks for new available updates and Small size telemetrics upload. No large data transfers or update installations.

RL_TELECAST 

Telecast run level.

Similar to RL_MONITOR and allowed for larger telemetrics uploads. No installation or download of updates allowed. System performance may be affected due to shared resource utilization such as internet and disk activity.

RL_XFER 

Transfer run level.

Similar to RL_TELECAST and allowed for Update download/pre-fetch. No installation of updates allowed. System performance may further be affected due to shared resource utilization such as internet and disk activity.

RL_BG_APPLY 

Background apply run level.

Similar to RL_XFER and allowed for Background installation of updates. No functionality may be disabled at any time. System performance may be affected due to heavy shared resource utilization such as internet, disk and other resource activity.

RL_FULL_APPLY 

Full apply run level.

Similar to RL_BG_APPLY and allowed for Complete update installation activities. System may temporarily be unavailable (e.g. reboots or taking components offline to update).

RL_UNRESTRICTED 

Unrestricted run level.

Similar to RL_FULL_APPLY and allowed for Unrestricted update installation activities. Only used for very major updates, such as first level repartitioning or storage failure recovery.

RL_INVALID 

Invalid run level.

Definition at line 159 of file ducommon.h.

DU_RCODE
uint32_t DU_RCODE
Drive Update error codes.
Definition: ducommon.h:74
DU_ERR_SUID_OFFSET
#define DU_ERR_SUID_OFFSET
Offset of SUID in DU_ERR_CODE.
Definition: ducommon.h:89
DU_ERR_MASK
#define DU_ERR_MASK
Mask of ERR in DU_ERR_CODE.
Definition: ducommon.h:95
DU_ERR_SUID_MASK
#define DU_ERR_SUID_MASK
Mask of SUID in DU_ERR_CODE.
Definition: ducommon.h:92
DU_ERR_UID_OFFSET
#define DU_ERR_UID_OFFSET
Offset of UID in DU_ERR_CODE.
Definition: ducommon.h:83
DU_ERR_UID_MASK
#define DU_ERR_UID_MASK
Mask of UID in DU_ERR_CODE.
Definition: ducommon.h:86