Lines Matching refs:accel_dev
40 static int adf_enable_sriov(struct adf_accel_dev *accel_dev) in adf_enable_sriov() argument
42 struct pci_dev *pdev = accel_to_pci_dev(accel_dev); in adf_enable_sriov()
44 struct adf_hw_device_data *hw_data = accel_dev->hw_device; in adf_enable_sriov()
48 for (i = 0, vf_info = accel_dev->pf.vf_info; i < totalvfs; in adf_enable_sriov()
51 vf_info->accel_dev = accel_dev; in adf_enable_sriov()
62 hw_data->configure_iov_threads(accel_dev, true); in adf_enable_sriov()
66 adf_enable_vf2pf_interrupts(accel_dev, BIT_ULL(totalvfs) - 1); in adf_enable_sriov()
85 void adf_disable_sriov(struct adf_accel_dev *accel_dev) in adf_disable_sriov() argument
87 struct adf_hw_device_data *hw_data = accel_dev->hw_device; in adf_disable_sriov()
88 int totalvfs = pci_sriov_get_totalvfs(accel_to_pci_dev(accel_dev)); in adf_disable_sriov()
92 if (!accel_dev->pf.vf_info) in adf_disable_sriov()
96 adf_pf2vf_notify_restarting(accel_dev); in adf_disable_sriov()
98 pci_disable_sriov(accel_to_pci_dev(accel_dev)); in adf_disable_sriov()
102 adf_disable_vf2pf_interrupts(accel_dev, GENMASK(31, 0)); in adf_disable_sriov()
106 hw_data->configure_iov_threads(accel_dev, false); in adf_disable_sriov()
108 for (i = 0, vf = accel_dev->pf.vf_info; i < totalvfs; i++, vf++) { in adf_disable_sriov()
112 kfree(accel_dev->pf.vf_info); in adf_disable_sriov()
113 accel_dev->pf.vf_info = NULL; in adf_disable_sriov()
131 struct adf_accel_dev *accel_dev = adf_devmgr_pci_to_accel_dev(pdev); in adf_sriov_configure() local
136 if (!accel_dev) { in adf_sriov_configure()
144 if (accel_dev->pf.vf_info) { in adf_sriov_configure()
149 if (adf_dev_started(accel_dev)) { in adf_sriov_configure()
150 if (adf_devmgr_in_reset(accel_dev) || in adf_sriov_configure()
151 adf_dev_in_use(accel_dev)) { in adf_sriov_configure()
152 dev_err(&GET_DEV(accel_dev), "Device busy\n"); in adf_sriov_configure()
156 adf_dev_stop(accel_dev); in adf_sriov_configure()
157 adf_dev_shutdown(accel_dev); in adf_sriov_configure()
160 if (adf_cfg_section_add(accel_dev, ADF_KERNEL_SEC)) in adf_sriov_configure()
163 if (adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC, in adf_sriov_configure()
167 set_bit(ADF_STATUS_CONFIGURED, &accel_dev->status); in adf_sriov_configure()
170 accel_dev->pf.vf_info = kcalloc(totalvfs, in adf_sriov_configure()
173 if (!accel_dev->pf.vf_info) in adf_sriov_configure()
176 if (adf_dev_init(accel_dev)) { in adf_sriov_configure()
177 dev_err(&GET_DEV(accel_dev), "Failed to init qat_dev%d\n", in adf_sriov_configure()
178 accel_dev->accel_id); in adf_sriov_configure()
182 if (adf_dev_start(accel_dev)) { in adf_sriov_configure()
183 dev_err(&GET_DEV(accel_dev), "Failed to start qat_dev%d\n", in adf_sriov_configure()
184 accel_dev->accel_id); in adf_sriov_configure()
188 ret = adf_enable_sriov(accel_dev); in adf_sriov_configure()