diff options
author | Marius Strobl <marius@FreeBSD.org> | 2023-08-03 20:23:42 +0000 |
---|---|---|
committer | Marius Strobl <marius@FreeBSD.org> | 2023-08-03 21:10:18 +0000 |
commit | 7ff9ae90f0bd133f56930858bb478a309da3982b (patch) | |
tree | 2382e4d6e07fd2dcd01dce8f3f5df2c9f2d0ece2 /sys/net/ifdi_if.m | |
parent | eee6537665ae9830e831d7473dedd6b2cc81c2ea (diff) | |
download | src-7ff9ae90f0bd133f56930858bb478a309da3982b.tar.gz src-7ff9ae90f0bd133f56930858bb478a309da3982b.zip |
Diffstat (limited to 'sys/net/ifdi_if.m')
-rw-r--r-- | sys/net/ifdi_if.m | 125 |
1 files changed, 9 insertions, 116 deletions
diff --git a/sys/net/ifdi_if.m b/sys/net/ifdi_if.m index 3a17f24fdf91..f07a79624e86 100644 --- a/sys/net/ifdi_if.m +++ b/sys/net/ifdi_if.m @@ -1,5 +1,5 @@ # -# Copyright (c) 2014-2018, Matthew Macy (mmacy@mattmacy.io) +# Copyright (c) 2014, Matthew Macy (mmacy@mattmacy.io) # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -39,10 +39,7 @@ #include <net/if_var.h> #include <net/if_media.h> #include <net/iflib.h> -#include <net/if_clone.h> -#include <net/if_dl.h> #include <net/if_private.h> -#include <net/if_types.h> INTERFACE ifdi; @@ -53,18 +50,6 @@ CODE { { } - static int - null_knlist_add(if_ctx_t _ctx __unused, struct knote *_kn) - { - return (0); - } - - static int - null_knote_event(if_ctx_t _ctx __unused, struct knote *_kn, int _hint) - { - return (0); - } - static void null_timer_op(if_ctx_t _ctx __unused, uint16_t _qsidx __unused) { @@ -77,12 +62,6 @@ CODE { } static int - null_int_int_op(if_ctx_t _ctx __unused, int arg0 __unused) - { - return (ENOTSUP); - } - - static int null_queue_intr_enable(if_ctx_t _ctx __unused, uint16_t _qid __unused) { return (ENOTSUP); @@ -134,43 +113,6 @@ CODE { return (ENOTSUP); } - static void - null_media_status(if_ctx_t ctx __unused, struct ifmediareq *ifmr) - { - ifmr->ifm_status = IFM_AVALID | IFM_ACTIVE; - ifmr->ifm_active = IFM_ETHER | IFM_25G_ACC | IFM_FDX; - } - - static int - null_cloneattach(if_ctx_t ctx __unused, struct if_clone *ifc __unused, - const char *name __unused, caddr_t params __unused) - { - return (0); - } - - static void - null_rx_clset(if_ctx_t _ctx __unused, uint16_t _flid __unused, - uint16_t _qid __unused, caddr_t *_sdcl __unused) - { - } - static void - null_object_info_get(if_ctx_t ctx __unused, void *data __unused, int size __unused) - { - } - static int - default_mac_set(if_ctx_t ctx, const uint8_t *mac) - { - struct ifnet *ifp = iflib_get_ifp(ctx); - struct sockaddr_dl *sdl; - - if (ifp && ifp->if_addr) { - sdl = (struct sockaddr_dl *)ifp->if_addr->ifa_addr; - MPASS(sdl->sdl_type == IFT_ETHER); - memcpy(LLADDR(sdl), mac, ETHER_ADDR_LEN); - } - return (0); - } - static bool null_needs_restart(if_ctx_t _ctx __unused, enum iflib_restart_event _event __unused) { @@ -179,57 +121,24 @@ CODE { }; # -# kevent interfaces -# - -METHOD int knlist_add { - if_ctx_t _ctx; - struct knote *_kn; -} DEFAULT null_knlist_add; - -METHOD int knote_event { - if_ctx_t _ctx; - struct knote *_kn; - int hint; -} DEFAULT null_knote_event; - - -# -# query -# - -METHOD int object_info_get { - if_ctx_t _ctx; - void *data; - int size; -} DEFAULT null_object_info_get; - -# # bus interfaces # METHOD int attach_pre { if_ctx_t _ctx; -} DEFAULT null_int_op; +}; METHOD int attach_post { if_ctx_t _ctx; -} DEFAULT null_int_op; +}; METHOD int reinit_pre { if_ctx_t _ctx; -} DEFAULT null_int_op; +}; METHOD int reinit_post { if_ctx_t _ctx; -} DEFAULT null_int_op; - -METHOD int cloneattach { - if_ctx_t _ctx; - struct if_clone *_ifc; - const char *_name; - caddr_t params; -} DEFAULT null_cloneattach; +}; METHOD int detach { if_ctx_t _ctx; @@ -270,14 +179,7 @@ METHOD int rx_queues_alloc { METHOD void queues_free { if_ctx_t _ctx; -} DEFAULT null_void_op; - -METHOD void rx_clset { - if_ctx_t _ctx; - uint16_t _fl; - uint16_t _qsetid; - caddr_t *_sdcl; -} DEFAULT null_rx_clset; +}; # # interface reset / stop @@ -298,7 +200,7 @@ METHOD void stop { METHOD int msix_intr_assign { if_ctx_t _sctx; int msix; -} DEFAULT null_int_int_op; +}; METHOD void intr_enable { if_ctx_t _ctx; @@ -338,10 +240,6 @@ METHOD int mtu_set { if_ctx_t _ctx; uint32_t _mtu; }; -METHOD int mac_set { - if_ctx_t _ctx; - const uint8_t *_mac; -} DEFAULT default_mac_set; METHOD void media_set{ if_ctx_t _ctx; @@ -394,11 +292,11 @@ METHOD void update_admin_status { METHOD void media_status { if_ctx_t _ctx; struct ifmediareq *_ifm; -} DEFAULT null_media_status; +}; METHOD int media_change { if_ctx_t _ctx; -} DEFAULT null_int_op; +}; METHOD uint64_t get_counter { if_ctx_t _ctx; @@ -439,11 +337,6 @@ METHOD void watchdog_reset { if_ctx_t _ctx; } DEFAULT null_void_op; -METHOD void watchdog_reset_queue { - if_ctx_t _ctx; - uint16_t _q; -} DEFAULT null_timer_op; - METHOD void led_func { if_ctx_t _ctx; int _onoff; |