if_ixl.c (37a48d408f2b41e2c45952de3498a018b4d41b31) if_ixl.c (f3bb92515317f9b66fca73deca375a79d49dc54a)
1/******************************************************************************
2
3 Copyright (c) 2013-2015, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 185 unchanged lines hidden (view full) ---

194static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS);
195static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS);
196static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS);
197#endif
198
199#ifdef PCI_IOV
200static int ixl_adminq_err_to_errno(enum i40e_admin_queue_err err);
201
1/******************************************************************************
2
3 Copyright (c) 2013-2015, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 185 unchanged lines hidden (view full) ---

194static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS);
195static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS);
196static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS);
197#endif
198
199#ifdef PCI_IOV
200static int ixl_adminq_err_to_errno(enum i40e_admin_queue_err err);
201
202static int ixl_init_iov(device_t dev, uint16_t num_vfs, const nvlist_t*);
203static void ixl_uninit_iov(device_t dev);
202static int ixl_iov_init(device_t dev, uint16_t num_vfs, const nvlist_t*);
203static void ixl_iov_uninit(device_t dev);
204static int ixl_add_vf(device_t dev, uint16_t vfnum, const nvlist_t*);
205
206static void ixl_handle_vf_msg(struct ixl_pf *,
207 struct i40e_arq_event_info *);
208static void ixl_handle_vflr(void *arg, int pending);
209
210static void ixl_reset_vf(struct ixl_pf *pf, struct ixl_vf *vf);
211static void ixl_reinit_vf(struct ixl_pf *pf, struct ixl_vf *vf);

--- 5 unchanged lines hidden (view full) ---

217
218static device_method_t ixl_methods[] = {
219 /* Device interface */
220 DEVMETHOD(device_probe, ixl_probe),
221 DEVMETHOD(device_attach, ixl_attach),
222 DEVMETHOD(device_detach, ixl_detach),
223 DEVMETHOD(device_shutdown, ixl_shutdown),
224#ifdef PCI_IOV
204static int ixl_add_vf(device_t dev, uint16_t vfnum, const nvlist_t*);
205
206static void ixl_handle_vf_msg(struct ixl_pf *,
207 struct i40e_arq_event_info *);
208static void ixl_handle_vflr(void *arg, int pending);
209
210static void ixl_reset_vf(struct ixl_pf *pf, struct ixl_vf *vf);
211static void ixl_reinit_vf(struct ixl_pf *pf, struct ixl_vf *vf);

--- 5 unchanged lines hidden (view full) ---

217
218static device_method_t ixl_methods[] = {
219 /* Device interface */
220 DEVMETHOD(device_probe, ixl_probe),
221 DEVMETHOD(device_attach, ixl_attach),
222 DEVMETHOD(device_detach, ixl_detach),
223 DEVMETHOD(device_shutdown, ixl_shutdown),
224#ifdef PCI_IOV
225 DEVMETHOD(pci_init_iov, ixl_init_iov),
226 DEVMETHOD(pci_uninit_iov, ixl_uninit_iov),
227 DEVMETHOD(pci_add_vf, ixl_add_vf),
225 DEVMETHOD(pci_iov_init, ixl_iov_init),
226 DEVMETHOD(pci_iov_uninit, ixl_iov_uninit),
227 DEVMETHOD(pci_iov_add_vf, ixl_add_vf),
228#endif
229 {0, 0}
230};
231
232static driver_t ixl_driver = {
233 "ixl", ixl_methods, sizeof(struct ixl_pf),
234};
235

--- 6215 unchanged lines hidden (view full) ---

6451 case I40E_AQ_RC_EFBIG:
6452 return (EFBIG);
6453 default:
6454 return (EINVAL);
6455 }
6456}
6457
6458static int
228#endif
229 {0, 0}
230};
231
232static driver_t ixl_driver = {
233 "ixl", ixl_methods, sizeof(struct ixl_pf),
234};
235

--- 6215 unchanged lines hidden (view full) ---

6451 case I40E_AQ_RC_EFBIG:
6452 return (EFBIG);
6453 default:
6454 return (EINVAL);
6455 }
6456}
6457
6458static int
6459ixl_init_iov(device_t dev, uint16_t num_vfs, const nvlist_t *params)
6459ixl_iov_init(device_t dev, uint16_t num_vfs, const nvlist_t *params)
6460{
6461 struct ixl_pf *pf;
6462 struct i40e_hw *hw;
6463 struct ixl_vsi *pf_vsi;
6464 enum i40e_status_code ret;
6465 int i, error;
6466
6467 pf = device_get_softc(dev);

--- 31 unchanged lines hidden (view full) ---

6499fail:
6500 free(pf->vfs, M_IXL);
6501 pf->vfs = NULL;
6502 IXL_PF_UNLOCK(pf);
6503 return (error);
6504}
6505
6506static void
6460{
6461 struct ixl_pf *pf;
6462 struct i40e_hw *hw;
6463 struct ixl_vsi *pf_vsi;
6464 enum i40e_status_code ret;
6465 int i, error;
6466
6467 pf = device_get_softc(dev);

--- 31 unchanged lines hidden (view full) ---

6499fail:
6500 free(pf->vfs, M_IXL);
6501 pf->vfs = NULL;
6502 IXL_PF_UNLOCK(pf);
6503 return (error);
6504}
6505
6506static void
6507ixl_uninit_iov(device_t dev)
6507ixl_iov_uninit(device_t dev)
6508{
6509 struct ixl_pf *pf;
6510 struct i40e_hw *hw;
6511 struct ixl_vsi *vsi;
6512 struct ifnet *ifp;
6513 struct ixl_vf *vfs;
6514 int i, num_vfs;
6515

--- 88 unchanged lines hidden ---
6508{
6509 struct ixl_pf *pf;
6510 struct i40e_hw *hw;
6511 struct ixl_vsi *vsi;
6512 struct ifnet *ifp;
6513 struct ixl_vf *vfs;
6514 int i, num_vfs;
6515

--- 88 unchanged lines hidden ---