xref: /freebsd/sys/dev/e1000/if_igb_iov.h (revision a6999a1c947f3dc8b7491c903231efc2d78538d5)
1 /*-
2  * SPDX-License-Identifier: BSD-3-Clause
3  *
4  * Copyright (c) 2010-2016, Intel Corporation
5  * Copyright (c) 2026 Kevin Bowling <kbowling@FreeBSD.org>
6  */
7 
8 #ifndef _IF_IGB_IOV_H_
9 #define _IF_IGB_IOV_H_
10 
11 #define	IGB_IOV_MAX_FRAME_SIZE	0x2600
12 
13 #ifdef PCI_IOV
14 
15 #include <sys/nv.h>
16 #include <sys/iov_schema.h>
17 #include <dev/pci/pci_iov.h>
18 
19 int	igb_iov_attach(struct e1000_softc *);
20 void	igb_iov_detach(struct e1000_softc *);
21 bool	igb_iov_supported(const struct e1000_softc *);
22 bool	igb_iov_enabled(const struct e1000_softc *);
23 int	igb_iov_validate(struct e1000_softc *, u16);
24 int	igb_if_iov_init(if_ctx_t, u16, const nvlist_t *);
25 void	igb_if_iov_uninit(if_ctx_t);
26 int	igb_if_iov_vf_add(if_ctx_t, u16, const nvlist_t *);
27 void	igb_iov_initialize(struct e1000_softc *);
28 void	igb_iov_handle_mbx(struct e1000_softc *);
29 void	igb_iov_handle_mdd(struct e1000_softc *);
30 void	igb_iov_mdd_event(struct e1000_softc *);
31 void	igb_iov_ping_all_vfs(struct e1000_softc *);
32 void	igb_iov_reset_prepare(struct e1000_softc *);
33 u32	igb_iov_intr_mask(const struct e1000_softc *);
34 void	igb_iov_intr_drain_stale(struct e1000_softc *);
35 void	igb_iov_rebuild_mta(struct e1000_softc *);
36 void	igb_iov_rebuild_vlan(struct e1000_softc *);
37 void	igb_iov_update_pf_vmolr(struct e1000_softc *);
38 
39 #else
40 
41 #define	igb_iov_attach(_sc)			((void)(_sc), 0)
42 #define	igb_iov_detach(_sc)			((void)(_sc))
43 #define	igb_iov_supported(_sc)			(false)
44 #define	igb_iov_enabled(_sc)			(false)
45 #define	igb_iov_initialize(_sc)
46 #define	igb_iov_handle_mbx(_sc)
47 #define	igb_iov_handle_mdd(_sc)
48 #define	igb_iov_mdd_event(_sc)
49 #define	igb_iov_ping_all_vfs(_sc)
50 #define	igb_iov_reset_prepare(_sc)
51 #define	igb_iov_intr_mask(_sc)			(0)
52 #define	igb_iov_intr_drain_stale(_sc)		((void)(_sc))
53 #define	igb_iov_rebuild_mta(_sc)
54 #define	igb_iov_rebuild_vlan(_sc)
55 #define	igb_iov_update_pf_vmolr(_sc)
56 
57 #endif
58 
59 #endif /* _IF_IGB_IOV_H_ */
60