NVIDIA DRIVE OS Linux SDK API Reference

6.0.9 Release
nvsciipc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2023, 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 
315 /*******************************************************************/
316 /************************ DATA TYPES *******************************/
317 /*******************************************************************/
318 
322 typedef uint64_t NvSciIpcEndpoint;
323 
325 
331  uint32_t nframes;
333  uint32_t frame_size;
334 };
335 
340 #define NVSCIIPC_MAX_ENDPOINT_NAME 64U
341 
342 /* NvSciIPC Event type */
344 #define NV_SCI_IPC_EVENT_READ 0x01U
345 
346 #define NV_SCI_IPC_EVENT_WRITE 0x02U
347 
348 #define NV_SCI_IPC_EVENT_CONN_EST 0x04U
349 
350 #define NV_SCI_IPC_EVENT_CONN_RESET 0x08U
351 
352 #define NV_SCI_IPC_EVENT_WRITE_EMPTY 0x10U
353 
354 #define NV_SCI_IPC_EVENT_ASYNC_ERROR 0x20U
355 
356 #define NV_SCI_IPC_EVENT_CONN_EST_ALL (NV_SCI_IPC_EVENT_CONN_EST | \
357  NV_SCI_IPC_EVENT_WRITE | NV_SCI_IPC_EVENT_WRITE_EMPTY | \
358  NV_SCI_IPC_EVENT_READ)
359 
361 #define NVSCIIPC_INFINITE_WAIT -1LL
362 
363 /* NvSciIpc Asynchronous erros */
365 #define NV_SCI_ASYNC_PCIE_EDMA_XFER_ERROR 0x1U
366 
367 #define NV_SCI_ASYNC_PCIE_AER_UNCORRECTABLE_FATAL 0x2U
368 
369 #define NV_SCI_ASYNC_PCIE_AER_UNCORRECTABLE_NONFATAL 0x4U
370 
371 #define NV_SCI_ASYNC_PCIE_VALIDATION_ERROR 0x8U
372 
373 /*******************************************************************/
374 /********************* FUNCTION TYPES ******************************/
375 /*******************************************************************/
376 
402 
430 void NvSciIpcDeinit(void);
431 
482 NvSciError NvSciIpcOpenEndpoint(const char *endpoint, NvSciIpcEndpoint *handle);
483 
538  NvSciIpcEndpoint *handle, NvSciEventService *eventService);
539 
584  NvSciEventNotifier **eventNotifier);
585 
615 
650 
698 
749 
806 NvSciError NvSciIpcRead(NvSciIpcEndpoint handle, void *buf, size_t size,
807  int32_t *bytes);
808 
861 NvSciError NvSciIpcReadSafe(NvSciIpcEndpoint handle, void *buf, uint32_t size,
862  uint32_t *bytes);
863 
911  const volatile void **buf);
912 
958 
1013 NvSciError NvSciIpcWrite(NvSciIpcEndpoint handle, const void *buf, size_t size,
1014  int32_t *bytes);
1015 
1066 NvSciError NvSciIpcWriteSafe(NvSciIpcEndpoint handle, const void *buf,
1067  uint32_t size, uint32_t *bytes);
1068 
1115  volatile void **buf);
1116 
1164 
1197  NvSciIpcEndpointInfo *info);
1198 
1199 #ifndef __QNX__
1200 
1233 #endif /* !__QNX__ */
1234 
1341 NvSciError NvSciIpcGetEvent(NvSciIpcEndpoint handle, uint32_t *events);
1342 
1450 NvSciError NvSciIpcGetEventSafe(NvSciIpcEndpoint handle, uint32_t *events);
1451 
1452 #if defined(__QNX__)
1453 
1517 int32_t NvSciIpcWaitEventQnx(int chid, int64_t microseconds, uint32_t bytes,
1518  void *pulse);
1519 
1588 NvSciError NvSciIpcSetQnxPulseParam(NvSciIpcEndpoint handle,
1589  int32_t coid, int16_t pulsePriority, int16_t pulseCode,
1590  void *pulseValue);
1591 
1657 NvSciError NvSciIpcSetQnxPulseParamSafe(NvSciIpcEndpoint handle,
1658  int32_t coid, int16_t pulsePriority, int16_t pulseCode);
1659 
1660 
1713 NvSciError NvSciIpcInspectEventQnx(int32_t chid, uint16_t numEvents,
1714  uint32_t epCount, NvSciIpcEndpoint **epHandleArray);
1715 #endif /* __QNX__ */
1716 
1755 NvSciError NvSciIpcGetAsyncErrors(NvSciIpcEndpoint handle, uint32_t* errors);
1756 
1810 
1846  uint32_t majorVer,
1847  uint32_t minorVer,
1848  bool* isCompatible);
1849 
1853 #ifdef __cplusplus
1854 }
1855 #endif
1856 #endif /* INCLUDED_NVSCIIPC_H */
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:435
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:322
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:333
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:331
NvSciIpcEndpointInfo
Defines information about the NvSciIpc endpoint.
Definition: nvsciipc.h:329
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:281