xref: /openbmc/linux/net/devlink/netlink_gen.c (revision c1e0230e)
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/devlink.yaml */
4 /* YNL-GEN kernel source */
5 
6 #include <net/netlink.h>
7 #include <net/genetlink.h>
8 
9 #include "netlink_gen.h"
10 
11 #include <uapi/linux/devlink.h>
12 
13 /* DEVLINK_CMD_GET - do */
14 static const struct nla_policy devlink_get_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
15 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
16 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
17 };
18 
19 /* DEVLINK_CMD_PORT_GET - do */
20 static const struct nla_policy devlink_port_get_do_nl_policy[DEVLINK_ATTR_PORT_INDEX + 1] = {
21 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
22 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
23 	[DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, },
24 };
25 
26 /* DEVLINK_CMD_PORT_GET - dump */
27 static const struct nla_policy devlink_port_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
28 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
29 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
30 };
31 
32 /* DEVLINK_CMD_SB_GET - do */
33 static const struct nla_policy devlink_sb_get_do_nl_policy[DEVLINK_ATTR_SB_INDEX + 1] = {
34 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
35 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
36 	[DEVLINK_ATTR_SB_INDEX] = { .type = NLA_U32, },
37 };
38 
39 /* DEVLINK_CMD_SB_GET - dump */
40 static const struct nla_policy devlink_sb_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
41 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
42 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
43 };
44 
45 /* DEVLINK_CMD_SB_POOL_GET - do */
46 static const struct nla_policy devlink_sb_pool_get_do_nl_policy[DEVLINK_ATTR_SB_POOL_INDEX + 1] = {
47 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
48 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
49 	[DEVLINK_ATTR_SB_INDEX] = { .type = NLA_U32, },
50 	[DEVLINK_ATTR_SB_POOL_INDEX] = { .type = NLA_U16, },
51 };
52 
53 /* DEVLINK_CMD_SB_POOL_GET - dump */
54 static const struct nla_policy devlink_sb_pool_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
55 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
56 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
57 };
58 
59 /* DEVLINK_CMD_SB_PORT_POOL_GET - do */
60 static const struct nla_policy devlink_sb_port_pool_get_do_nl_policy[DEVLINK_ATTR_SB_POOL_INDEX + 1] = {
61 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
62 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
63 	[DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, },
64 	[DEVLINK_ATTR_SB_INDEX] = { .type = NLA_U32, },
65 	[DEVLINK_ATTR_SB_POOL_INDEX] = { .type = NLA_U16, },
66 };
67 
68 /* DEVLINK_CMD_SB_PORT_POOL_GET - dump */
69 static const struct nla_policy devlink_sb_port_pool_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
70 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
71 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
72 };
73 
74 /* DEVLINK_CMD_SB_TC_POOL_BIND_GET - do */
75 static const struct nla_policy devlink_sb_tc_pool_bind_get_do_nl_policy[DEVLINK_ATTR_SB_TC_INDEX + 1] = {
76 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
77 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
78 	[DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, },
79 	[DEVLINK_ATTR_SB_INDEX] = { .type = NLA_U32, },
80 	[DEVLINK_ATTR_SB_POOL_TYPE] = NLA_POLICY_MAX(NLA_U8, 1),
81 	[DEVLINK_ATTR_SB_TC_INDEX] = { .type = NLA_U16, },
82 };
83 
84 /* DEVLINK_CMD_SB_TC_POOL_BIND_GET - dump */
85 static const struct nla_policy devlink_sb_tc_pool_bind_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
86 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
87 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
88 };
89 
90 /* DEVLINK_CMD_PARAM_GET - do */
91 static const struct nla_policy devlink_param_get_do_nl_policy[DEVLINK_ATTR_PARAM_NAME + 1] = {
92 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
93 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
94 	[DEVLINK_ATTR_PARAM_NAME] = { .type = NLA_NUL_STRING, },
95 };
96 
97 /* DEVLINK_CMD_PARAM_GET - dump */
98 static const struct nla_policy devlink_param_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
99 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
100 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
101 };
102 
103 /* DEVLINK_CMD_REGION_GET - do */
104 static const struct nla_policy devlink_region_get_do_nl_policy[DEVLINK_ATTR_REGION_NAME + 1] = {
105 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
106 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
107 	[DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, },
108 	[DEVLINK_ATTR_REGION_NAME] = { .type = NLA_NUL_STRING, },
109 };
110 
111 /* DEVLINK_CMD_REGION_GET - dump */
112 static const struct nla_policy devlink_region_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
113 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
114 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
115 };
116 
117 /* DEVLINK_CMD_INFO_GET - do */
118 static const struct nla_policy devlink_info_get_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
119 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
120 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
121 };
122 
123 /* DEVLINK_CMD_HEALTH_REPORTER_GET - do */
124 static const struct nla_policy devlink_health_reporter_get_do_nl_policy[DEVLINK_ATTR_HEALTH_REPORTER_NAME + 1] = {
125 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
126 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
127 	[DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, },
128 	[DEVLINK_ATTR_HEALTH_REPORTER_NAME] = { .type = NLA_NUL_STRING, },
129 };
130 
131 /* DEVLINK_CMD_HEALTH_REPORTER_GET - dump */
132 static const struct nla_policy devlink_health_reporter_get_dump_nl_policy[DEVLINK_ATTR_PORT_INDEX + 1] = {
133 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
134 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
135 	[DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, },
136 };
137 
138 /* DEVLINK_CMD_TRAP_GET - do */
139 static const struct nla_policy devlink_trap_get_do_nl_policy[DEVLINK_ATTR_TRAP_NAME + 1] = {
140 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
141 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
142 	[DEVLINK_ATTR_TRAP_NAME] = { .type = NLA_NUL_STRING, },
143 };
144 
145 /* DEVLINK_CMD_TRAP_GET - dump */
146 static const struct nla_policy devlink_trap_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
147 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
148 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
149 };
150 
151 /* DEVLINK_CMD_TRAP_GROUP_GET - do */
152 static const struct nla_policy devlink_trap_group_get_do_nl_policy[DEVLINK_ATTR_TRAP_GROUP_NAME + 1] = {
153 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
154 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
155 	[DEVLINK_ATTR_TRAP_GROUP_NAME] = { .type = NLA_NUL_STRING, },
156 };
157 
158 /* DEVLINK_CMD_TRAP_GROUP_GET - dump */
159 static const struct nla_policy devlink_trap_group_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
160 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
161 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
162 };
163 
164 /* DEVLINK_CMD_TRAP_POLICER_GET - do */
165 static const struct nla_policy devlink_trap_policer_get_do_nl_policy[DEVLINK_ATTR_TRAP_POLICER_ID + 1] = {
166 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
167 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
168 	[DEVLINK_ATTR_TRAP_POLICER_ID] = { .type = NLA_U32, },
169 };
170 
171 /* DEVLINK_CMD_TRAP_POLICER_GET - dump */
172 static const struct nla_policy devlink_trap_policer_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
173 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
174 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
175 };
176 
177 /* DEVLINK_CMD_RATE_GET - do */
178 static const struct nla_policy devlink_rate_get_do_nl_policy[DEVLINK_ATTR_RATE_NODE_NAME + 1] = {
179 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
180 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
181 	[DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, },
182 	[DEVLINK_ATTR_RATE_NODE_NAME] = { .type = NLA_NUL_STRING, },
183 };
184 
185 /* DEVLINK_CMD_RATE_GET - dump */
186 static const struct nla_policy devlink_rate_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
187 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
188 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
189 };
190 
191 /* DEVLINK_CMD_LINECARD_GET - do */
192 static const struct nla_policy devlink_linecard_get_do_nl_policy[DEVLINK_ATTR_LINECARD_INDEX + 1] = {
193 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
194 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
195 	[DEVLINK_ATTR_LINECARD_INDEX] = { .type = NLA_U32, },
196 };
197 
198 /* DEVLINK_CMD_LINECARD_GET - dump */
199 static const struct nla_policy devlink_linecard_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
200 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
201 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
202 };
203 
204 /* DEVLINK_CMD_SELFTESTS_GET - do */
205 static const struct nla_policy devlink_selftests_get_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = {
206 	[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
207 	[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
208 };
209 
210 /* Ops table for devlink */
211 const struct genl_split_ops devlink_nl_ops[32] = {
212 	{
213 		.cmd		= DEVLINK_CMD_GET,
214 		.validate	= GENL_DONT_VALIDATE_STRICT,
215 		.pre_doit	= devlink_nl_pre_doit,
216 		.doit		= devlink_nl_get_doit,
217 		.post_doit	= devlink_nl_post_doit,
218 		.policy		= devlink_get_nl_policy,
219 		.maxattr	= DEVLINK_ATTR_DEV_NAME,
220 		.flags		= GENL_CMD_CAP_DO,
221 	},
222 	{
223 		.cmd		= DEVLINK_CMD_GET,
224 		.validate	= GENL_DONT_VALIDATE_DUMP,
225 		.dumpit		= devlink_nl_get_dumpit,
226 		.flags		= GENL_CMD_CAP_DUMP,
227 	},
228 	{
229 		.cmd		= DEVLINK_CMD_PORT_GET,
230 		.validate	= GENL_DONT_VALIDATE_STRICT,
231 		.pre_doit	= devlink_nl_pre_doit_port,
232 		.doit		= devlink_nl_port_get_doit,
233 		.post_doit	= devlink_nl_post_doit,
234 		.policy		= devlink_port_get_do_nl_policy,
235 		.maxattr	= DEVLINK_ATTR_PORT_INDEX,
236 		.flags		= GENL_CMD_CAP_DO,
237 	},
238 	{
239 		.cmd		= DEVLINK_CMD_PORT_GET,
240 		.dumpit		= devlink_nl_port_get_dumpit,
241 		.policy		= devlink_port_get_dump_nl_policy,
242 		.maxattr	= DEVLINK_ATTR_DEV_NAME,
243 		.flags		= GENL_CMD_CAP_DUMP,
244 	},
245 	{
246 		.cmd		= DEVLINK_CMD_SB_GET,
247 		.validate	= GENL_DONT_VALIDATE_STRICT,
248 		.pre_doit	= devlink_nl_pre_doit,
249 		.doit		= devlink_nl_sb_get_doit,
250 		.post_doit	= devlink_nl_post_doit,
251 		.policy		= devlink_sb_get_do_nl_policy,
252 		.maxattr	= DEVLINK_ATTR_SB_INDEX,
253 		.flags		= GENL_CMD_CAP_DO,
254 	},
255 	{
256 		.cmd		= DEVLINK_CMD_SB_GET,
257 		.dumpit		= devlink_nl_sb_get_dumpit,
258 		.policy		= devlink_sb_get_dump_nl_policy,
259 		.maxattr	= DEVLINK_ATTR_DEV_NAME,
260 		.flags		= GENL_CMD_CAP_DUMP,
261 	},
262 	{
263 		.cmd		= DEVLINK_CMD_SB_POOL_GET,
264 		.validate	= GENL_DONT_VALIDATE_STRICT,
265 		.pre_doit	= devlink_nl_pre_doit,
266 		.doit		= devlink_nl_sb_pool_get_doit,
267 		.post_doit	= devlink_nl_post_doit,
268 		.policy		= devlink_sb_pool_get_do_nl_policy,
269 		.maxattr	= DEVLINK_ATTR_SB_POOL_INDEX,
270 		.flags		= GENL_CMD_CAP_DO,
271 	},
272 	{
273 		.cmd		= DEVLINK_CMD_SB_POOL_GET,
274 		.dumpit		= devlink_nl_sb_pool_get_dumpit,
275 		.policy		= devlink_sb_pool_get_dump_nl_policy,
276 		.maxattr	= DEVLINK_ATTR_DEV_NAME,
277 		.flags		= GENL_CMD_CAP_DUMP,
278 	},
279 	{
280 		.cmd		= DEVLINK_CMD_SB_PORT_POOL_GET,
281 		.validate	= GENL_DONT_VALIDATE_STRICT,
282 		.pre_doit	= devlink_nl_pre_doit_port,
283 		.doit		= devlink_nl_sb_port_pool_get_doit,
284 		.post_doit	= devlink_nl_post_doit,
285 		.policy		= devlink_sb_port_pool_get_do_nl_policy,
286 		.maxattr	= DEVLINK_ATTR_SB_POOL_INDEX,
287 		.flags		= GENL_CMD_CAP_DO,
288 	},
289 	{
290 		.cmd		= DEVLINK_CMD_SB_PORT_POOL_GET,
291 		.dumpit		= devlink_nl_sb_port_pool_get_dumpit,
292 		.policy		= devlink_sb_port_pool_get_dump_nl_policy,
293 		.maxattr	= DEVLINK_ATTR_DEV_NAME,
294 		.flags		= GENL_CMD_CAP_DUMP,
295 	},
296 	{
297 		.cmd		= DEVLINK_CMD_SB_TC_POOL_BIND_GET,
298 		.validate	= GENL_DONT_VALIDATE_STRICT,
299 		.pre_doit	= devlink_nl_pre_doit_port,
300 		.doit		= devlink_nl_sb_tc_pool_bind_get_doit,
301 		.post_doit	= devlink_nl_post_doit,
302 		.policy		= devlink_sb_tc_pool_bind_get_do_nl_policy,
303 		.maxattr	= DEVLINK_ATTR_SB_TC_INDEX,
304 		.flags		= GENL_CMD_CAP_DO,
305 	},
306 	{
307 		.cmd		= DEVLINK_CMD_SB_TC_POOL_BIND_GET,
308 		.dumpit		= devlink_nl_sb_tc_pool_bind_get_dumpit,
309 		.policy		= devlink_sb_tc_pool_bind_get_dump_nl_policy,
310 		.maxattr	= DEVLINK_ATTR_DEV_NAME,
311 		.flags		= GENL_CMD_CAP_DUMP,
312 	},
313 	{
314 		.cmd		= DEVLINK_CMD_PARAM_GET,
315 		.validate	= GENL_DONT_VALIDATE_STRICT,
316 		.pre_doit	= devlink_nl_pre_doit,
317 		.doit		= devlink_nl_param_get_doit,
318 		.post_doit	= devlink_nl_post_doit,
319 		.policy		= devlink_param_get_do_nl_policy,
320 		.maxattr	= DEVLINK_ATTR_PARAM_NAME,
321 		.flags		= GENL_CMD_CAP_DO,
322 	},
323 	{
324 		.cmd		= DEVLINK_CMD_PARAM_GET,
325 		.dumpit		= devlink_nl_param_get_dumpit,
326 		.policy		= devlink_param_get_dump_nl_policy,
327 		.maxattr	= DEVLINK_ATTR_DEV_NAME,
328 		.flags		= GENL_CMD_CAP_DUMP,
329 	},
330 	{
331 		.cmd		= DEVLINK_CMD_REGION_GET,
332 		.validate	= GENL_DONT_VALIDATE_STRICT,
333 		.pre_doit	= devlink_nl_pre_doit_port_optional,
334 		.doit		= devlink_nl_region_get_doit,
335 		.post_doit	= devlink_nl_post_doit,
336 		.policy		= devlink_region_get_do_nl_policy,
337 		.maxattr	= DEVLINK_ATTR_REGION_NAME,
338 		.flags		= GENL_CMD_CAP_DO,
339 	},
340 	{
341 		.cmd		= DEVLINK_CMD_REGION_GET,
342 		.dumpit		= devlink_nl_region_get_dumpit,
343 		.policy		= devlink_region_get_dump_nl_policy,
344 		.maxattr	= DEVLINK_ATTR_DEV_NAME,
345 		.flags		= GENL_CMD_CAP_DUMP,
346 	},
347 	{
348 		.cmd		= DEVLINK_CMD_INFO_GET,
349 		.validate	= GENL_DONT_VALIDATE_STRICT,
350 		.pre_doit	= devlink_nl_pre_doit,
351 		.doit		= devlink_nl_info_get_doit,
352 		.post_doit	= devlink_nl_post_doit,
353 		.policy		= devlink_info_get_nl_policy,
354 		.maxattr	= DEVLINK_ATTR_DEV_NAME,
355 		.flags		= GENL_CMD_CAP_DO,
356 	},
357 	{
358 		.cmd		= DEVLINK_CMD_INFO_GET,
359 		.validate	= GENL_DONT_VALIDATE_DUMP,
360 		.dumpit		= devlink_nl_info_get_dumpit,
361 		.flags		= GENL_CMD_CAP_DUMP,
362 	},
363 	{
364 		.cmd		= DEVLINK_CMD_HEALTH_REPORTER_GET,
365 		.validate	= GENL_DONT_VALIDATE_STRICT,
366 		.pre_doit	= devlink_nl_pre_doit_port_optional,
367 		.doit		= devlink_nl_health_reporter_get_doit,
368 		.post_doit	= devlink_nl_post_doit,
369 		.policy		= devlink_health_reporter_get_do_nl_policy,
370 		.maxattr	= DEVLINK_ATTR_HEALTH_REPORTER_NAME,
371 		.flags		= GENL_CMD_CAP_DO,
372 	},
373 	{
374 		.cmd		= DEVLINK_CMD_HEALTH_REPORTER_GET,
375 		.dumpit		= devlink_nl_health_reporter_get_dumpit,
376 		.policy		= devlink_health_reporter_get_dump_nl_policy,
377 		.maxattr	= DEVLINK_ATTR_PORT_INDEX,
378 		.flags		= GENL_CMD_CAP_DUMP,
379 	},
380 	{
381 		.cmd		= DEVLINK_CMD_TRAP_GET,
382 		.validate	= GENL_DONT_VALIDATE_STRICT,
383 		.pre_doit	= devlink_nl_pre_doit,
384 		.doit		= devlink_nl_trap_get_doit,
385 		.post_doit	= devlink_nl_post_doit,
386 		.policy		= devlink_trap_get_do_nl_policy,
387 		.maxattr	= DEVLINK_ATTR_TRAP_NAME,
388 		.flags		= GENL_CMD_CAP_DO,
389 	},
390 	{
391 		.cmd		= DEVLINK_CMD_TRAP_GET,
392 		.dumpit		= devlink_nl_trap_get_dumpit,
393 		.policy		= devlink_trap_get_dump_nl_policy,
394 		.maxattr	= DEVLINK_ATTR_DEV_NAME,
395 		.flags		= GENL_CMD_CAP_DUMP,
396 	},
397 	{
398 		.cmd		= DEVLINK_CMD_TRAP_GROUP_GET,
399 		.validate	= GENL_DONT_VALIDATE_STRICT,
400 		.pre_doit	= devlink_nl_pre_doit,
401 		.doit		= devlink_nl_trap_group_get_doit,
402 		.post_doit	= devlink_nl_post_doit,
403 		.policy		= devlink_trap_group_get_do_nl_policy,
404 		.maxattr	= DEVLINK_ATTR_TRAP_GROUP_NAME,
405 		.flags		= GENL_CMD_CAP_DO,
406 	},
407 	{
408 		.cmd		= DEVLINK_CMD_TRAP_GROUP_GET,
409 		.dumpit		= devlink_nl_trap_group_get_dumpit,
410 		.policy		= devlink_trap_group_get_dump_nl_policy,
411 		.maxattr	= DEVLINK_ATTR_DEV_NAME,
412 		.flags		= GENL_CMD_CAP_DUMP,
413 	},
414 	{
415 		.cmd		= DEVLINK_CMD_TRAP_POLICER_GET,
416 		.validate	= GENL_DONT_VALIDATE_STRICT,
417 		.pre_doit	= devlink_nl_pre_doit,
418 		.doit		= devlink_nl_trap_policer_get_doit,
419 		.post_doit	= devlink_nl_post_doit,
420 		.policy		= devlink_trap_policer_get_do_nl_policy,
421 		.maxattr	= DEVLINK_ATTR_TRAP_POLICER_ID,
422 		.flags		= GENL_CMD_CAP_DO,
423 	},
424 	{
425 		.cmd		= DEVLINK_CMD_TRAP_POLICER_GET,
426 		.dumpit		= devlink_nl_trap_policer_get_dumpit,
427 		.policy		= devlink_trap_policer_get_dump_nl_policy,
428 		.maxattr	= DEVLINK_ATTR_DEV_NAME,
429 		.flags		= GENL_CMD_CAP_DUMP,
430 	},
431 	{
432 		.cmd		= DEVLINK_CMD_RATE_GET,
433 		.validate	= GENL_DONT_VALIDATE_STRICT,
434 		.pre_doit	= devlink_nl_pre_doit,
435 		.doit		= devlink_nl_rate_get_doit,
436 		.post_doit	= devlink_nl_post_doit,
437 		.policy		= devlink_rate_get_do_nl_policy,
438 		.maxattr	= DEVLINK_ATTR_RATE_NODE_NAME,
439 		.flags		= GENL_CMD_CAP_DO,
440 	},
441 	{
442 		.cmd		= DEVLINK_CMD_RATE_GET,
443 		.dumpit		= devlink_nl_rate_get_dumpit,
444 		.policy		= devlink_rate_get_dump_nl_policy,
445 		.maxattr	= DEVLINK_ATTR_DEV_NAME,
446 		.flags		= GENL_CMD_CAP_DUMP,
447 	},
448 	{
449 		.cmd		= DEVLINK_CMD_LINECARD_GET,
450 		.validate	= GENL_DONT_VALIDATE_STRICT,
451 		.pre_doit	= devlink_nl_pre_doit,
452 		.doit		= devlink_nl_linecard_get_doit,
453 		.post_doit	= devlink_nl_post_doit,
454 		.policy		= devlink_linecard_get_do_nl_policy,
455 		.maxattr	= DEVLINK_ATTR_LINECARD_INDEX,
456 		.flags		= GENL_CMD_CAP_DO,
457 	},
458 	{
459 		.cmd		= DEVLINK_CMD_LINECARD_GET,
460 		.dumpit		= devlink_nl_linecard_get_dumpit,
461 		.policy		= devlink_linecard_get_dump_nl_policy,
462 		.maxattr	= DEVLINK_ATTR_DEV_NAME,
463 		.flags		= GENL_CMD_CAP_DUMP,
464 	},
465 	{
466 		.cmd		= DEVLINK_CMD_SELFTESTS_GET,
467 		.validate	= GENL_DONT_VALIDATE_STRICT,
468 		.pre_doit	= devlink_nl_pre_doit,
469 		.doit		= devlink_nl_selftests_get_doit,
470 		.post_doit	= devlink_nl_post_doit,
471 		.policy		= devlink_selftests_get_nl_policy,
472 		.maxattr	= DEVLINK_ATTR_DEV_NAME,
473 		.flags		= GENL_CMD_CAP_DO,
474 	},
475 	{
476 		.cmd		= DEVLINK_CMD_SELFTESTS_GET,
477 		.validate	= GENL_DONT_VALIDATE_DUMP,
478 		.dumpit		= devlink_nl_selftests_get_dumpit,
479 		.flags		= GENL_CMD_CAP_DUMP,
480 	},
481 };
482