/* * adf_isr_resource_alloc * Allocate the required ISR services. */ int adf_isr_resource_alloc(icp_accel_dev_t *accel_dev) { int status = SUCCESS, flags = 0; /* setup bottom half handlers */ adf_setup_bh(accel_dev); adf_setup_pf2vf_bh(accel_dev); /* Try to enable MSIX or MSI mode */ status = adf_enable_msi(&accel_dev->pciAccelDev); if( SUCCESS != status ) { ADF_ERROR("failed request_irq %d, status=%d\n", accel_dev->pciAccelDev.irq, status); } if (accel_dev->pciAccelDev.irq) { status = request_irq(accel_dev->pciAccelDev.irq, adf_isr, flags, adf_driver_name, (void*)accel_dev); if( SUCCESS != status ) { ADF_ERROR("failed request_irq %d, status=%d\n", accel_dev->pciAccelDev.irq, status); adf_isr_resource_free(accel_dev); } } return status; }
/** * adf_vf_isr_resource_alloc() - Allocate IRQ for acceleration device * @accel_dev: Pointer to acceleration device. * * Function allocates interrupts for acceleration device virtual function. * * Return: 0 on success, error code otherwise. */ int adf_vf_isr_resource_alloc(struct adf_accel_dev *accel_dev) { if (adf_enable_msi(accel_dev)) goto err_out; if (adf_setup_pf2vf_bh(accel_dev)) goto err_out; if (adf_setup_bh(accel_dev)) goto err_out; if (adf_request_msi_irq(accel_dev)) goto err_out; return 0; err_out: adf_vf_isr_resource_free(accel_dev); return -EFAULT; }