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)
69 null_led_func(if_ctx_t _ctx __unused, int _onoff __unused)
74 null_vlan_register_op(if_ctx_t _ctx __unused, uint16_t vtag __unused)
79 null_q_setup(if_ctx_t _ctx __unused, uint32_t _qid __unused)
85 null_i2c_req(if_ctx_t _sctx __unused, struct ifi2creq *_i2c __unused)
91 null_sysctl_int_delay(if_ctx_t _sctx __unused, if_int_delay_info_t _iidi __unused)
97 null_iov_init(if_ctx_t _ctx __unused, uint16_t num_vfs __unused, const nvlist_t *params __unused)
103 null_vf_add(if_ctx_t _ctx __unused, uint16_t num_vfs __unused, const nvlist_t *params __unused)
109 null_priv_ioctl(if_ctx_t _ctx __unused, u_long command, caddr_t *data __unused)
119 METHOD int attach_pre {
123 METHOD int attach_post {
133 } DEFAULT null_int_op;
135 METHOD int shutdown {
137 } DEFAULT null_int_op;
141 } DEFAULT null_int_op;
144 # downcall to driver to allocate its
145 # own queue state and tie it to the parent
148 METHOD int tx_queues_alloc {
156 METHOD int rx_queues_alloc {
164 METHOD void queues_free {
169 # interface reset / stop
181 # interrupt setup and manipulation
184 METHOD int msix_intr_assign {
189 METHOD void intr_enable {
193 METHOD void intr_disable {
197 METHOD void queue_intr_enable {
200 } DEFAULT null_queue_intr_enable;
202 METHOD void link_intr_enable {
204 } DEFAULT null_void_op;
207 # interface configuration
210 METHOD void multi_set {
219 METHOD void media_set{
221 } DEFAULT null_void_op;
223 METHOD int promisc_set {
228 METHOD void crcstrip_set {
237 METHOD void vflr_handle {
239 } DEFAULT null_void_op;
241 METHOD int iov_init {
244 const nvlist_t * params;
245 } DEFAULT null_iov_init;
247 METHOD void iov_uninit {
249 } DEFAULT null_void_op;
251 METHOD int iov_vf_add {
254 const nvlist_t * params;
255 } DEFAULT null_vf_add;
262 METHOD void update_admin_status {
266 METHOD void media_status {
268 struct ifmediareq *_ifm;
271 METHOD int media_change {
275 METHOD uint64_t get_counter {
280 METHOD int priv_ioctl {
284 } DEFAULT null_priv_ioctl;
292 struct ifi2creq *_req;
293 } DEFAULT null_i2c_req;
295 METHOD int txq_setup {
298 } DEFAULT null_q_setup;
300 METHOD int rxq_setup {
303 } DEFAULT null_q_setup;
308 } DEFAULT null_timer_op;
310 METHOD void watchdog_reset {
312 } DEFAULT null_void_op;
314 METHOD void led_func {
317 } DEFAULT null_led_func;
319 METHOD void vlan_register {
322 } DEFAULT null_vlan_register_op;
324 METHOD void vlan_unregister {
327 } DEFAULT null_vlan_register_op;
329 METHOD int sysctl_int_delay {
331 if_int_delay_info_t _iidi;
332 } DEFAULT null_sysctl_int_delay;