Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/ixl/if_ixl.c
Show First 20 Lines • Show All 193 Lines • ▼ Show 20 Lines | |||||
static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS); | static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS); | ||||
static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS); | static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS); | ||||
static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS); | static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS); | ||||
#endif | #endif | ||||
#ifdef PCI_IOV | #ifdef PCI_IOV | ||||
static int ixl_adminq_err_to_errno(enum i40e_admin_queue_err err); | static int ixl_adminq_err_to_errno(enum i40e_admin_queue_err err); | ||||
static int ixl_init_iov(device_t dev, uint16_t num_vfs, const nvlist_t*); | static int ixl_iov_init(device_t dev, uint16_t num_vfs, const nvlist_t*); | ||||
static void ixl_uninit_iov(device_t dev); | static void ixl_iov_uninit(device_t dev); | ||||
static int ixl_add_vf(device_t dev, uint16_t vfnum, const nvlist_t*); | static int ixl_add_vf(device_t dev, uint16_t vfnum, const nvlist_t*); | ||||
static void ixl_handle_vf_msg(struct ixl_pf *, | static void ixl_handle_vf_msg(struct ixl_pf *, | ||||
struct i40e_arq_event_info *); | struct i40e_arq_event_info *); | ||||
static void ixl_handle_vflr(void *arg, int pending); | static void ixl_handle_vflr(void *arg, int pending); | ||||
static void ixl_reset_vf(struct ixl_pf *pf, struct ixl_vf *vf); | static void ixl_reset_vf(struct ixl_pf *pf, struct ixl_vf *vf); | ||||
static void ixl_reinit_vf(struct ixl_pf *pf, struct ixl_vf *vf); | static void ixl_reinit_vf(struct ixl_pf *pf, struct ixl_vf *vf); | ||||
#endif | #endif | ||||
/********************************************************************* | /********************************************************************* | ||||
* FreeBSD Device Interface Entry Points | * FreeBSD Device Interface Entry Points | ||||
*********************************************************************/ | *********************************************************************/ | ||||
static device_method_t ixl_methods[] = { | static device_method_t ixl_methods[] = { | ||||
/* Device interface */ | /* Device interface */ | ||||
DEVMETHOD(device_probe, ixl_probe), | DEVMETHOD(device_probe, ixl_probe), | ||||
DEVMETHOD(device_attach, ixl_attach), | DEVMETHOD(device_attach, ixl_attach), | ||||
DEVMETHOD(device_detach, ixl_detach), | DEVMETHOD(device_detach, ixl_detach), | ||||
DEVMETHOD(device_shutdown, ixl_shutdown), | DEVMETHOD(device_shutdown, ixl_shutdown), | ||||
#ifdef PCI_IOV | #ifdef PCI_IOV | ||||
DEVMETHOD(pci_init_iov, ixl_init_iov), | DEVMETHOD(pci_iov_init, ixl_iov_init), | ||||
DEVMETHOD(pci_uninit_iov, ixl_uninit_iov), | DEVMETHOD(pci_iov_uninit, ixl_iov_uninit), | ||||
DEVMETHOD(pci_add_vf, ixl_add_vf), | DEVMETHOD(pci_iov_add_vf, ixl_add_vf), | ||||
#endif | #endif | ||||
{0, 0} | {0, 0} | ||||
}; | }; | ||||
static driver_t ixl_driver = { | static driver_t ixl_driver = { | ||||
"ixl", ixl_methods, sizeof(struct ixl_pf), | "ixl", ixl_methods, sizeof(struct ixl_pf), | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 6,215 Lines • ▼ Show 20 Lines | ixl_adminq_err_to_errno(enum i40e_admin_queue_err err) | ||||
case I40E_AQ_RC_EFBIG: | case I40E_AQ_RC_EFBIG: | ||||
return (EFBIG); | return (EFBIG); | ||||
default: | default: | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
} | } | ||||
static int | static int | ||||
ixl_init_iov(device_t dev, uint16_t num_vfs, const nvlist_t *params) | ixl_iov_init(device_t dev, uint16_t num_vfs, const nvlist_t *params) | ||||
{ | { | ||||
struct ixl_pf *pf; | struct ixl_pf *pf; | ||||
struct i40e_hw *hw; | struct i40e_hw *hw; | ||||
struct ixl_vsi *pf_vsi; | struct ixl_vsi *pf_vsi; | ||||
enum i40e_status_code ret; | enum i40e_status_code ret; | ||||
int i, error; | int i, error; | ||||
pf = device_get_softc(dev); | pf = device_get_softc(dev); | ||||
Show All 31 Lines | |||||
fail: | fail: | ||||
free(pf->vfs, M_IXL); | free(pf->vfs, M_IXL); | ||||
pf->vfs = NULL; | pf->vfs = NULL; | ||||
IXL_PF_UNLOCK(pf); | IXL_PF_UNLOCK(pf); | ||||
return (error); | return (error); | ||||
} | } | ||||
static void | static void | ||||
ixl_uninit_iov(device_t dev) | ixl_iov_uninit(device_t dev) | ||||
{ | { | ||||
struct ixl_pf *pf; | struct ixl_pf *pf; | ||||
struct i40e_hw *hw; | struct i40e_hw *hw; | ||||
struct ixl_vsi *vsi; | struct ixl_vsi *vsi; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
struct ixl_vf *vfs; | struct ixl_vf *vfs; | ||||
int i, num_vfs; | int i, num_vfs; | ||||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |