2 # Copyright (c) 2014, Matthew Macy (kmacy@freebsd.org)
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are met:
8 # 1. Redistributions of source code must retain the above copyright notice,
9 # this list of conditions and the following disclaimer.
11 # 2. Neither the name of Matthew Macy nor the names of its
12 # contributors may be used to endorse or promote products derived from
13 # this software without specific prior written permission.
15 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 # POSSIBILITY OF SUCH DAMAGE.
30 #include <sys/types.h>
31 #include <sys/systm.h>
32 #include <sys/socket.h>
34 #include <machine/bus.h>
37 #include <net/ethernet.h>
39 #include <net/if_var.h>
40 #include <net/if_media.h>
41 #include <net/iflib.h>
48 null_void_op(if_ctx_t _ctx __unused)
53 null_timer_op(if_ctx_t _ctx __unused, uint16_t _qsidx __unused)
58 null_int_op(if_ctx_t _ctx __unused)
64 null_queue_intr_enable(if_ctx_t _ctx __unused, uint16_t _qid __unused)
70 null_led_func(if_ctx_t _ctx __unused, int _onoff __unused)
75 null_vlan_register_op(if_ctx_t _ctx __unused, uint16_t vtag __unused)
80 null_q_setup(if_ctx_t _ctx __unused, uint32_t _qid __unused)
86 null_i2c_req(if_ctx_t _sctx __unused, struct ifi2creq *_i2c __unused)
92 null_sysctl_int_delay(if_ctx_t _sctx __unused, if_int_delay_info_t _iidi __unused)
98 null_iov_init(if_ctx_t _ctx __unused, uint16_t num_vfs __unused, const nvlist_t *params __unused)
104 null_vf_add(if_ctx_t _ctx __unused, uint16_t num_vfs __unused, const nvlist_t *params __unused)
110 null_priv_ioctl(if_ctx_t _ctx __unused, u_long command, caddr_t *data __unused)
120 METHOD int attach_pre {
124 METHOD int attach_post {
134 } DEFAULT null_int_op;
136 METHOD int shutdown {
138 } DEFAULT null_int_op;
142 } DEFAULT null_int_op;
145 # downcall to driver to allocate its
146 # own queue state and tie it to the parent
149 METHOD int tx_queues_alloc {
157 METHOD int rx_queues_alloc {
165 METHOD void queues_free {
170 # interface reset / stop
182 # interrupt setup and manipulation
185 METHOD int msix_intr_assign {
190 METHOD void intr_enable {
194 METHOD void intr_disable {
198 METHOD int queue_intr_enable {
201 } DEFAULT null_queue_intr_enable;
203 METHOD void link_intr_enable {
205 } DEFAULT null_void_op;
208 # interface configuration
211 METHOD void multi_set {
220 METHOD void media_set{
222 } DEFAULT null_void_op;
224 METHOD int promisc_set {
229 METHOD void crcstrip_set {
238 METHOD void vflr_handle {
240 } DEFAULT null_void_op;
242 METHOD int iov_init {
245 const nvlist_t * params;
246 } DEFAULT null_iov_init;
248 METHOD void iov_uninit {
250 } DEFAULT null_void_op;
252 METHOD int iov_vf_add {
255 const nvlist_t * params;
256 } DEFAULT null_vf_add;
263 METHOD void update_admin_status {
267 METHOD void media_status {
269 struct ifmediareq *_ifm;
272 METHOD int media_change {
276 METHOD uint64_t get_counter {
281 METHOD int priv_ioctl {
285 } DEFAULT null_priv_ioctl;
293 struct ifi2creq *_req;
294 } DEFAULT null_i2c_req;
296 METHOD int txq_setup {
299 } DEFAULT null_q_setup;
301 METHOD int rxq_setup {
304 } DEFAULT null_q_setup;
309 } DEFAULT null_timer_op;
311 METHOD void watchdog_reset {
313 } DEFAULT null_void_op;
315 METHOD void led_func {
318 } DEFAULT null_led_func;
320 METHOD void vlan_register {
323 } DEFAULT null_vlan_register_op;
325 METHOD void vlan_unregister {
328 } DEFAULT null_vlan_register_op;
330 METHOD int sysctl_int_delay {
332 if_int_delay_info_t _iidi;
333 } DEFAULT null_sysctl_int_delay;