1 /*
2 * This file is produced automatically.
3 * Do not modify anything in here by hand.
4 *
5 * Created from source file
6 * sys/net/ifdi_if.m
7 #
8 # Copyright (c) 2014-2018, Matthew Macy (mmacy@mattmacy.io)
9 # All rights reserved.
10 #
11 # Redistribution and use in source and binary forms, with or without
12 # modification, are permitted provided that the following conditions are met:
13 #
14 # 1. Redistributions of source code must retain the above copyright notice,
15 # this list of conditions and the following disclaimer.
16 #
17 # 2. Neither the name of Matthew Macy nor the names of its
18 # contributors may be used to endorse or promote products derived from
19 # this software without specific prior written permission.
20 #
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 # POSSIBILITY OF SUCH DAMAGE.
32 */
33
34
35 #ifndef _ifdi_if_h_
36 #define _ifdi_if_h_
37
38 #ifndef __HAIKU__
39 extern struct kobjop_desc ifdi_knlist_add_desc;
40 typedef int ifdi_knlist_add_t(if_ctx_t _ctx, struct knote *_kn);
41
IFDI_KNLIST_ADD(if_ctx_t _ctx,struct knote * _kn)42 static __inline int IFDI_KNLIST_ADD(if_ctx_t _ctx, struct knote *_kn)
43 {
44 kobjop_t _m;
45 int rc;
46 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_knlist_add);
47 rc = ((ifdi_knlist_add_t *) _m)(_ctx, _kn);
48 return (rc);
49 }
50
51 extern struct kobjop_desc ifdi_knote_event_desc;
52 typedef int ifdi_knote_event_t(if_ctx_t _ctx, struct knote *_kn, int hint);
53
IFDI_KNOTE_EVENT(if_ctx_t _ctx,struct knote * _kn,int hint)54 static __inline int IFDI_KNOTE_EVENT(if_ctx_t _ctx, struct knote *_kn, int hint)
55 {
56 kobjop_t _m;
57 int rc;
58 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_knote_event);
59 rc = ((ifdi_knote_event_t *) _m)(_ctx, _kn, hint);
60 return (rc);
61 }
62 #endif
63
64 extern struct kobjop_desc ifdi_object_info_get_desc;
65 typedef int ifdi_object_info_get_t(if_ctx_t _ctx, void *data, int size);
66
IFDI_OBJECT_INFO_GET(if_ctx_t _ctx,void * data,int size)67 static __inline int IFDI_OBJECT_INFO_GET(if_ctx_t _ctx, void *data, int size)
68 {
69 kobjop_t _m;
70 int rc;
71 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_object_info_get);
72 rc = ((ifdi_object_info_get_t *) _m)(_ctx, data, size);
73 return (rc);
74 }
75
76 extern struct kobjop_desc ifdi_attach_pre_desc;
77 typedef int ifdi_attach_pre_t(if_ctx_t _ctx);
78
IFDI_ATTACH_PRE(if_ctx_t _ctx)79 static __inline int IFDI_ATTACH_PRE(if_ctx_t _ctx)
80 {
81 kobjop_t _m;
82 int rc;
83 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_attach_pre);
84 rc = ((ifdi_attach_pre_t *) _m)(_ctx);
85 return (rc);
86 }
87
88 extern struct kobjop_desc ifdi_attach_post_desc;
89 typedef int ifdi_attach_post_t(if_ctx_t _ctx);
90
IFDI_ATTACH_POST(if_ctx_t _ctx)91 static __inline int IFDI_ATTACH_POST(if_ctx_t _ctx)
92 {
93 kobjop_t _m;
94 int rc;
95 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_attach_post);
96 rc = ((ifdi_attach_post_t *) _m)(_ctx);
97 return (rc);
98 }
99
100 extern struct kobjop_desc ifdi_reinit_pre_desc;
101 typedef int ifdi_reinit_pre_t(if_ctx_t _ctx);
102
IFDI_REINIT_PRE(if_ctx_t _ctx)103 static __inline int IFDI_REINIT_PRE(if_ctx_t _ctx)
104 {
105 kobjop_t _m;
106 int rc;
107 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_reinit_pre);
108 rc = ((ifdi_reinit_pre_t *) _m)(_ctx);
109 return (rc);
110 }
111
112 extern struct kobjop_desc ifdi_reinit_post_desc;
113 typedef int ifdi_reinit_post_t(if_ctx_t _ctx);
114
IFDI_REINIT_POST(if_ctx_t _ctx)115 static __inline int IFDI_REINIT_POST(if_ctx_t _ctx)
116 {
117 kobjop_t _m;
118 int rc;
119 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_reinit_post);
120 rc = ((ifdi_reinit_post_t *) _m)(_ctx);
121 return (rc);
122 }
123
124 extern struct kobjop_desc ifdi_cloneattach_desc;
125 typedef int ifdi_cloneattach_t(if_ctx_t _ctx, struct if_clone *_ifc,
126 const char *_name, caddr_t params);
127
IFDI_CLONEATTACH(if_ctx_t _ctx,struct if_clone * _ifc,const char * _name,caddr_t params)128 static __inline int IFDI_CLONEATTACH(if_ctx_t _ctx, struct if_clone *_ifc,
129 const char *_name, caddr_t params)
130 {
131 kobjop_t _m;
132 int rc;
133 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_cloneattach);
134 rc = ((ifdi_cloneattach_t *) _m)(_ctx, _ifc, _name, params);
135 return (rc);
136 }
137
138 extern struct kobjop_desc ifdi_detach_desc;
139 typedef int ifdi_detach_t(if_ctx_t _ctx);
140
IFDI_DETACH(if_ctx_t _ctx)141 static __inline int IFDI_DETACH(if_ctx_t _ctx)
142 {
143 kobjop_t _m;
144 int rc;
145 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_detach);
146 rc = ((ifdi_detach_t *) _m)(_ctx);
147 return (rc);
148 }
149
150 extern struct kobjop_desc ifdi_suspend_desc;
151 typedef int ifdi_suspend_t(if_ctx_t _ctx);
152
IFDI_SUSPEND(if_ctx_t _ctx)153 static __inline int IFDI_SUSPEND(if_ctx_t _ctx)
154 {
155 kobjop_t _m;
156 int rc;
157 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_suspend);
158 rc = ((ifdi_suspend_t *) _m)(_ctx);
159 return (rc);
160 }
161
162 extern struct kobjop_desc ifdi_shutdown_desc;
163 typedef int ifdi_shutdown_t(if_ctx_t _ctx);
164
IFDI_SHUTDOWN(if_ctx_t _ctx)165 static __inline int IFDI_SHUTDOWN(if_ctx_t _ctx)
166 {
167 kobjop_t _m;
168 int rc;
169 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_shutdown);
170 rc = ((ifdi_shutdown_t *) _m)(_ctx);
171 return (rc);
172 }
173
174 extern struct kobjop_desc ifdi_resume_desc;
175 typedef int ifdi_resume_t(if_ctx_t _ctx);
176
IFDI_RESUME(if_ctx_t _ctx)177 static __inline int IFDI_RESUME(if_ctx_t _ctx)
178 {
179 kobjop_t _m;
180 int rc;
181 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_resume);
182 rc = ((ifdi_resume_t *) _m)(_ctx);
183 return (rc);
184 }
185
186 extern struct kobjop_desc ifdi_tx_queues_alloc_desc;
187 typedef int ifdi_tx_queues_alloc_t(if_ctx_t _ctx, caddr_t *_vaddrs,
188 uint64_t *_paddrs, int ntxqs, int ntxqsets);
189
IFDI_TX_QUEUES_ALLOC(if_ctx_t _ctx,caddr_t * _vaddrs,uint64_t * _paddrs,int ntxqs,int ntxqsets)190 static __inline int IFDI_TX_QUEUES_ALLOC(if_ctx_t _ctx, caddr_t *_vaddrs,
191 uint64_t *_paddrs, int ntxqs,
192 int ntxqsets)
193 {
194 kobjop_t _m;
195 int rc;
196 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_tx_queues_alloc);
197 rc = ((ifdi_tx_queues_alloc_t *) _m)(_ctx, _vaddrs, _paddrs, ntxqs, ntxqsets);
198 return (rc);
199 }
200
201 extern struct kobjop_desc ifdi_rx_queues_alloc_desc;
202 typedef int ifdi_rx_queues_alloc_t(if_ctx_t _ctx, caddr_t *_vaddrs,
203 uint64_t *_paddrs, int nrxqs, int nrxqsets);
204
IFDI_RX_QUEUES_ALLOC(if_ctx_t _ctx,caddr_t * _vaddrs,uint64_t * _paddrs,int nrxqs,int nrxqsets)205 static __inline int IFDI_RX_QUEUES_ALLOC(if_ctx_t _ctx, caddr_t *_vaddrs,
206 uint64_t *_paddrs, int nrxqs,
207 int nrxqsets)
208 {
209 kobjop_t _m;
210 int rc;
211 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_rx_queues_alloc);
212 rc = ((ifdi_rx_queues_alloc_t *) _m)(_ctx, _vaddrs, _paddrs, nrxqs, nrxqsets);
213 return (rc);
214 }
215
216 extern struct kobjop_desc ifdi_queues_free_desc;
217 typedef void ifdi_queues_free_t(if_ctx_t _ctx);
218
IFDI_QUEUES_FREE(if_ctx_t _ctx)219 static __inline void IFDI_QUEUES_FREE(if_ctx_t _ctx)
220 {
221 kobjop_t _m;
222 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_queues_free);
223 ((ifdi_queues_free_t *) _m)(_ctx);
224 }
225
226 extern struct kobjop_desc ifdi_rx_clset_desc;
227 typedef void ifdi_rx_clset_t(if_ctx_t _ctx, uint16_t _fl, uint16_t _qsetid,
228 caddr_t *_sdcl);
229
IFDI_RX_CLSET(if_ctx_t _ctx,uint16_t _fl,uint16_t _qsetid,caddr_t * _sdcl)230 static __inline void IFDI_RX_CLSET(if_ctx_t _ctx, uint16_t _fl,
231 uint16_t _qsetid, caddr_t *_sdcl)
232 {
233 kobjop_t _m;
234 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_rx_clset);
235 ((ifdi_rx_clset_t *) _m)(_ctx, _fl, _qsetid, _sdcl);
236 }
237
238 extern struct kobjop_desc ifdi_init_desc;
239 typedef void ifdi_init_t(if_ctx_t _ctx);
240
IFDI_INIT(if_ctx_t _ctx)241 static __inline void IFDI_INIT(if_ctx_t _ctx)
242 {
243 kobjop_t _m;
244 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_init);
245 ((ifdi_init_t *) _m)(_ctx);
246 }
247
248 extern struct kobjop_desc ifdi_stop_desc;
249 typedef void ifdi_stop_t(if_ctx_t _ctx);
250
IFDI_STOP(if_ctx_t _ctx)251 static __inline void IFDI_STOP(if_ctx_t _ctx)
252 {
253 kobjop_t _m;
254 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_stop);
255 ((ifdi_stop_t *) _m)(_ctx);
256 }
257
258 extern struct kobjop_desc ifdi_msix_intr_assign_desc;
259 typedef int ifdi_msix_intr_assign_t(if_ctx_t _sctx, int msix);
260
IFDI_MSIX_INTR_ASSIGN(if_ctx_t _sctx,int msix)261 static __inline int IFDI_MSIX_INTR_ASSIGN(if_ctx_t _sctx, int msix)
262 {
263 kobjop_t _m;
264 int rc;
265 KOBJOPLOOKUP(((kobj_t)_sctx)->ops,ifdi_msix_intr_assign);
266 rc = ((ifdi_msix_intr_assign_t *) _m)(_sctx, msix);
267 return (rc);
268 }
269
270 extern struct kobjop_desc ifdi_intr_enable_desc;
271 typedef void ifdi_intr_enable_t(if_ctx_t _ctx);
272
IFDI_INTR_ENABLE(if_ctx_t _ctx)273 static __inline void IFDI_INTR_ENABLE(if_ctx_t _ctx)
274 {
275 kobjop_t _m;
276 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_intr_enable);
277 ((ifdi_intr_enable_t *) _m)(_ctx);
278 }
279
280 extern struct kobjop_desc ifdi_intr_disable_desc;
281 typedef void ifdi_intr_disable_t(if_ctx_t _ctx);
282
IFDI_INTR_DISABLE(if_ctx_t _ctx)283 static __inline void IFDI_INTR_DISABLE(if_ctx_t _ctx)
284 {
285 kobjop_t _m;
286 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_intr_disable);
287 ((ifdi_intr_disable_t *) _m)(_ctx);
288 }
289
290 extern struct kobjop_desc ifdi_rx_queue_intr_enable_desc;
291 typedef int ifdi_rx_queue_intr_enable_t(if_ctx_t _ctx, uint16_t _qid);
292
IFDI_RX_QUEUE_INTR_ENABLE(if_ctx_t _ctx,uint16_t _qid)293 static __inline int IFDI_RX_QUEUE_INTR_ENABLE(if_ctx_t _ctx, uint16_t _qid)
294 {
295 kobjop_t _m;
296 int rc;
297 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_rx_queue_intr_enable);
298 rc = ((ifdi_rx_queue_intr_enable_t *) _m)(_ctx, _qid);
299 return (rc);
300 }
301
302 extern struct kobjop_desc ifdi_tx_queue_intr_enable_desc;
303 typedef int ifdi_tx_queue_intr_enable_t(if_ctx_t _ctx, uint16_t _qid);
304
IFDI_TX_QUEUE_INTR_ENABLE(if_ctx_t _ctx,uint16_t _qid)305 static __inline int IFDI_TX_QUEUE_INTR_ENABLE(if_ctx_t _ctx, uint16_t _qid)
306 {
307 kobjop_t _m;
308 int rc;
309 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_tx_queue_intr_enable);
310 rc = ((ifdi_tx_queue_intr_enable_t *) _m)(_ctx, _qid);
311 return (rc);
312 }
313
314 extern struct kobjop_desc ifdi_link_intr_enable_desc;
315 typedef void ifdi_link_intr_enable_t(if_ctx_t _ctx);
316
IFDI_LINK_INTR_ENABLE(if_ctx_t _ctx)317 static __inline void IFDI_LINK_INTR_ENABLE(if_ctx_t _ctx)
318 {
319 kobjop_t _m;
320 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_link_intr_enable);
321 ((ifdi_link_intr_enable_t *) _m)(_ctx);
322 }
323
324 extern struct kobjop_desc ifdi_multi_set_desc;
325 typedef void ifdi_multi_set_t(if_ctx_t _ctx);
326
IFDI_MULTI_SET(if_ctx_t _ctx)327 static __inline void IFDI_MULTI_SET(if_ctx_t _ctx)
328 {
329 kobjop_t _m;
330 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_multi_set);
331 ((ifdi_multi_set_t *) _m)(_ctx);
332 }
333
334 extern struct kobjop_desc ifdi_mtu_set_desc;
335 typedef int ifdi_mtu_set_t(if_ctx_t _ctx, uint32_t _mtu);
336
IFDI_MTU_SET(if_ctx_t _ctx,uint32_t _mtu)337 static __inline int IFDI_MTU_SET(if_ctx_t _ctx, uint32_t _mtu)
338 {
339 kobjop_t _m;
340 int rc;
341 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_mtu_set);
342 rc = ((ifdi_mtu_set_t *) _m)(_ctx, _mtu);
343 return (rc);
344 }
345
346 extern struct kobjop_desc ifdi_mac_set_desc;
347 typedef int ifdi_mac_set_t(if_ctx_t _ctx, const uint8_t *_mac);
348
IFDI_MAC_SET(if_ctx_t _ctx,const uint8_t * _mac)349 static __inline int IFDI_MAC_SET(if_ctx_t _ctx, const uint8_t *_mac)
350 {
351 kobjop_t _m;
352 int rc;
353 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_mac_set);
354 rc = ((ifdi_mac_set_t *) _m)(_ctx, _mac);
355 return (rc);
356 }
357
358 extern struct kobjop_desc ifdi_media_set_desc;
359 typedef void ifdi_media_set_t(if_ctx_t _ctx);
360
IFDI_MEDIA_SET(if_ctx_t _ctx)361 static __inline void IFDI_MEDIA_SET(if_ctx_t _ctx)
362 {
363 kobjop_t _m;
364 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_media_set);
365 ((ifdi_media_set_t *) _m)(_ctx);
366 }
367
368 extern struct kobjop_desc ifdi_promisc_set_desc;
369 typedef int ifdi_promisc_set_t(if_ctx_t _ctx, int _flags);
370
IFDI_PROMISC_SET(if_ctx_t _ctx,int _flags)371 static __inline int IFDI_PROMISC_SET(if_ctx_t _ctx, int _flags)
372 {
373 kobjop_t _m;
374 int rc;
375 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_promisc_set);
376 rc = ((ifdi_promisc_set_t *) _m)(_ctx, _flags);
377 return (rc);
378 }
379
380 extern struct kobjop_desc ifdi_crcstrip_set_desc;
381 typedef void ifdi_crcstrip_set_t(if_ctx_t _ctx, int _onoff, int _strip);
382
IFDI_CRCSTRIP_SET(if_ctx_t _ctx,int _onoff,int _strip)383 static __inline void IFDI_CRCSTRIP_SET(if_ctx_t _ctx, int _onoff, int _strip)
384 {
385 kobjop_t _m;
386 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_crcstrip_set);
387 ((ifdi_crcstrip_set_t *) _m)(_ctx, _onoff, _strip);
388 }
389
390 extern struct kobjop_desc ifdi_vflr_handle_desc;
391 typedef void ifdi_vflr_handle_t(if_ctx_t _ctx);
392
IFDI_VFLR_HANDLE(if_ctx_t _ctx)393 static __inline void IFDI_VFLR_HANDLE(if_ctx_t _ctx)
394 {
395 kobjop_t _m;
396 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_vflr_handle);
397 ((ifdi_vflr_handle_t *) _m)(_ctx);
398 }
399
400 extern struct kobjop_desc ifdi_iov_init_desc;
401 typedef int ifdi_iov_init_t(if_ctx_t _ctx, uint16_t num_vfs,
402 const nvlist_t * params);
403
IFDI_IOV_INIT(if_ctx_t _ctx,uint16_t num_vfs,const nvlist_t * params)404 static __inline int IFDI_IOV_INIT(if_ctx_t _ctx, uint16_t num_vfs,
405 const nvlist_t * params)
406 {
407 kobjop_t _m;
408 int rc;
409 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_iov_init);
410 rc = ((ifdi_iov_init_t *) _m)(_ctx, num_vfs, params);
411 return (rc);
412 }
413
414 extern struct kobjop_desc ifdi_iov_uninit_desc;
415 typedef void ifdi_iov_uninit_t(if_ctx_t _ctx);
416
IFDI_IOV_UNINIT(if_ctx_t _ctx)417 static __inline void IFDI_IOV_UNINIT(if_ctx_t _ctx)
418 {
419 kobjop_t _m;
420 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_iov_uninit);
421 ((ifdi_iov_uninit_t *) _m)(_ctx);
422 }
423
424 extern struct kobjop_desc ifdi_iov_vf_add_desc;
425 typedef int ifdi_iov_vf_add_t(if_ctx_t _ctx, uint16_t num_vfs,
426 const nvlist_t * params);
427
IFDI_IOV_VF_ADD(if_ctx_t _ctx,uint16_t num_vfs,const nvlist_t * params)428 static __inline int IFDI_IOV_VF_ADD(if_ctx_t _ctx, uint16_t num_vfs,
429 const nvlist_t * params)
430 {
431 kobjop_t _m;
432 int rc;
433 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_iov_vf_add);
434 rc = ((ifdi_iov_vf_add_t *) _m)(_ctx, num_vfs, params);
435 return (rc);
436 }
437
438 extern struct kobjop_desc ifdi_update_admin_status_desc;
439 typedef void ifdi_update_admin_status_t(if_ctx_t _ctx);
440
IFDI_UPDATE_ADMIN_STATUS(if_ctx_t _ctx)441 static __inline void IFDI_UPDATE_ADMIN_STATUS(if_ctx_t _ctx)
442 {
443 kobjop_t _m;
444 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_update_admin_status);
445 ((ifdi_update_admin_status_t *) _m)(_ctx);
446 }
447
448 extern struct kobjop_desc ifdi_media_status_desc;
449 typedef void ifdi_media_status_t(if_ctx_t _ctx, struct ifmediareq *_ifm);
450
IFDI_MEDIA_STATUS(if_ctx_t _ctx,struct ifmediareq * _ifm)451 static __inline void IFDI_MEDIA_STATUS(if_ctx_t _ctx, struct ifmediareq *_ifm)
452 {
453 kobjop_t _m;
454 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_media_status);
455 ((ifdi_media_status_t *) _m)(_ctx, _ifm);
456 }
457
458 extern struct kobjop_desc ifdi_media_change_desc;
459 typedef int ifdi_media_change_t(if_ctx_t _ctx);
460
IFDI_MEDIA_CHANGE(if_ctx_t _ctx)461 static __inline int IFDI_MEDIA_CHANGE(if_ctx_t _ctx)
462 {
463 kobjop_t _m;
464 int rc;
465 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_media_change);
466 rc = ((ifdi_media_change_t *) _m)(_ctx);
467 return (rc);
468 }
469
470 extern struct kobjop_desc ifdi_get_counter_desc;
471 typedef uint64_t ifdi_get_counter_t(if_ctx_t _ctx, ift_counter cnt);
472
IFDI_GET_COUNTER(if_ctx_t _ctx,ift_counter cnt)473 static __inline uint64_t IFDI_GET_COUNTER(if_ctx_t _ctx, ift_counter cnt)
474 {
475 kobjop_t _m;
476 uint64_t rc;
477 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_get_counter);
478 rc = ((ifdi_get_counter_t *) _m)(_ctx, cnt);
479 return (rc);
480 }
481
482 extern struct kobjop_desc ifdi_priv_ioctl_desc;
483 typedef int ifdi_priv_ioctl_t(if_ctx_t _ctx, u_long _cmd, caddr_t _data);
484
IFDI_PRIV_IOCTL(if_ctx_t _ctx,u_long _cmd,caddr_t _data)485 static __inline int IFDI_PRIV_IOCTL(if_ctx_t _ctx, u_long _cmd, caddr_t _data)
486 {
487 kobjop_t _m;
488 int rc;
489 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_priv_ioctl);
490 rc = ((ifdi_priv_ioctl_t *) _m)(_ctx, _cmd, _data);
491 return (rc);
492 }
493
494 extern struct kobjop_desc ifdi_i2c_req_desc;
495 typedef int ifdi_i2c_req_t(if_ctx_t _ctx, struct ifi2creq *_req);
496
IFDI_I2C_REQ(if_ctx_t _ctx,struct ifi2creq * _req)497 static __inline int IFDI_I2C_REQ(if_ctx_t _ctx, struct ifi2creq *_req)
498 {
499 kobjop_t _m;
500 int rc;
501 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_i2c_req);
502 rc = ((ifdi_i2c_req_t *) _m)(_ctx, _req);
503 return (rc);
504 }
505
506 extern struct kobjop_desc ifdi_txq_setup_desc;
507 typedef int ifdi_txq_setup_t(if_ctx_t _ctx, uint32_t _txqid);
508
IFDI_TXQ_SETUP(if_ctx_t _ctx,uint32_t _txqid)509 static __inline int IFDI_TXQ_SETUP(if_ctx_t _ctx, uint32_t _txqid)
510 {
511 kobjop_t _m;
512 int rc;
513 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_txq_setup);
514 rc = ((ifdi_txq_setup_t *) _m)(_ctx, _txqid);
515 return (rc);
516 }
517
518 extern struct kobjop_desc ifdi_rxq_setup_desc;
519 typedef int ifdi_rxq_setup_t(if_ctx_t _ctx, uint32_t _txqid);
520
IFDI_RXQ_SETUP(if_ctx_t _ctx,uint32_t _txqid)521 static __inline int IFDI_RXQ_SETUP(if_ctx_t _ctx, uint32_t _txqid)
522 {
523 kobjop_t _m;
524 int rc;
525 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_rxq_setup);
526 rc = ((ifdi_rxq_setup_t *) _m)(_ctx, _txqid);
527 return (rc);
528 }
529
530 extern struct kobjop_desc ifdi_timer_desc;
531 typedef void ifdi_timer_t(if_ctx_t _ctx, uint16_t _txqid);
532
IFDI_TIMER(if_ctx_t _ctx,uint16_t _txqid)533 static __inline void IFDI_TIMER(if_ctx_t _ctx, uint16_t _txqid)
534 {
535 kobjop_t _m;
536 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_timer);
537 ((ifdi_timer_t *) _m)(_ctx, _txqid);
538 }
539
540 extern struct kobjop_desc ifdi_watchdog_reset_desc;
541 typedef void ifdi_watchdog_reset_t(if_ctx_t _ctx);
542
IFDI_WATCHDOG_RESET(if_ctx_t _ctx)543 static __inline void IFDI_WATCHDOG_RESET(if_ctx_t _ctx)
544 {
545 kobjop_t _m;
546 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_watchdog_reset);
547 ((ifdi_watchdog_reset_t *) _m)(_ctx);
548 }
549
550 extern struct kobjop_desc ifdi_watchdog_reset_queue_desc;
551 typedef void ifdi_watchdog_reset_queue_t(if_ctx_t _ctx, uint16_t _q);
552
IFDI_WATCHDOG_RESET_QUEUE(if_ctx_t _ctx,uint16_t _q)553 static __inline void IFDI_WATCHDOG_RESET_QUEUE(if_ctx_t _ctx, uint16_t _q)
554 {
555 kobjop_t _m;
556 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_watchdog_reset_queue);
557 ((ifdi_watchdog_reset_queue_t *) _m)(_ctx, _q);
558 }
559
560 extern struct kobjop_desc ifdi_led_func_desc;
561 typedef void ifdi_led_func_t(if_ctx_t _ctx, int _onoff);
562
IFDI_LED_FUNC(if_ctx_t _ctx,int _onoff)563 static __inline void IFDI_LED_FUNC(if_ctx_t _ctx, int _onoff)
564 {
565 kobjop_t _m;
566 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_led_func);
567 ((ifdi_led_func_t *) _m)(_ctx, _onoff);
568 }
569
570 extern struct kobjop_desc ifdi_vlan_register_desc;
571 typedef void ifdi_vlan_register_t(if_ctx_t _ctx, uint16_t _vtag);
572
IFDI_VLAN_REGISTER(if_ctx_t _ctx,uint16_t _vtag)573 static __inline void IFDI_VLAN_REGISTER(if_ctx_t _ctx, uint16_t _vtag)
574 {
575 kobjop_t _m;
576 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_vlan_register);
577 ((ifdi_vlan_register_t *) _m)(_ctx, _vtag);
578 }
579
580 extern struct kobjop_desc ifdi_vlan_unregister_desc;
581 typedef void ifdi_vlan_unregister_t(if_ctx_t _ctx, uint16_t _vtag);
582
IFDI_VLAN_UNREGISTER(if_ctx_t _ctx,uint16_t _vtag)583 static __inline void IFDI_VLAN_UNREGISTER(if_ctx_t _ctx, uint16_t _vtag)
584 {
585 kobjop_t _m;
586 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_vlan_unregister);
587 ((ifdi_vlan_unregister_t *) _m)(_ctx, _vtag);
588 }
589
590 extern struct kobjop_desc ifdi_sysctl_int_delay_desc;
591 typedef int ifdi_sysctl_int_delay_t(if_ctx_t _sctx, if_int_delay_info_t _iidi);
592
IFDI_SYSCTL_INT_DELAY(if_ctx_t _sctx,if_int_delay_info_t _iidi)593 static __inline int IFDI_SYSCTL_INT_DELAY(if_ctx_t _sctx,
594 if_int_delay_info_t _iidi)
595 {
596 kobjop_t _m;
597 int rc;
598 KOBJOPLOOKUP(((kobj_t)_sctx)->ops,ifdi_sysctl_int_delay);
599 rc = ((ifdi_sysctl_int_delay_t *) _m)(_sctx, _iidi);
600 return (rc);
601 }
602
603 extern struct kobjop_desc ifdi_debug_desc;
604 typedef void ifdi_debug_t(if_ctx_t _ctx);
605
IFDI_DEBUG(if_ctx_t _ctx)606 static __inline void IFDI_DEBUG(if_ctx_t _ctx)
607 {
608 kobjop_t _m;
609 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_debug);
610 ((ifdi_debug_t *) _m)(_ctx);
611 }
612
613 extern struct kobjop_desc ifdi_needs_restart_desc;
614 typedef bool ifdi_needs_restart_t(if_ctx_t _ctx, enum iflib_restart_event _event);
615
IFDI_NEEDS_RESTART(if_ctx_t _ctx,enum iflib_restart_event _event)616 static __inline bool IFDI_NEEDS_RESTART(if_ctx_t _ctx, enum iflib_restart_event _event)
617 {
618 kobjop_t _m;
619 bool rc;
620 KOBJOPLOOKUP(((kobj_t)_ctx)->ops,ifdi_needs_restart);
621 rc = ((ifdi_needs_restart_t *) _m)(_ctx, _event);
622 return (rc);
623 }
624
625 #endif
626