NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
nvsciipc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
3  *
4  * NVIDIA CORPORATION and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA CORPORATION is strictly prohibited.
9  */
10 
11 #ifndef INCLUDED_NVSCIIPC_H
12 #define INCLUDED_NVSCIIPC_H
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 #include <stdint.h>
19 #include <stddef.h>
20 #include "nvscierror.h"
21 #include "nvscievent.h"
22 
66 /* use constant global version variable instead of macro for consistency with
67  * version check API of existing NvSci family
68  */
69 
71 static const uint32_t NvSciIpcMajorVersion = 1U;
72 
74 static const uint32_t NvSciIpcMinorVersion = 4U;
75 
252 #ifdef __QNX__
253 /*******************************************************************/
254 /********************* ACCESS CONTROL ******************************/
255 /*******************************************************************/
256 
295 #endif /* __QNX___ */
296 
297 /*******************************************************************/
298 /************************ DATA TYPES *******************************/
299 /*******************************************************************/
300 
304 typedef uint64_t NvSciIpcEndpoint;
305 
307 
313  uint32_t nframes;
315  uint32_t frame_size;
316 };
317 
322 #define NVSCIIPC_MAX_ENDPOINT_NAME 64U
323 
324 /* NvSciIPC Event type */
326 #define NV_SCI_IPC_EVENT_READ 0x01U
327 
328 #define NV_SCI_IPC_EVENT_WRITE 0x02U
329 
330 #define NV_SCI_IPC_EVENT_CONN_EST 0x04U
331 
332 #define NV_SCI_IPC_EVENT_CONN_RESET 0x08U
333 
334 #define NV_SCI_IPC_EVENT_WRITE_EMPTY 0x10U
335 
336 #define NV_SCI_IPC_EVENT_ASYNC_ERROR 0x20U
337 
338 #define NV_SCI_IPC_EVENT_CONN_EST_ALL (NV_SCI_IPC_EVENT_CONN_EST | \
339  NV_SCI_IPC_EVENT_WRITE | NV_SCI_IPC_EVENT_WRITE_EMPTY | \
340  NV_SCI_IPC_EVENT_READ)
341 
343 #define NVSCIIPC_INFINITE_WAIT -1LL
344 
345 /* NvSciIpc Asynchronous erros */
347 #define NV_SCI_ASYNC_PCIE_EDMA_XFER_ERROR 0x1U
348 
349 #define NV_SCI_ASYNC_PCIE_AER_UNCORRECTABLE_FATAL 0x2U
350 
351 #define NV_SCI_ASYNC_PCIE_AER_UNCORRECTABLE_NONFATAL 0x4U
352 
353 #define NV_SCI_ASYNC_PCIE_VALIDATION_ERROR 0x8U
354 
355 /*******************************************************************/
356 /********************* FUNCTION TYPES ******************************/
357 /*******************************************************************/
358 
384 
414 void NvSciIpcDeinit(void);
415 
475 
538  NvSciIpcEndpoint *handle, NvSciEventService *eventService);
539 
582  NvSciEventNotifier **eventNotifier);
583 
592 
640 
649 
693 
701 NvSciError NvSciIpcRead(NvSciIpcEndpoint handle, void *buf, size_t size,
702  int32_t *bytes);
703 
753 NvSciError NvSciIpcReadSafe(NvSciIpcEndpoint handle, void *buf, uint32_t size,
754  uint32_t *bytes);
755 
811  const volatile void **buf);
812 
856 
864 NvSciError NvSciIpcWrite(NvSciIpcEndpoint handle, const void *buf, size_t size,
865  int32_t *bytes);
866 
918  uint32_t size, uint32_t *bytes);
919 
972  volatile void **buf);
973 
1022 
1055  NvSciIpcEndpointInfo *info);
1056 
1057 #ifndef __QNX__
1058 
1091 #endif /* !__QNX__ */
1092 
1101 
1204 
1205 #if defined(__QNX__)
1206 
1272 int32_t NvSciIpcWaitEventQnx(int32_t chid, int64_t microseconds, uint32_t bytes,
1273  void *pulse);
1274 
1283 NvSciError NvSciIpcSetQnxPulseParam(NvSciIpcEndpoint handle,
1284  int32_t coid, int16_t pulsePriority, int16_t pulseCode,
1285  void *pulseValue);
1286 
1352 NvSciError NvSciIpcSetQnxPulseParamSafe(NvSciIpcEndpoint handle,
1353  int32_t coid, int16_t pulsePriority, int16_t pulseCode);
1354 
1355 
1406 NvSciError NvSciIpcInspectEventQnx(int32_t chid, uint16_t numEvents,
1407  uint32_t epCount, NvSciIpcEndpoint **epHandleArray);
1408 #endif /* __QNX__ */
1409 
1449 
1500 
1536  uint32_t majorVer,
1537  uint32_t minorVer,
1538  bool* isCompatible);
1539 
1543 #ifdef __cplusplus
1544 }
1545 #endif
1546 #endif /* INCLUDED_NVSCIIPC_H */
1547 
NvSciError
NvSciError
Return/error codes for all NvSci functions.
Definition: nvscierror.h:45
NvSciIpcWriteAdvance
NvSciError NvSciIpcWriteAdvance(NvSciIpcEndpoint handle)
Advance to the next write frame of the endpoint.
nvscievent.h
NVIDIA Software Communications Interface (SCI) : NvSci Event Service
NvSciIpcDeinit
void NvSciIpcDeinit(void)
De-initializes the NvSciIpc library.
NvSciIpcCloseEndpoint
void NvSciIpcCloseEndpoint(NvSciIpcEndpoint handle)
Closes an endpoint with the given handle.
NvSciIpcGetEndpointInfo
NvSciError NvSciIpcGetEndpointInfo(NvSciIpcEndpoint handle, NvSciIpcEndpointInfo *info)
Returns endpoint information.
NvSciIpcOpenEndpoint
NvSciError NvSciIpcOpenEndpoint(const char *endpoint, NvSciIpcEndpoint *handle)
Opens an endpoint with the given name.
NvSciIpcGetEventSafe
NvSciError NvSciIpcGetEventSafe(NvSciIpcEndpoint handle, uint32_t *events)
Get Events (safety version)
NvSciIpcOpenEndpointWithEventService
NvSciError NvSciIpcOpenEndpointWithEventService(const char *endpoint, NvSciIpcEndpoint *handle, NvSciEventService *eventService)
Opens an endpoint with the given name and event service.
NvSciIpcRead
NvSciError NvSciIpcRead(NvSciIpcEndpoint handle, void *buf, size_t size, int32_t *bytes)
Reads a frame from the endpoint.
NvSciEventNotifier
An abstract interface to notify event to event consumer and to register event handler of the event co...
Definition: nvscievent.h:424
NvSciIpcGetLinuxEventFd
NvSciError NvSciIpcGetLinuxEventFd(NvSciIpcEndpoint handle, int32_t *fd)
Returns the NvSciIpc file descriptor for a given endpoint.
handle
const WFDCommitType const WFDHandle handle
Definition: wfdext.h:124
NvSciIpcReadAdvance
NvSciError NvSciIpcReadAdvance(NvSciIpcEndpoint handle)
Advance to the next read frame of the endpoint.
NvSciIpcResetEndpointSafe
NvSciError NvSciIpcResetEndpointSafe(NvSciIpcEndpoint handle)
Resets an endpoint.
NvSciIpcResetEndpoint
void NvSciIpcResetEndpoint(NvSciIpcEndpoint handle)
Resets an endpoint.
NvSciIpcGetEvent
NvSciError NvSciIpcGetEvent(NvSciIpcEndpoint handle, uint32_t *events)
Get Events.
NvSciIpcEnableNotification
NvSciError NvSciIpcEnableNotification(NvSciIpcEndpoint handle, bool flag)
Enable event notification (or polling)
NvSciIpcReadGetNextFrame
NvSciError NvSciIpcReadGetNextFrame(NvSciIpcEndpoint handle, const volatile void **buf)
Get a pointer to the read frame from the endpoint.
NvSciIpcEndpoint
uint64_t NvSciIpcEndpoint
Handle to the NvSciIpc endpoint.
Definition: nvsciipc.h:304
NvSciIpcReadSafe
NvSciError NvSciIpcReadSafe(NvSciIpcEndpoint handle, void *buf, uint32_t size, uint32_t *bytes)
Reads a frame from the endpoint (safety version)
NvSciIpcMinorVersion
static const uint32_t NvSciIpcMinorVersion
NvSciIpc API Minor version number.
Definition: nvsciipc.h:74
NvSciIpcWriteGetNextFrame
NvSciError NvSciIpcWriteGetNextFrame(NvSciIpcEndpoint handle, volatile void **buf)
Get a pointer to the write frame from the endpoint.
NvSciIpcInit
NvSciError NvSciIpcInit(void)
Initializes the NvSciIpc library.
NvSciIpcCloseEndpointSafe
NvSciError NvSciIpcCloseEndpointSafe(NvSciIpcEndpoint handle, bool clear)
Closes an endpoint with the given handle (safety version)
NvSciIpcWrite
NvSciError NvSciIpcWrite(NvSciIpcEndpoint handle, const void *buf, size_t size, int32_t *bytes)
Writes a frame to the endpoint.
NvSciIpcEndpointInfo::frame_size
uint32_t frame_size
Holds the frame size in bytes.
Definition: nvsciipc.h:315
NvSciIpcGetEventNotifier
NvSciError NvSciIpcGetEventNotifier(NvSciIpcEndpoint handle, NvSciEventNotifier **eventNotifier)
Get NvSciIpc event notifier.
nvscierror.h
NvSciIpcCheckVersionCompatibility
NvSciError NvSciIpcCheckVersionCompatibility(uint32_t majorVer, uint32_t minorVer, bool *isCompatible)
Check NvSciIpc library version compatibility.
NvSciIpcGetAsyncErrors
NvSciError NvSciIpcGetAsyncErrors(NvSciIpcEndpoint handle, uint32_t *errors)
Get asynchronouse errors.
NvSciIpcEndpointInfo::nframes
uint32_t nframes
Holds the number of frames.
Definition: nvsciipc.h:313
NvSciIpcEndpointInfo
Defines information about the NvSciIpc endpoint.
Definition: nvsciipc.h:311
NvSciIpcMajorVersion
static const uint32_t NvSciIpcMajorVersion
NvSciIpc API Major version number.
Definition: nvsciipc.h:71
NvSciIpcWriteSafe
NvSciError NvSciIpcWriteSafe(NvSciIpcEndpoint handle, const void *buf, uint32_t size, uint32_t *bytes)
Writes a frame to the endpoint.
NvSciEventService
An abstract interface for a program's event handling infrastructure.
Definition: nvscievent.h:270