Lines Matching refs:accel_dev

66 static int adf_enable_sriov(struct adf_accel_dev *accel_dev)  in adf_enable_sriov()  argument
68 struct pci_dev *pdev = accel_to_pci_dev(accel_dev); in adf_enable_sriov()
70 struct adf_hw_device_data *hw_data = accel_dev->hw_device; in adf_enable_sriov()
72 &GET_BARS(accel_dev)[hw_data->get_misc_bar_id(hw_data)]; in adf_enable_sriov()
78 for (i = 0, vf_info = accel_dev->pf.vf_info; i < totalvfs; in adf_enable_sriov()
81 vf_info->accel_dev = accel_dev; in adf_enable_sriov()
108 adf_enable_vf2pf_interrupts(accel_dev, GENMASK_ULL(totalvfs - 1, 0)); in adf_enable_sriov()
127 void adf_disable_sriov(struct adf_accel_dev *accel_dev) in adf_disable_sriov() argument
129 struct adf_hw_device_data *hw_data = accel_dev->hw_device; in adf_disable_sriov()
131 &GET_BARS(accel_dev)[hw_data->get_misc_bar_id(hw_data)]; in adf_disable_sriov()
133 int totalvfs = pci_sriov_get_totalvfs(accel_to_pci_dev(accel_dev)); in adf_disable_sriov()
138 if (!accel_dev->pf.vf_info) in adf_disable_sriov()
141 adf_pf2vf_notify_restarting(accel_dev); in adf_disable_sriov()
143 pci_disable_sriov(accel_to_pci_dev(accel_dev)); in adf_disable_sriov()
146 adf_disable_vf2pf_interrupts(accel_dev, 0xFFFFFFFF); in adf_disable_sriov()
162 for (i = 0, vf = accel_dev->pf.vf_info; i < totalvfs; i++, vf++) { in adf_disable_sriov()
168 kfree(accel_dev->pf.vf_info); in adf_disable_sriov()
169 accel_dev->pf.vf_info = NULL; in adf_disable_sriov()
187 struct adf_accel_dev *accel_dev = adf_devmgr_pci_to_accel_dev(pdev); in adf_sriov_configure() local
192 if (!accel_dev) { in adf_sriov_configure()
200 if (accel_dev->pf.vf_info) { in adf_sriov_configure()
205 if (adf_dev_started(accel_dev)) { in adf_sriov_configure()
206 if (adf_devmgr_in_reset(accel_dev) || in adf_sriov_configure()
207 adf_dev_in_use(accel_dev)) { in adf_sriov_configure()
208 dev_err(&GET_DEV(accel_dev), "Device busy\n"); in adf_sriov_configure()
212 adf_dev_stop(accel_dev); in adf_sriov_configure()
213 adf_dev_shutdown(accel_dev); in adf_sriov_configure()
216 if (adf_cfg_section_add(accel_dev, ADF_KERNEL_SEC)) in adf_sriov_configure()
219 if (adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC, in adf_sriov_configure()
223 set_bit(ADF_STATUS_CONFIGURED, &accel_dev->status); in adf_sriov_configure()
226 accel_dev->pf.vf_info = kcalloc(totalvfs, in adf_sriov_configure()
229 if (!accel_dev->pf.vf_info) in adf_sriov_configure()
232 if (adf_dev_init(accel_dev)) { in adf_sriov_configure()
233 dev_err(&GET_DEV(accel_dev), "Failed to init qat_dev%d\n", in adf_sriov_configure()
234 accel_dev->accel_id); in adf_sriov_configure()
238 if (adf_dev_start(accel_dev)) { in adf_sriov_configure()
239 dev_err(&GET_DEV(accel_dev), "Failed to start qat_dev%d\n", in adf_sriov_configure()
240 accel_dev->accel_id); in adf_sriov_configure()
244 ret = adf_enable_sriov(accel_dev); in adf_sriov_configure()