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