xref: /linux/drivers/gpu/drm/drm_ras_nl.c (revision 40286d6379aacfcc053253ef78dc78b09addffda)
1 // SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2 /* Do not edit directly, auto-generated from: */
3 /*	Documentation/netlink/specs/drm_ras.yaml */
4 /* YNL-GEN kernel source */
5 /* To regenerate run: tools/net/ynl/ynl-regen.sh */
6 
7 #include <net/netlink.h>
8 #include <net/genetlink.h>
9 
10 #include "drm_ras_nl.h"
11 
12 #include <uapi/drm/drm_ras.h>
13 
14 /* DRM_RAS_CMD_GET_ERROR_COUNTER - do */
15 static const struct nla_policy drm_ras_get_error_counter_do_nl_policy[DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID + 1] = {
16 	[DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID] = { .type = NLA_U32, },
17 	[DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID] = { .type = NLA_U32, },
18 };
19 
20 /* DRM_RAS_CMD_GET_ERROR_COUNTER - dump */
21 static const struct nla_policy drm_ras_get_error_counter_dump_nl_policy[DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID + 1] = {
22 	[DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID] = { .type = NLA_U32, },
23 };
24 
25 /* Ops table for drm_ras */
26 static const struct genl_split_ops drm_ras_nl_ops[] = {
27 	{
28 		.cmd	= DRM_RAS_CMD_LIST_NODES,
29 		.dumpit	= drm_ras_nl_list_nodes_dumpit,
30 		.flags	= GENL_ADMIN_PERM | GENL_CMD_CAP_DUMP,
31 	},
32 	{
33 		.cmd		= DRM_RAS_CMD_GET_ERROR_COUNTER,
34 		.doit		= drm_ras_nl_get_error_counter_doit,
35 		.policy		= drm_ras_get_error_counter_do_nl_policy,
36 		.maxattr	= DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID,
37 		.flags		= GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
38 	},
39 	{
40 		.cmd		= DRM_RAS_CMD_GET_ERROR_COUNTER,
41 		.dumpit		= drm_ras_nl_get_error_counter_dumpit,
42 		.policy		= drm_ras_get_error_counter_dump_nl_policy,
43 		.maxattr	= DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID,
44 		.flags		= GENL_ADMIN_PERM | GENL_CMD_CAP_DUMP,
45 	},
46 };
47 
48 struct genl_family drm_ras_nl_family __ro_after_init = {
49 	.name		= DRM_RAS_FAMILY_NAME,
50 	.version	= DRM_RAS_FAMILY_VERSION,
51 	.netnsok	= true,
52 	.parallel_ops	= true,
53 	.module		= THIS_MODULE,
54 	.split_ops	= drm_ras_nl_ops,
55 	.n_split_ops	= ARRAY_SIZE(drm_ras_nl_ops),
56 };
57