NVIDIA DRIVE OS Linux SDK API Reference

6.0.10.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 /*******************************************************************/
253 /********************* ACCESS CONTROL ******************************/
254 /*******************************************************************/
255 
295 /*******************************************************************/
296 /************************ DATA TYPES *******************************/
297 /*******************************************************************/
298 
302 typedef uint64_t NvSciIpcEndpoint;
303 
305 
311  uint32_t nframes;
313  uint32_t frame_size;
314 };
315 
320 #define NVSCIIPC_MAX_ENDPOINT_NAME 64U
321 
322 /* NvSciIPC Event type */
324 #define NV_SCI_IPC_EVENT_READ 0x01U
325 
326 #define NV_SCI_IPC_EVENT_WRITE 0x02U
327 
328 #define NV_SCI_IPC_EVENT_CONN_EST 0x04U
329 
330 #define NV_SCI_IPC_EVENT_CONN_RESET 0x08U
331 
332 #define NV_SCI_IPC_EVENT_WRITE_EMPTY 0x10U
333 
334 #define NV_SCI_IPC_EVENT_ASYNC_ERROR 0x20U
335 
336 #define NV_SCI_IPC_EVENT_CONN_EST_ALL (NV_SCI_IPC_EVENT_CONN_EST | \
337  NV_SCI_IPC_EVENT_WRITE | NV_SCI_IPC_EVENT_WRITE_EMPTY | \
338  NV_SCI_IPC_EVENT_READ)
339 
341 #define NVSCIIPC_INFINITE_WAIT -1LL
342 
343 /* NvSciIpc Asynchronous erros */
345 #define NV_SCI_ASYNC_PCIE_EDMA_XFER_ERROR 0x1U
346 
347 #define NV_SCI_ASYNC_PCIE_AER_UNCORRECTABLE_FATAL 0x2U
348 
349 #define NV_SCI_ASYNC_PCIE_AER_UNCORRECTABLE_NONFATAL 0x4U
350 
351 #define NV_SCI_ASYNC_PCIE_VALIDATION_ERROR 0x8U
352 
353 /*******************************************************************/
354 /********************* FUNCTION TYPES ******************************/
355 /*******************************************************************/
356 
382 
412 void NvSciIpcDeinit(void);
413 
472 NvSciError NvSciIpcOpenEndpoint(const char *endpoint, NvSciIpcEndpoint *handle);
473 
536  NvSciIpcEndpoint *handle, NvSciEventService *eventService);
537 
580  NvSciEventNotifier **eventNotifier);
581 
590 
638 
647 
691 
699 NvSciError NvSciIpcRead(NvSciIpcEndpoint handle, void *buf, size_t size,
700  int32_t *bytes);
701 
751 NvSciError NvSciIpcReadSafe(NvSciIpcEndpoint handle, void *buf, uint32_t size,
752  uint32_t *bytes);
753 
809  const volatile void **buf);
810 
854 
862 NvSciError NvSciIpcWrite(NvSciIpcEndpoint handle, const void *buf, size_t size,
863  int32_t *bytes);
864 
915 NvSciError NvSciIpcWriteSafe(NvSciIpcEndpoint handle, const void *buf,
916  uint32_t size, uint32_t *bytes);
917 
970  volatile void **buf);
971 
1020 
1053  NvSciIpcEndpointInfo *info);
1054 
1055 #ifndef __QNX__
1056 
1089 #endif /* !__QNX__ */
1090 
1098 NvSciError NvSciIpcGetEvent(NvSciIpcEndpoint handle, uint32_t *events);
1099 
1201 NvSciError NvSciIpcGetEventSafe(NvSciIpcEndpoint handle, uint32_t *events);
1202 
1203 #if defined(__QNX__)
1204 
1270 int32_t NvSciIpcWaitEventQnx(int32_t chid, int64_t microseconds, uint32_t bytes,
1271  void *pulse);
1272 
1281 NvSciError NvSciIpcSetQnxPulseParam(NvSciIpcEndpoint handle,
1282  int32_t coid, int16_t pulsePriority, int16_t pulseCode,
1283  void *pulseValue);
1284 
1350 NvSciError NvSciIpcSetQnxPulseParamSafe(NvSciIpcEndpoint handle,
1351  int32_t coid, int16_t pulsePriority, int16_t pulseCode);
1352 
1353 
1404 NvSciError NvSciIpcInspectEventQnx(int32_t chid, uint16_t numEvents,
1405  uint32_t epCount, NvSciIpcEndpoint **epHandleArray);
1406 #endif /* __QNX__ */
1407 
1446 NvSciError NvSciIpcGetAsyncErrors(NvSciIpcEndpoint handle, uint32_t* errors);
1447 
1498 
1534  uint32_t majorVer,
1535  uint32_t minorVer,
1536  bool* isCompatible);
1537 
1541 #ifdef __cplusplus
1542 }
1543 #endif
1544 #endif /* INCLUDED_NVSCIIPC_H */
1545 
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:420
NvSciIpcGetLinuxEventFd
NvSciError NvSciIpcGetLinuxEventFd(NvSciIpcEndpoint handle, int32_t *fd)
Returns the NvSciIpc file descriptor for a given endpoint.
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:302
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:313
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:311
NvSciIpcEndpointInfo
Defines information about the NvSciIpc endpoint.
Definition: nvsciipc.h:309
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:266