summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorPetlozu Pravareshwar <petlozup@nvidia.com>2018-02-16 04:26:58 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-03-22 19:22:53 -0400
commit97041d678813b7bbb508ab24e294f22b2baecbde (patch)
tree308ae1010cd0dcdcec1e7a4534ac06ceeafd2d86 /include/uapi/linux
parent03ab6394f1bf20e58ed437726f979366d0740de8 (diff)
nvlink: Update tegra nvlink ioctl header file
Below updates are made to tegra nvlink ioctl header file: * tegra-nvlink-mods.h file is moved to include/uapi/linux/ * Rename tegra-nvlink-mods.h file to tegra-nvlink-uapi.h * Use specific macros like _IOR/_IOW for read-only/write-only IOCTLs. * Every name in header file should have a "tegra_" prefix to avoid name clashes with RM enums/structs/ioctl names. JIRA NVLINK-152 Change-Id: Ic3509470b425c37a6f96918de873f32602c32f23 Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1659849 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Adeel Raza <araza@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/tegra-nvlink-uapi.h423
1 files changed, 423 insertions, 0 deletions
diff --git a/include/uapi/linux/tegra-nvlink-uapi.h b/include/uapi/linux/tegra-nvlink-uapi.h
new file mode 100644
index 000000000..6ce53f703
--- /dev/null
+++ b/include/uapi/linux/tegra-nvlink-uapi.h
@@ -0,0 +1,423 @@
1/*
2 * tegra-nvlink-uapi.h:
3 * This header contains the structures and variables needed for
4 * the NVLINK userspace APIs exported by the Tegra NVLINK endpoint driver.
5 *
6 * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License,
10 * version 2, as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef TEGRA_NVLINK_UAPI_H
22#define TEGRA_NVLINK_UAPI_H
23
24/* TEGRA_CTRL_CMD_NVLINK_GET_NVLINK_CAPS */
25
26#define TEGRA_NVLINK_VERSION_10 0x00000001
27#define TEGRA_NVLINK_VERSION_20 0x00000002
28#define TEGRA_NVLINK_VERSION_22 0x00000004
29
30#define TEGRA_CTRL_NVLINK_CAPS_NVLINK_VERSION_INVALID (0x00000000)
31#define TEGRA_CTRL_NVLINK_CAPS_NVLINK_VERSION_1_0 (0x00000001)
32#define TEGRA_CTRL_NVLINK_CAPS_NVLINK_VERSION_2_0 (0x00000002)
33#define TEGRA_CTRL_NVLINK_CAPS_NVLINK_VERSION_2_2 (0x00000004)
34
35#define TEGRA_CTRL_NVLINK_CAPS_NCI_VERSION_INVALID (0x00000000)
36#define TEGRA_CTRL_NVLINK_CAPS_NCI_VERSION_1_0 (0x00000001)
37#define TEGRA_CTRL_NVLINK_CAPS_NCI_VERSION_2_0 (0x00000002)
38#define TEGRA_CTRL_NVLINK_CAPS_NCI_VERSION_2_2 (0x00000004)
39
40#define TEGRA_CTRL_NVLINK_CAPS_SUPPORTED BIT(0)
41#define TEGRA_CTRL_NVLINK_CAPS_P2P_SUPPORTED BIT(1)
42#define TEGRA_CTRL_NVLINK_CAPS_SYSMEM_ACCESS BIT(2)
43#define TEGRA_CTRL_NVLINK_CAPS_P2P_ATOMICS BIT(3)
44#define TEGRA_CTRL_NVLINK_CAPS_SYSMEM_ATOMICS BIT(4)
45#define TEGRA_CTRL_NVLINK_CAPS_PEX_TUNNELING BIT(5)
46#define TEGRA_CTRL_NVLINK_CAPS_SLI_BRIDGE BIT(6)
47#define TEGRA_CTRL_NVLINK_CAPS_SLI_BRIDGE_SENSABLE BIT(7)
48#define TEGRA_CTRL_NVLINK_CAPS_POWER_STATE_L0 BIT(8)
49#define TEGRA_CTRL_NVLINK_CAPS_POWER_STATE_L1 BIT(9)
50#define TEGRA_CTRL_NVLINK_CAPS_POWER_STATE_L2 BIT(10)
51#define TEGRA_CTRL_NVLINK_CAPS_POWER_STATE_L3 BIT(11)
52#define TEGRA_CTRL_NVLINK_CAPS_VALID BIT(12)
53
54struct tegra_nvlink_caps {
55 __u16 nvlink_caps;
56
57 __u8 lowest_nvlink_version;
58 __u8 highest_nvlink_version;
59 __u8 lowest_nci_version;
60 __u8 highest_nci_version;
61
62 __u32 discovered_link_mask;
63 __u32 enabled_link_mask;
64};
65
66/* TEGRA_CTRL_CMD_NVLINK_GET_NVLINK_STATUS */
67
68/* NVLink link states */
69#define TEGRA_CTRL_NVLINK_STATUS_LINK_STATE_INIT (0x00000000)
70#define TEGRA_CTRL_NVLINK_STATUS_LINK_STATE_HWCFG (0x00000001)
71#define TEGRA_CTRL_NVLINK_STATUS_LINK_STATE_SWCFG (0x00000002)
72#define TEGRA_CTRL_NVLINK_STATUS_LINK_STATE_ACTIVE (0x00000003)
73#define TEGRA_CTRL_NVLINK_STATUS_LINK_STATE_FAULT (0x00000004)
74#define TEGRA_CTRL_NVLINK_STATUS_LINK_STATE_RECOVERY (0x00000006)
75#define TEGRA_CTRL_NVLINK_STATUS_LINK_STATE_INVALID (0xFFFFFFFF)
76
77/* NVLink Tx sublink states */
78#define TEGRA_CTRL_NVLINK_STATUS_SUBLINK_RX_STATE_HIGH_SPEED_1 (0x00000000)
79#define TEGRA_CTRL_NVLINK_STATUS_SUBLINK_RX_STATE_SINGLE_LANE (0x00000004)
80#define TEGRA_CTRL_NVLINK_STATUS_SUBLINK_RX_STATE_TRAINING (0x00000005)
81#define TEGRA_CTRL_NVLINK_STATUS_SUBLINK_RX_STATE_SAFE_MODE (0x00000006)
82#define TEGRA_CTRL_NVLINK_STATUS_SUBLINK_RX_STATE_OFF (0x00000007)
83#define TEGRA_CTRL_NVLINK_STATUS_SUBLINK_RX_STATE_INVALID (0x000000FF)
84
85/* NVLink Rx sublink states */
86#define TEGRA_CTRL_NVLINK_STATUS_SUBLINK_TX_STATE_HIGH_SPEED_1 (0x00000000)
87#define TEGRA_CTRL_NVLINK_STATUS_SUBLINK_TX_STATE_SINGLE_LANE (0x00000004)
88#define TEGRA_CTRL_NVLINK_STATUS_SUBLINK_TX_STATE_TRAINING (0x00000005)
89#define TEGRA_CTRL_NVLINK_STATUS_SUBLINK_TX_STATE_SAFE_MODE (0x00000006)
90#define TEGRA_CTRL_NVLINK_STATUS_SUBLINK_TX_STATE_OFF (0x00000007)
91#define TEGRA_CTRL_NVLINK_STATUS_SUBLINK_TX_STATE_INVALID (0x000000FF)
92
93#define TEGRA_CTRL_NVLINK_STATUS_PHY_NVHS (0x00000001)
94#define TEGRA_CTRL_NVLINK_STATUS_PHY_GRS (0x00000002)
95#define TEGRA_CTRL_NVLINK_STATUS_PHY_INVALID (0x000000FF)
96
97/* Version information */
98#define TEGRA_CTRL_NVLINK_STATUS_NVLINK_VERSION_1_0 (0x00000001)
99#define TEGRA_CTRL_NVLINK_STATUS_NVLINK_VERSION_2_0 (0x00000002)
100#define TEGRA_CTRL_NVLINK_STATUS_NVLINK_VERSION_2_2 (0x00000004)
101#define TEGRA_CTRL_NVLINK_STATUS_NVLINK_VERSION_INVALID (0x000000FF)
102
103#define TEGRA_CTRL_NVLINK_STATUS_NCI_VERSION_1_0 (0x00000001)
104#define TEGRA_CTRL_NVLINK_STATUS_NCI_VERSION_2_0 (0x00000002)
105#define TEGRA_CTRL_NVLINK_STATUS_NCI_VERSION_2_2 (0x00000004)
106#define TEGRA_CTRL_NVLINK_STATUS_NCI_VERSION_INVALID (0x000000FF)
107
108#define TEGRA_CTRL_NVLINK_STATUS_NVHS_VERSION_1_0 (0x00000001)
109#define TEGRA_CTRL_NVLINK_STATUS_NVHS_VERSION_INVALID (0x000000FF)
110
111#define TEGRA_CTRL_NVLINK_STATUS_GRS_VERSION_1_0 (0x00000001)
112#define TEGRA_CTRL_NVLINK_STATUS_GRS_VERSION_INVALID (0x000000FF)
113
114/* Connection properties */
115#define TEGRA_CTRL_NVLINK_STATUS_CONNECTED_TRUE (0x00000001)
116#define TEGRA_CTRL_NVLINK_STATUS_CONNECTED_FALSE (0x00000000)
117
118#define TEGRA_CTRL_NVLINK_STATUS_LOOP_PROPERTY_LOOPBACK (0x00000001)
119#define TEGRA_CTRL_NVLINK_STATUS_LOOP_PROPERTY_LOOPOUT (0x00000002)
120#define TEGRA_CTRL_NVLINK_STATUS_LOOP_PROPERTY_NONE (0x00000000)
121
122#define TEGRA_CTRL_NVLINK_STATUS_REMOTE_LINK_NUMBER_INVALID (0x000000FF)
123
124/* NVLink REFCLK types */
125#define TEGRA_CTRL_NVLINK_REFCLK_TYPE_INVALID (0x00)
126#define TEGRA_CTRL_NVLINK_REFCLK_TYPE_NVHS (0x01)
127#define TEGRA_CTRL_NVLINK_REFCLK_TYPE_PEX (0x02)
128
129#define TEGRA_CTRL_NVLINK_DEVICE_INFO_DEVICE_ID_FLAGS_NONE (0x00000000)
130#define TEGRA_CTRL_NVLINK_DEVICE_INFO_DEVICE_ID_FLAGS_PCI (0x00000001)
131#define TEGRA_CTRL_NVLINK_DEVICE_INFO_DEVICE_ID_FLAGS_UUID (0x00000002)
132
133#define TEGRA_CTRL_NVLINK_DEVICE_INFO_DEVICE_TYPE_EBRIDGE (0x00000000)
134#define TEGRA_CTRL_NVLINK_DEVICE_INFO_DEVICE_TYPE_NPU (0x00000001)
135#define TEGRA_CTRL_NVLINK_DEVICE_INFO_DEVICE_TYPE_GPU (0x00000002)
136#define TEGRA_CTRL_NVLINK_DEVICE_INFO_DEVICE_TYPE_SWITCH (0x00000003)
137#define TEGRA_CTRL_NVLINK_DEVICE_INFO_DEVICE_TYPE_TEGRA (0x00000004)
138#define TEGRA_CTRL_NVLINK_DEVICE_INFO_DEVICE_TYPE_NONE (0x000000FF)
139
140#define TEGRA_CTRL_NVLINK_DEVICE_INFO_DEVICE_UUID_INVALID (0xFFFFFFFF)
141
142struct tegra_nvlink_device_info {
143 /* ID Flags */
144 __u32 device_id_flags;
145
146 /* PCI Information */
147 __u16 domain;
148 __u16 bus;
149 __u16 device;
150 __u16 function;
151 __u32 pci_device_id;
152
153 /* Device Type */
154 __u64 device_type;
155
156 /* Device UUID */
157 __u8 device_uuid[16];
158};
159
160struct tegra_nvlink_link_status_info {
161 /* Top level capablilites */
162 __u16 caps;
163
164 __u8 phy_type;
165 __u8 sublink_width;
166
167 /* Link and sublink states */
168 __u32 link_state;
169 __u8 rx_sublink_status;
170 __u8 tx_sublink_status;
171
172 /* Indicates that lane reveral is in effect on this link */
173 bool bLane_reversal;
174
175 __u8 nvlink_version;
176 __u8 nci_version;
177 __u8 phy_version;
178
179 /* Clock information */
180 __u32 nvlink_link_clockKHz;
181 __u32 nvlink_common_clock_speedKHz;
182 __u32 nvlink_ref_clk_speedKHz;
183 __u8 nvlink_ref_clk_type;
184
185 __u32 nvlink_link_clockMhz;
186 __u32 nvlink_common_clock_speedMhz;
187 __u32 nvlink_ref_clk_speedMhz;
188
189 /* Connection information */
190 bool connected;
191 __u8 loop_property;
192 __u8 remote_device_link_number;
193 __u8 local_device_link_number;
194
195 struct tegra_nvlink_device_info remote_device_info;
196 struct tegra_nvlink_device_info local_device_info;
197};
198
199struct tegra_nvlink_status {
200 __u32 enabled_link_mask;
201 struct tegra_nvlink_link_status_info link_info;
202};
203
204/* TEGRA_CTRL_CMD_NVLINK_CLEAR_COUNTERS */
205
206/* These are the bitmask definitions for different counter types */
207#define TEGRA_CTRL_NVLINK_COUNTER_INVALID 0x00000000
208
209#define TEGRA_CTRL_NVLINK_COUNTER_TL_TX0 0x00000001
210#define TEGRA_CTRL_NVLINK_COUNTER_TL_TX1 0x00000002
211#define TEGRA_CTRL_NVLINK_COUNTER_TL_RX0 0x00000004
212#define TEGRA_CTRL_NVLINK_COUNTER_TL_RX1 0x00000008
213
214#define TEGRA_CTRL_NVLINK_COUNTER_DL_RX_ERR_CRC_FLIT 0x00010000
215
216#define TEGRA_CTRL_NVLINK_COUNTER_DL_RX_ERR_CRC_LANE_L(i) (1 << (i + 17))
217#define TEGRA_CTRL_NVLINK_COUNTER_DL_RX_ERR_CRC_LANE_SIZE 8
218#define TEGRA_CTRL_NVLINK_COUNTER_DL_RX_ERR_CRC_LANE_L0 0x00020000
219#define TEGRA_CTRL_NVLINK_COUNTER_DL_RX_ERR_CRC_LANE_L1 0x00040000
220#define TEGRA_CTRL_NVLINK_COUNTER_DL_RX_ERR_CRC_LANE_L2 0x00080000
221#define TEGRA_CTRL_NVLINK_COUNTER_DL_RX_ERR_CRC_LANE_L3 0x00100000
222#define TEGRA_CTRL_NVLINK_COUNTER_DL_RX_ERR_CRC_LANE_L4 0x00200000
223#define TEGRA_CTRL_NVLINK_COUNTER_DL_RX_ERR_CRC_LANE_L5 0x00400000
224#define TEGRA_CTRL_NVLINK_COUNTER_DL_RX_ERR_CRC_LANE_L6 0x00800000
225#define TEGRA_CTRL_NVLINK_COUNTER_DL_RX_ERR_CRC_LANE_L7 0x01000000
226
227#define TEGRA_CTRL_NVLINK_COUNTER_DL_TX_ERR_REPLAY 0x02000000
228#define TEGRA_CTRL_NVLINK_COUNTER_DL_TX_ERR_RECOVERY 0x04000000
229
230#define TEGRA_CTRL_NVLINK_COUNTER_MAX_TYPES 32
231
232/*
233 * Return index of the bit that is set in 'n'. This assumes there is only
234 * one such set bit in 'n'. Even if multiple bits are set,
235 * result is in range of 0-31.
236 */
237#define TEGRA_BIT_IDX_32(n) \
238 ((((n) & 0xFFFF0000) ? 0x10 : 0) | \
239 (((n) & 0xFF00FF00) ? 0x08 : 0) | \
240 (((n) & 0xF0F0F0F0) ? 0x04 : 0) | \
241 (((n) & 0xCCCCCCCC) ? 0x02 : 0) | \
242 (((n) & 0xAAAAAAAA) ? 0x01 : 0))
243
244struct tegra_nvlink_clear_counters {
245 __u32 link_mask;
246 __u32 counter_mask;
247};
248
249/* TEGRA_CTRL_CMD_NVLINK_GET_COUNTERS */
250#define tegra_nvlink_counter(x) \
251 TEGRA_BIT_IDX_32(TEGRA_CTRL_NVLINK_COUNTER_DL_RX_ERR_CRC_LANE_L(x))
252
253struct tegra_nvlink_get_counters {
254 __u8 link_id;
255 __u32 counter_mask;
256 bool bTx0_tl_counter_overflow;
257 bool bTx1_tl_counter_overflow;
258 bool bRx0_tl_counter_overflow;
259 bool bRx1_tl_counter_overflow;
260 __u64 nvlink_counters[TEGRA_CTRL_NVLINK_COUNTER_MAX_TYPES];
261};
262
263/* TEGRA_CTRL_CMD_NVLINK_GET_ERR_INFO */
264struct tegra_nvlink_err_info {
265 __u32 tl_err_log;
266 __u32 tl_intr_en;
267 __u32 tlc_tx_err_status0;
268 __u32 tlc_rx_err_status0;
269 __u32 tlc_rx_err_status1;
270 __u32 tlc_tx_err_log_en0;
271 __u32 tlc_rx_err_log_en0;
272 __u32 tlc_rx_err_log_en1;
273 __u32 mif_tx_err_status0;
274 __u32 mif_rx_err_status0;
275 __u32 dl_speed_status_tx;
276 __u32 dl_speed_status_rx;
277 bool bExcess_error_dl;
278};
279
280struct tegra_nvlink_get_err_info {
281 __u32 link_mask;
282 struct tegra_nvlink_err_info link_err_info;
283};
284
285/* TEGRA_CTRL_CMD_NVLINK_GET_ERROR_RECOVERIES */
286struct tegra_nvlink_get_error_recoveries {
287 __u32 link_mask;
288 __u32 num_recoveries;
289};
290
291/* TEGRA_CTRL_CMD_NVLINK_SETUP_EOM */
292struct tegra_nvlink_setup_eom {
293 __u8 link_id;
294 __u32 params;
295};
296
297/* TEGRA_CTRL_NVLINK_TRAIN_INTRANODE_CONN */
298enum tegra_ctrl_link_mode {
299 TEGRA_CTRL_NVLINK_LINK_OFF,
300 TEGRA_CTRL_NVLINK_LINK_HS,
301 TEGRA_CTRL_NVLINK_LINK_SAFE,
302 TEGRA_CTRL_NVLINK_LINK_FAULT,
303 TEGRA_CTRL_NVLINK_LINK_RECOVERY,
304 TEGRA_CTRL_NVLINK_LINK_DETECT,
305 TEGRA_CTRL_NVLINK_LINK_RESET,
306 TEGRA_CTRL_NVLINK_LINK_ENABLE_PM,
307 TEGRA_CTRL_NVLINK_LINK_DISABLE_PM,
308 TEGRA_CTRL_NVLINK_LINK_DISABLE_ERR_DETECT,
309 TEGRA_CTRL_NVLINK_LINK_LANE_DISABLE,
310 TEGRA_CTRL_NVLINK_LINK_LANE_SHUTDOWN
311};
312
313enum tegra_ctrl_tx_mode {
314 TEGRA_CTRL_NVLINK_TX_HS,
315 TEGRA_CTRL_NVLINK_TX_ENABLE_PM,
316 TEGRA_CTRL_NVLINK_TX_DISABLE_PM,
317 TEGRA_CTRL_NVLINK_TX_SINGLE_LANE,
318 TEGRA_CTRL_NVLINK_TX_SAFE,
319 TEGRA_CTRL_NVLINK_TX_OFF,
320 TEGRA_CTRL_NVLINK_TX_COMMON,
321 TEGRA_CTRL_NVLINK_TX_COMMON_DISABLE,
322 TEGRA_CTRL_NVLINK_TX_DATA_READY,
323 TEGRA_CTRL_NVLINK_TX_PRBS_EN,
324};
325
326enum tegra_ctrl_rx_mode {
327 TEGRA_CTRL_NVLINK_RX_HS,
328 TEGRA_CTRL_NVLINK_RX_ENABLE_PM,
329 TEGRA_CTRL_NVLINK_RX_DISABLE_PM,
330 TEGRA_CTRL_NVLINK_RX_SINGLE_LANE,
331 TEGRA_CTRL_NVLINK_RX_SAFE,
332 TEGRA_CTRL_NVLINK_RX_OFF,
333 TEGRA_CTRL_NVLINK_RX_RXCAL,
334};
335
336struct tegra_nvlink_pci_dev_info {
337 __u16 domain;
338 __u8 bus;
339 __u8 device;
340 __u8 function;
341};
342
343struct tegra_nvlink_endpoint {
344 __u16 node_id;
345 __u32 link_index;
346 struct tegra_nvlink_pci_dev_info pci_info;
347};
348
349/* link and sublink state of an nvlink endpoint */
350struct tegra_nvlink_link_state {
351 __u64 link_mode;
352 __u64 tx_sublink_mode;
353 __u64 rx_sublink_mode;
354};
355
356enum tegra_nvlink_conn_train_type {
357 nvlink_train_conn_off_to_swcfg = 0,
358 nvlink_train_conn_swcfg_to_active,
359 nvlink_train_conn_to_off,
360 nvlink_train_conn_active_to_swcfg,
361 nvlink_train_conn_swcfg_to_off,
362};
363
364struct tegra_nvlink_train_intranode_conn {
365 /* input fields */
366 enum tegra_nvlink_conn_train_type train_to;
367 struct tegra_nvlink_endpoint src_end_point;
368 struct tegra_nvlink_endpoint dst_end_point;
369
370 /* output fields */
371 int status;
372 struct tegra_nvlink_link_state src_end_state;
373 struct tegra_nvlink_link_state dst_end_state;
374};
375
376/* TEGRA_CTRL_CMD_NVLINK_GET_LP_COUNTERS */
377#define TEGRA_CTRL_NVLINK_GET_LP_COUNTERS_COUNT_TX_NVHS 0
378#define TEGRA_CTRL_NVLINK_GET_LP_COUNTERS_COUNT_TX_EIGHTH 1
379#define TEGRA_CTRL_NVLINK_GET_LP_COUNTERS_COUNT_TX_OTHER 2
380#define TEGRA_CTRL_NVLINK_GET_LP_COUNTERS_NUM_TX_LP_ENTER 3
381#define TEGRA_CTRL_NVLINK_GET_LP_COUNTERS_NUM_TX_LP_EXIT 4
382#define TEGRA_CTRL_NVLINK_GET_LP_COUNTERS_MAX_COUNTERS 5
383
384struct tegra_nvlink_get_lp_counters {
385 /* input field */
386 __u32 link_id;
387 /* input, output field */
388 __u32 counter_valid_mask;
389 /* output field */
390 __u32 counter_values[TEGRA_CTRL_NVLINK_GET_LP_COUNTERS_MAX_COUNTERS];
391};
392
393/* TEGRA_CTRL_CMD_NVLINK_CLEAR_LP_COUNTERS */
394struct tegra_nvlink_clear_lp_counters {
395 __u32 link_id;
396};
397
398/* TODO: choose a unique MAGIC number for ioctl implementation */
399#define TEGRA_NVLINK_IOC_MAGIC 'T'
400#define TEGRA_CTRL_CMD_NVLINK_GET_NVLINK_CAPS \
401 _IOR(TEGRA_NVLINK_IOC_MAGIC, 1, struct tegra_nvlink_caps)
402#define TEGRA_CTRL_CMD_NVLINK_GET_NVLINK_STATUS \
403 _IOR(TEGRA_NVLINK_IOC_MAGIC, 2, struct tegra_nvlink_status)
404#define TEGRA_CTRL_CMD_NVLINK_CLEAR_COUNTERS \
405 _IOW(TEGRA_NVLINK_IOC_MAGIC, 3, struct tegra_nvlink_clear_counters)
406#define TEGRA_CTRL_CMD_NVLINK_GET_COUNTERS \
407 _IOWR(TEGRA_NVLINK_IOC_MAGIC, 4, struct tegra_nvlink_get_counters)
408#define TEGRA_CTRL_CMD_NVLINK_GET_ERR_INFO \
409 _IOR(TEGRA_NVLINK_IOC_MAGIC, 5, struct tegra_nvlink_get_err_info)
410#define TEGRA_CTRL_CMD_NVLINK_GET_ERROR_RECOVERIES \
411 _IOWR(TEGRA_NVLINK_IOC_MAGIC, 6, \
412 struct tegra_nvlink_get_error_recoveries)
413#define TEGRA_CTRL_CMD_NVLINK_SETUP_EOM \
414 _IOW(TEGRA_NVLINK_IOC_MAGIC, 7, struct tegra_nvlink_setup_eom)
415#define TEGRA_CTRL_NVLINK_TRAIN_INTRANODE_CONN \
416 _IOWR(TEGRA_NVLINK_IOC_MAGIC, 8, \
417 struct tegra_nvlink_train_intranode_conn)
418#define TEGRA_CTRL_CMD_NVLINK_GET_LP_COUNTERS \
419 _IOWR(TEGRA_NVLINK_IOC_MAGIC, 9, struct tegra_nvlink_get_lp_counters)
420#define TEGRA_CTRL_CMD_NVLINK_CLEAR_LP_COUNTERS \
421 _IOW(TEGRA_NVLINK_IOC_MAGIC, 10, struct tegra_nvlink_clear_lp_counters)
422
423#endif /* TEGRA_NVLINK_UAPI_H */