NVIDIA DRIVE OS Linux API Reference

5.1.6.1 Release
For Test and Development only

 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 
55 /* This default code can be used by Application in NvSciIpcSetQnxPulseParam() */
57 #define NV_SCI_IPC_NOTIFY_CODE (_PULSE_CODE_MINAVAIL + 1)
58 #endif // QNX
60 
61 /*******************************************************************/
62 /************************ DATA TYPES *******************************/
63 /*******************************************************************/
67 typedef uint64_t NvSciIpcEndpoint;
68 
69 /* NvSciIpcEventNotifier type is for Drive OS internal use only */
71 typedef int32_t NvSciIpcEventNotifier;
73 
79  uint32_t nframes;
81  uint32_t frame_size;
82 };
83 
84 /* NvSciIPC Event type */
86 #define NV_SCI_IPC_EVENT_READ 1U
87 
88 #define NV_SCI_IPC_EVENT_WRITE 2U
89 
90 #define NV_SCI_IPC_EVENT_CONN_EST 4U
91 
92 #define NV_SCI_IPC_EVENT_CONN_RESET 8U
93 
94 /********************* FUNCTION TYPES *******************************/
95 /*******************************************************************/
96 
107 
116 void NvSciIpcDeinit(void);
117 
139 NvSciError NvSciIpcOpenEndpoint(const char *endpoint, NvSciIpcEndpoint *handle);
140 
150 void NvSciIpcCloseEndpoint(NvSciIpcEndpoint handle);
151 
163 void NvSciIpcResetEndpoint(NvSciIpcEndpoint handle);
164 
199 NvSciError NvSciIpcRead(NvSciIpcEndpoint handle, void *buf, size_t size,
200  int32_t *bytes);
201 
224 NvSciError NvSciIpcReadGetNextFrame(NvSciIpcEndpoint handle, void **buf);
225 
248 NvSciError NvSciIpcReadAdvance(NvSciIpcEndpoint handle);
249 
280 NvSciError NvSciIpcWrite(NvSciIpcEndpoint handle, const void *buf, size_t size,
281  int32_t *bytes);
282 
305 NvSciError NvSciIpcWriteGetNextFrame(NvSciIpcEndpoint handle, void **buf);
306 
330 NvSciError NvSciIpcWriteAdvance(NvSciIpcEndpoint handle);
331 
344 NvSciError NvSciIpcGetEndpointInfo(NvSciIpcEndpoint handle,
345  struct NvSciIpcEndpointInfo *info);
346 
362 /* For internal use only. */
364 NvSciError NvSciIpcGetEventNotifier(NvSciIpcEndpoint handle,
365  NvSciIpcEventNotifier *eventNotifier);
367 
384 NvSciError NvSciIpcGetLinuxEventFd(NvSciIpcEndpoint handle, int32_t *fd);
385 
451 NvSciError NvSciIpcGetEvent(NvSciIpcEndpoint handle, uint32_t *event);
452 
471 /* For internal use only. */
473 NvSciError NvSciIpcSetEventNotifierPulseParam(NvSciIpcEndpoint handle,
474  int32_t chid, int16_t pulsePriority, int16_t pulseCode,
475  int32_t pulseValue);
477 
519 NvSciError NvSciIpcSetQnxPulseParam(NvSciIpcEndpoint handle,
520  int32_t coid, int16_t pulsePriority, int16_t pulseCode,
521  void *pulseValue);
522 
532 /* For internal use only. */
534 NvSciError NvSciIpcErrnoToNvSciErr(int32_t err);
536 
547 /* For internal use only. */
549 int32_t NvSciIpcNvSciErrToErrno(NvSciError nvSciErr);
551 
554 #ifdef __cplusplus
555 }
556 #endif
557 #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:79
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:67
NvSciError NvSciIpcWriteAdvance(NvSciIpcEndpoint handle)
Writes the next frame to the endpoint.
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:81
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 NvSciIpcGetEvent(NvSciIpcEndpoint handle, uint32_t *event)
Returns a bitwise OR operation on new events that occurred since the last call to this function...
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:77