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/ethtool.yaml */
4 /* YNL-GEN user header */
5 /* YNL-ARG --user-header linux/ethtool_netlink.h --exclude-op stats-get */
6 
7 #ifndef _LINUX_ETHTOOL_GEN_H
8 #define _LINUX_ETHTOOL_GEN_H
9 
10 #include <stdlib.h>
11 #include <string.h>
12 #include <linux/types.h>
13 #include <linux/ethtool.h>
14 
15 struct ynl_sock;
16 
17 extern const struct ynl_family ynl_ethtool_family;
18 
19 /* Enums */
20 const char *ethtool_op_str(int op);
21 const char *ethtool_udp_tunnel_type_str(int value);
22 const char *ethtool_stringset_str(enum ethtool_stringset value);
23 
24 /* Common nested types */
25 struct ethtool_header {
26 	struct {
27 		__u32 dev_index:1;
28 		__u32 dev_name_len;
29 		__u32 flags:1;
30 	} _present;
31 
32 	__u32 dev_index;
33 	char *dev_name;
34 	__u32 flags;
35 };
36 
37 struct ethtool_pause_stat {
38 	struct {
39 		__u32 tx_frames:1;
40 		__u32 rx_frames:1;
41 	} _present;
42 
43 	__u64 tx_frames;
44 	__u64 rx_frames;
45 };
46 
47 struct ethtool_cable_test_tdr_cfg {
48 	struct {
49 		__u32 first:1;
50 		__u32 last:1;
51 		__u32 step:1;
52 		__u32 pair:1;
53 	} _present;
54 
55 	__u32 first;
56 	__u32 last;
57 	__u32 step;
58 	__u8 pair;
59 };
60 
61 struct ethtool_fec_stat {
62 	struct {
63 		__u32 corrected_len;
64 		__u32 uncorr_len;
65 		__u32 corr_bits_len;
66 	} _present;
67 
68 	void *corrected;
69 	void *uncorr;
70 	void *corr_bits;
71 };
72 
73 struct ethtool_mm_stat {
74 	struct {
75 		__u32 reassembly_errors:1;
76 		__u32 smd_errors:1;
77 		__u32 reassembly_ok:1;
78 		__u32 rx_frag_count:1;
79 		__u32 tx_frag_count:1;
80 		__u32 hold_count:1;
81 	} _present;
82 
83 	__u64 reassembly_errors;
84 	__u64 smd_errors;
85 	__u64 reassembly_ok;
86 	__u64 rx_frag_count;
87 	__u64 tx_frag_count;
88 	__u64 hold_count;
89 };
90 
91 struct ethtool_cable_result {
92 	struct {
93 		__u32 pair:1;
94 		__u32 code:1;
95 	} _present;
96 
97 	__u8 pair;
98 	__u8 code;
99 };
100 
101 struct ethtool_cable_fault_length {
102 	struct {
103 		__u32 pair:1;
104 		__u32 cm:1;
105 	} _present;
106 
107 	__u8 pair;
108 	__u32 cm;
109 };
110 
111 struct ethtool_bitset_bit {
112 	struct {
113 		__u32 index:1;
114 		__u32 name_len;
115 		__u32 value:1;
116 	} _present;
117 
118 	__u32 index;
119 	char *name;
120 };
121 
122 struct ethtool_tunnel_udp_entry {
123 	struct {
124 		__u32 port:1;
125 		__u32 type:1;
126 	} _present;
127 
128 	__u16 port /* big-endian */;
129 	__u32 type;
130 };
131 
132 struct ethtool_string {
133 	struct {
134 		__u32 index:1;
135 		__u32 value_len;
136 	} _present;
137 
138 	__u32 index;
139 	char *value;
140 };
141 
142 struct ethtool_cable_nest {
143 	struct {
144 		__u32 result:1;
145 		__u32 fault_length:1;
146 	} _present;
147 
148 	struct ethtool_cable_result result;
149 	struct ethtool_cable_fault_length fault_length;
150 };
151 
152 struct ethtool_bitset_bits {
153 	unsigned int n_bit;
154 	struct ethtool_bitset_bit *bit;
155 };
156 
157 struct ethtool_strings {
158 	unsigned int n_string;
159 	struct ethtool_string *string;
160 };
161 
162 struct ethtool_bitset {
163 	struct {
164 		__u32 nomask:1;
165 		__u32 size:1;
166 		__u32 bits:1;
167 	} _present;
168 
169 	__u32 size;
170 	struct ethtool_bitset_bits bits;
171 };
172 
173 struct ethtool_stringset_ {
174 	struct {
175 		__u32 id:1;
176 		__u32 count:1;
177 	} _present;
178 
179 	__u32 id;
180 	__u32 count;
181 	unsigned int n_strings;
182 	struct ethtool_strings *strings;
183 };
184 
185 struct ethtool_tunnel_udp_table {
186 	struct {
187 		__u32 size:1;
188 		__u32 types:1;
189 	} _present;
190 
191 	__u32 size;
192 	struct ethtool_bitset types;
193 	unsigned int n_entry;
194 	struct ethtool_tunnel_udp_entry *entry;
195 };
196 
197 struct ethtool_stringsets {
198 	unsigned int n_stringset;
199 	struct ethtool_stringset_ *stringset;
200 };
201 
202 struct ethtool_tunnel_udp {
203 	struct {
204 		__u32 table:1;
205 	} _present;
206 
207 	struct ethtool_tunnel_udp_table table;
208 };
209 
210 /* ============== ETHTOOL_MSG_STRSET_GET ============== */
211 /* ETHTOOL_MSG_STRSET_GET - do */
212 struct ethtool_strset_get_req {
213 	struct {
214 		__u32 header:1;
215 		__u32 stringsets:1;
216 		__u32 counts_only:1;
217 	} _present;
218 
219 	struct ethtool_header header;
220 	struct ethtool_stringsets stringsets;
221 };
222 
223 static inline struct ethtool_strset_get_req *ethtool_strset_get_req_alloc(void)
224 {
225 	return calloc(1, sizeof(struct ethtool_strset_get_req));
226 }
227 void ethtool_strset_get_req_free(struct ethtool_strset_get_req *req);
228 
229 static inline void
230 ethtool_strset_get_req_set_header_dev_index(struct ethtool_strset_get_req *req,
231 					    __u32 dev_index)
232 {
233 	req->_present.header = 1;
234 	req->header._present.dev_index = 1;
235 	req->header.dev_index = dev_index;
236 }
237 static inline void
238 ethtool_strset_get_req_set_header_dev_name(struct ethtool_strset_get_req *req,
239 					   const char *dev_name)
240 {
241 	free(req->header.dev_name);
242 	req->header._present.dev_name_len = strlen(dev_name);
243 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
244 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
245 	req->header.dev_name[req->header._present.dev_name_len] = 0;
246 }
247 static inline void
248 ethtool_strset_get_req_set_header_flags(struct ethtool_strset_get_req *req,
249 					__u32 flags)
250 {
251 	req->_present.header = 1;
252 	req->header._present.flags = 1;
253 	req->header.flags = flags;
254 }
255 static inline void
256 __ethtool_strset_get_req_set_stringsets_stringset(struct ethtool_strset_get_req *req,
257 						  struct ethtool_stringset_ *stringset,
258 						  unsigned int n_stringset)
259 {
260 	free(req->stringsets.stringset);
261 	req->stringsets.stringset = stringset;
262 	req->stringsets.n_stringset = n_stringset;
263 }
264 static inline void
265 ethtool_strset_get_req_set_counts_only(struct ethtool_strset_get_req *req)
266 {
267 	req->_present.counts_only = 1;
268 }
269 
270 struct ethtool_strset_get_rsp {
271 	struct {
272 		__u32 header:1;
273 		__u32 stringsets:1;
274 	} _present;
275 
276 	struct ethtool_header header;
277 	struct ethtool_stringsets stringsets;
278 };
279 
280 void ethtool_strset_get_rsp_free(struct ethtool_strset_get_rsp *rsp);
281 
282 /*
283  * Get string set from the kernel.
284  */
285 struct ethtool_strset_get_rsp *
286 ethtool_strset_get(struct ynl_sock *ys, struct ethtool_strset_get_req *req);
287 
288 /* ETHTOOL_MSG_STRSET_GET - dump */
289 struct ethtool_strset_get_req_dump {
290 	struct {
291 		__u32 header:1;
292 		__u32 stringsets:1;
293 		__u32 counts_only:1;
294 	} _present;
295 
296 	struct ethtool_header header;
297 	struct ethtool_stringsets stringsets;
298 };
299 
300 static inline struct ethtool_strset_get_req_dump *
301 ethtool_strset_get_req_dump_alloc(void)
302 {
303 	return calloc(1, sizeof(struct ethtool_strset_get_req_dump));
304 }
305 void ethtool_strset_get_req_dump_free(struct ethtool_strset_get_req_dump *req);
306 
307 static inline void
308 ethtool_strset_get_req_dump_set_header_dev_index(struct ethtool_strset_get_req_dump *req,
309 						 __u32 dev_index)
310 {
311 	req->_present.header = 1;
312 	req->header._present.dev_index = 1;
313 	req->header.dev_index = dev_index;
314 }
315 static inline void
316 ethtool_strset_get_req_dump_set_header_dev_name(struct ethtool_strset_get_req_dump *req,
317 						const char *dev_name)
318 {
319 	free(req->header.dev_name);
320 	req->header._present.dev_name_len = strlen(dev_name);
321 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
322 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
323 	req->header.dev_name[req->header._present.dev_name_len] = 0;
324 }
325 static inline void
326 ethtool_strset_get_req_dump_set_header_flags(struct ethtool_strset_get_req_dump *req,
327 					     __u32 flags)
328 {
329 	req->_present.header = 1;
330 	req->header._present.flags = 1;
331 	req->header.flags = flags;
332 }
333 static inline void
334 __ethtool_strset_get_req_dump_set_stringsets_stringset(struct ethtool_strset_get_req_dump *req,
335 						       struct ethtool_stringset_ *stringset,
336 						       unsigned int n_stringset)
337 {
338 	free(req->stringsets.stringset);
339 	req->stringsets.stringset = stringset;
340 	req->stringsets.n_stringset = n_stringset;
341 }
342 static inline void
343 ethtool_strset_get_req_dump_set_counts_only(struct ethtool_strset_get_req_dump *req)
344 {
345 	req->_present.counts_only = 1;
346 }
347 
348 struct ethtool_strset_get_list {
349 	struct ethtool_strset_get_list *next;
350 	struct ethtool_strset_get_rsp obj __attribute__ ((aligned (8)));
351 };
352 
353 void ethtool_strset_get_list_free(struct ethtool_strset_get_list *rsp);
354 
355 struct ethtool_strset_get_list *
356 ethtool_strset_get_dump(struct ynl_sock *ys,
357 			struct ethtool_strset_get_req_dump *req);
358 
359 /* ============== ETHTOOL_MSG_LINKINFO_GET ============== */
360 /* ETHTOOL_MSG_LINKINFO_GET - do */
361 struct ethtool_linkinfo_get_req {
362 	struct {
363 		__u32 header:1;
364 	} _present;
365 
366 	struct ethtool_header header;
367 };
368 
369 static inline struct ethtool_linkinfo_get_req *
370 ethtool_linkinfo_get_req_alloc(void)
371 {
372 	return calloc(1, sizeof(struct ethtool_linkinfo_get_req));
373 }
374 void ethtool_linkinfo_get_req_free(struct ethtool_linkinfo_get_req *req);
375 
376 static inline void
377 ethtool_linkinfo_get_req_set_header_dev_index(struct ethtool_linkinfo_get_req *req,
378 					      __u32 dev_index)
379 {
380 	req->_present.header = 1;
381 	req->header._present.dev_index = 1;
382 	req->header.dev_index = dev_index;
383 }
384 static inline void
385 ethtool_linkinfo_get_req_set_header_dev_name(struct ethtool_linkinfo_get_req *req,
386 					     const char *dev_name)
387 {
388 	free(req->header.dev_name);
389 	req->header._present.dev_name_len = strlen(dev_name);
390 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
391 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
392 	req->header.dev_name[req->header._present.dev_name_len] = 0;
393 }
394 static inline void
395 ethtool_linkinfo_get_req_set_header_flags(struct ethtool_linkinfo_get_req *req,
396 					  __u32 flags)
397 {
398 	req->_present.header = 1;
399 	req->header._present.flags = 1;
400 	req->header.flags = flags;
401 }
402 
403 struct ethtool_linkinfo_get_rsp {
404 	struct {
405 		__u32 header:1;
406 		__u32 port:1;
407 		__u32 phyaddr:1;
408 		__u32 tp_mdix:1;
409 		__u32 tp_mdix_ctrl:1;
410 		__u32 transceiver:1;
411 	} _present;
412 
413 	struct ethtool_header header;
414 	__u8 port;
415 	__u8 phyaddr;
416 	__u8 tp_mdix;
417 	__u8 tp_mdix_ctrl;
418 	__u8 transceiver;
419 };
420 
421 void ethtool_linkinfo_get_rsp_free(struct ethtool_linkinfo_get_rsp *rsp);
422 
423 /*
424  * Get link info.
425  */
426 struct ethtool_linkinfo_get_rsp *
427 ethtool_linkinfo_get(struct ynl_sock *ys, struct ethtool_linkinfo_get_req *req);
428 
429 /* ETHTOOL_MSG_LINKINFO_GET - dump */
430 struct ethtool_linkinfo_get_req_dump {
431 	struct {
432 		__u32 header:1;
433 	} _present;
434 
435 	struct ethtool_header header;
436 };
437 
438 static inline struct ethtool_linkinfo_get_req_dump *
439 ethtool_linkinfo_get_req_dump_alloc(void)
440 {
441 	return calloc(1, sizeof(struct ethtool_linkinfo_get_req_dump));
442 }
443 void
444 ethtool_linkinfo_get_req_dump_free(struct ethtool_linkinfo_get_req_dump *req);
445 
446 static inline void
447 ethtool_linkinfo_get_req_dump_set_header_dev_index(struct ethtool_linkinfo_get_req_dump *req,
448 						   __u32 dev_index)
449 {
450 	req->_present.header = 1;
451 	req->header._present.dev_index = 1;
452 	req->header.dev_index = dev_index;
453 }
454 static inline void
455 ethtool_linkinfo_get_req_dump_set_header_dev_name(struct ethtool_linkinfo_get_req_dump *req,
456 						  const char *dev_name)
457 {
458 	free(req->header.dev_name);
459 	req->header._present.dev_name_len = strlen(dev_name);
460 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
461 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
462 	req->header.dev_name[req->header._present.dev_name_len] = 0;
463 }
464 static inline void
465 ethtool_linkinfo_get_req_dump_set_header_flags(struct ethtool_linkinfo_get_req_dump *req,
466 					       __u32 flags)
467 {
468 	req->_present.header = 1;
469 	req->header._present.flags = 1;
470 	req->header.flags = flags;
471 }
472 
473 struct ethtool_linkinfo_get_list {
474 	struct ethtool_linkinfo_get_list *next;
475 	struct ethtool_linkinfo_get_rsp obj __attribute__ ((aligned (8)));
476 };
477 
478 void ethtool_linkinfo_get_list_free(struct ethtool_linkinfo_get_list *rsp);
479 
480 struct ethtool_linkinfo_get_list *
481 ethtool_linkinfo_get_dump(struct ynl_sock *ys,
482 			  struct ethtool_linkinfo_get_req_dump *req);
483 
484 /* ETHTOOL_MSG_LINKINFO_GET - notify */
485 struct ethtool_linkinfo_get_ntf {
486 	__u16 family;
487 	__u8 cmd;
488 	struct ynl_ntf_base_type *next;
489 	void (*free)(struct ethtool_linkinfo_get_ntf *ntf);
490 	struct ethtool_linkinfo_get_rsp obj __attribute__ ((aligned (8)));
491 };
492 
493 void ethtool_linkinfo_get_ntf_free(struct ethtool_linkinfo_get_ntf *rsp);
494 
495 /* ============== ETHTOOL_MSG_LINKINFO_SET ============== */
496 /* ETHTOOL_MSG_LINKINFO_SET - do */
497 struct ethtool_linkinfo_set_req {
498 	struct {
499 		__u32 header:1;
500 		__u32 port:1;
501 		__u32 phyaddr:1;
502 		__u32 tp_mdix:1;
503 		__u32 tp_mdix_ctrl:1;
504 		__u32 transceiver:1;
505 	} _present;
506 
507 	struct ethtool_header header;
508 	__u8 port;
509 	__u8 phyaddr;
510 	__u8 tp_mdix;
511 	__u8 tp_mdix_ctrl;
512 	__u8 transceiver;
513 };
514 
515 static inline struct ethtool_linkinfo_set_req *
516 ethtool_linkinfo_set_req_alloc(void)
517 {
518 	return calloc(1, sizeof(struct ethtool_linkinfo_set_req));
519 }
520 void ethtool_linkinfo_set_req_free(struct ethtool_linkinfo_set_req *req);
521 
522 static inline void
523 ethtool_linkinfo_set_req_set_header_dev_index(struct ethtool_linkinfo_set_req *req,
524 					      __u32 dev_index)
525 {
526 	req->_present.header = 1;
527 	req->header._present.dev_index = 1;
528 	req->header.dev_index = dev_index;
529 }
530 static inline void
531 ethtool_linkinfo_set_req_set_header_dev_name(struct ethtool_linkinfo_set_req *req,
532 					     const char *dev_name)
533 {
534 	free(req->header.dev_name);
535 	req->header._present.dev_name_len = strlen(dev_name);
536 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
537 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
538 	req->header.dev_name[req->header._present.dev_name_len] = 0;
539 }
540 static inline void
541 ethtool_linkinfo_set_req_set_header_flags(struct ethtool_linkinfo_set_req *req,
542 					  __u32 flags)
543 {
544 	req->_present.header = 1;
545 	req->header._present.flags = 1;
546 	req->header.flags = flags;
547 }
548 static inline void
549 ethtool_linkinfo_set_req_set_port(struct ethtool_linkinfo_set_req *req,
550 				  __u8 port)
551 {
552 	req->_present.port = 1;
553 	req->port = port;
554 }
555 static inline void
556 ethtool_linkinfo_set_req_set_phyaddr(struct ethtool_linkinfo_set_req *req,
557 				     __u8 phyaddr)
558 {
559 	req->_present.phyaddr = 1;
560 	req->phyaddr = phyaddr;
561 }
562 static inline void
563 ethtool_linkinfo_set_req_set_tp_mdix(struct ethtool_linkinfo_set_req *req,
564 				     __u8 tp_mdix)
565 {
566 	req->_present.tp_mdix = 1;
567 	req->tp_mdix = tp_mdix;
568 }
569 static inline void
570 ethtool_linkinfo_set_req_set_tp_mdix_ctrl(struct ethtool_linkinfo_set_req *req,
571 					  __u8 tp_mdix_ctrl)
572 {
573 	req->_present.tp_mdix_ctrl = 1;
574 	req->tp_mdix_ctrl = tp_mdix_ctrl;
575 }
576 static inline void
577 ethtool_linkinfo_set_req_set_transceiver(struct ethtool_linkinfo_set_req *req,
578 					 __u8 transceiver)
579 {
580 	req->_present.transceiver = 1;
581 	req->transceiver = transceiver;
582 }
583 
584 /*
585  * Set link info.
586  */
587 int ethtool_linkinfo_set(struct ynl_sock *ys,
588 			 struct ethtool_linkinfo_set_req *req);
589 
590 /* ============== ETHTOOL_MSG_LINKMODES_GET ============== */
591 /* ETHTOOL_MSG_LINKMODES_GET - do */
592 struct ethtool_linkmodes_get_req {
593 	struct {
594 		__u32 header:1;
595 	} _present;
596 
597 	struct ethtool_header header;
598 };
599 
600 static inline struct ethtool_linkmodes_get_req *
601 ethtool_linkmodes_get_req_alloc(void)
602 {
603 	return calloc(1, sizeof(struct ethtool_linkmodes_get_req));
604 }
605 void ethtool_linkmodes_get_req_free(struct ethtool_linkmodes_get_req *req);
606 
607 static inline void
608 ethtool_linkmodes_get_req_set_header_dev_index(struct ethtool_linkmodes_get_req *req,
609 					       __u32 dev_index)
610 {
611 	req->_present.header = 1;
612 	req->header._present.dev_index = 1;
613 	req->header.dev_index = dev_index;
614 }
615 static inline void
616 ethtool_linkmodes_get_req_set_header_dev_name(struct ethtool_linkmodes_get_req *req,
617 					      const char *dev_name)
618 {
619 	free(req->header.dev_name);
620 	req->header._present.dev_name_len = strlen(dev_name);
621 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
622 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
623 	req->header.dev_name[req->header._present.dev_name_len] = 0;
624 }
625 static inline void
626 ethtool_linkmodes_get_req_set_header_flags(struct ethtool_linkmodes_get_req *req,
627 					   __u32 flags)
628 {
629 	req->_present.header = 1;
630 	req->header._present.flags = 1;
631 	req->header.flags = flags;
632 }
633 
634 struct ethtool_linkmodes_get_rsp {
635 	struct {
636 		__u32 header:1;
637 		__u32 autoneg:1;
638 		__u32 ours:1;
639 		__u32 peer:1;
640 		__u32 speed:1;
641 		__u32 duplex:1;
642 		__u32 master_slave_cfg:1;
643 		__u32 master_slave_state:1;
644 		__u32 lanes:1;
645 		__u32 rate_matching:1;
646 	} _present;
647 
648 	struct ethtool_header header;
649 	__u8 autoneg;
650 	struct ethtool_bitset ours;
651 	struct ethtool_bitset peer;
652 	__u32 speed;
653 	__u8 duplex;
654 	__u8 master_slave_cfg;
655 	__u8 master_slave_state;
656 	__u32 lanes;
657 	__u8 rate_matching;
658 };
659 
660 void ethtool_linkmodes_get_rsp_free(struct ethtool_linkmodes_get_rsp *rsp);
661 
662 /*
663  * Get link modes.
664  */
665 struct ethtool_linkmodes_get_rsp *
666 ethtool_linkmodes_get(struct ynl_sock *ys,
667 		      struct ethtool_linkmodes_get_req *req);
668 
669 /* ETHTOOL_MSG_LINKMODES_GET - dump */
670 struct ethtool_linkmodes_get_req_dump {
671 	struct {
672 		__u32 header:1;
673 	} _present;
674 
675 	struct ethtool_header header;
676 };
677 
678 static inline struct ethtool_linkmodes_get_req_dump *
679 ethtool_linkmodes_get_req_dump_alloc(void)
680 {
681 	return calloc(1, sizeof(struct ethtool_linkmodes_get_req_dump));
682 }
683 void
684 ethtool_linkmodes_get_req_dump_free(struct ethtool_linkmodes_get_req_dump *req);
685 
686 static inline void
687 ethtool_linkmodes_get_req_dump_set_header_dev_index(struct ethtool_linkmodes_get_req_dump *req,
688 						    __u32 dev_index)
689 {
690 	req->_present.header = 1;
691 	req->header._present.dev_index = 1;
692 	req->header.dev_index = dev_index;
693 }
694 static inline void
695 ethtool_linkmodes_get_req_dump_set_header_dev_name(struct ethtool_linkmodes_get_req_dump *req,
696 						   const char *dev_name)
697 {
698 	free(req->header.dev_name);
699 	req->header._present.dev_name_len = strlen(dev_name);
700 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
701 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
702 	req->header.dev_name[req->header._present.dev_name_len] = 0;
703 }
704 static inline void
705 ethtool_linkmodes_get_req_dump_set_header_flags(struct ethtool_linkmodes_get_req_dump *req,
706 						__u32 flags)
707 {
708 	req->_present.header = 1;
709 	req->header._present.flags = 1;
710 	req->header.flags = flags;
711 }
712 
713 struct ethtool_linkmodes_get_list {
714 	struct ethtool_linkmodes_get_list *next;
715 	struct ethtool_linkmodes_get_rsp obj __attribute__ ((aligned (8)));
716 };
717 
718 void ethtool_linkmodes_get_list_free(struct ethtool_linkmodes_get_list *rsp);
719 
720 struct ethtool_linkmodes_get_list *
721 ethtool_linkmodes_get_dump(struct ynl_sock *ys,
722 			   struct ethtool_linkmodes_get_req_dump *req);
723 
724 /* ETHTOOL_MSG_LINKMODES_GET - notify */
725 struct ethtool_linkmodes_get_ntf {
726 	__u16 family;
727 	__u8 cmd;
728 	struct ynl_ntf_base_type *next;
729 	void (*free)(struct ethtool_linkmodes_get_ntf *ntf);
730 	struct ethtool_linkmodes_get_rsp obj __attribute__ ((aligned (8)));
731 };
732 
733 void ethtool_linkmodes_get_ntf_free(struct ethtool_linkmodes_get_ntf *rsp);
734 
735 /* ============== ETHTOOL_MSG_LINKMODES_SET ============== */
736 /* ETHTOOL_MSG_LINKMODES_SET - do */
737 struct ethtool_linkmodes_set_req {
738 	struct {
739 		__u32 header:1;
740 		__u32 autoneg:1;
741 		__u32 ours:1;
742 		__u32 peer:1;
743 		__u32 speed:1;
744 		__u32 duplex:1;
745 		__u32 master_slave_cfg:1;
746 		__u32 master_slave_state:1;
747 		__u32 lanes:1;
748 		__u32 rate_matching:1;
749 	} _present;
750 
751 	struct ethtool_header header;
752 	__u8 autoneg;
753 	struct ethtool_bitset ours;
754 	struct ethtool_bitset peer;
755 	__u32 speed;
756 	__u8 duplex;
757 	__u8 master_slave_cfg;
758 	__u8 master_slave_state;
759 	__u32 lanes;
760 	__u8 rate_matching;
761 };
762 
763 static inline struct ethtool_linkmodes_set_req *
764 ethtool_linkmodes_set_req_alloc(void)
765 {
766 	return calloc(1, sizeof(struct ethtool_linkmodes_set_req));
767 }
768 void ethtool_linkmodes_set_req_free(struct ethtool_linkmodes_set_req *req);
769 
770 static inline void
771 ethtool_linkmodes_set_req_set_header_dev_index(struct ethtool_linkmodes_set_req *req,
772 					       __u32 dev_index)
773 {
774 	req->_present.header = 1;
775 	req->header._present.dev_index = 1;
776 	req->header.dev_index = dev_index;
777 }
778 static inline void
779 ethtool_linkmodes_set_req_set_header_dev_name(struct ethtool_linkmodes_set_req *req,
780 					      const char *dev_name)
781 {
782 	free(req->header.dev_name);
783 	req->header._present.dev_name_len = strlen(dev_name);
784 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
785 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
786 	req->header.dev_name[req->header._present.dev_name_len] = 0;
787 }
788 static inline void
789 ethtool_linkmodes_set_req_set_header_flags(struct ethtool_linkmodes_set_req *req,
790 					   __u32 flags)
791 {
792 	req->_present.header = 1;
793 	req->header._present.flags = 1;
794 	req->header.flags = flags;
795 }
796 static inline void
797 ethtool_linkmodes_set_req_set_autoneg(struct ethtool_linkmodes_set_req *req,
798 				      __u8 autoneg)
799 {
800 	req->_present.autoneg = 1;
801 	req->autoneg = autoneg;
802 }
803 static inline void
804 ethtool_linkmodes_set_req_set_ours_nomask(struct ethtool_linkmodes_set_req *req)
805 {
806 	req->_present.ours = 1;
807 	req->ours._present.nomask = 1;
808 }
809 static inline void
810 ethtool_linkmodes_set_req_set_ours_size(struct ethtool_linkmodes_set_req *req,
811 					__u32 size)
812 {
813 	req->_present.ours = 1;
814 	req->ours._present.size = 1;
815 	req->ours.size = size;
816 }
817 static inline void
818 __ethtool_linkmodes_set_req_set_ours_bits_bit(struct ethtool_linkmodes_set_req *req,
819 					      struct ethtool_bitset_bit *bit,
820 					      unsigned int n_bit)
821 {
822 	free(req->ours.bits.bit);
823 	req->ours.bits.bit = bit;
824 	req->ours.bits.n_bit = n_bit;
825 }
826 static inline void
827 ethtool_linkmodes_set_req_set_peer_nomask(struct ethtool_linkmodes_set_req *req)
828 {
829 	req->_present.peer = 1;
830 	req->peer._present.nomask = 1;
831 }
832 static inline void
833 ethtool_linkmodes_set_req_set_peer_size(struct ethtool_linkmodes_set_req *req,
834 					__u32 size)
835 {
836 	req->_present.peer = 1;
837 	req->peer._present.size = 1;
838 	req->peer.size = size;
839 }
840 static inline void
841 __ethtool_linkmodes_set_req_set_peer_bits_bit(struct ethtool_linkmodes_set_req *req,
842 					      struct ethtool_bitset_bit *bit,
843 					      unsigned int n_bit)
844 {
845 	free(req->peer.bits.bit);
846 	req->peer.bits.bit = bit;
847 	req->peer.bits.n_bit = n_bit;
848 }
849 static inline void
850 ethtool_linkmodes_set_req_set_speed(struct ethtool_linkmodes_set_req *req,
851 				    __u32 speed)
852 {
853 	req->_present.speed = 1;
854 	req->speed = speed;
855 }
856 static inline void
857 ethtool_linkmodes_set_req_set_duplex(struct ethtool_linkmodes_set_req *req,
858 				     __u8 duplex)
859 {
860 	req->_present.duplex = 1;
861 	req->duplex = duplex;
862 }
863 static inline void
864 ethtool_linkmodes_set_req_set_master_slave_cfg(struct ethtool_linkmodes_set_req *req,
865 					       __u8 master_slave_cfg)
866 {
867 	req->_present.master_slave_cfg = 1;
868 	req->master_slave_cfg = master_slave_cfg;
869 }
870 static inline void
871 ethtool_linkmodes_set_req_set_master_slave_state(struct ethtool_linkmodes_set_req *req,
872 						 __u8 master_slave_state)
873 {
874 	req->_present.master_slave_state = 1;
875 	req->master_slave_state = master_slave_state;
876 }
877 static inline void
878 ethtool_linkmodes_set_req_set_lanes(struct ethtool_linkmodes_set_req *req,
879 				    __u32 lanes)
880 {
881 	req->_present.lanes = 1;
882 	req->lanes = lanes;
883 }
884 static inline void
885 ethtool_linkmodes_set_req_set_rate_matching(struct ethtool_linkmodes_set_req *req,
886 					    __u8 rate_matching)
887 {
888 	req->_present.rate_matching = 1;
889 	req->rate_matching = rate_matching;
890 }
891 
892 /*
893  * Set link modes.
894  */
895 int ethtool_linkmodes_set(struct ynl_sock *ys,
896 			  struct ethtool_linkmodes_set_req *req);
897 
898 /* ============== ETHTOOL_MSG_LINKSTATE_GET ============== */
899 /* ETHTOOL_MSG_LINKSTATE_GET - do */
900 struct ethtool_linkstate_get_req {
901 	struct {
902 		__u32 header:1;
903 	} _present;
904 
905 	struct ethtool_header header;
906 };
907 
908 static inline struct ethtool_linkstate_get_req *
909 ethtool_linkstate_get_req_alloc(void)
910 {
911 	return calloc(1, sizeof(struct ethtool_linkstate_get_req));
912 }
913 void ethtool_linkstate_get_req_free(struct ethtool_linkstate_get_req *req);
914 
915 static inline void
916 ethtool_linkstate_get_req_set_header_dev_index(struct ethtool_linkstate_get_req *req,
917 					       __u32 dev_index)
918 {
919 	req->_present.header = 1;
920 	req->header._present.dev_index = 1;
921 	req->header.dev_index = dev_index;
922 }
923 static inline void
924 ethtool_linkstate_get_req_set_header_dev_name(struct ethtool_linkstate_get_req *req,
925 					      const char *dev_name)
926 {
927 	free(req->header.dev_name);
928 	req->header._present.dev_name_len = strlen(dev_name);
929 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
930 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
931 	req->header.dev_name[req->header._present.dev_name_len] = 0;
932 }
933 static inline void
934 ethtool_linkstate_get_req_set_header_flags(struct ethtool_linkstate_get_req *req,
935 					   __u32 flags)
936 {
937 	req->_present.header = 1;
938 	req->header._present.flags = 1;
939 	req->header.flags = flags;
940 }
941 
942 struct ethtool_linkstate_get_rsp {
943 	struct {
944 		__u32 header:1;
945 		__u32 link:1;
946 		__u32 sqi:1;
947 		__u32 sqi_max:1;
948 		__u32 ext_state:1;
949 		__u32 ext_substate:1;
950 		__u32 ext_down_cnt:1;
951 	} _present;
952 
953 	struct ethtool_header header;
954 	__u8 link;
955 	__u32 sqi;
956 	__u32 sqi_max;
957 	__u8 ext_state;
958 	__u8 ext_substate;
959 	__u32 ext_down_cnt;
960 };
961 
962 void ethtool_linkstate_get_rsp_free(struct ethtool_linkstate_get_rsp *rsp);
963 
964 /*
965  * Get link state.
966  */
967 struct ethtool_linkstate_get_rsp *
968 ethtool_linkstate_get(struct ynl_sock *ys,
969 		      struct ethtool_linkstate_get_req *req);
970 
971 /* ETHTOOL_MSG_LINKSTATE_GET - dump */
972 struct ethtool_linkstate_get_req_dump {
973 	struct {
974 		__u32 header:1;
975 	} _present;
976 
977 	struct ethtool_header header;
978 };
979 
980 static inline struct ethtool_linkstate_get_req_dump *
981 ethtool_linkstate_get_req_dump_alloc(void)
982 {
983 	return calloc(1, sizeof(struct ethtool_linkstate_get_req_dump));
984 }
985 void
986 ethtool_linkstate_get_req_dump_free(struct ethtool_linkstate_get_req_dump *req);
987 
988 static inline void
989 ethtool_linkstate_get_req_dump_set_header_dev_index(struct ethtool_linkstate_get_req_dump *req,
990 						    __u32 dev_index)
991 {
992 	req->_present.header = 1;
993 	req->header._present.dev_index = 1;
994 	req->header.dev_index = dev_index;
995 }
996 static inline void
997 ethtool_linkstate_get_req_dump_set_header_dev_name(struct ethtool_linkstate_get_req_dump *req,
998 						   const char *dev_name)
999 {
1000 	free(req->header.dev_name);
1001 	req->header._present.dev_name_len = strlen(dev_name);
1002 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
1003 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
1004 	req->header.dev_name[req->header._present.dev_name_len] = 0;
1005 }
1006 static inline void
1007 ethtool_linkstate_get_req_dump_set_header_flags(struct ethtool_linkstate_get_req_dump *req,
1008 						__u32 flags)
1009 {
1010 	req->_present.header = 1;
1011 	req->header._present.flags = 1;
1012 	req->header.flags = flags;
1013 }
1014 
1015 struct ethtool_linkstate_get_list {
1016 	struct ethtool_linkstate_get_list *next;
1017 	struct ethtool_linkstate_get_rsp obj __attribute__ ((aligned (8)));
1018 };
1019 
1020 void ethtool_linkstate_get_list_free(struct ethtool_linkstate_get_list *rsp);
1021 
1022 struct ethtool_linkstate_get_list *
1023 ethtool_linkstate_get_dump(struct ynl_sock *ys,
1024 			   struct ethtool_linkstate_get_req_dump *req);
1025 
1026 /* ============== ETHTOOL_MSG_DEBUG_GET ============== */
1027 /* ETHTOOL_MSG_DEBUG_GET - do */
1028 struct ethtool_debug_get_req {
1029 	struct {
1030 		__u32 header:1;
1031 	} _present;
1032 
1033 	struct ethtool_header header;
1034 };
1035 
1036 static inline struct ethtool_debug_get_req *ethtool_debug_get_req_alloc(void)
1037 {
1038 	return calloc(1, sizeof(struct ethtool_debug_get_req));
1039 }
1040 void ethtool_debug_get_req_free(struct ethtool_debug_get_req *req);
1041 
1042 static inline void
1043 ethtool_debug_get_req_set_header_dev_index(struct ethtool_debug_get_req *req,
1044 					   __u32 dev_index)
1045 {
1046 	req->_present.header = 1;
1047 	req->header._present.dev_index = 1;
1048 	req->header.dev_index = dev_index;
1049 }
1050 static inline void
1051 ethtool_debug_get_req_set_header_dev_name(struct ethtool_debug_get_req *req,
1052 					  const char *dev_name)
1053 {
1054 	free(req->header.dev_name);
1055 	req->header._present.dev_name_len = strlen(dev_name);
1056 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
1057 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
1058 	req->header.dev_name[req->header._present.dev_name_len] = 0;
1059 }
1060 static inline void
1061 ethtool_debug_get_req_set_header_flags(struct ethtool_debug_get_req *req,
1062 				       __u32 flags)
1063 {
1064 	req->_present.header = 1;
1065 	req->header._present.flags = 1;
1066 	req->header.flags = flags;
1067 }
1068 
1069 struct ethtool_debug_get_rsp {
1070 	struct {
1071 		__u32 header:1;
1072 		__u32 msgmask:1;
1073 	} _present;
1074 
1075 	struct ethtool_header header;
1076 	struct ethtool_bitset msgmask;
1077 };
1078 
1079 void ethtool_debug_get_rsp_free(struct ethtool_debug_get_rsp *rsp);
1080 
1081 /*
1082  * Get debug message mask.
1083  */
1084 struct ethtool_debug_get_rsp *
1085 ethtool_debug_get(struct ynl_sock *ys, struct ethtool_debug_get_req *req);
1086 
1087 /* ETHTOOL_MSG_DEBUG_GET - dump */
1088 struct ethtool_debug_get_req_dump {
1089 	struct {
1090 		__u32 header:1;
1091 	} _present;
1092 
1093 	struct ethtool_header header;
1094 };
1095 
1096 static inline struct ethtool_debug_get_req_dump *
1097 ethtool_debug_get_req_dump_alloc(void)
1098 {
1099 	return calloc(1, sizeof(struct ethtool_debug_get_req_dump));
1100 }
1101 void ethtool_debug_get_req_dump_free(struct ethtool_debug_get_req_dump *req);
1102 
1103 static inline void
1104 ethtool_debug_get_req_dump_set_header_dev_index(struct ethtool_debug_get_req_dump *req,
1105 						__u32 dev_index)
1106 {
1107 	req->_present.header = 1;
1108 	req->header._present.dev_index = 1;
1109 	req->header.dev_index = dev_index;
1110 }
1111 static inline void
1112 ethtool_debug_get_req_dump_set_header_dev_name(struct ethtool_debug_get_req_dump *req,
1113 					       const char *dev_name)
1114 {
1115 	free(req->header.dev_name);
1116 	req->header._present.dev_name_len = strlen(dev_name);
1117 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
1118 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
1119 	req->header.dev_name[req->header._present.dev_name_len] = 0;
1120 }
1121 static inline void
1122 ethtool_debug_get_req_dump_set_header_flags(struct ethtool_debug_get_req_dump *req,
1123 					    __u32 flags)
1124 {
1125 	req->_present.header = 1;
1126 	req->header._present.flags = 1;
1127 	req->header.flags = flags;
1128 }
1129 
1130 struct ethtool_debug_get_list {
1131 	struct ethtool_debug_get_list *next;
1132 	struct ethtool_debug_get_rsp obj __attribute__ ((aligned (8)));
1133 };
1134 
1135 void ethtool_debug_get_list_free(struct ethtool_debug_get_list *rsp);
1136 
1137 struct ethtool_debug_get_list *
1138 ethtool_debug_get_dump(struct ynl_sock *ys,
1139 		       struct ethtool_debug_get_req_dump *req);
1140 
1141 /* ETHTOOL_MSG_DEBUG_GET - notify */
1142 struct ethtool_debug_get_ntf {
1143 	__u16 family;
1144 	__u8 cmd;
1145 	struct ynl_ntf_base_type *next;
1146 	void (*free)(struct ethtool_debug_get_ntf *ntf);
1147 	struct ethtool_debug_get_rsp obj __attribute__ ((aligned (8)));
1148 };
1149 
1150 void ethtool_debug_get_ntf_free(struct ethtool_debug_get_ntf *rsp);
1151 
1152 /* ============== ETHTOOL_MSG_DEBUG_SET ============== */
1153 /* ETHTOOL_MSG_DEBUG_SET - do */
1154 struct ethtool_debug_set_req {
1155 	struct {
1156 		__u32 header:1;
1157 		__u32 msgmask:1;
1158 	} _present;
1159 
1160 	struct ethtool_header header;
1161 	struct ethtool_bitset msgmask;
1162 };
1163 
1164 static inline struct ethtool_debug_set_req *ethtool_debug_set_req_alloc(void)
1165 {
1166 	return calloc(1, sizeof(struct ethtool_debug_set_req));
1167 }
1168 void ethtool_debug_set_req_free(struct ethtool_debug_set_req *req);
1169 
1170 static inline void
1171 ethtool_debug_set_req_set_header_dev_index(struct ethtool_debug_set_req *req,
1172 					   __u32 dev_index)
1173 {
1174 	req->_present.header = 1;
1175 	req->header._present.dev_index = 1;
1176 	req->header.dev_index = dev_index;
1177 }
1178 static inline void
1179 ethtool_debug_set_req_set_header_dev_name(struct ethtool_debug_set_req *req,
1180 					  const char *dev_name)
1181 {
1182 	free(req->header.dev_name);
1183 	req->header._present.dev_name_len = strlen(dev_name);
1184 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
1185 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
1186 	req->header.dev_name[req->header._present.dev_name_len] = 0;
1187 }
1188 static inline void
1189 ethtool_debug_set_req_set_header_flags(struct ethtool_debug_set_req *req,
1190 				       __u32 flags)
1191 {
1192 	req->_present.header = 1;
1193 	req->header._present.flags = 1;
1194 	req->header.flags = flags;
1195 }
1196 static inline void
1197 ethtool_debug_set_req_set_msgmask_nomask(struct ethtool_debug_set_req *req)
1198 {
1199 	req->_present.msgmask = 1;
1200 	req->msgmask._present.nomask = 1;
1201 }
1202 static inline void
1203 ethtool_debug_set_req_set_msgmask_size(struct ethtool_debug_set_req *req,
1204 				       __u32 size)
1205 {
1206 	req->_present.msgmask = 1;
1207 	req->msgmask._present.size = 1;
1208 	req->msgmask.size = size;
1209 }
1210 static inline void
1211 __ethtool_debug_set_req_set_msgmask_bits_bit(struct ethtool_debug_set_req *req,
1212 					     struct ethtool_bitset_bit *bit,
1213 					     unsigned int n_bit)
1214 {
1215 	free(req->msgmask.bits.bit);
1216 	req->msgmask.bits.bit = bit;
1217 	req->msgmask.bits.n_bit = n_bit;
1218 }
1219 
1220 /*
1221  * Set debug message mask.
1222  */
1223 int ethtool_debug_set(struct ynl_sock *ys, struct ethtool_debug_set_req *req);
1224 
1225 /* ============== ETHTOOL_MSG_WOL_GET ============== */
1226 /* ETHTOOL_MSG_WOL_GET - do */
1227 struct ethtool_wol_get_req {
1228 	struct {
1229 		__u32 header:1;
1230 	} _present;
1231 
1232 	struct ethtool_header header;
1233 };
1234 
1235 static inline struct ethtool_wol_get_req *ethtool_wol_get_req_alloc(void)
1236 {
1237 	return calloc(1, sizeof(struct ethtool_wol_get_req));
1238 }
1239 void ethtool_wol_get_req_free(struct ethtool_wol_get_req *req);
1240 
1241 static inline void
1242 ethtool_wol_get_req_set_header_dev_index(struct ethtool_wol_get_req *req,
1243 					 __u32 dev_index)
1244 {
1245 	req->_present.header = 1;
1246 	req->header._present.dev_index = 1;
1247 	req->header.dev_index = dev_index;
1248 }
1249 static inline void
1250 ethtool_wol_get_req_set_header_dev_name(struct ethtool_wol_get_req *req,
1251 					const char *dev_name)
1252 {
1253 	free(req->header.dev_name);
1254 	req->header._present.dev_name_len = strlen(dev_name);
1255 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
1256 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
1257 	req->header.dev_name[req->header._present.dev_name_len] = 0;
1258 }
1259 static inline void
1260 ethtool_wol_get_req_set_header_flags(struct ethtool_wol_get_req *req,
1261 				     __u32 flags)
1262 {
1263 	req->_present.header = 1;
1264 	req->header._present.flags = 1;
1265 	req->header.flags = flags;
1266 }
1267 
1268 struct ethtool_wol_get_rsp {
1269 	struct {
1270 		__u32 header:1;
1271 		__u32 modes:1;
1272 		__u32 sopass_len;
1273 	} _present;
1274 
1275 	struct ethtool_header header;
1276 	struct ethtool_bitset modes;
1277 	void *sopass;
1278 };
1279 
1280 void ethtool_wol_get_rsp_free(struct ethtool_wol_get_rsp *rsp);
1281 
1282 /*
1283  * Get WOL params.
1284  */
1285 struct ethtool_wol_get_rsp *
1286 ethtool_wol_get(struct ynl_sock *ys, struct ethtool_wol_get_req *req);
1287 
1288 /* ETHTOOL_MSG_WOL_GET - dump */
1289 struct ethtool_wol_get_req_dump {
1290 	struct {
1291 		__u32 header:1;
1292 	} _present;
1293 
1294 	struct ethtool_header header;
1295 };
1296 
1297 static inline struct ethtool_wol_get_req_dump *
1298 ethtool_wol_get_req_dump_alloc(void)
1299 {
1300 	return calloc(1, sizeof(struct ethtool_wol_get_req_dump));
1301 }
1302 void ethtool_wol_get_req_dump_free(struct ethtool_wol_get_req_dump *req);
1303 
1304 static inline void
1305 ethtool_wol_get_req_dump_set_header_dev_index(struct ethtool_wol_get_req_dump *req,
1306 					      __u32 dev_index)
1307 {
1308 	req->_present.header = 1;
1309 	req->header._present.dev_index = 1;
1310 	req->header.dev_index = dev_index;
1311 }
1312 static inline void
1313 ethtool_wol_get_req_dump_set_header_dev_name(struct ethtool_wol_get_req_dump *req,
1314 					     const char *dev_name)
1315 {
1316 	free(req->header.dev_name);
1317 	req->header._present.dev_name_len = strlen(dev_name);
1318 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
1319 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
1320 	req->header.dev_name[req->header._present.dev_name_len] = 0;
1321 }
1322 static inline void
1323 ethtool_wol_get_req_dump_set_header_flags(struct ethtool_wol_get_req_dump *req,
1324 					  __u32 flags)
1325 {
1326 	req->_present.header = 1;
1327 	req->header._present.flags = 1;
1328 	req->header.flags = flags;
1329 }
1330 
1331 struct ethtool_wol_get_list {
1332 	struct ethtool_wol_get_list *next;
1333 	struct ethtool_wol_get_rsp obj __attribute__ ((aligned (8)));
1334 };
1335 
1336 void ethtool_wol_get_list_free(struct ethtool_wol_get_list *rsp);
1337 
1338 struct ethtool_wol_get_list *
1339 ethtool_wol_get_dump(struct ynl_sock *ys, struct ethtool_wol_get_req_dump *req);
1340 
1341 /* ETHTOOL_MSG_WOL_GET - notify */
1342 struct ethtool_wol_get_ntf {
1343 	__u16 family;
1344 	__u8 cmd;
1345 	struct ynl_ntf_base_type *next;
1346 	void (*free)(struct ethtool_wol_get_ntf *ntf);
1347 	struct ethtool_wol_get_rsp obj __attribute__ ((aligned (8)));
1348 };
1349 
1350 void ethtool_wol_get_ntf_free(struct ethtool_wol_get_ntf *rsp);
1351 
1352 /* ============== ETHTOOL_MSG_WOL_SET ============== */
1353 /* ETHTOOL_MSG_WOL_SET - do */
1354 struct ethtool_wol_set_req {
1355 	struct {
1356 		__u32 header:1;
1357 		__u32 modes:1;
1358 		__u32 sopass_len;
1359 	} _present;
1360 
1361 	struct ethtool_header header;
1362 	struct ethtool_bitset modes;
1363 	void *sopass;
1364 };
1365 
1366 static inline struct ethtool_wol_set_req *ethtool_wol_set_req_alloc(void)
1367 {
1368 	return calloc(1, sizeof(struct ethtool_wol_set_req));
1369 }
1370 void ethtool_wol_set_req_free(struct ethtool_wol_set_req *req);
1371 
1372 static inline void
1373 ethtool_wol_set_req_set_header_dev_index(struct ethtool_wol_set_req *req,
1374 					 __u32 dev_index)
1375 {
1376 	req->_present.header = 1;
1377 	req->header._present.dev_index = 1;
1378 	req->header.dev_index = dev_index;
1379 }
1380 static inline void
1381 ethtool_wol_set_req_set_header_dev_name(struct ethtool_wol_set_req *req,
1382 					const char *dev_name)
1383 {
1384 	free(req->header.dev_name);
1385 	req->header._present.dev_name_len = strlen(dev_name);
1386 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
1387 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
1388 	req->header.dev_name[req->header._present.dev_name_len] = 0;
1389 }
1390 static inline void
1391 ethtool_wol_set_req_set_header_flags(struct ethtool_wol_set_req *req,
1392 				     __u32 flags)
1393 {
1394 	req->_present.header = 1;
1395 	req->header._present.flags = 1;
1396 	req->header.flags = flags;
1397 }
1398 static inline void
1399 ethtool_wol_set_req_set_modes_nomask(struct ethtool_wol_set_req *req)
1400 {
1401 	req->_present.modes = 1;
1402 	req->modes._present.nomask = 1;
1403 }
1404 static inline void
1405 ethtool_wol_set_req_set_modes_size(struct ethtool_wol_set_req *req, __u32 size)
1406 {
1407 	req->_present.modes = 1;
1408 	req->modes._present.size = 1;
1409 	req->modes.size = size;
1410 }
1411 static inline void
1412 __ethtool_wol_set_req_set_modes_bits_bit(struct ethtool_wol_set_req *req,
1413 					 struct ethtool_bitset_bit *bit,
1414 					 unsigned int n_bit)
1415 {
1416 	free(req->modes.bits.bit);
1417 	req->modes.bits.bit = bit;
1418 	req->modes.bits.n_bit = n_bit;
1419 }
1420 static inline void
1421 ethtool_wol_set_req_set_sopass(struct ethtool_wol_set_req *req,
1422 			       const void *sopass, size_t len)
1423 {
1424 	free(req->sopass);
1425 	req->sopass = malloc(req->_present.sopass_len);
1426 	memcpy(req->sopass, sopass, req->_present.sopass_len);
1427 }
1428 
1429 /*
1430  * Set WOL params.
1431  */
1432 int ethtool_wol_set(struct ynl_sock *ys, struct ethtool_wol_set_req *req);
1433 
1434 /* ============== ETHTOOL_MSG_FEATURES_GET ============== */
1435 /* ETHTOOL_MSG_FEATURES_GET - do */
1436 struct ethtool_features_get_req {
1437 	struct {
1438 		__u32 header:1;
1439 	} _present;
1440 
1441 	struct ethtool_header header;
1442 };
1443 
1444 static inline struct ethtool_features_get_req *
1445 ethtool_features_get_req_alloc(void)
1446 {
1447 	return calloc(1, sizeof(struct ethtool_features_get_req));
1448 }
1449 void ethtool_features_get_req_free(struct ethtool_features_get_req *req);
1450 
1451 static inline void
1452 ethtool_features_get_req_set_header_dev_index(struct ethtool_features_get_req *req,
1453 					      __u32 dev_index)
1454 {
1455 	req->_present.header = 1;
1456 	req->header._present.dev_index = 1;
1457 	req->header.dev_index = dev_index;
1458 }
1459 static inline void
1460 ethtool_features_get_req_set_header_dev_name(struct ethtool_features_get_req *req,
1461 					     const char *dev_name)
1462 {
1463 	free(req->header.dev_name);
1464 	req->header._present.dev_name_len = strlen(dev_name);
1465 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
1466 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
1467 	req->header.dev_name[req->header._present.dev_name_len] = 0;
1468 }
1469 static inline void
1470 ethtool_features_get_req_set_header_flags(struct ethtool_features_get_req *req,
1471 					  __u32 flags)
1472 {
1473 	req->_present.header = 1;
1474 	req->header._present.flags = 1;
1475 	req->header.flags = flags;
1476 }
1477 
1478 struct ethtool_features_get_rsp {
1479 	struct {
1480 		__u32 header:1;
1481 		__u32 hw:1;
1482 		__u32 wanted:1;
1483 		__u32 active:1;
1484 		__u32 nochange:1;
1485 	} _present;
1486 
1487 	struct ethtool_header header;
1488 	struct ethtool_bitset hw;
1489 	struct ethtool_bitset wanted;
1490 	struct ethtool_bitset active;
1491 	struct ethtool_bitset nochange;
1492 };
1493 
1494 void ethtool_features_get_rsp_free(struct ethtool_features_get_rsp *rsp);
1495 
1496 /*
1497  * Get features.
1498  */
1499 struct ethtool_features_get_rsp *
1500 ethtool_features_get(struct ynl_sock *ys, struct ethtool_features_get_req *req);
1501 
1502 /* ETHTOOL_MSG_FEATURES_GET - dump */
1503 struct ethtool_features_get_req_dump {
1504 	struct {
1505 		__u32 header:1;
1506 	} _present;
1507 
1508 	struct ethtool_header header;
1509 };
1510 
1511 static inline struct ethtool_features_get_req_dump *
1512 ethtool_features_get_req_dump_alloc(void)
1513 {
1514 	return calloc(1, sizeof(struct ethtool_features_get_req_dump));
1515 }
1516 void
1517 ethtool_features_get_req_dump_free(struct ethtool_features_get_req_dump *req);
1518 
1519 static inline void
1520 ethtool_features_get_req_dump_set_header_dev_index(struct ethtool_features_get_req_dump *req,
1521 						   __u32 dev_index)
1522 {
1523 	req->_present.header = 1;
1524 	req->header._present.dev_index = 1;
1525 	req->header.dev_index = dev_index;
1526 }
1527 static inline void
1528 ethtool_features_get_req_dump_set_header_dev_name(struct ethtool_features_get_req_dump *req,
1529 						  const char *dev_name)
1530 {
1531 	free(req->header.dev_name);
1532 	req->header._present.dev_name_len = strlen(dev_name);
1533 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
1534 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
1535 	req->header.dev_name[req->header._present.dev_name_len] = 0;
1536 }
1537 static inline void
1538 ethtool_features_get_req_dump_set_header_flags(struct ethtool_features_get_req_dump *req,
1539 					       __u32 flags)
1540 {
1541 	req->_present.header = 1;
1542 	req->header._present.flags = 1;
1543 	req->header.flags = flags;
1544 }
1545 
1546 struct ethtool_features_get_list {
1547 	struct ethtool_features_get_list *next;
1548 	struct ethtool_features_get_rsp obj __attribute__ ((aligned (8)));
1549 };
1550 
1551 void ethtool_features_get_list_free(struct ethtool_features_get_list *rsp);
1552 
1553 struct ethtool_features_get_list *
1554 ethtool_features_get_dump(struct ynl_sock *ys,
1555 			  struct ethtool_features_get_req_dump *req);
1556 
1557 /* ETHTOOL_MSG_FEATURES_GET - notify */
1558 struct ethtool_features_get_ntf {
1559 	__u16 family;
1560 	__u8 cmd;
1561 	struct ynl_ntf_base_type *next;
1562 	void (*free)(struct ethtool_features_get_ntf *ntf);
1563 	struct ethtool_features_get_rsp obj __attribute__ ((aligned (8)));
1564 };
1565 
1566 void ethtool_features_get_ntf_free(struct ethtool_features_get_ntf *rsp);
1567 
1568 /* ============== ETHTOOL_MSG_FEATURES_SET ============== */
1569 /* ETHTOOL_MSG_FEATURES_SET - do */
1570 struct ethtool_features_set_req {
1571 	struct {
1572 		__u32 header:1;
1573 		__u32 hw:1;
1574 		__u32 wanted:1;
1575 		__u32 active:1;
1576 		__u32 nochange:1;
1577 	} _present;
1578 
1579 	struct ethtool_header header;
1580 	struct ethtool_bitset hw;
1581 	struct ethtool_bitset wanted;
1582 	struct ethtool_bitset active;
1583 	struct ethtool_bitset nochange;
1584 };
1585 
1586 static inline struct ethtool_features_set_req *
1587 ethtool_features_set_req_alloc(void)
1588 {
1589 	return calloc(1, sizeof(struct ethtool_features_set_req));
1590 }
1591 void ethtool_features_set_req_free(struct ethtool_features_set_req *req);
1592 
1593 static inline void
1594 ethtool_features_set_req_set_header_dev_index(struct ethtool_features_set_req *req,
1595 					      __u32 dev_index)
1596 {
1597 	req->_present.header = 1;
1598 	req->header._present.dev_index = 1;
1599 	req->header.dev_index = dev_index;
1600 }
1601 static inline void
1602 ethtool_features_set_req_set_header_dev_name(struct ethtool_features_set_req *req,
1603 					     const char *dev_name)
1604 {
1605 	free(req->header.dev_name);
1606 	req->header._present.dev_name_len = strlen(dev_name);
1607 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
1608 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
1609 	req->header.dev_name[req->header._present.dev_name_len] = 0;
1610 }
1611 static inline void
1612 ethtool_features_set_req_set_header_flags(struct ethtool_features_set_req *req,
1613 					  __u32 flags)
1614 {
1615 	req->_present.header = 1;
1616 	req->header._present.flags = 1;
1617 	req->header.flags = flags;
1618 }
1619 static inline void
1620 ethtool_features_set_req_set_hw_nomask(struct ethtool_features_set_req *req)
1621 {
1622 	req->_present.hw = 1;
1623 	req->hw._present.nomask = 1;
1624 }
1625 static inline void
1626 ethtool_features_set_req_set_hw_size(struct ethtool_features_set_req *req,
1627 				     __u32 size)
1628 {
1629 	req->_present.hw = 1;
1630 	req->hw._present.size = 1;
1631 	req->hw.size = size;
1632 }
1633 static inline void
1634 __ethtool_features_set_req_set_hw_bits_bit(struct ethtool_features_set_req *req,
1635 					   struct ethtool_bitset_bit *bit,
1636 					   unsigned int n_bit)
1637 {
1638 	free(req->hw.bits.bit);
1639 	req->hw.bits.bit = bit;
1640 	req->hw.bits.n_bit = n_bit;
1641 }
1642 static inline void
1643 ethtool_features_set_req_set_wanted_nomask(struct ethtool_features_set_req *req)
1644 {
1645 	req->_present.wanted = 1;
1646 	req->wanted._present.nomask = 1;
1647 }
1648 static inline void
1649 ethtool_features_set_req_set_wanted_size(struct ethtool_features_set_req *req,
1650 					 __u32 size)
1651 {
1652 	req->_present.wanted = 1;
1653 	req->wanted._present.size = 1;
1654 	req->wanted.size = size;
1655 }
1656 static inline void
1657 __ethtool_features_set_req_set_wanted_bits_bit(struct ethtool_features_set_req *req,
1658 					       struct ethtool_bitset_bit *bit,
1659 					       unsigned int n_bit)
1660 {
1661 	free(req->wanted.bits.bit);
1662 	req->wanted.bits.bit = bit;
1663 	req->wanted.bits.n_bit = n_bit;
1664 }
1665 static inline void
1666 ethtool_features_set_req_set_active_nomask(struct ethtool_features_set_req *req)
1667 {
1668 	req->_present.active = 1;
1669 	req->active._present.nomask = 1;
1670 }
1671 static inline void
1672 ethtool_features_set_req_set_active_size(struct ethtool_features_set_req *req,
1673 					 __u32 size)
1674 {
1675 	req->_present.active = 1;
1676 	req->active._present.size = 1;
1677 	req->active.size = size;
1678 }
1679 static inline void
1680 __ethtool_features_set_req_set_active_bits_bit(struct ethtool_features_set_req *req,
1681 					       struct ethtool_bitset_bit *bit,
1682 					       unsigned int n_bit)
1683 {
1684 	free(req->active.bits.bit);
1685 	req->active.bits.bit = bit;
1686 	req->active.bits.n_bit = n_bit;
1687 }
1688 static inline void
1689 ethtool_features_set_req_set_nochange_nomask(struct ethtool_features_set_req *req)
1690 {
1691 	req->_present.nochange = 1;
1692 	req->nochange._present.nomask = 1;
1693 }
1694 static inline void
1695 ethtool_features_set_req_set_nochange_size(struct ethtool_features_set_req *req,
1696 					   __u32 size)
1697 {
1698 	req->_present.nochange = 1;
1699 	req->nochange._present.size = 1;
1700 	req->nochange.size = size;
1701 }
1702 static inline void
1703 __ethtool_features_set_req_set_nochange_bits_bit(struct ethtool_features_set_req *req,
1704 						 struct ethtool_bitset_bit *bit,
1705 						 unsigned int n_bit)
1706 {
1707 	free(req->nochange.bits.bit);
1708 	req->nochange.bits.bit = bit;
1709 	req->nochange.bits.n_bit = n_bit;
1710 }
1711 
1712 struct ethtool_features_set_rsp {
1713 	struct {
1714 		__u32 header:1;
1715 		__u32 hw:1;
1716 		__u32 wanted:1;
1717 		__u32 active:1;
1718 		__u32 nochange:1;
1719 	} _present;
1720 
1721 	struct ethtool_header header;
1722 	struct ethtool_bitset hw;
1723 	struct ethtool_bitset wanted;
1724 	struct ethtool_bitset active;
1725 	struct ethtool_bitset nochange;
1726 };
1727 
1728 void ethtool_features_set_rsp_free(struct ethtool_features_set_rsp *rsp);
1729 
1730 /*
1731  * Set features.
1732  */
1733 struct ethtool_features_set_rsp *
1734 ethtool_features_set(struct ynl_sock *ys, struct ethtool_features_set_req *req);
1735 
1736 /* ============== ETHTOOL_MSG_PRIVFLAGS_GET ============== */
1737 /* ETHTOOL_MSG_PRIVFLAGS_GET - do */
1738 struct ethtool_privflags_get_req {
1739 	struct {
1740 		__u32 header:1;
1741 	} _present;
1742 
1743 	struct ethtool_header header;
1744 };
1745 
1746 static inline struct ethtool_privflags_get_req *
1747 ethtool_privflags_get_req_alloc(void)
1748 {
1749 	return calloc(1, sizeof(struct ethtool_privflags_get_req));
1750 }
1751 void ethtool_privflags_get_req_free(struct ethtool_privflags_get_req *req);
1752 
1753 static inline void
1754 ethtool_privflags_get_req_set_header_dev_index(struct ethtool_privflags_get_req *req,
1755 					       __u32 dev_index)
1756 {
1757 	req->_present.header = 1;
1758 	req->header._present.dev_index = 1;
1759 	req->header.dev_index = dev_index;
1760 }
1761 static inline void
1762 ethtool_privflags_get_req_set_header_dev_name(struct ethtool_privflags_get_req *req,
1763 					      const char *dev_name)
1764 {
1765 	free(req->header.dev_name);
1766 	req->header._present.dev_name_len = strlen(dev_name);
1767 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
1768 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
1769 	req->header.dev_name[req->header._present.dev_name_len] = 0;
1770 }
1771 static inline void
1772 ethtool_privflags_get_req_set_header_flags(struct ethtool_privflags_get_req *req,
1773 					   __u32 flags)
1774 {
1775 	req->_present.header = 1;
1776 	req->header._present.flags = 1;
1777 	req->header.flags = flags;
1778 }
1779 
1780 struct ethtool_privflags_get_rsp {
1781 	struct {
1782 		__u32 header:1;
1783 		__u32 flags:1;
1784 	} _present;
1785 
1786 	struct ethtool_header header;
1787 	struct ethtool_bitset flags;
1788 };
1789 
1790 void ethtool_privflags_get_rsp_free(struct ethtool_privflags_get_rsp *rsp);
1791 
1792 /*
1793  * Get device private flags.
1794  */
1795 struct ethtool_privflags_get_rsp *
1796 ethtool_privflags_get(struct ynl_sock *ys,
1797 		      struct ethtool_privflags_get_req *req);
1798 
1799 /* ETHTOOL_MSG_PRIVFLAGS_GET - dump */
1800 struct ethtool_privflags_get_req_dump {
1801 	struct {
1802 		__u32 header:1;
1803 	} _present;
1804 
1805 	struct ethtool_header header;
1806 };
1807 
1808 static inline struct ethtool_privflags_get_req_dump *
1809 ethtool_privflags_get_req_dump_alloc(void)
1810 {
1811 	return calloc(1, sizeof(struct ethtool_privflags_get_req_dump));
1812 }
1813 void
1814 ethtool_privflags_get_req_dump_free(struct ethtool_privflags_get_req_dump *req);
1815 
1816 static inline void
1817 ethtool_privflags_get_req_dump_set_header_dev_index(struct ethtool_privflags_get_req_dump *req,
1818 						    __u32 dev_index)
1819 {
1820 	req->_present.header = 1;
1821 	req->header._present.dev_index = 1;
1822 	req->header.dev_index = dev_index;
1823 }
1824 static inline void
1825 ethtool_privflags_get_req_dump_set_header_dev_name(struct ethtool_privflags_get_req_dump *req,
1826 						   const char *dev_name)
1827 {
1828 	free(req->header.dev_name);
1829 	req->header._present.dev_name_len = strlen(dev_name);
1830 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
1831 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
1832 	req->header.dev_name[req->header._present.dev_name_len] = 0;
1833 }
1834 static inline void
1835 ethtool_privflags_get_req_dump_set_header_flags(struct ethtool_privflags_get_req_dump *req,
1836 						__u32 flags)
1837 {
1838 	req->_present.header = 1;
1839 	req->header._present.flags = 1;
1840 	req->header.flags = flags;
1841 }
1842 
1843 struct ethtool_privflags_get_list {
1844 	struct ethtool_privflags_get_list *next;
1845 	struct ethtool_privflags_get_rsp obj __attribute__ ((aligned (8)));
1846 };
1847 
1848 void ethtool_privflags_get_list_free(struct ethtool_privflags_get_list *rsp);
1849 
1850 struct ethtool_privflags_get_list *
1851 ethtool_privflags_get_dump(struct ynl_sock *ys,
1852 			   struct ethtool_privflags_get_req_dump *req);
1853 
1854 /* ETHTOOL_MSG_PRIVFLAGS_GET - notify */
1855 struct ethtool_privflags_get_ntf {
1856 	__u16 family;
1857 	__u8 cmd;
1858 	struct ynl_ntf_base_type *next;
1859 	void (*free)(struct ethtool_privflags_get_ntf *ntf);
1860 	struct ethtool_privflags_get_rsp obj __attribute__ ((aligned (8)));
1861 };
1862 
1863 void ethtool_privflags_get_ntf_free(struct ethtool_privflags_get_ntf *rsp);
1864 
1865 /* ============== ETHTOOL_MSG_PRIVFLAGS_SET ============== */
1866 /* ETHTOOL_MSG_PRIVFLAGS_SET - do */
1867 struct ethtool_privflags_set_req {
1868 	struct {
1869 		__u32 header:1;
1870 		__u32 flags:1;
1871 	} _present;
1872 
1873 	struct ethtool_header header;
1874 	struct ethtool_bitset flags;
1875 };
1876 
1877 static inline struct ethtool_privflags_set_req *
1878 ethtool_privflags_set_req_alloc(void)
1879 {
1880 	return calloc(1, sizeof(struct ethtool_privflags_set_req));
1881 }
1882 void ethtool_privflags_set_req_free(struct ethtool_privflags_set_req *req);
1883 
1884 static inline void
1885 ethtool_privflags_set_req_set_header_dev_index(struct ethtool_privflags_set_req *req,
1886 					       __u32 dev_index)
1887 {
1888 	req->_present.header = 1;
1889 	req->header._present.dev_index = 1;
1890 	req->header.dev_index = dev_index;
1891 }
1892 static inline void
1893 ethtool_privflags_set_req_set_header_dev_name(struct ethtool_privflags_set_req *req,
1894 					      const char *dev_name)
1895 {
1896 	free(req->header.dev_name);
1897 	req->header._present.dev_name_len = strlen(dev_name);
1898 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
1899 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
1900 	req->header.dev_name[req->header._present.dev_name_len] = 0;
1901 }
1902 static inline void
1903 ethtool_privflags_set_req_set_header_flags(struct ethtool_privflags_set_req *req,
1904 					   __u32 flags)
1905 {
1906 	req->_present.header = 1;
1907 	req->header._present.flags = 1;
1908 	req->header.flags = flags;
1909 }
1910 static inline void
1911 ethtool_privflags_set_req_set_flags_nomask(struct ethtool_privflags_set_req *req)
1912 {
1913 	req->_present.flags = 1;
1914 	req->flags._present.nomask = 1;
1915 }
1916 static inline void
1917 ethtool_privflags_set_req_set_flags_size(struct ethtool_privflags_set_req *req,
1918 					 __u32 size)
1919 {
1920 	req->_present.flags = 1;
1921 	req->flags._present.size = 1;
1922 	req->flags.size = size;
1923 }
1924 static inline void
1925 __ethtool_privflags_set_req_set_flags_bits_bit(struct ethtool_privflags_set_req *req,
1926 					       struct ethtool_bitset_bit *bit,
1927 					       unsigned int n_bit)
1928 {
1929 	free(req->flags.bits.bit);
1930 	req->flags.bits.bit = bit;
1931 	req->flags.bits.n_bit = n_bit;
1932 }
1933 
1934 /*
1935  * Set device private flags.
1936  */
1937 int ethtool_privflags_set(struct ynl_sock *ys,
1938 			  struct ethtool_privflags_set_req *req);
1939 
1940 /* ============== ETHTOOL_MSG_RINGS_GET ============== */
1941 /* ETHTOOL_MSG_RINGS_GET - do */
1942 struct ethtool_rings_get_req {
1943 	struct {
1944 		__u32 header:1;
1945 	} _present;
1946 
1947 	struct ethtool_header header;
1948 };
1949 
1950 static inline struct ethtool_rings_get_req *ethtool_rings_get_req_alloc(void)
1951 {
1952 	return calloc(1, sizeof(struct ethtool_rings_get_req));
1953 }
1954 void ethtool_rings_get_req_free(struct ethtool_rings_get_req *req);
1955 
1956 static inline void
1957 ethtool_rings_get_req_set_header_dev_index(struct ethtool_rings_get_req *req,
1958 					   __u32 dev_index)
1959 {
1960 	req->_present.header = 1;
1961 	req->header._present.dev_index = 1;
1962 	req->header.dev_index = dev_index;
1963 }
1964 static inline void
1965 ethtool_rings_get_req_set_header_dev_name(struct ethtool_rings_get_req *req,
1966 					  const char *dev_name)
1967 {
1968 	free(req->header.dev_name);
1969 	req->header._present.dev_name_len = strlen(dev_name);
1970 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
1971 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
1972 	req->header.dev_name[req->header._present.dev_name_len] = 0;
1973 }
1974 static inline void
1975 ethtool_rings_get_req_set_header_flags(struct ethtool_rings_get_req *req,
1976 				       __u32 flags)
1977 {
1978 	req->_present.header = 1;
1979 	req->header._present.flags = 1;
1980 	req->header.flags = flags;
1981 }
1982 
1983 struct ethtool_rings_get_rsp {
1984 	struct {
1985 		__u32 header:1;
1986 		__u32 rx_max:1;
1987 		__u32 rx_mini_max:1;
1988 		__u32 rx_jumbo_max:1;
1989 		__u32 tx_max:1;
1990 		__u32 rx:1;
1991 		__u32 rx_mini:1;
1992 		__u32 rx_jumbo:1;
1993 		__u32 tx:1;
1994 		__u32 rx_buf_len:1;
1995 		__u32 tcp_data_split:1;
1996 		__u32 cqe_size:1;
1997 		__u32 tx_push:1;
1998 		__u32 rx_push:1;
1999 		__u32 tx_push_buf_len:1;
2000 		__u32 tx_push_buf_len_max:1;
2001 	} _present;
2002 
2003 	struct ethtool_header header;
2004 	__u32 rx_max;
2005 	__u32 rx_mini_max;
2006 	__u32 rx_jumbo_max;
2007 	__u32 tx_max;
2008 	__u32 rx;
2009 	__u32 rx_mini;
2010 	__u32 rx_jumbo;
2011 	__u32 tx;
2012 	__u32 rx_buf_len;
2013 	__u8 tcp_data_split;
2014 	__u32 cqe_size;
2015 	__u8 tx_push;
2016 	__u8 rx_push;
2017 	__u32 tx_push_buf_len;
2018 	__u32 tx_push_buf_len_max;
2019 };
2020 
2021 void ethtool_rings_get_rsp_free(struct ethtool_rings_get_rsp *rsp);
2022 
2023 /*
2024  * Get ring params.
2025  */
2026 struct ethtool_rings_get_rsp *
2027 ethtool_rings_get(struct ynl_sock *ys, struct ethtool_rings_get_req *req);
2028 
2029 /* ETHTOOL_MSG_RINGS_GET - dump */
2030 struct ethtool_rings_get_req_dump {
2031 	struct {
2032 		__u32 header:1;
2033 	} _present;
2034 
2035 	struct ethtool_header header;
2036 };
2037 
2038 static inline struct ethtool_rings_get_req_dump *
2039 ethtool_rings_get_req_dump_alloc(void)
2040 {
2041 	return calloc(1, sizeof(struct ethtool_rings_get_req_dump));
2042 }
2043 void ethtool_rings_get_req_dump_free(struct ethtool_rings_get_req_dump *req);
2044 
2045 static inline void
2046 ethtool_rings_get_req_dump_set_header_dev_index(struct ethtool_rings_get_req_dump *req,
2047 						__u32 dev_index)
2048 {
2049 	req->_present.header = 1;
2050 	req->header._present.dev_index = 1;
2051 	req->header.dev_index = dev_index;
2052 }
2053 static inline void
2054 ethtool_rings_get_req_dump_set_header_dev_name(struct ethtool_rings_get_req_dump *req,
2055 					       const char *dev_name)
2056 {
2057 	free(req->header.dev_name);
2058 	req->header._present.dev_name_len = strlen(dev_name);
2059 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
2060 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
2061 	req->header.dev_name[req->header._present.dev_name_len] = 0;
2062 }
2063 static inline void
2064 ethtool_rings_get_req_dump_set_header_flags(struct ethtool_rings_get_req_dump *req,
2065 					    __u32 flags)
2066 {
2067 	req->_present.header = 1;
2068 	req->header._present.flags = 1;
2069 	req->header.flags = flags;
2070 }
2071 
2072 struct ethtool_rings_get_list {
2073 	struct ethtool_rings_get_list *next;
2074 	struct ethtool_rings_get_rsp obj __attribute__ ((aligned (8)));
2075 };
2076 
2077 void ethtool_rings_get_list_free(struct ethtool_rings_get_list *rsp);
2078 
2079 struct ethtool_rings_get_list *
2080 ethtool_rings_get_dump(struct ynl_sock *ys,
2081 		       struct ethtool_rings_get_req_dump *req);
2082 
2083 /* ETHTOOL_MSG_RINGS_GET - notify */
2084 struct ethtool_rings_get_ntf {
2085 	__u16 family;
2086 	__u8 cmd;
2087 	struct ynl_ntf_base_type *next;
2088 	void (*free)(struct ethtool_rings_get_ntf *ntf);
2089 	struct ethtool_rings_get_rsp obj __attribute__ ((aligned (8)));
2090 };
2091 
2092 void ethtool_rings_get_ntf_free(struct ethtool_rings_get_ntf *rsp);
2093 
2094 /* ============== ETHTOOL_MSG_RINGS_SET ============== */
2095 /* ETHTOOL_MSG_RINGS_SET - do */
2096 struct ethtool_rings_set_req {
2097 	struct {
2098 		__u32 header:1;
2099 		__u32 rx_max:1;
2100 		__u32 rx_mini_max:1;
2101 		__u32 rx_jumbo_max:1;
2102 		__u32 tx_max:1;
2103 		__u32 rx:1;
2104 		__u32 rx_mini:1;
2105 		__u32 rx_jumbo:1;
2106 		__u32 tx:1;
2107 		__u32 rx_buf_len:1;
2108 		__u32 tcp_data_split:1;
2109 		__u32 cqe_size:1;
2110 		__u32 tx_push:1;
2111 		__u32 rx_push:1;
2112 		__u32 tx_push_buf_len:1;
2113 		__u32 tx_push_buf_len_max:1;
2114 	} _present;
2115 
2116 	struct ethtool_header header;
2117 	__u32 rx_max;
2118 	__u32 rx_mini_max;
2119 	__u32 rx_jumbo_max;
2120 	__u32 tx_max;
2121 	__u32 rx;
2122 	__u32 rx_mini;
2123 	__u32 rx_jumbo;
2124 	__u32 tx;
2125 	__u32 rx_buf_len;
2126 	__u8 tcp_data_split;
2127 	__u32 cqe_size;
2128 	__u8 tx_push;
2129 	__u8 rx_push;
2130 	__u32 tx_push_buf_len;
2131 	__u32 tx_push_buf_len_max;
2132 };
2133 
2134 static inline struct ethtool_rings_set_req *ethtool_rings_set_req_alloc(void)
2135 {
2136 	return calloc(1, sizeof(struct ethtool_rings_set_req));
2137 }
2138 void ethtool_rings_set_req_free(struct ethtool_rings_set_req *req);
2139 
2140 static inline void
2141 ethtool_rings_set_req_set_header_dev_index(struct ethtool_rings_set_req *req,
2142 					   __u32 dev_index)
2143 {
2144 	req->_present.header = 1;
2145 	req->header._present.dev_index = 1;
2146 	req->header.dev_index = dev_index;
2147 }
2148 static inline void
2149 ethtool_rings_set_req_set_header_dev_name(struct ethtool_rings_set_req *req,
2150 					  const char *dev_name)
2151 {
2152 	free(req->header.dev_name);
2153 	req->header._present.dev_name_len = strlen(dev_name);
2154 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
2155 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
2156 	req->header.dev_name[req->header._present.dev_name_len] = 0;
2157 }
2158 static inline void
2159 ethtool_rings_set_req_set_header_flags(struct ethtool_rings_set_req *req,
2160 				       __u32 flags)
2161 {
2162 	req->_present.header = 1;
2163 	req->header._present.flags = 1;
2164 	req->header.flags = flags;
2165 }
2166 static inline void
2167 ethtool_rings_set_req_set_rx_max(struct ethtool_rings_set_req *req,
2168 				 __u32 rx_max)
2169 {
2170 	req->_present.rx_max = 1;
2171 	req->rx_max = rx_max;
2172 }
2173 static inline void
2174 ethtool_rings_set_req_set_rx_mini_max(struct ethtool_rings_set_req *req,
2175 				      __u32 rx_mini_max)
2176 {
2177 	req->_present.rx_mini_max = 1;
2178 	req->rx_mini_max = rx_mini_max;
2179 }
2180 static inline void
2181 ethtool_rings_set_req_set_rx_jumbo_max(struct ethtool_rings_set_req *req,
2182 				       __u32 rx_jumbo_max)
2183 {
2184 	req->_present.rx_jumbo_max = 1;
2185 	req->rx_jumbo_max = rx_jumbo_max;
2186 }
2187 static inline void
2188 ethtool_rings_set_req_set_tx_max(struct ethtool_rings_set_req *req,
2189 				 __u32 tx_max)
2190 {
2191 	req->_present.tx_max = 1;
2192 	req->tx_max = tx_max;
2193 }
2194 static inline void
2195 ethtool_rings_set_req_set_rx(struct ethtool_rings_set_req *req, __u32 rx)
2196 {
2197 	req->_present.rx = 1;
2198 	req->rx = rx;
2199 }
2200 static inline void
2201 ethtool_rings_set_req_set_rx_mini(struct ethtool_rings_set_req *req,
2202 				  __u32 rx_mini)
2203 {
2204 	req->_present.rx_mini = 1;
2205 	req->rx_mini = rx_mini;
2206 }
2207 static inline void
2208 ethtool_rings_set_req_set_rx_jumbo(struct ethtool_rings_set_req *req,
2209 				   __u32 rx_jumbo)
2210 {
2211 	req->_present.rx_jumbo = 1;
2212 	req->rx_jumbo = rx_jumbo;
2213 }
2214 static inline void
2215 ethtool_rings_set_req_set_tx(struct ethtool_rings_set_req *req, __u32 tx)
2216 {
2217 	req->_present.tx = 1;
2218 	req->tx = tx;
2219 }
2220 static inline void
2221 ethtool_rings_set_req_set_rx_buf_len(struct ethtool_rings_set_req *req,
2222 				     __u32 rx_buf_len)
2223 {
2224 	req->_present.rx_buf_len = 1;
2225 	req->rx_buf_len = rx_buf_len;
2226 }
2227 static inline void
2228 ethtool_rings_set_req_set_tcp_data_split(struct ethtool_rings_set_req *req,
2229 					 __u8 tcp_data_split)
2230 {
2231 	req->_present.tcp_data_split = 1;
2232 	req->tcp_data_split = tcp_data_split;
2233 }
2234 static inline void
2235 ethtool_rings_set_req_set_cqe_size(struct ethtool_rings_set_req *req,
2236 				   __u32 cqe_size)
2237 {
2238 	req->_present.cqe_size = 1;
2239 	req->cqe_size = cqe_size;
2240 }
2241 static inline void
2242 ethtool_rings_set_req_set_tx_push(struct ethtool_rings_set_req *req,
2243 				  __u8 tx_push)
2244 {
2245 	req->_present.tx_push = 1;
2246 	req->tx_push = tx_push;
2247 }
2248 static inline void
2249 ethtool_rings_set_req_set_rx_push(struct ethtool_rings_set_req *req,
2250 				  __u8 rx_push)
2251 {
2252 	req->_present.rx_push = 1;
2253 	req->rx_push = rx_push;
2254 }
2255 static inline void
2256 ethtool_rings_set_req_set_tx_push_buf_len(struct ethtool_rings_set_req *req,
2257 					  __u32 tx_push_buf_len)
2258 {
2259 	req->_present.tx_push_buf_len = 1;
2260 	req->tx_push_buf_len = tx_push_buf_len;
2261 }
2262 static inline void
2263 ethtool_rings_set_req_set_tx_push_buf_len_max(struct ethtool_rings_set_req *req,
2264 					      __u32 tx_push_buf_len_max)
2265 {
2266 	req->_present.tx_push_buf_len_max = 1;
2267 	req->tx_push_buf_len_max = tx_push_buf_len_max;
2268 }
2269 
2270 /*
2271  * Set ring params.
2272  */
2273 int ethtool_rings_set(struct ynl_sock *ys, struct ethtool_rings_set_req *req);
2274 
2275 /* ============== ETHTOOL_MSG_CHANNELS_GET ============== */
2276 /* ETHTOOL_MSG_CHANNELS_GET - do */
2277 struct ethtool_channels_get_req {
2278 	struct {
2279 		__u32 header:1;
2280 	} _present;
2281 
2282 	struct ethtool_header header;
2283 };
2284 
2285 static inline struct ethtool_channels_get_req *
2286 ethtool_channels_get_req_alloc(void)
2287 {
2288 	return calloc(1, sizeof(struct ethtool_channels_get_req));
2289 }
2290 void ethtool_channels_get_req_free(struct ethtool_channels_get_req *req);
2291 
2292 static inline void
2293 ethtool_channels_get_req_set_header_dev_index(struct ethtool_channels_get_req *req,
2294 					      __u32 dev_index)
2295 {
2296 	req->_present.header = 1;
2297 	req->header._present.dev_index = 1;
2298 	req->header.dev_index = dev_index;
2299 }
2300 static inline void
2301 ethtool_channels_get_req_set_header_dev_name(struct ethtool_channels_get_req *req,
2302 					     const char *dev_name)
2303 {
2304 	free(req->header.dev_name);
2305 	req->header._present.dev_name_len = strlen(dev_name);
2306 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
2307 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
2308 	req->header.dev_name[req->header._present.dev_name_len] = 0;
2309 }
2310 static inline void
2311 ethtool_channels_get_req_set_header_flags(struct ethtool_channels_get_req *req,
2312 					  __u32 flags)
2313 {
2314 	req->_present.header = 1;
2315 	req->header._present.flags = 1;
2316 	req->header.flags = flags;
2317 }
2318 
2319 struct ethtool_channels_get_rsp {
2320 	struct {
2321 		__u32 header:1;
2322 		__u32 rx_max:1;
2323 		__u32 tx_max:1;
2324 		__u32 other_max:1;
2325 		__u32 combined_max:1;
2326 		__u32 rx_count:1;
2327 		__u32 tx_count:1;
2328 		__u32 other_count:1;
2329 		__u32 combined_count:1;
2330 	} _present;
2331 
2332 	struct ethtool_header header;
2333 	__u32 rx_max;
2334 	__u32 tx_max;
2335 	__u32 other_max;
2336 	__u32 combined_max;
2337 	__u32 rx_count;
2338 	__u32 tx_count;
2339 	__u32 other_count;
2340 	__u32 combined_count;
2341 };
2342 
2343 void ethtool_channels_get_rsp_free(struct ethtool_channels_get_rsp *rsp);
2344 
2345 /*
2346  * Get channel params.
2347  */
2348 struct ethtool_channels_get_rsp *
2349 ethtool_channels_get(struct ynl_sock *ys, struct ethtool_channels_get_req *req);
2350 
2351 /* ETHTOOL_MSG_CHANNELS_GET - dump */
2352 struct ethtool_channels_get_req_dump {
2353 	struct {
2354 		__u32 header:1;
2355 	} _present;
2356 
2357 	struct ethtool_header header;
2358 };
2359 
2360 static inline struct ethtool_channels_get_req_dump *
2361 ethtool_channels_get_req_dump_alloc(void)
2362 {
2363 	return calloc(1, sizeof(struct ethtool_channels_get_req_dump));
2364 }
2365 void
2366 ethtool_channels_get_req_dump_free(struct ethtool_channels_get_req_dump *req);
2367 
2368 static inline void
2369 ethtool_channels_get_req_dump_set_header_dev_index(struct ethtool_channels_get_req_dump *req,
2370 						   __u32 dev_index)
2371 {
2372 	req->_present.header = 1;
2373 	req->header._present.dev_index = 1;
2374 	req->header.dev_index = dev_index;
2375 }
2376 static inline void
2377 ethtool_channels_get_req_dump_set_header_dev_name(struct ethtool_channels_get_req_dump *req,
2378 						  const char *dev_name)
2379 {
2380 	free(req->header.dev_name);
2381 	req->header._present.dev_name_len = strlen(dev_name);
2382 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
2383 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
2384 	req->header.dev_name[req->header._present.dev_name_len] = 0;
2385 }
2386 static inline void
2387 ethtool_channels_get_req_dump_set_header_flags(struct ethtool_channels_get_req_dump *req,
2388 					       __u32 flags)
2389 {
2390 	req->_present.header = 1;
2391 	req->header._present.flags = 1;
2392 	req->header.flags = flags;
2393 }
2394 
2395 struct ethtool_channels_get_list {
2396 	struct ethtool_channels_get_list *next;
2397 	struct ethtool_channels_get_rsp obj __attribute__ ((aligned (8)));
2398 };
2399 
2400 void ethtool_channels_get_list_free(struct ethtool_channels_get_list *rsp);
2401 
2402 struct ethtool_channels_get_list *
2403 ethtool_channels_get_dump(struct ynl_sock *ys,
2404 			  struct ethtool_channels_get_req_dump *req);
2405 
2406 /* ETHTOOL_MSG_CHANNELS_GET - notify */
2407 struct ethtool_channels_get_ntf {
2408 	__u16 family;
2409 	__u8 cmd;
2410 	struct ynl_ntf_base_type *next;
2411 	void (*free)(struct ethtool_channels_get_ntf *ntf);
2412 	struct ethtool_channels_get_rsp obj __attribute__ ((aligned (8)));
2413 };
2414 
2415 void ethtool_channels_get_ntf_free(struct ethtool_channels_get_ntf *rsp);
2416 
2417 /* ============== ETHTOOL_MSG_CHANNELS_SET ============== */
2418 /* ETHTOOL_MSG_CHANNELS_SET - do */
2419 struct ethtool_channels_set_req {
2420 	struct {
2421 		__u32 header:1;
2422 		__u32 rx_max:1;
2423 		__u32 tx_max:1;
2424 		__u32 other_max:1;
2425 		__u32 combined_max:1;
2426 		__u32 rx_count:1;
2427 		__u32 tx_count:1;
2428 		__u32 other_count:1;
2429 		__u32 combined_count:1;
2430 	} _present;
2431 
2432 	struct ethtool_header header;
2433 	__u32 rx_max;
2434 	__u32 tx_max;
2435 	__u32 other_max;
2436 	__u32 combined_max;
2437 	__u32 rx_count;
2438 	__u32 tx_count;
2439 	__u32 other_count;
2440 	__u32 combined_count;
2441 };
2442 
2443 static inline struct ethtool_channels_set_req *
2444 ethtool_channels_set_req_alloc(void)
2445 {
2446 	return calloc(1, sizeof(struct ethtool_channels_set_req));
2447 }
2448 void ethtool_channels_set_req_free(struct ethtool_channels_set_req *req);
2449 
2450 static inline void
2451 ethtool_channels_set_req_set_header_dev_index(struct ethtool_channels_set_req *req,
2452 					      __u32 dev_index)
2453 {
2454 	req->_present.header = 1;
2455 	req->header._present.dev_index = 1;
2456 	req->header.dev_index = dev_index;
2457 }
2458 static inline void
2459 ethtool_channels_set_req_set_header_dev_name(struct ethtool_channels_set_req *req,
2460 					     const char *dev_name)
2461 {
2462 	free(req->header.dev_name);
2463 	req->header._present.dev_name_len = strlen(dev_name);
2464 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
2465 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
2466 	req->header.dev_name[req->header._present.dev_name_len] = 0;
2467 }
2468 static inline void
2469 ethtool_channels_set_req_set_header_flags(struct ethtool_channels_set_req *req,
2470 					  __u32 flags)
2471 {
2472 	req->_present.header = 1;
2473 	req->header._present.flags = 1;
2474 	req->header.flags = flags;
2475 }
2476 static inline void
2477 ethtool_channels_set_req_set_rx_max(struct ethtool_channels_set_req *req,
2478 				    __u32 rx_max)
2479 {
2480 	req->_present.rx_max = 1;
2481 	req->rx_max = rx_max;
2482 }
2483 static inline void
2484 ethtool_channels_set_req_set_tx_max(struct ethtool_channels_set_req *req,
2485 				    __u32 tx_max)
2486 {
2487 	req->_present.tx_max = 1;
2488 	req->tx_max = tx_max;
2489 }
2490 static inline void
2491 ethtool_channels_set_req_set_other_max(struct ethtool_channels_set_req *req,
2492 				       __u32 other_max)
2493 {
2494 	req->_present.other_max = 1;
2495 	req->other_max = other_max;
2496 }
2497 static inline void
2498 ethtool_channels_set_req_set_combined_max(struct ethtool_channels_set_req *req,
2499 					  __u32 combined_max)
2500 {
2501 	req->_present.combined_max = 1;
2502 	req->combined_max = combined_max;
2503 }
2504 static inline void
2505 ethtool_channels_set_req_set_rx_count(struct ethtool_channels_set_req *req,
2506 				      __u32 rx_count)
2507 {
2508 	req->_present.rx_count = 1;
2509 	req->rx_count = rx_count;
2510 }
2511 static inline void
2512 ethtool_channels_set_req_set_tx_count(struct ethtool_channels_set_req *req,
2513 				      __u32 tx_count)
2514 {
2515 	req->_present.tx_count = 1;
2516 	req->tx_count = tx_count;
2517 }
2518 static inline void
2519 ethtool_channels_set_req_set_other_count(struct ethtool_channels_set_req *req,
2520 					 __u32 other_count)
2521 {
2522 	req->_present.other_count = 1;
2523 	req->other_count = other_count;
2524 }
2525 static inline void
2526 ethtool_channels_set_req_set_combined_count(struct ethtool_channels_set_req *req,
2527 					    __u32 combined_count)
2528 {
2529 	req->_present.combined_count = 1;
2530 	req->combined_count = combined_count;
2531 }
2532 
2533 /*
2534  * Set channel params.
2535  */
2536 int ethtool_channels_set(struct ynl_sock *ys,
2537 			 struct ethtool_channels_set_req *req);
2538 
2539 /* ============== ETHTOOL_MSG_COALESCE_GET ============== */
2540 /* ETHTOOL_MSG_COALESCE_GET - do */
2541 struct ethtool_coalesce_get_req {
2542 	struct {
2543 		__u32 header:1;
2544 	} _present;
2545 
2546 	struct ethtool_header header;
2547 };
2548 
2549 static inline struct ethtool_coalesce_get_req *
2550 ethtool_coalesce_get_req_alloc(void)
2551 {
2552 	return calloc(1, sizeof(struct ethtool_coalesce_get_req));
2553 }
2554 void ethtool_coalesce_get_req_free(struct ethtool_coalesce_get_req *req);
2555 
2556 static inline void
2557 ethtool_coalesce_get_req_set_header_dev_index(struct ethtool_coalesce_get_req *req,
2558 					      __u32 dev_index)
2559 {
2560 	req->_present.header = 1;
2561 	req->header._present.dev_index = 1;
2562 	req->header.dev_index = dev_index;
2563 }
2564 static inline void
2565 ethtool_coalesce_get_req_set_header_dev_name(struct ethtool_coalesce_get_req *req,
2566 					     const char *dev_name)
2567 {
2568 	free(req->header.dev_name);
2569 	req->header._present.dev_name_len = strlen(dev_name);
2570 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
2571 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
2572 	req->header.dev_name[req->header._present.dev_name_len] = 0;
2573 }
2574 static inline void
2575 ethtool_coalesce_get_req_set_header_flags(struct ethtool_coalesce_get_req *req,
2576 					  __u32 flags)
2577 {
2578 	req->_present.header = 1;
2579 	req->header._present.flags = 1;
2580 	req->header.flags = flags;
2581 }
2582 
2583 struct ethtool_coalesce_get_rsp {
2584 	struct {
2585 		__u32 header:1;
2586 		__u32 rx_usecs:1;
2587 		__u32 rx_max_frames:1;
2588 		__u32 rx_usecs_irq:1;
2589 		__u32 rx_max_frames_irq:1;
2590 		__u32 tx_usecs:1;
2591 		__u32 tx_max_frames:1;
2592 		__u32 tx_usecs_irq:1;
2593 		__u32 tx_max_frames_irq:1;
2594 		__u32 stats_block_usecs:1;
2595 		__u32 use_adaptive_rx:1;
2596 		__u32 use_adaptive_tx:1;
2597 		__u32 pkt_rate_low:1;
2598 		__u32 rx_usecs_low:1;
2599 		__u32 rx_max_frames_low:1;
2600 		__u32 tx_usecs_low:1;
2601 		__u32 tx_max_frames_low:1;
2602 		__u32 pkt_rate_high:1;
2603 		__u32 rx_usecs_high:1;
2604 		__u32 rx_max_frames_high:1;
2605 		__u32 tx_usecs_high:1;
2606 		__u32 tx_max_frames_high:1;
2607 		__u32 rate_sample_interval:1;
2608 		__u32 use_cqe_mode_tx:1;
2609 		__u32 use_cqe_mode_rx:1;
2610 		__u32 tx_aggr_max_bytes:1;
2611 		__u32 tx_aggr_max_frames:1;
2612 		__u32 tx_aggr_time_usecs:1;
2613 	} _present;
2614 
2615 	struct ethtool_header header;
2616 	__u32 rx_usecs;
2617 	__u32 rx_max_frames;
2618 	__u32 rx_usecs_irq;
2619 	__u32 rx_max_frames_irq;
2620 	__u32 tx_usecs;
2621 	__u32 tx_max_frames;
2622 	__u32 tx_usecs_irq;
2623 	__u32 tx_max_frames_irq;
2624 	__u32 stats_block_usecs;
2625 	__u8 use_adaptive_rx;
2626 	__u8 use_adaptive_tx;
2627 	__u32 pkt_rate_low;
2628 	__u32 rx_usecs_low;
2629 	__u32 rx_max_frames_low;
2630 	__u32 tx_usecs_low;
2631 	__u32 tx_max_frames_low;
2632 	__u32 pkt_rate_high;
2633 	__u32 rx_usecs_high;
2634 	__u32 rx_max_frames_high;
2635 	__u32 tx_usecs_high;
2636 	__u32 tx_max_frames_high;
2637 	__u32 rate_sample_interval;
2638 	__u8 use_cqe_mode_tx;
2639 	__u8 use_cqe_mode_rx;
2640 	__u32 tx_aggr_max_bytes;
2641 	__u32 tx_aggr_max_frames;
2642 	__u32 tx_aggr_time_usecs;
2643 };
2644 
2645 void ethtool_coalesce_get_rsp_free(struct ethtool_coalesce_get_rsp *rsp);
2646 
2647 /*
2648  * Get coalesce params.
2649  */
2650 struct ethtool_coalesce_get_rsp *
2651 ethtool_coalesce_get(struct ynl_sock *ys, struct ethtool_coalesce_get_req *req);
2652 
2653 /* ETHTOOL_MSG_COALESCE_GET - dump */
2654 struct ethtool_coalesce_get_req_dump {
2655 	struct {
2656 		__u32 header:1;
2657 	} _present;
2658 
2659 	struct ethtool_header header;
2660 };
2661 
2662 static inline struct ethtool_coalesce_get_req_dump *
2663 ethtool_coalesce_get_req_dump_alloc(void)
2664 {
2665 	return calloc(1, sizeof(struct ethtool_coalesce_get_req_dump));
2666 }
2667 void
2668 ethtool_coalesce_get_req_dump_free(struct ethtool_coalesce_get_req_dump *req);
2669 
2670 static inline void
2671 ethtool_coalesce_get_req_dump_set_header_dev_index(struct ethtool_coalesce_get_req_dump *req,
2672 						   __u32 dev_index)
2673 {
2674 	req->_present.header = 1;
2675 	req->header._present.dev_index = 1;
2676 	req->header.dev_index = dev_index;
2677 }
2678 static inline void
2679 ethtool_coalesce_get_req_dump_set_header_dev_name(struct ethtool_coalesce_get_req_dump *req,
2680 						  const char *dev_name)
2681 {
2682 	free(req->header.dev_name);
2683 	req->header._present.dev_name_len = strlen(dev_name);
2684 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
2685 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
2686 	req->header.dev_name[req->header._present.dev_name_len] = 0;
2687 }
2688 static inline void
2689 ethtool_coalesce_get_req_dump_set_header_flags(struct ethtool_coalesce_get_req_dump *req,
2690 					       __u32 flags)
2691 {
2692 	req->_present.header = 1;
2693 	req->header._present.flags = 1;
2694 	req->header.flags = flags;
2695 }
2696 
2697 struct ethtool_coalesce_get_list {
2698 	struct ethtool_coalesce_get_list *next;
2699 	struct ethtool_coalesce_get_rsp obj __attribute__ ((aligned (8)));
2700 };
2701 
2702 void ethtool_coalesce_get_list_free(struct ethtool_coalesce_get_list *rsp);
2703 
2704 struct ethtool_coalesce_get_list *
2705 ethtool_coalesce_get_dump(struct ynl_sock *ys,
2706 			  struct ethtool_coalesce_get_req_dump *req);
2707 
2708 /* ETHTOOL_MSG_COALESCE_GET - notify */
2709 struct ethtool_coalesce_get_ntf {
2710 	__u16 family;
2711 	__u8 cmd;
2712 	struct ynl_ntf_base_type *next;
2713 	void (*free)(struct ethtool_coalesce_get_ntf *ntf);
2714 	struct ethtool_coalesce_get_rsp obj __attribute__ ((aligned (8)));
2715 };
2716 
2717 void ethtool_coalesce_get_ntf_free(struct ethtool_coalesce_get_ntf *rsp);
2718 
2719 /* ============== ETHTOOL_MSG_COALESCE_SET ============== */
2720 /* ETHTOOL_MSG_COALESCE_SET - do */
2721 struct ethtool_coalesce_set_req {
2722 	struct {
2723 		__u32 header:1;
2724 		__u32 rx_usecs:1;
2725 		__u32 rx_max_frames:1;
2726 		__u32 rx_usecs_irq:1;
2727 		__u32 rx_max_frames_irq:1;
2728 		__u32 tx_usecs:1;
2729 		__u32 tx_max_frames:1;
2730 		__u32 tx_usecs_irq:1;
2731 		__u32 tx_max_frames_irq:1;
2732 		__u32 stats_block_usecs:1;
2733 		__u32 use_adaptive_rx:1;
2734 		__u32 use_adaptive_tx:1;
2735 		__u32 pkt_rate_low:1;
2736 		__u32 rx_usecs_low:1;
2737 		__u32 rx_max_frames_low:1;
2738 		__u32 tx_usecs_low:1;
2739 		__u32 tx_max_frames_low:1;
2740 		__u32 pkt_rate_high:1;
2741 		__u32 rx_usecs_high:1;
2742 		__u32 rx_max_frames_high:1;
2743 		__u32 tx_usecs_high:1;
2744 		__u32 tx_max_frames_high:1;
2745 		__u32 rate_sample_interval:1;
2746 		__u32 use_cqe_mode_tx:1;
2747 		__u32 use_cqe_mode_rx:1;
2748 		__u32 tx_aggr_max_bytes:1;
2749 		__u32 tx_aggr_max_frames:1;
2750 		__u32 tx_aggr_time_usecs:1;
2751 	} _present;
2752 
2753 	struct ethtool_header header;
2754 	__u32 rx_usecs;
2755 	__u32 rx_max_frames;
2756 	__u32 rx_usecs_irq;
2757 	__u32 rx_max_frames_irq;
2758 	__u32 tx_usecs;
2759 	__u32 tx_max_frames;
2760 	__u32 tx_usecs_irq;
2761 	__u32 tx_max_frames_irq;
2762 	__u32 stats_block_usecs;
2763 	__u8 use_adaptive_rx;
2764 	__u8 use_adaptive_tx;
2765 	__u32 pkt_rate_low;
2766 	__u32 rx_usecs_low;
2767 	__u32 rx_max_frames_low;
2768 	__u32 tx_usecs_low;
2769 	__u32 tx_max_frames_low;
2770 	__u32 pkt_rate_high;
2771 	__u32 rx_usecs_high;
2772 	__u32 rx_max_frames_high;
2773 	__u32 tx_usecs_high;
2774 	__u32 tx_max_frames_high;
2775 	__u32 rate_sample_interval;
2776 	__u8 use_cqe_mode_tx;
2777 	__u8 use_cqe_mode_rx;
2778 	__u32 tx_aggr_max_bytes;
2779 	__u32 tx_aggr_max_frames;
2780 	__u32 tx_aggr_time_usecs;
2781 };
2782 
2783 static inline struct ethtool_coalesce_set_req *
2784 ethtool_coalesce_set_req_alloc(void)
2785 {
2786 	return calloc(1, sizeof(struct ethtool_coalesce_set_req));
2787 }
2788 void ethtool_coalesce_set_req_free(struct ethtool_coalesce_set_req *req);
2789 
2790 static inline void
2791 ethtool_coalesce_set_req_set_header_dev_index(struct ethtool_coalesce_set_req *req,
2792 					      __u32 dev_index)
2793 {
2794 	req->_present.header = 1;
2795 	req->header._present.dev_index = 1;
2796 	req->header.dev_index = dev_index;
2797 }
2798 static inline void
2799 ethtool_coalesce_set_req_set_header_dev_name(struct ethtool_coalesce_set_req *req,
2800 					     const char *dev_name)
2801 {
2802 	free(req->header.dev_name);
2803 	req->header._present.dev_name_len = strlen(dev_name);
2804 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
2805 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
2806 	req->header.dev_name[req->header._present.dev_name_len] = 0;
2807 }
2808 static inline void
2809 ethtool_coalesce_set_req_set_header_flags(struct ethtool_coalesce_set_req *req,
2810 					  __u32 flags)
2811 {
2812 	req->_present.header = 1;
2813 	req->header._present.flags = 1;
2814 	req->header.flags = flags;
2815 }
2816 static inline void
2817 ethtool_coalesce_set_req_set_rx_usecs(struct ethtool_coalesce_set_req *req,
2818 				      __u32 rx_usecs)
2819 {
2820 	req->_present.rx_usecs = 1;
2821 	req->rx_usecs = rx_usecs;
2822 }
2823 static inline void
2824 ethtool_coalesce_set_req_set_rx_max_frames(struct ethtool_coalesce_set_req *req,
2825 					   __u32 rx_max_frames)
2826 {
2827 	req->_present.rx_max_frames = 1;
2828 	req->rx_max_frames = rx_max_frames;
2829 }
2830 static inline void
2831 ethtool_coalesce_set_req_set_rx_usecs_irq(struct ethtool_coalesce_set_req *req,
2832 					  __u32 rx_usecs_irq)
2833 {
2834 	req->_present.rx_usecs_irq = 1;
2835 	req->rx_usecs_irq = rx_usecs_irq;
2836 }
2837 static inline void
2838 ethtool_coalesce_set_req_set_rx_max_frames_irq(struct ethtool_coalesce_set_req *req,
2839 					       __u32 rx_max_frames_irq)
2840 {
2841 	req->_present.rx_max_frames_irq = 1;
2842 	req->rx_max_frames_irq = rx_max_frames_irq;
2843 }
2844 static inline void
2845 ethtool_coalesce_set_req_set_tx_usecs(struct ethtool_coalesce_set_req *req,
2846 				      __u32 tx_usecs)
2847 {
2848 	req->_present.tx_usecs = 1;
2849 	req->tx_usecs = tx_usecs;
2850 }
2851 static inline void
2852 ethtool_coalesce_set_req_set_tx_max_frames(struct ethtool_coalesce_set_req *req,
2853 					   __u32 tx_max_frames)
2854 {
2855 	req->_present.tx_max_frames = 1;
2856 	req->tx_max_frames = tx_max_frames;
2857 }
2858 static inline void
2859 ethtool_coalesce_set_req_set_tx_usecs_irq(struct ethtool_coalesce_set_req *req,
2860 					  __u32 tx_usecs_irq)
2861 {
2862 	req->_present.tx_usecs_irq = 1;
2863 	req->tx_usecs_irq = tx_usecs_irq;
2864 }
2865 static inline void
2866 ethtool_coalesce_set_req_set_tx_max_frames_irq(struct ethtool_coalesce_set_req *req,
2867 					       __u32 tx_max_frames_irq)
2868 {
2869 	req->_present.tx_max_frames_irq = 1;
2870 	req->tx_max_frames_irq = tx_max_frames_irq;
2871 }
2872 static inline void
2873 ethtool_coalesce_set_req_set_stats_block_usecs(struct ethtool_coalesce_set_req *req,
2874 					       __u32 stats_block_usecs)
2875 {
2876 	req->_present.stats_block_usecs = 1;
2877 	req->stats_block_usecs = stats_block_usecs;
2878 }
2879 static inline void
2880 ethtool_coalesce_set_req_set_use_adaptive_rx(struct ethtool_coalesce_set_req *req,
2881 					     __u8 use_adaptive_rx)
2882 {
2883 	req->_present.use_adaptive_rx = 1;
2884 	req->use_adaptive_rx = use_adaptive_rx;
2885 }
2886 static inline void
2887 ethtool_coalesce_set_req_set_use_adaptive_tx(struct ethtool_coalesce_set_req *req,
2888 					     __u8 use_adaptive_tx)
2889 {
2890 	req->_present.use_adaptive_tx = 1;
2891 	req->use_adaptive_tx = use_adaptive_tx;
2892 }
2893 static inline void
2894 ethtool_coalesce_set_req_set_pkt_rate_low(struct ethtool_coalesce_set_req *req,
2895 					  __u32 pkt_rate_low)
2896 {
2897 	req->_present.pkt_rate_low = 1;
2898 	req->pkt_rate_low = pkt_rate_low;
2899 }
2900 static inline void
2901 ethtool_coalesce_set_req_set_rx_usecs_low(struct ethtool_coalesce_set_req *req,
2902 					  __u32 rx_usecs_low)
2903 {
2904 	req->_present.rx_usecs_low = 1;
2905 	req->rx_usecs_low = rx_usecs_low;
2906 }
2907 static inline void
2908 ethtool_coalesce_set_req_set_rx_max_frames_low(struct ethtool_coalesce_set_req *req,
2909 					       __u32 rx_max_frames_low)
2910 {
2911 	req->_present.rx_max_frames_low = 1;
2912 	req->rx_max_frames_low = rx_max_frames_low;
2913 }
2914 static inline void
2915 ethtool_coalesce_set_req_set_tx_usecs_low(struct ethtool_coalesce_set_req *req,
2916 					  __u32 tx_usecs_low)
2917 {
2918 	req->_present.tx_usecs_low = 1;
2919 	req->tx_usecs_low = tx_usecs_low;
2920 }
2921 static inline void
2922 ethtool_coalesce_set_req_set_tx_max_frames_low(struct ethtool_coalesce_set_req *req,
2923 					       __u32 tx_max_frames_low)
2924 {
2925 	req->_present.tx_max_frames_low = 1;
2926 	req->tx_max_frames_low = tx_max_frames_low;
2927 }
2928 static inline void
2929 ethtool_coalesce_set_req_set_pkt_rate_high(struct ethtool_coalesce_set_req *req,
2930 					   __u32 pkt_rate_high)
2931 {
2932 	req->_present.pkt_rate_high = 1;
2933 	req->pkt_rate_high = pkt_rate_high;
2934 }
2935 static inline void
2936 ethtool_coalesce_set_req_set_rx_usecs_high(struct ethtool_coalesce_set_req *req,
2937 					   __u32 rx_usecs_high)
2938 {
2939 	req->_present.rx_usecs_high = 1;
2940 	req->rx_usecs_high = rx_usecs_high;
2941 }
2942 static inline void
2943 ethtool_coalesce_set_req_set_rx_max_frames_high(struct ethtool_coalesce_set_req *req,
2944 						__u32 rx_max_frames_high)
2945 {
2946 	req->_present.rx_max_frames_high = 1;
2947 	req->rx_max_frames_high = rx_max_frames_high;
2948 }
2949 static inline void
2950 ethtool_coalesce_set_req_set_tx_usecs_high(struct ethtool_coalesce_set_req *req,
2951 					   __u32 tx_usecs_high)
2952 {
2953 	req->_present.tx_usecs_high = 1;
2954 	req->tx_usecs_high = tx_usecs_high;
2955 }
2956 static inline void
2957 ethtool_coalesce_set_req_set_tx_max_frames_high(struct ethtool_coalesce_set_req *req,
2958 						__u32 tx_max_frames_high)
2959 {
2960 	req->_present.tx_max_frames_high = 1;
2961 	req->tx_max_frames_high = tx_max_frames_high;
2962 }
2963 static inline void
2964 ethtool_coalesce_set_req_set_rate_sample_interval(struct ethtool_coalesce_set_req *req,
2965 						  __u32 rate_sample_interval)
2966 {
2967 	req->_present.rate_sample_interval = 1;
2968 	req->rate_sample_interval = rate_sample_interval;
2969 }
2970 static inline void
2971 ethtool_coalesce_set_req_set_use_cqe_mode_tx(struct ethtool_coalesce_set_req *req,
2972 					     __u8 use_cqe_mode_tx)
2973 {
2974 	req->_present.use_cqe_mode_tx = 1;
2975 	req->use_cqe_mode_tx = use_cqe_mode_tx;
2976 }
2977 static inline void
2978 ethtool_coalesce_set_req_set_use_cqe_mode_rx(struct ethtool_coalesce_set_req *req,
2979 					     __u8 use_cqe_mode_rx)
2980 {
2981 	req->_present.use_cqe_mode_rx = 1;
2982 	req->use_cqe_mode_rx = use_cqe_mode_rx;
2983 }
2984 static inline void
2985 ethtool_coalesce_set_req_set_tx_aggr_max_bytes(struct ethtool_coalesce_set_req *req,
2986 					       __u32 tx_aggr_max_bytes)
2987 {
2988 	req->_present.tx_aggr_max_bytes = 1;
2989 	req->tx_aggr_max_bytes = tx_aggr_max_bytes;
2990 }
2991 static inline void
2992 ethtool_coalesce_set_req_set_tx_aggr_max_frames(struct ethtool_coalesce_set_req *req,
2993 						__u32 tx_aggr_max_frames)
2994 {
2995 	req->_present.tx_aggr_max_frames = 1;
2996 	req->tx_aggr_max_frames = tx_aggr_max_frames;
2997 }
2998 static inline void
2999 ethtool_coalesce_set_req_set_tx_aggr_time_usecs(struct ethtool_coalesce_set_req *req,
3000 						__u32 tx_aggr_time_usecs)
3001 {
3002 	req->_present.tx_aggr_time_usecs = 1;
3003 	req->tx_aggr_time_usecs = tx_aggr_time_usecs;
3004 }
3005 
3006 /*
3007  * Set coalesce params.
3008  */
3009 int ethtool_coalesce_set(struct ynl_sock *ys,
3010 			 struct ethtool_coalesce_set_req *req);
3011 
3012 /* ============== ETHTOOL_MSG_PAUSE_GET ============== */
3013 /* ETHTOOL_MSG_PAUSE_GET - do */
3014 struct ethtool_pause_get_req {
3015 	struct {
3016 		__u32 header:1;
3017 	} _present;
3018 
3019 	struct ethtool_header header;
3020 };
3021 
3022 static inline struct ethtool_pause_get_req *ethtool_pause_get_req_alloc(void)
3023 {
3024 	return calloc(1, sizeof(struct ethtool_pause_get_req));
3025 }
3026 void ethtool_pause_get_req_free(struct ethtool_pause_get_req *req);
3027 
3028 static inline void
3029 ethtool_pause_get_req_set_header_dev_index(struct ethtool_pause_get_req *req,
3030 					   __u32 dev_index)
3031 {
3032 	req->_present.header = 1;
3033 	req->header._present.dev_index = 1;
3034 	req->header.dev_index = dev_index;
3035 }
3036 static inline void
3037 ethtool_pause_get_req_set_header_dev_name(struct ethtool_pause_get_req *req,
3038 					  const char *dev_name)
3039 {
3040 	free(req->header.dev_name);
3041 	req->header._present.dev_name_len = strlen(dev_name);
3042 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
3043 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
3044 	req->header.dev_name[req->header._present.dev_name_len] = 0;
3045 }
3046 static inline void
3047 ethtool_pause_get_req_set_header_flags(struct ethtool_pause_get_req *req,
3048 				       __u32 flags)
3049 {
3050 	req->_present.header = 1;
3051 	req->header._present.flags = 1;
3052 	req->header.flags = flags;
3053 }
3054 
3055 struct ethtool_pause_get_rsp {
3056 	struct {
3057 		__u32 header:1;
3058 		__u32 autoneg:1;
3059 		__u32 rx:1;
3060 		__u32 tx:1;
3061 		__u32 stats:1;
3062 		__u32 stats_src:1;
3063 	} _present;
3064 
3065 	struct ethtool_header header;
3066 	__u8 autoneg;
3067 	__u8 rx;
3068 	__u8 tx;
3069 	struct ethtool_pause_stat stats;
3070 	__u32 stats_src;
3071 };
3072 
3073 void ethtool_pause_get_rsp_free(struct ethtool_pause_get_rsp *rsp);
3074 
3075 /*
3076  * Get pause params.
3077  */
3078 struct ethtool_pause_get_rsp *
3079 ethtool_pause_get(struct ynl_sock *ys, struct ethtool_pause_get_req *req);
3080 
3081 /* ETHTOOL_MSG_PAUSE_GET - dump */
3082 struct ethtool_pause_get_req_dump {
3083 	struct {
3084 		__u32 header:1;
3085 	} _present;
3086 
3087 	struct ethtool_header header;
3088 };
3089 
3090 static inline struct ethtool_pause_get_req_dump *
3091 ethtool_pause_get_req_dump_alloc(void)
3092 {
3093 	return calloc(1, sizeof(struct ethtool_pause_get_req_dump));
3094 }
3095 void ethtool_pause_get_req_dump_free(struct ethtool_pause_get_req_dump *req);
3096 
3097 static inline void
3098 ethtool_pause_get_req_dump_set_header_dev_index(struct ethtool_pause_get_req_dump *req,
3099 						__u32 dev_index)
3100 {
3101 	req->_present.header = 1;
3102 	req->header._present.dev_index = 1;
3103 	req->header.dev_index = dev_index;
3104 }
3105 static inline void
3106 ethtool_pause_get_req_dump_set_header_dev_name(struct ethtool_pause_get_req_dump *req,
3107 					       const char *dev_name)
3108 {
3109 	free(req->header.dev_name);
3110 	req->header._present.dev_name_len = strlen(dev_name);
3111 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
3112 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
3113 	req->header.dev_name[req->header._present.dev_name_len] = 0;
3114 }
3115 static inline void
3116 ethtool_pause_get_req_dump_set_header_flags(struct ethtool_pause_get_req_dump *req,
3117 					    __u32 flags)
3118 {
3119 	req->_present.header = 1;
3120 	req->header._present.flags = 1;
3121 	req->header.flags = flags;
3122 }
3123 
3124 struct ethtool_pause_get_list {
3125 	struct ethtool_pause_get_list *next;
3126 	struct ethtool_pause_get_rsp obj __attribute__ ((aligned (8)));
3127 };
3128 
3129 void ethtool_pause_get_list_free(struct ethtool_pause_get_list *rsp);
3130 
3131 struct ethtool_pause_get_list *
3132 ethtool_pause_get_dump(struct ynl_sock *ys,
3133 		       struct ethtool_pause_get_req_dump *req);
3134 
3135 /* ETHTOOL_MSG_PAUSE_GET - notify */
3136 struct ethtool_pause_get_ntf {
3137 	__u16 family;
3138 	__u8 cmd;
3139 	struct ynl_ntf_base_type *next;
3140 	void (*free)(struct ethtool_pause_get_ntf *ntf);
3141 	struct ethtool_pause_get_rsp obj __attribute__ ((aligned (8)));
3142 };
3143 
3144 void ethtool_pause_get_ntf_free(struct ethtool_pause_get_ntf *rsp);
3145 
3146 /* ============== ETHTOOL_MSG_PAUSE_SET ============== */
3147 /* ETHTOOL_MSG_PAUSE_SET - do */
3148 struct ethtool_pause_set_req {
3149 	struct {
3150 		__u32 header:1;
3151 		__u32 autoneg:1;
3152 		__u32 rx:1;
3153 		__u32 tx:1;
3154 		__u32 stats:1;
3155 		__u32 stats_src:1;
3156 	} _present;
3157 
3158 	struct ethtool_header header;
3159 	__u8 autoneg;
3160 	__u8 rx;
3161 	__u8 tx;
3162 	struct ethtool_pause_stat stats;
3163 	__u32 stats_src;
3164 };
3165 
3166 static inline struct ethtool_pause_set_req *ethtool_pause_set_req_alloc(void)
3167 {
3168 	return calloc(1, sizeof(struct ethtool_pause_set_req));
3169 }
3170 void ethtool_pause_set_req_free(struct ethtool_pause_set_req *req);
3171 
3172 static inline void
3173 ethtool_pause_set_req_set_header_dev_index(struct ethtool_pause_set_req *req,
3174 					   __u32 dev_index)
3175 {
3176 	req->_present.header = 1;
3177 	req->header._present.dev_index = 1;
3178 	req->header.dev_index = dev_index;
3179 }
3180 static inline void
3181 ethtool_pause_set_req_set_header_dev_name(struct ethtool_pause_set_req *req,
3182 					  const char *dev_name)
3183 {
3184 	free(req->header.dev_name);
3185 	req->header._present.dev_name_len = strlen(dev_name);
3186 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
3187 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
3188 	req->header.dev_name[req->header._present.dev_name_len] = 0;
3189 }
3190 static inline void
3191 ethtool_pause_set_req_set_header_flags(struct ethtool_pause_set_req *req,
3192 				       __u32 flags)
3193 {
3194 	req->_present.header = 1;
3195 	req->header._present.flags = 1;
3196 	req->header.flags = flags;
3197 }
3198 static inline void
3199 ethtool_pause_set_req_set_autoneg(struct ethtool_pause_set_req *req,
3200 				  __u8 autoneg)
3201 {
3202 	req->_present.autoneg = 1;
3203 	req->autoneg = autoneg;
3204 }
3205 static inline void
3206 ethtool_pause_set_req_set_rx(struct ethtool_pause_set_req *req, __u8 rx)
3207 {
3208 	req->_present.rx = 1;
3209 	req->rx = rx;
3210 }
3211 static inline void
3212 ethtool_pause_set_req_set_tx(struct ethtool_pause_set_req *req, __u8 tx)
3213 {
3214 	req->_present.tx = 1;
3215 	req->tx = tx;
3216 }
3217 static inline void
3218 ethtool_pause_set_req_set_stats_tx_frames(struct ethtool_pause_set_req *req,
3219 					  __u64 tx_frames)
3220 {
3221 	req->_present.stats = 1;
3222 	req->stats._present.tx_frames = 1;
3223 	req->stats.tx_frames = tx_frames;
3224 }
3225 static inline void
3226 ethtool_pause_set_req_set_stats_rx_frames(struct ethtool_pause_set_req *req,
3227 					  __u64 rx_frames)
3228 {
3229 	req->_present.stats = 1;
3230 	req->stats._present.rx_frames = 1;
3231 	req->stats.rx_frames = rx_frames;
3232 }
3233 static inline void
3234 ethtool_pause_set_req_set_stats_src(struct ethtool_pause_set_req *req,
3235 				    __u32 stats_src)
3236 {
3237 	req->_present.stats_src = 1;
3238 	req->stats_src = stats_src;
3239 }
3240 
3241 /*
3242  * Set pause params.
3243  */
3244 int ethtool_pause_set(struct ynl_sock *ys, struct ethtool_pause_set_req *req);
3245 
3246 /* ============== ETHTOOL_MSG_EEE_GET ============== */
3247 /* ETHTOOL_MSG_EEE_GET - do */
3248 struct ethtool_eee_get_req {
3249 	struct {
3250 		__u32 header:1;
3251 	} _present;
3252 
3253 	struct ethtool_header header;
3254 };
3255 
3256 static inline struct ethtool_eee_get_req *ethtool_eee_get_req_alloc(void)
3257 {
3258 	return calloc(1, sizeof(struct ethtool_eee_get_req));
3259 }
3260 void ethtool_eee_get_req_free(struct ethtool_eee_get_req *req);
3261 
3262 static inline void
3263 ethtool_eee_get_req_set_header_dev_index(struct ethtool_eee_get_req *req,
3264 					 __u32 dev_index)
3265 {
3266 	req->_present.header = 1;
3267 	req->header._present.dev_index = 1;
3268 	req->header.dev_index = dev_index;
3269 }
3270 static inline void
3271 ethtool_eee_get_req_set_header_dev_name(struct ethtool_eee_get_req *req,
3272 					const char *dev_name)
3273 {
3274 	free(req->header.dev_name);
3275 	req->header._present.dev_name_len = strlen(dev_name);
3276 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
3277 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
3278 	req->header.dev_name[req->header._present.dev_name_len] = 0;
3279 }
3280 static inline void
3281 ethtool_eee_get_req_set_header_flags(struct ethtool_eee_get_req *req,
3282 				     __u32 flags)
3283 {
3284 	req->_present.header = 1;
3285 	req->header._present.flags = 1;
3286 	req->header.flags = flags;
3287 }
3288 
3289 struct ethtool_eee_get_rsp {
3290 	struct {
3291 		__u32 header:1;
3292 		__u32 modes_ours:1;
3293 		__u32 modes_peer:1;
3294 		__u32 active:1;
3295 		__u32 enabled:1;
3296 		__u32 tx_lpi_enabled:1;
3297 		__u32 tx_lpi_timer:1;
3298 	} _present;
3299 
3300 	struct ethtool_header header;
3301 	struct ethtool_bitset modes_ours;
3302 	struct ethtool_bitset modes_peer;
3303 	__u8 active;
3304 	__u8 enabled;
3305 	__u8 tx_lpi_enabled;
3306 	__u32 tx_lpi_timer;
3307 };
3308 
3309 void ethtool_eee_get_rsp_free(struct ethtool_eee_get_rsp *rsp);
3310 
3311 /*
3312  * Get eee params.
3313  */
3314 struct ethtool_eee_get_rsp *
3315 ethtool_eee_get(struct ynl_sock *ys, struct ethtool_eee_get_req *req);
3316 
3317 /* ETHTOOL_MSG_EEE_GET - dump */
3318 struct ethtool_eee_get_req_dump {
3319 	struct {
3320 		__u32 header:1;
3321 	} _present;
3322 
3323 	struct ethtool_header header;
3324 };
3325 
3326 static inline struct ethtool_eee_get_req_dump *
3327 ethtool_eee_get_req_dump_alloc(void)
3328 {
3329 	return calloc(1, sizeof(struct ethtool_eee_get_req_dump));
3330 }
3331 void ethtool_eee_get_req_dump_free(struct ethtool_eee_get_req_dump *req);
3332 
3333 static inline void
3334 ethtool_eee_get_req_dump_set_header_dev_index(struct ethtool_eee_get_req_dump *req,
3335 					      __u32 dev_index)
3336 {
3337 	req->_present.header = 1;
3338 	req->header._present.dev_index = 1;
3339 	req->header.dev_index = dev_index;
3340 }
3341 static inline void
3342 ethtool_eee_get_req_dump_set_header_dev_name(struct ethtool_eee_get_req_dump *req,
3343 					     const char *dev_name)
3344 {
3345 	free(req->header.dev_name);
3346 	req->header._present.dev_name_len = strlen(dev_name);
3347 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
3348 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
3349 	req->header.dev_name[req->header._present.dev_name_len] = 0;
3350 }
3351 static inline void
3352 ethtool_eee_get_req_dump_set_header_flags(struct ethtool_eee_get_req_dump *req,
3353 					  __u32 flags)
3354 {
3355 	req->_present.header = 1;
3356 	req->header._present.flags = 1;
3357 	req->header.flags = flags;
3358 }
3359 
3360 struct ethtool_eee_get_list {
3361 	struct ethtool_eee_get_list *next;
3362 	struct ethtool_eee_get_rsp obj __attribute__ ((aligned (8)));
3363 };
3364 
3365 void ethtool_eee_get_list_free(struct ethtool_eee_get_list *rsp);
3366 
3367 struct ethtool_eee_get_list *
3368 ethtool_eee_get_dump(struct ynl_sock *ys, struct ethtool_eee_get_req_dump *req);
3369 
3370 /* ETHTOOL_MSG_EEE_GET - notify */
3371 struct ethtool_eee_get_ntf {
3372 	__u16 family;
3373 	__u8 cmd;
3374 	struct ynl_ntf_base_type *next;
3375 	void (*free)(struct ethtool_eee_get_ntf *ntf);
3376 	struct ethtool_eee_get_rsp obj __attribute__ ((aligned (8)));
3377 };
3378 
3379 void ethtool_eee_get_ntf_free(struct ethtool_eee_get_ntf *rsp);
3380 
3381 /* ============== ETHTOOL_MSG_EEE_SET ============== */
3382 /* ETHTOOL_MSG_EEE_SET - do */
3383 struct ethtool_eee_set_req {
3384 	struct {
3385 		__u32 header:1;
3386 		__u32 modes_ours:1;
3387 		__u32 modes_peer:1;
3388 		__u32 active:1;
3389 		__u32 enabled:1;
3390 		__u32 tx_lpi_enabled:1;
3391 		__u32 tx_lpi_timer:1;
3392 	} _present;
3393 
3394 	struct ethtool_header header;
3395 	struct ethtool_bitset modes_ours;
3396 	struct ethtool_bitset modes_peer;
3397 	__u8 active;
3398 	__u8 enabled;
3399 	__u8 tx_lpi_enabled;
3400 	__u32 tx_lpi_timer;
3401 };
3402 
3403 static inline struct ethtool_eee_set_req *ethtool_eee_set_req_alloc(void)
3404 {
3405 	return calloc(1, sizeof(struct ethtool_eee_set_req));
3406 }
3407 void ethtool_eee_set_req_free(struct ethtool_eee_set_req *req);
3408 
3409 static inline void
3410 ethtool_eee_set_req_set_header_dev_index(struct ethtool_eee_set_req *req,
3411 					 __u32 dev_index)
3412 {
3413 	req->_present.header = 1;
3414 	req->header._present.dev_index = 1;
3415 	req->header.dev_index = dev_index;
3416 }
3417 static inline void
3418 ethtool_eee_set_req_set_header_dev_name(struct ethtool_eee_set_req *req,
3419 					const char *dev_name)
3420 {
3421 	free(req->header.dev_name);
3422 	req->header._present.dev_name_len = strlen(dev_name);
3423 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
3424 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
3425 	req->header.dev_name[req->header._present.dev_name_len] = 0;
3426 }
3427 static inline void
3428 ethtool_eee_set_req_set_header_flags(struct ethtool_eee_set_req *req,
3429 				     __u32 flags)
3430 {
3431 	req->_present.header = 1;
3432 	req->header._present.flags = 1;
3433 	req->header.flags = flags;
3434 }
3435 static inline void
3436 ethtool_eee_set_req_set_modes_ours_nomask(struct ethtool_eee_set_req *req)
3437 {
3438 	req->_present.modes_ours = 1;
3439 	req->modes_ours._present.nomask = 1;
3440 }
3441 static inline void
3442 ethtool_eee_set_req_set_modes_ours_size(struct ethtool_eee_set_req *req,
3443 					__u32 size)
3444 {
3445 	req->_present.modes_ours = 1;
3446 	req->modes_ours._present.size = 1;
3447 	req->modes_ours.size = size;
3448 }
3449 static inline void
3450 __ethtool_eee_set_req_set_modes_ours_bits_bit(struct ethtool_eee_set_req *req,
3451 					      struct ethtool_bitset_bit *bit,
3452 					      unsigned int n_bit)
3453 {
3454 	free(req->modes_ours.bits.bit);
3455 	req->modes_ours.bits.bit = bit;
3456 	req->modes_ours.bits.n_bit = n_bit;
3457 }
3458 static inline void
3459 ethtool_eee_set_req_set_modes_peer_nomask(struct ethtool_eee_set_req *req)
3460 {
3461 	req->_present.modes_peer = 1;
3462 	req->modes_peer._present.nomask = 1;
3463 }
3464 static inline void
3465 ethtool_eee_set_req_set_modes_peer_size(struct ethtool_eee_set_req *req,
3466 					__u32 size)
3467 {
3468 	req->_present.modes_peer = 1;
3469 	req->modes_peer._present.size = 1;
3470 	req->modes_peer.size = size;
3471 }
3472 static inline void
3473 __ethtool_eee_set_req_set_modes_peer_bits_bit(struct ethtool_eee_set_req *req,
3474 					      struct ethtool_bitset_bit *bit,
3475 					      unsigned int n_bit)
3476 {
3477 	free(req->modes_peer.bits.bit);
3478 	req->modes_peer.bits.bit = bit;
3479 	req->modes_peer.bits.n_bit = n_bit;
3480 }
3481 static inline void
3482 ethtool_eee_set_req_set_active(struct ethtool_eee_set_req *req, __u8 active)
3483 {
3484 	req->_present.active = 1;
3485 	req->active = active;
3486 }
3487 static inline void
3488 ethtool_eee_set_req_set_enabled(struct ethtool_eee_set_req *req, __u8 enabled)
3489 {
3490 	req->_present.enabled = 1;
3491 	req->enabled = enabled;
3492 }
3493 static inline void
3494 ethtool_eee_set_req_set_tx_lpi_enabled(struct ethtool_eee_set_req *req,
3495 				       __u8 tx_lpi_enabled)
3496 {
3497 	req->_present.tx_lpi_enabled = 1;
3498 	req->tx_lpi_enabled = tx_lpi_enabled;
3499 }
3500 static inline void
3501 ethtool_eee_set_req_set_tx_lpi_timer(struct ethtool_eee_set_req *req,
3502 				     __u32 tx_lpi_timer)
3503 {
3504 	req->_present.tx_lpi_timer = 1;
3505 	req->tx_lpi_timer = tx_lpi_timer;
3506 }
3507 
3508 /*
3509  * Set eee params.
3510  */
3511 int ethtool_eee_set(struct ynl_sock *ys, struct ethtool_eee_set_req *req);
3512 
3513 /* ============== ETHTOOL_MSG_TSINFO_GET ============== */
3514 /* ETHTOOL_MSG_TSINFO_GET - do */
3515 struct ethtool_tsinfo_get_req {
3516 	struct {
3517 		__u32 header:1;
3518 	} _present;
3519 
3520 	struct ethtool_header header;
3521 };
3522 
3523 static inline struct ethtool_tsinfo_get_req *ethtool_tsinfo_get_req_alloc(void)
3524 {
3525 	return calloc(1, sizeof(struct ethtool_tsinfo_get_req));
3526 }
3527 void ethtool_tsinfo_get_req_free(struct ethtool_tsinfo_get_req *req);
3528 
3529 static inline void
3530 ethtool_tsinfo_get_req_set_header_dev_index(struct ethtool_tsinfo_get_req *req,
3531 					    __u32 dev_index)
3532 {
3533 	req->_present.header = 1;
3534 	req->header._present.dev_index = 1;
3535 	req->header.dev_index = dev_index;
3536 }
3537 static inline void
3538 ethtool_tsinfo_get_req_set_header_dev_name(struct ethtool_tsinfo_get_req *req,
3539 					   const char *dev_name)
3540 {
3541 	free(req->header.dev_name);
3542 	req->header._present.dev_name_len = strlen(dev_name);
3543 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
3544 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
3545 	req->header.dev_name[req->header._present.dev_name_len] = 0;
3546 }
3547 static inline void
3548 ethtool_tsinfo_get_req_set_header_flags(struct ethtool_tsinfo_get_req *req,
3549 					__u32 flags)
3550 {
3551 	req->_present.header = 1;
3552 	req->header._present.flags = 1;
3553 	req->header.flags = flags;
3554 }
3555 
3556 struct ethtool_tsinfo_get_rsp {
3557 	struct {
3558 		__u32 header:1;
3559 		__u32 timestamping:1;
3560 		__u32 tx_types:1;
3561 		__u32 rx_filters:1;
3562 		__u32 phc_index:1;
3563 	} _present;
3564 
3565 	struct ethtool_header header;
3566 	struct ethtool_bitset timestamping;
3567 	struct ethtool_bitset tx_types;
3568 	struct ethtool_bitset rx_filters;
3569 	__u32 phc_index;
3570 };
3571 
3572 void ethtool_tsinfo_get_rsp_free(struct ethtool_tsinfo_get_rsp *rsp);
3573 
3574 /*
3575  * Get tsinfo params.
3576  */
3577 struct ethtool_tsinfo_get_rsp *
3578 ethtool_tsinfo_get(struct ynl_sock *ys, struct ethtool_tsinfo_get_req *req);
3579 
3580 /* ETHTOOL_MSG_TSINFO_GET - dump */
3581 struct ethtool_tsinfo_get_req_dump {
3582 	struct {
3583 		__u32 header:1;
3584 	} _present;
3585 
3586 	struct ethtool_header header;
3587 };
3588 
3589 static inline struct ethtool_tsinfo_get_req_dump *
3590 ethtool_tsinfo_get_req_dump_alloc(void)
3591 {
3592 	return calloc(1, sizeof(struct ethtool_tsinfo_get_req_dump));
3593 }
3594 void ethtool_tsinfo_get_req_dump_free(struct ethtool_tsinfo_get_req_dump *req);
3595 
3596 static inline void
3597 ethtool_tsinfo_get_req_dump_set_header_dev_index(struct ethtool_tsinfo_get_req_dump *req,
3598 						 __u32 dev_index)
3599 {
3600 	req->_present.header = 1;
3601 	req->header._present.dev_index = 1;
3602 	req->header.dev_index = dev_index;
3603 }
3604 static inline void
3605 ethtool_tsinfo_get_req_dump_set_header_dev_name(struct ethtool_tsinfo_get_req_dump *req,
3606 						const char *dev_name)
3607 {
3608 	free(req->header.dev_name);
3609 	req->header._present.dev_name_len = strlen(dev_name);
3610 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
3611 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
3612 	req->header.dev_name[req->header._present.dev_name_len] = 0;
3613 }
3614 static inline void
3615 ethtool_tsinfo_get_req_dump_set_header_flags(struct ethtool_tsinfo_get_req_dump *req,
3616 					     __u32 flags)
3617 {
3618 	req->_present.header = 1;
3619 	req->header._present.flags = 1;
3620 	req->header.flags = flags;
3621 }
3622 
3623 struct ethtool_tsinfo_get_list {
3624 	struct ethtool_tsinfo_get_list *next;
3625 	struct ethtool_tsinfo_get_rsp obj __attribute__ ((aligned (8)));
3626 };
3627 
3628 void ethtool_tsinfo_get_list_free(struct ethtool_tsinfo_get_list *rsp);
3629 
3630 struct ethtool_tsinfo_get_list *
3631 ethtool_tsinfo_get_dump(struct ynl_sock *ys,
3632 			struct ethtool_tsinfo_get_req_dump *req);
3633 
3634 /* ============== ETHTOOL_MSG_CABLE_TEST_ACT ============== */
3635 /* ETHTOOL_MSG_CABLE_TEST_ACT - do */
3636 struct ethtool_cable_test_act_req {
3637 	struct {
3638 		__u32 header:1;
3639 	} _present;
3640 
3641 	struct ethtool_header header;
3642 };
3643 
3644 static inline struct ethtool_cable_test_act_req *
3645 ethtool_cable_test_act_req_alloc(void)
3646 {
3647 	return calloc(1, sizeof(struct ethtool_cable_test_act_req));
3648 }
3649 void ethtool_cable_test_act_req_free(struct ethtool_cable_test_act_req *req);
3650 
3651 static inline void
3652 ethtool_cable_test_act_req_set_header_dev_index(struct ethtool_cable_test_act_req *req,
3653 						__u32 dev_index)
3654 {
3655 	req->_present.header = 1;
3656 	req->header._present.dev_index = 1;
3657 	req->header.dev_index = dev_index;
3658 }
3659 static inline void
3660 ethtool_cable_test_act_req_set_header_dev_name(struct ethtool_cable_test_act_req *req,
3661 					       const char *dev_name)
3662 {
3663 	free(req->header.dev_name);
3664 	req->header._present.dev_name_len = strlen(dev_name);
3665 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
3666 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
3667 	req->header.dev_name[req->header._present.dev_name_len] = 0;
3668 }
3669 static inline void
3670 ethtool_cable_test_act_req_set_header_flags(struct ethtool_cable_test_act_req *req,
3671 					    __u32 flags)
3672 {
3673 	req->_present.header = 1;
3674 	req->header._present.flags = 1;
3675 	req->header.flags = flags;
3676 }
3677 
3678 /*
3679  * Cable test.
3680  */
3681 int ethtool_cable_test_act(struct ynl_sock *ys,
3682 			   struct ethtool_cable_test_act_req *req);
3683 
3684 /* ============== ETHTOOL_MSG_CABLE_TEST_TDR_ACT ============== */
3685 /* ETHTOOL_MSG_CABLE_TEST_TDR_ACT - do */
3686 struct ethtool_cable_test_tdr_act_req {
3687 	struct {
3688 		__u32 header:1;
3689 	} _present;
3690 
3691 	struct ethtool_header header;
3692 };
3693 
3694 static inline struct ethtool_cable_test_tdr_act_req *
3695 ethtool_cable_test_tdr_act_req_alloc(void)
3696 {
3697 	return calloc(1, sizeof(struct ethtool_cable_test_tdr_act_req));
3698 }
3699 void
3700 ethtool_cable_test_tdr_act_req_free(struct ethtool_cable_test_tdr_act_req *req);
3701 
3702 static inline void
3703 ethtool_cable_test_tdr_act_req_set_header_dev_index(struct ethtool_cable_test_tdr_act_req *req,
3704 						    __u32 dev_index)
3705 {
3706 	req->_present.header = 1;
3707 	req->header._present.dev_index = 1;
3708 	req->header.dev_index = dev_index;
3709 }
3710 static inline void
3711 ethtool_cable_test_tdr_act_req_set_header_dev_name(struct ethtool_cable_test_tdr_act_req *req,
3712 						   const char *dev_name)
3713 {
3714 	free(req->header.dev_name);
3715 	req->header._present.dev_name_len = strlen(dev_name);
3716 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
3717 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
3718 	req->header.dev_name[req->header._present.dev_name_len] = 0;
3719 }
3720 static inline void
3721 ethtool_cable_test_tdr_act_req_set_header_flags(struct ethtool_cable_test_tdr_act_req *req,
3722 						__u32 flags)
3723 {
3724 	req->_present.header = 1;
3725 	req->header._present.flags = 1;
3726 	req->header.flags = flags;
3727 }
3728 
3729 /*
3730  * Cable test TDR.
3731  */
3732 int ethtool_cable_test_tdr_act(struct ynl_sock *ys,
3733 			       struct ethtool_cable_test_tdr_act_req *req);
3734 
3735 /* ============== ETHTOOL_MSG_TUNNEL_INFO_GET ============== */
3736 /* ETHTOOL_MSG_TUNNEL_INFO_GET - do */
3737 struct ethtool_tunnel_info_get_req {
3738 	struct {
3739 		__u32 header:1;
3740 	} _present;
3741 
3742 	struct ethtool_header header;
3743 };
3744 
3745 static inline struct ethtool_tunnel_info_get_req *
3746 ethtool_tunnel_info_get_req_alloc(void)
3747 {
3748 	return calloc(1, sizeof(struct ethtool_tunnel_info_get_req));
3749 }
3750 void ethtool_tunnel_info_get_req_free(struct ethtool_tunnel_info_get_req *req);
3751 
3752 static inline void
3753 ethtool_tunnel_info_get_req_set_header_dev_index(struct ethtool_tunnel_info_get_req *req,
3754 						 __u32 dev_index)
3755 {
3756 	req->_present.header = 1;
3757 	req->header._present.dev_index = 1;
3758 	req->header.dev_index = dev_index;
3759 }
3760 static inline void
3761 ethtool_tunnel_info_get_req_set_header_dev_name(struct ethtool_tunnel_info_get_req *req,
3762 						const char *dev_name)
3763 {
3764 	free(req->header.dev_name);
3765 	req->header._present.dev_name_len = strlen(dev_name);
3766 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
3767 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
3768 	req->header.dev_name[req->header._present.dev_name_len] = 0;
3769 }
3770 static inline void
3771 ethtool_tunnel_info_get_req_set_header_flags(struct ethtool_tunnel_info_get_req *req,
3772 					     __u32 flags)
3773 {
3774 	req->_present.header = 1;
3775 	req->header._present.flags = 1;
3776 	req->header.flags = flags;
3777 }
3778 
3779 struct ethtool_tunnel_info_get_rsp {
3780 	struct {
3781 		__u32 header:1;
3782 		__u32 udp_ports:1;
3783 	} _present;
3784 
3785 	struct ethtool_header header;
3786 	struct ethtool_tunnel_udp udp_ports;
3787 };
3788 
3789 void ethtool_tunnel_info_get_rsp_free(struct ethtool_tunnel_info_get_rsp *rsp);
3790 
3791 /*
3792  * Get tsinfo params.
3793  */
3794 struct ethtool_tunnel_info_get_rsp *
3795 ethtool_tunnel_info_get(struct ynl_sock *ys,
3796 			struct ethtool_tunnel_info_get_req *req);
3797 
3798 /* ETHTOOL_MSG_TUNNEL_INFO_GET - dump */
3799 struct ethtool_tunnel_info_get_req_dump {
3800 	struct {
3801 		__u32 header:1;
3802 	} _present;
3803 
3804 	struct ethtool_header header;
3805 };
3806 
3807 static inline struct ethtool_tunnel_info_get_req_dump *
3808 ethtool_tunnel_info_get_req_dump_alloc(void)
3809 {
3810 	return calloc(1, sizeof(struct ethtool_tunnel_info_get_req_dump));
3811 }
3812 void
3813 ethtool_tunnel_info_get_req_dump_free(struct ethtool_tunnel_info_get_req_dump *req);
3814 
3815 static inline void
3816 ethtool_tunnel_info_get_req_dump_set_header_dev_index(struct ethtool_tunnel_info_get_req_dump *req,
3817 						      __u32 dev_index)
3818 {
3819 	req->_present.header = 1;
3820 	req->header._present.dev_index = 1;
3821 	req->header.dev_index = dev_index;
3822 }
3823 static inline void
3824 ethtool_tunnel_info_get_req_dump_set_header_dev_name(struct ethtool_tunnel_info_get_req_dump *req,
3825 						     const char *dev_name)
3826 {
3827 	free(req->header.dev_name);
3828 	req->header._present.dev_name_len = strlen(dev_name);
3829 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
3830 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
3831 	req->header.dev_name[req->header._present.dev_name_len] = 0;
3832 }
3833 static inline void
3834 ethtool_tunnel_info_get_req_dump_set_header_flags(struct ethtool_tunnel_info_get_req_dump *req,
3835 						  __u32 flags)
3836 {
3837 	req->_present.header = 1;
3838 	req->header._present.flags = 1;
3839 	req->header.flags = flags;
3840 }
3841 
3842 struct ethtool_tunnel_info_get_list {
3843 	struct ethtool_tunnel_info_get_list *next;
3844 	struct ethtool_tunnel_info_get_rsp obj __attribute__ ((aligned (8)));
3845 };
3846 
3847 void
3848 ethtool_tunnel_info_get_list_free(struct ethtool_tunnel_info_get_list *rsp);
3849 
3850 struct ethtool_tunnel_info_get_list *
3851 ethtool_tunnel_info_get_dump(struct ynl_sock *ys,
3852 			     struct ethtool_tunnel_info_get_req_dump *req);
3853 
3854 /* ============== ETHTOOL_MSG_FEC_GET ============== */
3855 /* ETHTOOL_MSG_FEC_GET - do */
3856 struct ethtool_fec_get_req {
3857 	struct {
3858 		__u32 header:1;
3859 	} _present;
3860 
3861 	struct ethtool_header header;
3862 };
3863 
3864 static inline struct ethtool_fec_get_req *ethtool_fec_get_req_alloc(void)
3865 {
3866 	return calloc(1, sizeof(struct ethtool_fec_get_req));
3867 }
3868 void ethtool_fec_get_req_free(struct ethtool_fec_get_req *req);
3869 
3870 static inline void
3871 ethtool_fec_get_req_set_header_dev_index(struct ethtool_fec_get_req *req,
3872 					 __u32 dev_index)
3873 {
3874 	req->_present.header = 1;
3875 	req->header._present.dev_index = 1;
3876 	req->header.dev_index = dev_index;
3877 }
3878 static inline void
3879 ethtool_fec_get_req_set_header_dev_name(struct ethtool_fec_get_req *req,
3880 					const char *dev_name)
3881 {
3882 	free(req->header.dev_name);
3883 	req->header._present.dev_name_len = strlen(dev_name);
3884 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
3885 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
3886 	req->header.dev_name[req->header._present.dev_name_len] = 0;
3887 }
3888 static inline void
3889 ethtool_fec_get_req_set_header_flags(struct ethtool_fec_get_req *req,
3890 				     __u32 flags)
3891 {
3892 	req->_present.header = 1;
3893 	req->header._present.flags = 1;
3894 	req->header.flags = flags;
3895 }
3896 
3897 struct ethtool_fec_get_rsp {
3898 	struct {
3899 		__u32 header:1;
3900 		__u32 modes:1;
3901 		__u32 auto_:1;
3902 		__u32 active:1;
3903 		__u32 stats:1;
3904 	} _present;
3905 
3906 	struct ethtool_header header;
3907 	struct ethtool_bitset modes;
3908 	__u8 auto_;
3909 	__u32 active;
3910 	struct ethtool_fec_stat stats;
3911 };
3912 
3913 void ethtool_fec_get_rsp_free(struct ethtool_fec_get_rsp *rsp);
3914 
3915 /*
3916  * Get FEC params.
3917  */
3918 struct ethtool_fec_get_rsp *
3919 ethtool_fec_get(struct ynl_sock *ys, struct ethtool_fec_get_req *req);
3920 
3921 /* ETHTOOL_MSG_FEC_GET - dump */
3922 struct ethtool_fec_get_req_dump {
3923 	struct {
3924 		__u32 header:1;
3925 	} _present;
3926 
3927 	struct ethtool_header header;
3928 };
3929 
3930 static inline struct ethtool_fec_get_req_dump *
3931 ethtool_fec_get_req_dump_alloc(void)
3932 {
3933 	return calloc(1, sizeof(struct ethtool_fec_get_req_dump));
3934 }
3935 void ethtool_fec_get_req_dump_free(struct ethtool_fec_get_req_dump *req);
3936 
3937 static inline void
3938 ethtool_fec_get_req_dump_set_header_dev_index(struct ethtool_fec_get_req_dump *req,
3939 					      __u32 dev_index)
3940 {
3941 	req->_present.header = 1;
3942 	req->header._present.dev_index = 1;
3943 	req->header.dev_index = dev_index;
3944 }
3945 static inline void
3946 ethtool_fec_get_req_dump_set_header_dev_name(struct ethtool_fec_get_req_dump *req,
3947 					     const char *dev_name)
3948 {
3949 	free(req->header.dev_name);
3950 	req->header._present.dev_name_len = strlen(dev_name);
3951 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
3952 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
3953 	req->header.dev_name[req->header._present.dev_name_len] = 0;
3954 }
3955 static inline void
3956 ethtool_fec_get_req_dump_set_header_flags(struct ethtool_fec_get_req_dump *req,
3957 					  __u32 flags)
3958 {
3959 	req->_present.header = 1;
3960 	req->header._present.flags = 1;
3961 	req->header.flags = flags;
3962 }
3963 
3964 struct ethtool_fec_get_list {
3965 	struct ethtool_fec_get_list *next;
3966 	struct ethtool_fec_get_rsp obj __attribute__ ((aligned (8)));
3967 };
3968 
3969 void ethtool_fec_get_list_free(struct ethtool_fec_get_list *rsp);
3970 
3971 struct ethtool_fec_get_list *
3972 ethtool_fec_get_dump(struct ynl_sock *ys, struct ethtool_fec_get_req_dump *req);
3973 
3974 /* ETHTOOL_MSG_FEC_GET - notify */
3975 struct ethtool_fec_get_ntf {
3976 	__u16 family;
3977 	__u8 cmd;
3978 	struct ynl_ntf_base_type *next;
3979 	void (*free)(struct ethtool_fec_get_ntf *ntf);
3980 	struct ethtool_fec_get_rsp obj __attribute__ ((aligned (8)));
3981 };
3982 
3983 void ethtool_fec_get_ntf_free(struct ethtool_fec_get_ntf *rsp);
3984 
3985 /* ============== ETHTOOL_MSG_FEC_SET ============== */
3986 /* ETHTOOL_MSG_FEC_SET - do */
3987 struct ethtool_fec_set_req {
3988 	struct {
3989 		__u32 header:1;
3990 		__u32 modes:1;
3991 		__u32 auto_:1;
3992 		__u32 active:1;
3993 		__u32 stats:1;
3994 	} _present;
3995 
3996 	struct ethtool_header header;
3997 	struct ethtool_bitset modes;
3998 	__u8 auto_;
3999 	__u32 active;
4000 	struct ethtool_fec_stat stats;
4001 };
4002 
4003 static inline struct ethtool_fec_set_req *ethtool_fec_set_req_alloc(void)
4004 {
4005 	return calloc(1, sizeof(struct ethtool_fec_set_req));
4006 }
4007 void ethtool_fec_set_req_free(struct ethtool_fec_set_req *req);
4008 
4009 static inline void
4010 ethtool_fec_set_req_set_header_dev_index(struct ethtool_fec_set_req *req,
4011 					 __u32 dev_index)
4012 {
4013 	req->_present.header = 1;
4014 	req->header._present.dev_index = 1;
4015 	req->header.dev_index = dev_index;
4016 }
4017 static inline void
4018 ethtool_fec_set_req_set_header_dev_name(struct ethtool_fec_set_req *req,
4019 					const char *dev_name)
4020 {
4021 	free(req->header.dev_name);
4022 	req->header._present.dev_name_len = strlen(dev_name);
4023 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
4024 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
4025 	req->header.dev_name[req->header._present.dev_name_len] = 0;
4026 }
4027 static inline void
4028 ethtool_fec_set_req_set_header_flags(struct ethtool_fec_set_req *req,
4029 				     __u32 flags)
4030 {
4031 	req->_present.header = 1;
4032 	req->header._present.flags = 1;
4033 	req->header.flags = flags;
4034 }
4035 static inline void
4036 ethtool_fec_set_req_set_modes_nomask(struct ethtool_fec_set_req *req)
4037 {
4038 	req->_present.modes = 1;
4039 	req->modes._present.nomask = 1;
4040 }
4041 static inline void
4042 ethtool_fec_set_req_set_modes_size(struct ethtool_fec_set_req *req, __u32 size)
4043 {
4044 	req->_present.modes = 1;
4045 	req->modes._present.size = 1;
4046 	req->modes.size = size;
4047 }
4048 static inline void
4049 __ethtool_fec_set_req_set_modes_bits_bit(struct ethtool_fec_set_req *req,
4050 					 struct ethtool_bitset_bit *bit,
4051 					 unsigned int n_bit)
4052 {
4053 	free(req->modes.bits.bit);
4054 	req->modes.bits.bit = bit;
4055 	req->modes.bits.n_bit = n_bit;
4056 }
4057 static inline void
4058 ethtool_fec_set_req_set_auto_(struct ethtool_fec_set_req *req, __u8 auto_)
4059 {
4060 	req->_present.auto_ = 1;
4061 	req->auto_ = auto_;
4062 }
4063 static inline void
4064 ethtool_fec_set_req_set_active(struct ethtool_fec_set_req *req, __u32 active)
4065 {
4066 	req->_present.active = 1;
4067 	req->active = active;
4068 }
4069 static inline void
4070 ethtool_fec_set_req_set_stats_corrected(struct ethtool_fec_set_req *req,
4071 					const void *corrected, size_t len)
4072 {
4073 	free(req->stats.corrected);
4074 	req->stats.corrected = malloc(req->stats._present.corrected_len);
4075 	memcpy(req->stats.corrected, corrected, req->stats._present.corrected_len);
4076 }
4077 static inline void
4078 ethtool_fec_set_req_set_stats_uncorr(struct ethtool_fec_set_req *req,
4079 				     const void *uncorr, size_t len)
4080 {
4081 	free(req->stats.uncorr);
4082 	req->stats.uncorr = malloc(req->stats._present.uncorr_len);
4083 	memcpy(req->stats.uncorr, uncorr, req->stats._present.uncorr_len);
4084 }
4085 static inline void
4086 ethtool_fec_set_req_set_stats_corr_bits(struct ethtool_fec_set_req *req,
4087 					const void *corr_bits, size_t len)
4088 {
4089 	free(req->stats.corr_bits);
4090 	req->stats.corr_bits = malloc(req->stats._present.corr_bits_len);
4091 	memcpy(req->stats.corr_bits, corr_bits, req->stats._present.corr_bits_len);
4092 }
4093 
4094 /*
4095  * Set FEC params.
4096  */
4097 int ethtool_fec_set(struct ynl_sock *ys, struct ethtool_fec_set_req *req);
4098 
4099 /* ============== ETHTOOL_MSG_MODULE_EEPROM_GET ============== */
4100 /* ETHTOOL_MSG_MODULE_EEPROM_GET - do */
4101 struct ethtool_module_eeprom_get_req {
4102 	struct {
4103 		__u32 header:1;
4104 	} _present;
4105 
4106 	struct ethtool_header header;
4107 };
4108 
4109 static inline struct ethtool_module_eeprom_get_req *
4110 ethtool_module_eeprom_get_req_alloc(void)
4111 {
4112 	return calloc(1, sizeof(struct ethtool_module_eeprom_get_req));
4113 }
4114 void
4115 ethtool_module_eeprom_get_req_free(struct ethtool_module_eeprom_get_req *req);
4116 
4117 static inline void
4118 ethtool_module_eeprom_get_req_set_header_dev_index(struct ethtool_module_eeprom_get_req *req,
4119 						   __u32 dev_index)
4120 {
4121 	req->_present.header = 1;
4122 	req->header._present.dev_index = 1;
4123 	req->header.dev_index = dev_index;
4124 }
4125 static inline void
4126 ethtool_module_eeprom_get_req_set_header_dev_name(struct ethtool_module_eeprom_get_req *req,
4127 						  const char *dev_name)
4128 {
4129 	free(req->header.dev_name);
4130 	req->header._present.dev_name_len = strlen(dev_name);
4131 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
4132 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
4133 	req->header.dev_name[req->header._present.dev_name_len] = 0;
4134 }
4135 static inline void
4136 ethtool_module_eeprom_get_req_set_header_flags(struct ethtool_module_eeprom_get_req *req,
4137 					       __u32 flags)
4138 {
4139 	req->_present.header = 1;
4140 	req->header._present.flags = 1;
4141 	req->header.flags = flags;
4142 }
4143 
4144 struct ethtool_module_eeprom_get_rsp {
4145 	struct {
4146 		__u32 header:1;
4147 		__u32 offset:1;
4148 		__u32 length:1;
4149 		__u32 page:1;
4150 		__u32 bank:1;
4151 		__u32 i2c_address:1;
4152 		__u32 data_len;
4153 	} _present;
4154 
4155 	struct ethtool_header header;
4156 	__u32 offset;
4157 	__u32 length;
4158 	__u8 page;
4159 	__u8 bank;
4160 	__u8 i2c_address;
4161 	void *data;
4162 };
4163 
4164 void
4165 ethtool_module_eeprom_get_rsp_free(struct ethtool_module_eeprom_get_rsp *rsp);
4166 
4167 /*
4168  * Get module EEPROM params.
4169  */
4170 struct ethtool_module_eeprom_get_rsp *
4171 ethtool_module_eeprom_get(struct ynl_sock *ys,
4172 			  struct ethtool_module_eeprom_get_req *req);
4173 
4174 /* ETHTOOL_MSG_MODULE_EEPROM_GET - dump */
4175 struct ethtool_module_eeprom_get_req_dump {
4176 	struct {
4177 		__u32 header:1;
4178 	} _present;
4179 
4180 	struct ethtool_header header;
4181 };
4182 
4183 static inline struct ethtool_module_eeprom_get_req_dump *
4184 ethtool_module_eeprom_get_req_dump_alloc(void)
4185 {
4186 	return calloc(1, sizeof(struct ethtool_module_eeprom_get_req_dump));
4187 }
4188 void
4189 ethtool_module_eeprom_get_req_dump_free(struct ethtool_module_eeprom_get_req_dump *req);
4190 
4191 static inline void
4192 ethtool_module_eeprom_get_req_dump_set_header_dev_index(struct ethtool_module_eeprom_get_req_dump *req,
4193 							__u32 dev_index)
4194 {
4195 	req->_present.header = 1;
4196 	req->header._present.dev_index = 1;
4197 	req->header.dev_index = dev_index;
4198 }
4199 static inline void
4200 ethtool_module_eeprom_get_req_dump_set_header_dev_name(struct ethtool_module_eeprom_get_req_dump *req,
4201 						       const char *dev_name)
4202 {
4203 	free(req->header.dev_name);
4204 	req->header._present.dev_name_len = strlen(dev_name);
4205 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
4206 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
4207 	req->header.dev_name[req->header._present.dev_name_len] = 0;
4208 }
4209 static inline void
4210 ethtool_module_eeprom_get_req_dump_set_header_flags(struct ethtool_module_eeprom_get_req_dump *req,
4211 						    __u32 flags)
4212 {
4213 	req->_present.header = 1;
4214 	req->header._present.flags = 1;
4215 	req->header.flags = flags;
4216 }
4217 
4218 struct ethtool_module_eeprom_get_list {
4219 	struct ethtool_module_eeprom_get_list *next;
4220 	struct ethtool_module_eeprom_get_rsp obj __attribute__ ((aligned (8)));
4221 };
4222 
4223 void
4224 ethtool_module_eeprom_get_list_free(struct ethtool_module_eeprom_get_list *rsp);
4225 
4226 struct ethtool_module_eeprom_get_list *
4227 ethtool_module_eeprom_get_dump(struct ynl_sock *ys,
4228 			       struct ethtool_module_eeprom_get_req_dump *req);
4229 
4230 /* ============== ETHTOOL_MSG_PHC_VCLOCKS_GET ============== */
4231 /* ETHTOOL_MSG_PHC_VCLOCKS_GET - do */
4232 struct ethtool_phc_vclocks_get_req {
4233 	struct {
4234 		__u32 header:1;
4235 	} _present;
4236 
4237 	struct ethtool_header header;
4238 };
4239 
4240 static inline struct ethtool_phc_vclocks_get_req *
4241 ethtool_phc_vclocks_get_req_alloc(void)
4242 {
4243 	return calloc(1, sizeof(struct ethtool_phc_vclocks_get_req));
4244 }
4245 void ethtool_phc_vclocks_get_req_free(struct ethtool_phc_vclocks_get_req *req);
4246 
4247 static inline void
4248 ethtool_phc_vclocks_get_req_set_header_dev_index(struct ethtool_phc_vclocks_get_req *req,
4249 						 __u32 dev_index)
4250 {
4251 	req->_present.header = 1;
4252 	req->header._present.dev_index = 1;
4253 	req->header.dev_index = dev_index;
4254 }
4255 static inline void
4256 ethtool_phc_vclocks_get_req_set_header_dev_name(struct ethtool_phc_vclocks_get_req *req,
4257 						const char *dev_name)
4258 {
4259 	free(req->header.dev_name);
4260 	req->header._present.dev_name_len = strlen(dev_name);
4261 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
4262 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
4263 	req->header.dev_name[req->header._present.dev_name_len] = 0;
4264 }
4265 static inline void
4266 ethtool_phc_vclocks_get_req_set_header_flags(struct ethtool_phc_vclocks_get_req *req,
4267 					     __u32 flags)
4268 {
4269 	req->_present.header = 1;
4270 	req->header._present.flags = 1;
4271 	req->header.flags = flags;
4272 }
4273 
4274 struct ethtool_phc_vclocks_get_rsp {
4275 	struct {
4276 		__u32 header:1;
4277 		__u32 num:1;
4278 	} _present;
4279 
4280 	struct ethtool_header header;
4281 	__u32 num;
4282 };
4283 
4284 void ethtool_phc_vclocks_get_rsp_free(struct ethtool_phc_vclocks_get_rsp *rsp);
4285 
4286 /*
4287  * Get PHC VCLOCKs.
4288  */
4289 struct ethtool_phc_vclocks_get_rsp *
4290 ethtool_phc_vclocks_get(struct ynl_sock *ys,
4291 			struct ethtool_phc_vclocks_get_req *req);
4292 
4293 /* ETHTOOL_MSG_PHC_VCLOCKS_GET - dump */
4294 struct ethtool_phc_vclocks_get_req_dump {
4295 	struct {
4296 		__u32 header:1;
4297 	} _present;
4298 
4299 	struct ethtool_header header;
4300 };
4301 
4302 static inline struct ethtool_phc_vclocks_get_req_dump *
4303 ethtool_phc_vclocks_get_req_dump_alloc(void)
4304 {
4305 	return calloc(1, sizeof(struct ethtool_phc_vclocks_get_req_dump));
4306 }
4307 void
4308 ethtool_phc_vclocks_get_req_dump_free(struct ethtool_phc_vclocks_get_req_dump *req);
4309 
4310 static inline void
4311 ethtool_phc_vclocks_get_req_dump_set_header_dev_index(struct ethtool_phc_vclocks_get_req_dump *req,
4312 						      __u32 dev_index)
4313 {
4314 	req->_present.header = 1;
4315 	req->header._present.dev_index = 1;
4316 	req->header.dev_index = dev_index;
4317 }
4318 static inline void
4319 ethtool_phc_vclocks_get_req_dump_set_header_dev_name(struct ethtool_phc_vclocks_get_req_dump *req,
4320 						     const char *dev_name)
4321 {
4322 	free(req->header.dev_name);
4323 	req->header._present.dev_name_len = strlen(dev_name);
4324 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
4325 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
4326 	req->header.dev_name[req->header._present.dev_name_len] = 0;
4327 }
4328 static inline void
4329 ethtool_phc_vclocks_get_req_dump_set_header_flags(struct ethtool_phc_vclocks_get_req_dump *req,
4330 						  __u32 flags)
4331 {
4332 	req->_present.header = 1;
4333 	req->header._present.flags = 1;
4334 	req->header.flags = flags;
4335 }
4336 
4337 struct ethtool_phc_vclocks_get_list {
4338 	struct ethtool_phc_vclocks_get_list *next;
4339 	struct ethtool_phc_vclocks_get_rsp obj __attribute__ ((aligned (8)));
4340 };
4341 
4342 void
4343 ethtool_phc_vclocks_get_list_free(struct ethtool_phc_vclocks_get_list *rsp);
4344 
4345 struct ethtool_phc_vclocks_get_list *
4346 ethtool_phc_vclocks_get_dump(struct ynl_sock *ys,
4347 			     struct ethtool_phc_vclocks_get_req_dump *req);
4348 
4349 /* ============== ETHTOOL_MSG_MODULE_GET ============== */
4350 /* ETHTOOL_MSG_MODULE_GET - do */
4351 struct ethtool_module_get_req {
4352 	struct {
4353 		__u32 header:1;
4354 	} _present;
4355 
4356 	struct ethtool_header header;
4357 };
4358 
4359 static inline struct ethtool_module_get_req *ethtool_module_get_req_alloc(void)
4360 {
4361 	return calloc(1, sizeof(struct ethtool_module_get_req));
4362 }
4363 void ethtool_module_get_req_free(struct ethtool_module_get_req *req);
4364 
4365 static inline void
4366 ethtool_module_get_req_set_header_dev_index(struct ethtool_module_get_req *req,
4367 					    __u32 dev_index)
4368 {
4369 	req->_present.header = 1;
4370 	req->header._present.dev_index = 1;
4371 	req->header.dev_index = dev_index;
4372 }
4373 static inline void
4374 ethtool_module_get_req_set_header_dev_name(struct ethtool_module_get_req *req,
4375 					   const char *dev_name)
4376 {
4377 	free(req->header.dev_name);
4378 	req->header._present.dev_name_len = strlen(dev_name);
4379 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
4380 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
4381 	req->header.dev_name[req->header._present.dev_name_len] = 0;
4382 }
4383 static inline void
4384 ethtool_module_get_req_set_header_flags(struct ethtool_module_get_req *req,
4385 					__u32 flags)
4386 {
4387 	req->_present.header = 1;
4388 	req->header._present.flags = 1;
4389 	req->header.flags = flags;
4390 }
4391 
4392 struct ethtool_module_get_rsp {
4393 	struct {
4394 		__u32 header:1;
4395 		__u32 power_mode_policy:1;
4396 		__u32 power_mode:1;
4397 	} _present;
4398 
4399 	struct ethtool_header header;
4400 	__u8 power_mode_policy;
4401 	__u8 power_mode;
4402 };
4403 
4404 void ethtool_module_get_rsp_free(struct ethtool_module_get_rsp *rsp);
4405 
4406 /*
4407  * Get module params.
4408  */
4409 struct ethtool_module_get_rsp *
4410 ethtool_module_get(struct ynl_sock *ys, struct ethtool_module_get_req *req);
4411 
4412 /* ETHTOOL_MSG_MODULE_GET - dump */
4413 struct ethtool_module_get_req_dump {
4414 	struct {
4415 		__u32 header:1;
4416 	} _present;
4417 
4418 	struct ethtool_header header;
4419 };
4420 
4421 static inline struct ethtool_module_get_req_dump *
4422 ethtool_module_get_req_dump_alloc(void)
4423 {
4424 	return calloc(1, sizeof(struct ethtool_module_get_req_dump));
4425 }
4426 void ethtool_module_get_req_dump_free(struct ethtool_module_get_req_dump *req);
4427 
4428 static inline void
4429 ethtool_module_get_req_dump_set_header_dev_index(struct ethtool_module_get_req_dump *req,
4430 						 __u32 dev_index)
4431 {
4432 	req->_present.header = 1;
4433 	req->header._present.dev_index = 1;
4434 	req->header.dev_index = dev_index;
4435 }
4436 static inline void
4437 ethtool_module_get_req_dump_set_header_dev_name(struct ethtool_module_get_req_dump *req,
4438 						const char *dev_name)
4439 {
4440 	free(req->header.dev_name);
4441 	req->header._present.dev_name_len = strlen(dev_name);
4442 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
4443 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
4444 	req->header.dev_name[req->header._present.dev_name_len] = 0;
4445 }
4446 static inline void
4447 ethtool_module_get_req_dump_set_header_flags(struct ethtool_module_get_req_dump *req,
4448 					     __u32 flags)
4449 {
4450 	req->_present.header = 1;
4451 	req->header._present.flags = 1;
4452 	req->header.flags = flags;
4453 }
4454 
4455 struct ethtool_module_get_list {
4456 	struct ethtool_module_get_list *next;
4457 	struct ethtool_module_get_rsp obj __attribute__ ((aligned (8)));
4458 };
4459 
4460 void ethtool_module_get_list_free(struct ethtool_module_get_list *rsp);
4461 
4462 struct ethtool_module_get_list *
4463 ethtool_module_get_dump(struct ynl_sock *ys,
4464 			struct ethtool_module_get_req_dump *req);
4465 
4466 /* ETHTOOL_MSG_MODULE_GET - notify */
4467 struct ethtool_module_get_ntf {
4468 	__u16 family;
4469 	__u8 cmd;
4470 	struct ynl_ntf_base_type *next;
4471 	void (*free)(struct ethtool_module_get_ntf *ntf);
4472 	struct ethtool_module_get_rsp obj __attribute__ ((aligned (8)));
4473 };
4474 
4475 void ethtool_module_get_ntf_free(struct ethtool_module_get_ntf *rsp);
4476 
4477 /* ============== ETHTOOL_MSG_MODULE_SET ============== */
4478 /* ETHTOOL_MSG_MODULE_SET - do */
4479 struct ethtool_module_set_req {
4480 	struct {
4481 		__u32 header:1;
4482 		__u32 power_mode_policy:1;
4483 		__u32 power_mode:1;
4484 	} _present;
4485 
4486 	struct ethtool_header header;
4487 	__u8 power_mode_policy;
4488 	__u8 power_mode;
4489 };
4490 
4491 static inline struct ethtool_module_set_req *ethtool_module_set_req_alloc(void)
4492 {
4493 	return calloc(1, sizeof(struct ethtool_module_set_req));
4494 }
4495 void ethtool_module_set_req_free(struct ethtool_module_set_req *req);
4496 
4497 static inline void
4498 ethtool_module_set_req_set_header_dev_index(struct ethtool_module_set_req *req,
4499 					    __u32 dev_index)
4500 {
4501 	req->_present.header = 1;
4502 	req->header._present.dev_index = 1;
4503 	req->header.dev_index = dev_index;
4504 }
4505 static inline void
4506 ethtool_module_set_req_set_header_dev_name(struct ethtool_module_set_req *req,
4507 					   const char *dev_name)
4508 {
4509 	free(req->header.dev_name);
4510 	req->header._present.dev_name_len = strlen(dev_name);
4511 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
4512 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
4513 	req->header.dev_name[req->header._present.dev_name_len] = 0;
4514 }
4515 static inline void
4516 ethtool_module_set_req_set_header_flags(struct ethtool_module_set_req *req,
4517 					__u32 flags)
4518 {
4519 	req->_present.header = 1;
4520 	req->header._present.flags = 1;
4521 	req->header.flags = flags;
4522 }
4523 static inline void
4524 ethtool_module_set_req_set_power_mode_policy(struct ethtool_module_set_req *req,
4525 					     __u8 power_mode_policy)
4526 {
4527 	req->_present.power_mode_policy = 1;
4528 	req->power_mode_policy = power_mode_policy;
4529 }
4530 static inline void
4531 ethtool_module_set_req_set_power_mode(struct ethtool_module_set_req *req,
4532 				      __u8 power_mode)
4533 {
4534 	req->_present.power_mode = 1;
4535 	req->power_mode = power_mode;
4536 }
4537 
4538 /*
4539  * Set module params.
4540  */
4541 int ethtool_module_set(struct ynl_sock *ys, struct ethtool_module_set_req *req);
4542 
4543 /* ============== ETHTOOL_MSG_PSE_GET ============== */
4544 /* ETHTOOL_MSG_PSE_GET - do */
4545 struct ethtool_pse_get_req {
4546 	struct {
4547 		__u32 header:1;
4548 	} _present;
4549 
4550 	struct ethtool_header header;
4551 };
4552 
4553 static inline struct ethtool_pse_get_req *ethtool_pse_get_req_alloc(void)
4554 {
4555 	return calloc(1, sizeof(struct ethtool_pse_get_req));
4556 }
4557 void ethtool_pse_get_req_free(struct ethtool_pse_get_req *req);
4558 
4559 static inline void
4560 ethtool_pse_get_req_set_header_dev_index(struct ethtool_pse_get_req *req,
4561 					 __u32 dev_index)
4562 {
4563 	req->_present.header = 1;
4564 	req->header._present.dev_index = 1;
4565 	req->header.dev_index = dev_index;
4566 }
4567 static inline void
4568 ethtool_pse_get_req_set_header_dev_name(struct ethtool_pse_get_req *req,
4569 					const char *dev_name)
4570 {
4571 	free(req->header.dev_name);
4572 	req->header._present.dev_name_len = strlen(dev_name);
4573 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
4574 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
4575 	req->header.dev_name[req->header._present.dev_name_len] = 0;
4576 }
4577 static inline void
4578 ethtool_pse_get_req_set_header_flags(struct ethtool_pse_get_req *req,
4579 				     __u32 flags)
4580 {
4581 	req->_present.header = 1;
4582 	req->header._present.flags = 1;
4583 	req->header.flags = flags;
4584 }
4585 
4586 struct ethtool_pse_get_rsp {
4587 	struct {
4588 		__u32 header:1;
4589 		__u32 admin_state:1;
4590 		__u32 admin_control:1;
4591 		__u32 pw_d_status:1;
4592 	} _present;
4593 
4594 	struct ethtool_header header;
4595 	__u32 admin_state;
4596 	__u32 admin_control;
4597 	__u32 pw_d_status;
4598 };
4599 
4600 void ethtool_pse_get_rsp_free(struct ethtool_pse_get_rsp *rsp);
4601 
4602 /*
4603  * Get Power Sourcing Equipment params.
4604  */
4605 struct ethtool_pse_get_rsp *
4606 ethtool_pse_get(struct ynl_sock *ys, struct ethtool_pse_get_req *req);
4607 
4608 /* ETHTOOL_MSG_PSE_GET - dump */
4609 struct ethtool_pse_get_req_dump {
4610 	struct {
4611 		__u32 header:1;
4612 	} _present;
4613 
4614 	struct ethtool_header header;
4615 };
4616 
4617 static inline struct ethtool_pse_get_req_dump *
4618 ethtool_pse_get_req_dump_alloc(void)
4619 {
4620 	return calloc(1, sizeof(struct ethtool_pse_get_req_dump));
4621 }
4622 void ethtool_pse_get_req_dump_free(struct ethtool_pse_get_req_dump *req);
4623 
4624 static inline void
4625 ethtool_pse_get_req_dump_set_header_dev_index(struct ethtool_pse_get_req_dump *req,
4626 					      __u32 dev_index)
4627 {
4628 	req->_present.header = 1;
4629 	req->header._present.dev_index = 1;
4630 	req->header.dev_index = dev_index;
4631 }
4632 static inline void
4633 ethtool_pse_get_req_dump_set_header_dev_name(struct ethtool_pse_get_req_dump *req,
4634 					     const char *dev_name)
4635 {
4636 	free(req->header.dev_name);
4637 	req->header._present.dev_name_len = strlen(dev_name);
4638 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
4639 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
4640 	req->header.dev_name[req->header._present.dev_name_len] = 0;
4641 }
4642 static inline void
4643 ethtool_pse_get_req_dump_set_header_flags(struct ethtool_pse_get_req_dump *req,
4644 					  __u32 flags)
4645 {
4646 	req->_present.header = 1;
4647 	req->header._present.flags = 1;
4648 	req->header.flags = flags;
4649 }
4650 
4651 struct ethtool_pse_get_list {
4652 	struct ethtool_pse_get_list *next;
4653 	struct ethtool_pse_get_rsp obj __attribute__ ((aligned (8)));
4654 };
4655 
4656 void ethtool_pse_get_list_free(struct ethtool_pse_get_list *rsp);
4657 
4658 struct ethtool_pse_get_list *
4659 ethtool_pse_get_dump(struct ynl_sock *ys, struct ethtool_pse_get_req_dump *req);
4660 
4661 /* ============== ETHTOOL_MSG_PSE_SET ============== */
4662 /* ETHTOOL_MSG_PSE_SET - do */
4663 struct ethtool_pse_set_req {
4664 	struct {
4665 		__u32 header:1;
4666 		__u32 admin_state:1;
4667 		__u32 admin_control:1;
4668 		__u32 pw_d_status:1;
4669 	} _present;
4670 
4671 	struct ethtool_header header;
4672 	__u32 admin_state;
4673 	__u32 admin_control;
4674 	__u32 pw_d_status;
4675 };
4676 
4677 static inline struct ethtool_pse_set_req *ethtool_pse_set_req_alloc(void)
4678 {
4679 	return calloc(1, sizeof(struct ethtool_pse_set_req));
4680 }
4681 void ethtool_pse_set_req_free(struct ethtool_pse_set_req *req);
4682 
4683 static inline void
4684 ethtool_pse_set_req_set_header_dev_index(struct ethtool_pse_set_req *req,
4685 					 __u32 dev_index)
4686 {
4687 	req->_present.header = 1;
4688 	req->header._present.dev_index = 1;
4689 	req->header.dev_index = dev_index;
4690 }
4691 static inline void
4692 ethtool_pse_set_req_set_header_dev_name(struct ethtool_pse_set_req *req,
4693 					const char *dev_name)
4694 {
4695 	free(req->header.dev_name);
4696 	req->header._present.dev_name_len = strlen(dev_name);
4697 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
4698 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
4699 	req->header.dev_name[req->header._present.dev_name_len] = 0;
4700 }
4701 static inline void
4702 ethtool_pse_set_req_set_header_flags(struct ethtool_pse_set_req *req,
4703 				     __u32 flags)
4704 {
4705 	req->_present.header = 1;
4706 	req->header._present.flags = 1;
4707 	req->header.flags = flags;
4708 }
4709 static inline void
4710 ethtool_pse_set_req_set_admin_state(struct ethtool_pse_set_req *req,
4711 				    __u32 admin_state)
4712 {
4713 	req->_present.admin_state = 1;
4714 	req->admin_state = admin_state;
4715 }
4716 static inline void
4717 ethtool_pse_set_req_set_admin_control(struct ethtool_pse_set_req *req,
4718 				      __u32 admin_control)
4719 {
4720 	req->_present.admin_control = 1;
4721 	req->admin_control = admin_control;
4722 }
4723 static inline void
4724 ethtool_pse_set_req_set_pw_d_status(struct ethtool_pse_set_req *req,
4725 				    __u32 pw_d_status)
4726 {
4727 	req->_present.pw_d_status = 1;
4728 	req->pw_d_status = pw_d_status;
4729 }
4730 
4731 /*
4732  * Set Power Sourcing Equipment params.
4733  */
4734 int ethtool_pse_set(struct ynl_sock *ys, struct ethtool_pse_set_req *req);
4735 
4736 /* ============== ETHTOOL_MSG_RSS_GET ============== */
4737 /* ETHTOOL_MSG_RSS_GET - do */
4738 struct ethtool_rss_get_req {
4739 	struct {
4740 		__u32 header:1;
4741 	} _present;
4742 
4743 	struct ethtool_header header;
4744 };
4745 
4746 static inline struct ethtool_rss_get_req *ethtool_rss_get_req_alloc(void)
4747 {
4748 	return calloc(1, sizeof(struct ethtool_rss_get_req));
4749 }
4750 void ethtool_rss_get_req_free(struct ethtool_rss_get_req *req);
4751 
4752 static inline void
4753 ethtool_rss_get_req_set_header_dev_index(struct ethtool_rss_get_req *req,
4754 					 __u32 dev_index)
4755 {
4756 	req->_present.header = 1;
4757 	req->header._present.dev_index = 1;
4758 	req->header.dev_index = dev_index;
4759 }
4760 static inline void
4761 ethtool_rss_get_req_set_header_dev_name(struct ethtool_rss_get_req *req,
4762 					const char *dev_name)
4763 {
4764 	free(req->header.dev_name);
4765 	req->header._present.dev_name_len = strlen(dev_name);
4766 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
4767 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
4768 	req->header.dev_name[req->header._present.dev_name_len] = 0;
4769 }
4770 static inline void
4771 ethtool_rss_get_req_set_header_flags(struct ethtool_rss_get_req *req,
4772 				     __u32 flags)
4773 {
4774 	req->_present.header = 1;
4775 	req->header._present.flags = 1;
4776 	req->header.flags = flags;
4777 }
4778 
4779 struct ethtool_rss_get_rsp {
4780 	struct {
4781 		__u32 header:1;
4782 		__u32 context:1;
4783 		__u32 hfunc:1;
4784 		__u32 indir_len;
4785 		__u32 hkey_len;
4786 	} _present;
4787 
4788 	struct ethtool_header header;
4789 	__u32 context;
4790 	__u32 hfunc;
4791 	void *indir;
4792 	void *hkey;
4793 };
4794 
4795 void ethtool_rss_get_rsp_free(struct ethtool_rss_get_rsp *rsp);
4796 
4797 /*
4798  * Get RSS params.
4799  */
4800 struct ethtool_rss_get_rsp *
4801 ethtool_rss_get(struct ynl_sock *ys, struct ethtool_rss_get_req *req);
4802 
4803 /* ETHTOOL_MSG_RSS_GET - dump */
4804 struct ethtool_rss_get_req_dump {
4805 	struct {
4806 		__u32 header:1;
4807 	} _present;
4808 
4809 	struct ethtool_header header;
4810 };
4811 
4812 static inline struct ethtool_rss_get_req_dump *
4813 ethtool_rss_get_req_dump_alloc(void)
4814 {
4815 	return calloc(1, sizeof(struct ethtool_rss_get_req_dump));
4816 }
4817 void ethtool_rss_get_req_dump_free(struct ethtool_rss_get_req_dump *req);
4818 
4819 static inline void
4820 ethtool_rss_get_req_dump_set_header_dev_index(struct ethtool_rss_get_req_dump *req,
4821 					      __u32 dev_index)
4822 {
4823 	req->_present.header = 1;
4824 	req->header._present.dev_index = 1;
4825 	req->header.dev_index = dev_index;
4826 }
4827 static inline void
4828 ethtool_rss_get_req_dump_set_header_dev_name(struct ethtool_rss_get_req_dump *req,
4829 					     const char *dev_name)
4830 {
4831 	free(req->header.dev_name);
4832 	req->header._present.dev_name_len = strlen(dev_name);
4833 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
4834 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
4835 	req->header.dev_name[req->header._present.dev_name_len] = 0;
4836 }
4837 static inline void
4838 ethtool_rss_get_req_dump_set_header_flags(struct ethtool_rss_get_req_dump *req,
4839 					  __u32 flags)
4840 {
4841 	req->_present.header = 1;
4842 	req->header._present.flags = 1;
4843 	req->header.flags = flags;
4844 }
4845 
4846 struct ethtool_rss_get_list {
4847 	struct ethtool_rss_get_list *next;
4848 	struct ethtool_rss_get_rsp obj __attribute__ ((aligned (8)));
4849 };
4850 
4851 void ethtool_rss_get_list_free(struct ethtool_rss_get_list *rsp);
4852 
4853 struct ethtool_rss_get_list *
4854 ethtool_rss_get_dump(struct ynl_sock *ys, struct ethtool_rss_get_req_dump *req);
4855 
4856 /* ============== ETHTOOL_MSG_PLCA_GET_CFG ============== */
4857 /* ETHTOOL_MSG_PLCA_GET_CFG - do */
4858 struct ethtool_plca_get_cfg_req {
4859 	struct {
4860 		__u32 header:1;
4861 	} _present;
4862 
4863 	struct ethtool_header header;
4864 };
4865 
4866 static inline struct ethtool_plca_get_cfg_req *
4867 ethtool_plca_get_cfg_req_alloc(void)
4868 {
4869 	return calloc(1, sizeof(struct ethtool_plca_get_cfg_req));
4870 }
4871 void ethtool_plca_get_cfg_req_free(struct ethtool_plca_get_cfg_req *req);
4872 
4873 static inline void
4874 ethtool_plca_get_cfg_req_set_header_dev_index(struct ethtool_plca_get_cfg_req *req,
4875 					      __u32 dev_index)
4876 {
4877 	req->_present.header = 1;
4878 	req->header._present.dev_index = 1;
4879 	req->header.dev_index = dev_index;
4880 }
4881 static inline void
4882 ethtool_plca_get_cfg_req_set_header_dev_name(struct ethtool_plca_get_cfg_req *req,
4883 					     const char *dev_name)
4884 {
4885 	free(req->header.dev_name);
4886 	req->header._present.dev_name_len = strlen(dev_name);
4887 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
4888 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
4889 	req->header.dev_name[req->header._present.dev_name_len] = 0;
4890 }
4891 static inline void
4892 ethtool_plca_get_cfg_req_set_header_flags(struct ethtool_plca_get_cfg_req *req,
4893 					  __u32 flags)
4894 {
4895 	req->_present.header = 1;
4896 	req->header._present.flags = 1;
4897 	req->header.flags = flags;
4898 }
4899 
4900 struct ethtool_plca_get_cfg_rsp {
4901 	struct {
4902 		__u32 header:1;
4903 		__u32 version:1;
4904 		__u32 enabled:1;
4905 		__u32 status:1;
4906 		__u32 node_cnt:1;
4907 		__u32 node_id:1;
4908 		__u32 to_tmr:1;
4909 		__u32 burst_cnt:1;
4910 		__u32 burst_tmr:1;
4911 	} _present;
4912 
4913 	struct ethtool_header header;
4914 	__u16 version;
4915 	__u8 enabled;
4916 	__u8 status;
4917 	__u32 node_cnt;
4918 	__u32 node_id;
4919 	__u32 to_tmr;
4920 	__u32 burst_cnt;
4921 	__u32 burst_tmr;
4922 };
4923 
4924 void ethtool_plca_get_cfg_rsp_free(struct ethtool_plca_get_cfg_rsp *rsp);
4925 
4926 /*
4927  * Get PLCA params.
4928  */
4929 struct ethtool_plca_get_cfg_rsp *
4930 ethtool_plca_get_cfg(struct ynl_sock *ys, struct ethtool_plca_get_cfg_req *req);
4931 
4932 /* ETHTOOL_MSG_PLCA_GET_CFG - dump */
4933 struct ethtool_plca_get_cfg_req_dump {
4934 	struct {
4935 		__u32 header:1;
4936 	} _present;
4937 
4938 	struct ethtool_header header;
4939 };
4940 
4941 static inline struct ethtool_plca_get_cfg_req_dump *
4942 ethtool_plca_get_cfg_req_dump_alloc(void)
4943 {
4944 	return calloc(1, sizeof(struct ethtool_plca_get_cfg_req_dump));
4945 }
4946 void
4947 ethtool_plca_get_cfg_req_dump_free(struct ethtool_plca_get_cfg_req_dump *req);
4948 
4949 static inline void
4950 ethtool_plca_get_cfg_req_dump_set_header_dev_index(struct ethtool_plca_get_cfg_req_dump *req,
4951 						   __u32 dev_index)
4952 {
4953 	req->_present.header = 1;
4954 	req->header._present.dev_index = 1;
4955 	req->header.dev_index = dev_index;
4956 }
4957 static inline void
4958 ethtool_plca_get_cfg_req_dump_set_header_dev_name(struct ethtool_plca_get_cfg_req_dump *req,
4959 						  const char *dev_name)
4960 {
4961 	free(req->header.dev_name);
4962 	req->header._present.dev_name_len = strlen(dev_name);
4963 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
4964 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
4965 	req->header.dev_name[req->header._present.dev_name_len] = 0;
4966 }
4967 static inline void
4968 ethtool_plca_get_cfg_req_dump_set_header_flags(struct ethtool_plca_get_cfg_req_dump *req,
4969 					       __u32 flags)
4970 {
4971 	req->_present.header = 1;
4972 	req->header._present.flags = 1;
4973 	req->header.flags = flags;
4974 }
4975 
4976 struct ethtool_plca_get_cfg_list {
4977 	struct ethtool_plca_get_cfg_list *next;
4978 	struct ethtool_plca_get_cfg_rsp obj __attribute__ ((aligned (8)));
4979 };
4980 
4981 void ethtool_plca_get_cfg_list_free(struct ethtool_plca_get_cfg_list *rsp);
4982 
4983 struct ethtool_plca_get_cfg_list *
4984 ethtool_plca_get_cfg_dump(struct ynl_sock *ys,
4985 			  struct ethtool_plca_get_cfg_req_dump *req);
4986 
4987 /* ETHTOOL_MSG_PLCA_GET_CFG - notify */
4988 struct ethtool_plca_get_cfg_ntf {
4989 	__u16 family;
4990 	__u8 cmd;
4991 	struct ynl_ntf_base_type *next;
4992 	void (*free)(struct ethtool_plca_get_cfg_ntf *ntf);
4993 	struct ethtool_plca_get_cfg_rsp obj __attribute__ ((aligned (8)));
4994 };
4995 
4996 void ethtool_plca_get_cfg_ntf_free(struct ethtool_plca_get_cfg_ntf *rsp);
4997 
4998 /* ============== ETHTOOL_MSG_PLCA_SET_CFG ============== */
4999 /* ETHTOOL_MSG_PLCA_SET_CFG - do */
5000 struct ethtool_plca_set_cfg_req {
5001 	struct {
5002 		__u32 header:1;
5003 		__u32 version:1;
5004 		__u32 enabled:1;
5005 		__u32 status:1;
5006 		__u32 node_cnt:1;
5007 		__u32 node_id:1;
5008 		__u32 to_tmr:1;
5009 		__u32 burst_cnt:1;
5010 		__u32 burst_tmr:1;
5011 	} _present;
5012 
5013 	struct ethtool_header header;
5014 	__u16 version;
5015 	__u8 enabled;
5016 	__u8 status;
5017 	__u32 node_cnt;
5018 	__u32 node_id;
5019 	__u32 to_tmr;
5020 	__u32 burst_cnt;
5021 	__u32 burst_tmr;
5022 };
5023 
5024 static inline struct ethtool_plca_set_cfg_req *
5025 ethtool_plca_set_cfg_req_alloc(void)
5026 {
5027 	return calloc(1, sizeof(struct ethtool_plca_set_cfg_req));
5028 }
5029 void ethtool_plca_set_cfg_req_free(struct ethtool_plca_set_cfg_req *req);
5030 
5031 static inline void
5032 ethtool_plca_set_cfg_req_set_header_dev_index(struct ethtool_plca_set_cfg_req *req,
5033 					      __u32 dev_index)
5034 {
5035 	req->_present.header = 1;
5036 	req->header._present.dev_index = 1;
5037 	req->header.dev_index = dev_index;
5038 }
5039 static inline void
5040 ethtool_plca_set_cfg_req_set_header_dev_name(struct ethtool_plca_set_cfg_req *req,
5041 					     const char *dev_name)
5042 {
5043 	free(req->header.dev_name);
5044 	req->header._present.dev_name_len = strlen(dev_name);
5045 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
5046 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
5047 	req->header.dev_name[req->header._present.dev_name_len] = 0;
5048 }
5049 static inline void
5050 ethtool_plca_set_cfg_req_set_header_flags(struct ethtool_plca_set_cfg_req *req,
5051 					  __u32 flags)
5052 {
5053 	req->_present.header = 1;
5054 	req->header._present.flags = 1;
5055 	req->header.flags = flags;
5056 }
5057 static inline void
5058 ethtool_plca_set_cfg_req_set_version(struct ethtool_plca_set_cfg_req *req,
5059 				     __u16 version)
5060 {
5061 	req->_present.version = 1;
5062 	req->version = version;
5063 }
5064 static inline void
5065 ethtool_plca_set_cfg_req_set_enabled(struct ethtool_plca_set_cfg_req *req,
5066 				     __u8 enabled)
5067 {
5068 	req->_present.enabled = 1;
5069 	req->enabled = enabled;
5070 }
5071 static inline void
5072 ethtool_plca_set_cfg_req_set_status(struct ethtool_plca_set_cfg_req *req,
5073 				    __u8 status)
5074 {
5075 	req->_present.status = 1;
5076 	req->status = status;
5077 }
5078 static inline void
5079 ethtool_plca_set_cfg_req_set_node_cnt(struct ethtool_plca_set_cfg_req *req,
5080 				      __u32 node_cnt)
5081 {
5082 	req->_present.node_cnt = 1;
5083 	req->node_cnt = node_cnt;
5084 }
5085 static inline void
5086 ethtool_plca_set_cfg_req_set_node_id(struct ethtool_plca_set_cfg_req *req,
5087 				     __u32 node_id)
5088 {
5089 	req->_present.node_id = 1;
5090 	req->node_id = node_id;
5091 }
5092 static inline void
5093 ethtool_plca_set_cfg_req_set_to_tmr(struct ethtool_plca_set_cfg_req *req,
5094 				    __u32 to_tmr)
5095 {
5096 	req->_present.to_tmr = 1;
5097 	req->to_tmr = to_tmr;
5098 }
5099 static inline void
5100 ethtool_plca_set_cfg_req_set_burst_cnt(struct ethtool_plca_set_cfg_req *req,
5101 				       __u32 burst_cnt)
5102 {
5103 	req->_present.burst_cnt = 1;
5104 	req->burst_cnt = burst_cnt;
5105 }
5106 static inline void
5107 ethtool_plca_set_cfg_req_set_burst_tmr(struct ethtool_plca_set_cfg_req *req,
5108 				       __u32 burst_tmr)
5109 {
5110 	req->_present.burst_tmr = 1;
5111 	req->burst_tmr = burst_tmr;
5112 }
5113 
5114 /*
5115  * Set PLCA params.
5116  */
5117 int ethtool_plca_set_cfg(struct ynl_sock *ys,
5118 			 struct ethtool_plca_set_cfg_req *req);
5119 
5120 /* ============== ETHTOOL_MSG_PLCA_GET_STATUS ============== */
5121 /* ETHTOOL_MSG_PLCA_GET_STATUS - do */
5122 struct ethtool_plca_get_status_req {
5123 	struct {
5124 		__u32 header:1;
5125 	} _present;
5126 
5127 	struct ethtool_header header;
5128 };
5129 
5130 static inline struct ethtool_plca_get_status_req *
5131 ethtool_plca_get_status_req_alloc(void)
5132 {
5133 	return calloc(1, sizeof(struct ethtool_plca_get_status_req));
5134 }
5135 void ethtool_plca_get_status_req_free(struct ethtool_plca_get_status_req *req);
5136 
5137 static inline void
5138 ethtool_plca_get_status_req_set_header_dev_index(struct ethtool_plca_get_status_req *req,
5139 						 __u32 dev_index)
5140 {
5141 	req->_present.header = 1;
5142 	req->header._present.dev_index = 1;
5143 	req->header.dev_index = dev_index;
5144 }
5145 static inline void
5146 ethtool_plca_get_status_req_set_header_dev_name(struct ethtool_plca_get_status_req *req,
5147 						const char *dev_name)
5148 {
5149 	free(req->header.dev_name);
5150 	req->header._present.dev_name_len = strlen(dev_name);
5151 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
5152 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
5153 	req->header.dev_name[req->header._present.dev_name_len] = 0;
5154 }
5155 static inline void
5156 ethtool_plca_get_status_req_set_header_flags(struct ethtool_plca_get_status_req *req,
5157 					     __u32 flags)
5158 {
5159 	req->_present.header = 1;
5160 	req->header._present.flags = 1;
5161 	req->header.flags = flags;
5162 }
5163 
5164 struct ethtool_plca_get_status_rsp {
5165 	struct {
5166 		__u32 header:1;
5167 		__u32 version:1;
5168 		__u32 enabled:1;
5169 		__u32 status:1;
5170 		__u32 node_cnt:1;
5171 		__u32 node_id:1;
5172 		__u32 to_tmr:1;
5173 		__u32 burst_cnt:1;
5174 		__u32 burst_tmr:1;
5175 	} _present;
5176 
5177 	struct ethtool_header header;
5178 	__u16 version;
5179 	__u8 enabled;
5180 	__u8 status;
5181 	__u32 node_cnt;
5182 	__u32 node_id;
5183 	__u32 to_tmr;
5184 	__u32 burst_cnt;
5185 	__u32 burst_tmr;
5186 };
5187 
5188 void ethtool_plca_get_status_rsp_free(struct ethtool_plca_get_status_rsp *rsp);
5189 
5190 /*
5191  * Get PLCA status params.
5192  */
5193 struct ethtool_plca_get_status_rsp *
5194 ethtool_plca_get_status(struct ynl_sock *ys,
5195 			struct ethtool_plca_get_status_req *req);
5196 
5197 /* ETHTOOL_MSG_PLCA_GET_STATUS - dump */
5198 struct ethtool_plca_get_status_req_dump {
5199 	struct {
5200 		__u32 header:1;
5201 	} _present;
5202 
5203 	struct ethtool_header header;
5204 };
5205 
5206 static inline struct ethtool_plca_get_status_req_dump *
5207 ethtool_plca_get_status_req_dump_alloc(void)
5208 {
5209 	return calloc(1, sizeof(struct ethtool_plca_get_status_req_dump));
5210 }
5211 void
5212 ethtool_plca_get_status_req_dump_free(struct ethtool_plca_get_status_req_dump *req);
5213 
5214 static inline void
5215 ethtool_plca_get_status_req_dump_set_header_dev_index(struct ethtool_plca_get_status_req_dump *req,
5216 						      __u32 dev_index)
5217 {
5218 	req->_present.header = 1;
5219 	req->header._present.dev_index = 1;
5220 	req->header.dev_index = dev_index;
5221 }
5222 static inline void
5223 ethtool_plca_get_status_req_dump_set_header_dev_name(struct ethtool_plca_get_status_req_dump *req,
5224 						     const char *dev_name)
5225 {
5226 	free(req->header.dev_name);
5227 	req->header._present.dev_name_len = strlen(dev_name);
5228 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
5229 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
5230 	req->header.dev_name[req->header._present.dev_name_len] = 0;
5231 }
5232 static inline void
5233 ethtool_plca_get_status_req_dump_set_header_flags(struct ethtool_plca_get_status_req_dump *req,
5234 						  __u32 flags)
5235 {
5236 	req->_present.header = 1;
5237 	req->header._present.flags = 1;
5238 	req->header.flags = flags;
5239 }
5240 
5241 struct ethtool_plca_get_status_list {
5242 	struct ethtool_plca_get_status_list *next;
5243 	struct ethtool_plca_get_status_rsp obj __attribute__ ((aligned (8)));
5244 };
5245 
5246 void
5247 ethtool_plca_get_status_list_free(struct ethtool_plca_get_status_list *rsp);
5248 
5249 struct ethtool_plca_get_status_list *
5250 ethtool_plca_get_status_dump(struct ynl_sock *ys,
5251 			     struct ethtool_plca_get_status_req_dump *req);
5252 
5253 /* ============== ETHTOOL_MSG_MM_GET ============== */
5254 /* ETHTOOL_MSG_MM_GET - do */
5255 struct ethtool_mm_get_req {
5256 	struct {
5257 		__u32 header:1;
5258 	} _present;
5259 
5260 	struct ethtool_header header;
5261 };
5262 
5263 static inline struct ethtool_mm_get_req *ethtool_mm_get_req_alloc(void)
5264 {
5265 	return calloc(1, sizeof(struct ethtool_mm_get_req));
5266 }
5267 void ethtool_mm_get_req_free(struct ethtool_mm_get_req *req);
5268 
5269 static inline void
5270 ethtool_mm_get_req_set_header_dev_index(struct ethtool_mm_get_req *req,
5271 					__u32 dev_index)
5272 {
5273 	req->_present.header = 1;
5274 	req->header._present.dev_index = 1;
5275 	req->header.dev_index = dev_index;
5276 }
5277 static inline void
5278 ethtool_mm_get_req_set_header_dev_name(struct ethtool_mm_get_req *req,
5279 				       const char *dev_name)
5280 {
5281 	free(req->header.dev_name);
5282 	req->header._present.dev_name_len = strlen(dev_name);
5283 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
5284 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
5285 	req->header.dev_name[req->header._present.dev_name_len] = 0;
5286 }
5287 static inline void
5288 ethtool_mm_get_req_set_header_flags(struct ethtool_mm_get_req *req,
5289 				    __u32 flags)
5290 {
5291 	req->_present.header = 1;
5292 	req->header._present.flags = 1;
5293 	req->header.flags = flags;
5294 }
5295 
5296 struct ethtool_mm_get_rsp {
5297 	struct {
5298 		__u32 header:1;
5299 		__u32 pmac_enabled:1;
5300 		__u32 tx_enabled:1;
5301 		__u32 tx_active:1;
5302 		__u32 tx_min_frag_size:1;
5303 		__u32 rx_min_frag_size:1;
5304 		__u32 verify_enabled:1;
5305 		__u32 verify_time:1;
5306 		__u32 max_verify_time:1;
5307 		__u32 stats:1;
5308 	} _present;
5309 
5310 	struct ethtool_header header;
5311 	__u8 pmac_enabled;
5312 	__u8 tx_enabled;
5313 	__u8 tx_active;
5314 	__u32 tx_min_frag_size;
5315 	__u32 rx_min_frag_size;
5316 	__u8 verify_enabled;
5317 	__u32 verify_time;
5318 	__u32 max_verify_time;
5319 	struct ethtool_mm_stat stats;
5320 };
5321 
5322 void ethtool_mm_get_rsp_free(struct ethtool_mm_get_rsp *rsp);
5323 
5324 /*
5325  * Get MAC Merge configuration and state
5326  */
5327 struct ethtool_mm_get_rsp *
5328 ethtool_mm_get(struct ynl_sock *ys, struct ethtool_mm_get_req *req);
5329 
5330 /* ETHTOOL_MSG_MM_GET - dump */
5331 struct ethtool_mm_get_req_dump {
5332 	struct {
5333 		__u32 header:1;
5334 	} _present;
5335 
5336 	struct ethtool_header header;
5337 };
5338 
5339 static inline struct ethtool_mm_get_req_dump *
5340 ethtool_mm_get_req_dump_alloc(void)
5341 {
5342 	return calloc(1, sizeof(struct ethtool_mm_get_req_dump));
5343 }
5344 void ethtool_mm_get_req_dump_free(struct ethtool_mm_get_req_dump *req);
5345 
5346 static inline void
5347 ethtool_mm_get_req_dump_set_header_dev_index(struct ethtool_mm_get_req_dump *req,
5348 					     __u32 dev_index)
5349 {
5350 	req->_present.header = 1;
5351 	req->header._present.dev_index = 1;
5352 	req->header.dev_index = dev_index;
5353 }
5354 static inline void
5355 ethtool_mm_get_req_dump_set_header_dev_name(struct ethtool_mm_get_req_dump *req,
5356 					    const char *dev_name)
5357 {
5358 	free(req->header.dev_name);
5359 	req->header._present.dev_name_len = strlen(dev_name);
5360 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
5361 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
5362 	req->header.dev_name[req->header._present.dev_name_len] = 0;
5363 }
5364 static inline void
5365 ethtool_mm_get_req_dump_set_header_flags(struct ethtool_mm_get_req_dump *req,
5366 					 __u32 flags)
5367 {
5368 	req->_present.header = 1;
5369 	req->header._present.flags = 1;
5370 	req->header.flags = flags;
5371 }
5372 
5373 struct ethtool_mm_get_list {
5374 	struct ethtool_mm_get_list *next;
5375 	struct ethtool_mm_get_rsp obj __attribute__ ((aligned (8)));
5376 };
5377 
5378 void ethtool_mm_get_list_free(struct ethtool_mm_get_list *rsp);
5379 
5380 struct ethtool_mm_get_list *
5381 ethtool_mm_get_dump(struct ynl_sock *ys, struct ethtool_mm_get_req_dump *req);
5382 
5383 /* ETHTOOL_MSG_MM_GET - notify */
5384 struct ethtool_mm_get_ntf {
5385 	__u16 family;
5386 	__u8 cmd;
5387 	struct ynl_ntf_base_type *next;
5388 	void (*free)(struct ethtool_mm_get_ntf *ntf);
5389 	struct ethtool_mm_get_rsp obj __attribute__ ((aligned (8)));
5390 };
5391 
5392 void ethtool_mm_get_ntf_free(struct ethtool_mm_get_ntf *rsp);
5393 
5394 /* ============== ETHTOOL_MSG_MM_SET ============== */
5395 /* ETHTOOL_MSG_MM_SET - do */
5396 struct ethtool_mm_set_req {
5397 	struct {
5398 		__u32 header:1;
5399 		__u32 verify_enabled:1;
5400 		__u32 verify_time:1;
5401 		__u32 tx_enabled:1;
5402 		__u32 pmac_enabled:1;
5403 		__u32 tx_min_frag_size:1;
5404 	} _present;
5405 
5406 	struct ethtool_header header;
5407 	__u8 verify_enabled;
5408 	__u32 verify_time;
5409 	__u8 tx_enabled;
5410 	__u8 pmac_enabled;
5411 	__u32 tx_min_frag_size;
5412 };
5413 
5414 static inline struct ethtool_mm_set_req *ethtool_mm_set_req_alloc(void)
5415 {
5416 	return calloc(1, sizeof(struct ethtool_mm_set_req));
5417 }
5418 void ethtool_mm_set_req_free(struct ethtool_mm_set_req *req);
5419 
5420 static inline void
5421 ethtool_mm_set_req_set_header_dev_index(struct ethtool_mm_set_req *req,
5422 					__u32 dev_index)
5423 {
5424 	req->_present.header = 1;
5425 	req->header._present.dev_index = 1;
5426 	req->header.dev_index = dev_index;
5427 }
5428 static inline void
5429 ethtool_mm_set_req_set_header_dev_name(struct ethtool_mm_set_req *req,
5430 				       const char *dev_name)
5431 {
5432 	free(req->header.dev_name);
5433 	req->header._present.dev_name_len = strlen(dev_name);
5434 	req->header.dev_name = malloc(req->header._present.dev_name_len + 1);
5435 	memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len);
5436 	req->header.dev_name[req->header._present.dev_name_len] = 0;
5437 }
5438 static inline void
5439 ethtool_mm_set_req_set_header_flags(struct ethtool_mm_set_req *req,
5440 				    __u32 flags)
5441 {
5442 	req->_present.header = 1;
5443 	req->header._present.flags = 1;
5444 	req->header.flags = flags;
5445 }
5446 static inline void
5447 ethtool_mm_set_req_set_verify_enabled(struct ethtool_mm_set_req *req,
5448 				      __u8 verify_enabled)
5449 {
5450 	req->_present.verify_enabled = 1;
5451 	req->verify_enabled = verify_enabled;
5452 }
5453 static inline void
5454 ethtool_mm_set_req_set_verify_time(struct ethtool_mm_set_req *req,
5455 				   __u32 verify_time)
5456 {
5457 	req->_present.verify_time = 1;
5458 	req->verify_time = verify_time;
5459 }
5460 static inline void
5461 ethtool_mm_set_req_set_tx_enabled(struct ethtool_mm_set_req *req,
5462 				  __u8 tx_enabled)
5463 {
5464 	req->_present.tx_enabled = 1;
5465 	req->tx_enabled = tx_enabled;
5466 }
5467 static inline void
5468 ethtool_mm_set_req_set_pmac_enabled(struct ethtool_mm_set_req *req,
5469 				    __u8 pmac_enabled)
5470 {
5471 	req->_present.pmac_enabled = 1;
5472 	req->pmac_enabled = pmac_enabled;
5473 }
5474 static inline void
5475 ethtool_mm_set_req_set_tx_min_frag_size(struct ethtool_mm_set_req *req,
5476 					__u32 tx_min_frag_size)
5477 {
5478 	req->_present.tx_min_frag_size = 1;
5479 	req->tx_min_frag_size = tx_min_frag_size;
5480 }
5481 
5482 /*
5483  * Set MAC Merge configuration
5484  */
5485 int ethtool_mm_set(struct ynl_sock *ys, struct ethtool_mm_set_req *req);
5486 
5487 /* ETHTOOL_MSG_CABLE_TEST_NTF - event */
5488 struct ethtool_cable_test_ntf_rsp {
5489 	struct {
5490 		__u32 header:1;
5491 		__u32 status:1;
5492 	} _present;
5493 
5494 	struct ethtool_header header;
5495 	__u8 status;
5496 };
5497 
5498 struct ethtool_cable_test_ntf {
5499 	__u16 family;
5500 	__u8 cmd;
5501 	struct ynl_ntf_base_type *next;
5502 	void (*free)(struct ethtool_cable_test_ntf *ntf);
5503 	struct ethtool_cable_test_ntf_rsp obj __attribute__ ((aligned (8)));
5504 };
5505 
5506 void ethtool_cable_test_ntf_free(struct ethtool_cable_test_ntf *rsp);
5507 
5508 /* ETHTOOL_MSG_CABLE_TEST_TDR_NTF - event */
5509 struct ethtool_cable_test_tdr_ntf_rsp {
5510 	struct {
5511 		__u32 header:1;
5512 		__u32 status:1;
5513 		__u32 nest:1;
5514 	} _present;
5515 
5516 	struct ethtool_header header;
5517 	__u8 status;
5518 	struct ethtool_cable_nest nest;
5519 };
5520 
5521 struct ethtool_cable_test_tdr_ntf {
5522 	__u16 family;
5523 	__u8 cmd;
5524 	struct ynl_ntf_base_type *next;
5525 	void (*free)(struct ethtool_cable_test_tdr_ntf *ntf);
5526 	struct ethtool_cable_test_tdr_ntf_rsp obj __attribute__ ((aligned (8)));
5527 };
5528 
5529 void ethtool_cable_test_tdr_ntf_free(struct ethtool_cable_test_tdr_ntf *rsp);
5530 
5531 #endif /* _LINUX_ETHTOOL_GEN_H */
5532