libxcoder
5.2.0
ni_p2p_ioctl.h
Go to the documentation of this file.
1
/*******************************************************************************
2
*
3
* Copyright (C) 2022 NETINT Technologies
4
*
5
* Permission is hereby granted, free of charge, to any person obtaining a copy
6
* of this software and associated documentation files (the "Software"), to deal
7
* in the Software without restriction, including without limitation the rights
8
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
* copies of the Software, and to permit persons to whom the Software is
10
* furnished to do so, subject to the following conditions:
11
*
12
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
* SOFTWARE.
19
*
20
******************************************************************************/
21
22
/*!*****************************************************************************
23
* \file ni_p2p_ioctl.h
24
*
25
* \brief Definitions related to NETINT P2P kernel driver interface
26
******************************************************************************/
27
28
#ifndef _NETINT_IOCTL_H
29
#define _NETINT_IOCTL_H
30
31
#define NI_DMABUF_READ_FENCE (1 << 0)
32
#define NI_DMABUF_SYNC_FILE_OUT_FENCE (1 << 1)
33
#define NI_DMABUF_SYNC_FILE_IN_FENCE (1 << 2)
34
35
#define NI_DMABUF_MAX_SGL_ENTRY 128
36
37
enum
38
{
39
NI_DMABUF_READ_FROM_DEVICE
= 0,
40
NI_DMABUF_WRITE_TO_DEVICE
= 1,
41
};
42
43
struct
netint_iocmd_export_dmabuf
44
{
45
int
fd
;
46
unsigned
int
flags
;
47
int
domain
;
48
int
bus
;
49
int
dev
;
50
int
fn
;
51
int
bar
;
52
unsigned
long
offset
;
53
unsigned
long
length
;
54
};
55
56
struct
netint_iocmd_import_dmabuf
{
57
int
fd
;
58
unsigned
int
flags
;
// reserved for future use
59
int
domain
;
60
int
bus
;
61
int
dev
;
62
int
fn
;
63
int
nents
;
64
unsigned
int
dma_len
[
NI_DMABUF_MAX_SGL_ENTRY
];
65
#ifdef __linux__
66
__u64
dma_addr
[
NI_DMABUF_MAX_SGL_ENTRY
];
67
#else
68
unsigned
long
dma_addr
[
NI_DMABUF_MAX_SGL_ENTRY
];
69
#endif
70
};
71
72
struct
netint_iocmd_issue_request
73
{
74
int
fd
;
75
unsigned
int
len
;
76
int
dir
;
77
unsigned
char
*
data
;
78
};
79
80
struct
netint_iocmd_attach_rfence
81
{
82
int
fd
;
83
int
fence_fd
;
84
unsigned
int
flags
;
85
};
86
87
struct
netint_iocmd_signal_rfence
88
{
89
int
fd
;
90
};
91
92
#define NETINT_IOCTL_ID _IO('N', 0x80)
93
#define NETINT_IOCTL_EXPORT_DMABUF \
94
_IOWR('N', 0x81, struct netint_iocmd_export_dmabuf)
95
#define NETINT_IOCTL_ATTACH_RFENCE \
96
_IOW('N', 0x82, struct netint_iocmd_attach_rfence)
97
#define NETINT_IOCTL_SIGNAL_RFENCE \
98
_IOW('N', 0x83, struct netint_iocmd_signal_rfence)
99
#define NETINT_IOCTL_ISSUE_REQ \
100
_IOW('N', 0x85, struct netint_iocmd_issue_request)
101
#define NETINT_IOCTL_IMPORT_DMABUF \
102
_IOW('N', 0x88, struct netint_iocmd_import_dmabuf)
103
#endif
/* _NETINT_IOCTL_H */
netint_iocmd_issue_request::len
unsigned int len
Definition:
ni_p2p_ioctl.h:75
netint_iocmd_attach_rfence
Definition:
ni_p2p_ioctl.h:80
netint_iocmd_attach_rfence::fence_fd
int fence_fd
Definition:
ni_p2p_ioctl.h:83
netint_iocmd_import_dmabuf::dma_addr
unsigned long dma_addr[NI_DMABUF_MAX_SGL_ENTRY]
Definition:
ni_p2p_ioctl.h:68
netint_iocmd_issue_request::dir
int dir
Definition:
ni_p2p_ioctl.h:76
netint_iocmd_export_dmabuf::bar
int bar
Definition:
ni_p2p_ioctl.h:51
NI_DMABUF_MAX_SGL_ENTRY
#define NI_DMABUF_MAX_SGL_ENTRY
Definition:
ni_p2p_ioctl.h:35
netint_iocmd_export_dmabuf::bus
int bus
Definition:
ni_p2p_ioctl.h:48
netint_iocmd_import_dmabuf::dma_len
unsigned int dma_len[NI_DMABUF_MAX_SGL_ENTRY]
Definition:
ni_p2p_ioctl.h:64
netint_iocmd_export_dmabuf
Definition:
ni_p2p_ioctl.h:43
NI_DMABUF_WRITE_TO_DEVICE
@ NI_DMABUF_WRITE_TO_DEVICE
Definition:
ni_p2p_ioctl.h:40
netint_iocmd_attach_rfence::flags
unsigned int flags
Definition:
ni_p2p_ioctl.h:84
netint_iocmd_import_dmabuf::fn
int fn
Definition:
ni_p2p_ioctl.h:62
netint_iocmd_import_dmabuf::fd
int fd
Definition:
ni_p2p_ioctl.h:57
netint_iocmd_issue_request::fd
int fd
Definition:
ni_p2p_ioctl.h:74
netint_iocmd_import_dmabuf::domain
int domain
Definition:
ni_p2p_ioctl.h:59
netint_iocmd_export_dmabuf::flags
unsigned int flags
Definition:
ni_p2p_ioctl.h:46
netint_iocmd_export_dmabuf::fn
int fn
Definition:
ni_p2p_ioctl.h:50
netint_iocmd_signal_rfence::fd
int fd
Definition:
ni_p2p_ioctl.h:89
netint_iocmd_import_dmabuf
Definition:
ni_p2p_ioctl.h:56
netint_iocmd_export_dmabuf::domain
int domain
Definition:
ni_p2p_ioctl.h:47
netint_iocmd_issue_request::data
unsigned char * data
Definition:
ni_p2p_ioctl.h:77
netint_iocmd_attach_rfence::fd
int fd
Definition:
ni_p2p_ioctl.h:82
netint_iocmd_export_dmabuf::length
unsigned long length
Definition:
ni_p2p_ioctl.h:53
NI_DMABUF_READ_FROM_DEVICE
@ NI_DMABUF_READ_FROM_DEVICE
Definition:
ni_p2p_ioctl.h:39
netint_iocmd_export_dmabuf::fd
int fd
Definition:
ni_p2p_ioctl.h:45
netint_iocmd_issue_request
Definition:
ni_p2p_ioctl.h:72
netint_iocmd_export_dmabuf::dev
int dev
Definition:
ni_p2p_ioctl.h:49
netint_iocmd_import_dmabuf::flags
unsigned int flags
Definition:
ni_p2p_ioctl.h:58
netint_iocmd_import_dmabuf::nents
int nents
Definition:
ni_p2p_ioctl.h:63
netint_iocmd_import_dmabuf::dev
int dev
Definition:
ni_p2p_ioctl.h:61
netint_iocmd_signal_rfence
Definition:
ni_p2p_ioctl.h:87
netint_iocmd_export_dmabuf::offset
unsigned long offset
Definition:
ni_p2p_ioctl.h:52
netint_iocmd_import_dmabuf::bus
int bus
Definition:
ni_p2p_ioctl.h:60
source
ni_p2p_ioctl.h
Generated by
1.8.17