NVIDIA DRIVE OS Linux SDK API Reference

5.1.9.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvsciipc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2019, 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 NVSCIIPC_H
12 #define NVSCIIPC_H
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 #include <stdint.h>
19 #include <stddef.h>
20 #include <nvscierror.h>
49 /*******************************************************************/
50 /************************ OS SPECIFIC ******************************/
51 /*******************************************************************/
52 #ifdef __QNX__
53 #include <sys/neutrino.h>
54 #endif /* __QNX__ */
55 
56 /*******************************************************************/
57 /************************ DATA TYPES *******************************/
58 /*******************************************************************/
62 typedef uint64_t NvSciIpcEndpoint;
63 
69  uint32_t nframes;
71  uint32_t frame_size;
72 };
73 
75 #define NVSCIIPC_MAX_ENDPOINT_NAME 32U
76 
77 /* NvSciIPC Event type */
79 #define NV_SCI_IPC_EVENT_READ 1U
80 
81 #define NV_SCI_IPC_EVENT_WRITE 2U
82 
83 #define NV_SCI_IPC_EVENT_CONN_EST 4U
84 
85 #define NV_SCI_IPC_EVENT_CONN_RESET 8U
86 
87 #define NV_SCI_IPC_EVENT_CONN_EST_ALL \
88  (NV_SCI_IPC_EVENT_CONN_EST | \
89  NV_SCI_IPC_EVENT_WRITE | \
90  NV_SCI_IPC_EVENT_READ)
91 
92 /*******************************************************************/
93 /********************* FUNCTION TYPES ******************************/
94 /*******************************************************************/
95 
119 
142 void NvSciIpcDeinit(void);
143 
179 NvSciError NvSciIpcOpenEndpoint(const char *endpoint, NvSciIpcEndpoint *handle);
180 
204 void NvSciIpcCloseEndpoint(NvSciIpcEndpoint handle);
205 
231 void NvSciIpcResetEndpoint(NvSciIpcEndpoint handle);
232 
281 NvSciError NvSciIpcRead(NvSciIpcEndpoint handle, void *buf, size_t size,
282  int32_t *bytes);
283 
322 NvSciError NvSciIpcReadGetNextFrame(NvSciIpcEndpoint handle, void **buf);
323 
362 NvSciError NvSciIpcReadAdvance(NvSciIpcEndpoint handle);
363 
408 NvSciError NvSciIpcWrite(NvSciIpcEndpoint handle, const void *buf, size_t size,
409  int32_t *bytes);
410 
449 NvSciError NvSciIpcWriteGetNextFrame(NvSciIpcEndpoint handle, void **buf);
450 
490 NvSciError NvSciIpcWriteAdvance(NvSciIpcEndpoint handle);
491 
518 NvSciError NvSciIpcGetEndpointInfo(NvSciIpcEndpoint handle,
519  struct NvSciIpcEndpointInfo *info);
520 
537 NvSciError NvSciIpcGetLinuxEventFd(NvSciIpcEndpoint handle, int32_t *fd);
538 
620 NvSciError NvSciIpcGetEvent(NvSciIpcEndpoint handle, uint32_t *events);
621 
677 NvSciError NvSciIpcSetQnxPulseParam(NvSciIpcEndpoint handle,
678  int32_t coid, int16_t pulsePriority, int16_t pulseCode,
679  void *pulseValue);
680 
683 #ifdef __cplusplus
684 }
685 #endif
686 #endif /* NVSCIIPC_H */
NvSciError NvSciIpcReadGetNextFrame(NvSciIpcEndpoint handle, void **buf)
Returns a pointer to the location of the next frame from an endpoint.
NvSciError NvSciIpcReadAdvance(NvSciIpcEndpoint handle)
Removes the next frame from an endpoint.
uint32_t nframes
Holds the number of frames.
Definition: nvsciipc.h:69
NvSciError NvSciIpcInit(void)
Initializes the NvSciIpc library.
void NvSciIpcDeinit(void)
De-initializes the NvSciIpc library.
NVIDIA Software Communications Interface (SCI): Error Handling
uint64_t NvSciIpcEndpoint
Handle to the IPC endpoint.
Definition: nvsciipc.h:62
NvSciError NvSciIpcWriteAdvance(NvSciIpcEndpoint handle)
Writes the next frame to the endpoint.
NvSciError NvSciIpcGetEvent(NvSciIpcEndpoint handle, uint32_t *events)
Get Events.
NvSciError NvSciIpcOpenEndpoint(const char *endpoint, NvSciIpcEndpoint *handle)
Opens an endpoint with the given name.
NvSciError NvSciIpcGetEndpointInfo(NvSciIpcEndpoint handle, struct NvSciIpcEndpointInfo *info)
Returns endpoint information.
void NvSciIpcResetEndpoint(NvSciIpcEndpoint handle)
Resets an endpoint.
NvSciError NvSciIpcWriteGetNextFrame(NvSciIpcEndpoint handle, void **buf)
Returns a pointer to the location of the next frame for writing data.
NvSciError NvSciIpcWrite(NvSciIpcEndpoint handle, const void *buf, size_t size, int32_t *bytes)
Writes a new frame to the endpoint.
enum NvSciErrorRec NvSciError
Return/error codes for all NvSci functions.
uint32_t frame_size
Holds the frame size.
Definition: nvsciipc.h:71
NvSciError NvSciIpcRead(NvSciIpcEndpoint handle, void *buf, size_t size, int32_t *bytes)
Returns the contents of the next frame from an endpoint.
void NvSciIpcCloseEndpoint(NvSciIpcEndpoint handle)
Closes an endpoint with the given handle.
NvSciError NvSciIpcGetLinuxEventFd(NvSciIpcEndpoint handle, int32_t *fd)
Returns the NvSciIpc file descriptor for a given endpoint.
NvSciError NvSciIpcSetQnxPulseParam(NvSciIpcEndpoint handle, int32_t coid, int16_t pulsePriority, int16_t pulseCode, void *pulseValue)
Sets the event pulse parameters for QNX.
Defines information about the IPC endpoint.
Definition: nvsciipc.h:67