aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/e1000/if_igb_iov.h
blob: 390e63175c7aa50707d332e4a1a57dd54015c218 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*-
 * SPDX-License-Identifier: BSD-3-Clause
 *
 * Copyright (c) 2010-2016, Intel Corporation
 * Copyright (c) 2026 Kevin Bowling <kbowling@FreeBSD.org>
 */

#ifndef _IF_IGB_IOV_H_
#define _IF_IGB_IOV_H_

#define	IGB_IOV_MAX_FRAME_SIZE	0x2600

#ifdef PCI_IOV

#include <sys/nv.h>
#include <sys/iov_schema.h>
#include <dev/pci/pci_iov.h>

int	igb_iov_attach(struct e1000_softc *);
void	igb_iov_detach(struct e1000_softc *);
bool	igb_iov_supported(const struct e1000_softc *);
bool	igb_iov_enabled(const struct e1000_softc *);
int	igb_iov_validate(struct e1000_softc *, u16);
int	igb_if_iov_init(if_ctx_t, u16, const nvlist_t *);
void	igb_if_iov_uninit(if_ctx_t);
int	igb_if_iov_vf_add(if_ctx_t, u16, const nvlist_t *);
int	igb_if_vf_status(if_ctx_t, nvlist_t *);
void	igb_iov_initialize(struct e1000_softc *);
void	igb_iov_handle_mbx(struct e1000_softc *);
void	igb_iov_handle_mdd(struct e1000_softc *);
void	igb_iov_mdd_event(struct e1000_softc *);
void	igb_iov_ping_all_vfs(struct e1000_softc *);
void	igb_iov_reset_prepare(struct e1000_softc *);
u32	igb_iov_intr_mask(const struct e1000_softc *);
void	igb_iov_intr_drain_stale(struct e1000_softc *);
void	igb_iov_rebuild_mta(struct e1000_softc *);
void	igb_iov_rebuild_vlan(struct e1000_softc *);
void	igb_iov_update_pf_vmolr(struct e1000_softc *);

#else

#define	igb_iov_attach(_sc)			((void)(_sc), 0)
#define	igb_iov_detach(_sc)			((void)(_sc))
#define	igb_iov_supported(_sc)			(false)
#define	igb_iov_enabled(_sc)			(false)
#define	igb_iov_initialize(_sc)
#define	igb_iov_handle_mbx(_sc)
#define	igb_iov_handle_mdd(_sc)
#define	igb_iov_mdd_event(_sc)
#define	igb_iov_ping_all_vfs(_sc)
#define	igb_iov_reset_prepare(_sc)
#define	igb_iov_intr_mask(_sc)			(0)
#define	igb_iov_intr_drain_stale(_sc)		((void)(_sc))
#define	igb_iov_rebuild_mta(_sc)
#define	igb_iov_rebuild_vlan(_sc)
#define	igb_iov_update_pf_vmolr(_sc)

#endif

#endif /* _IF_IGB_IOV_H_ */