/* * 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; }
int adf_isr_resource_alloc(struct adf_accel_dev *accel_dev) { int ret; ret = adf_isr_alloc_msix_entry_table(accel_dev); if (ret) return ret; if (adf_enable_msix(accel_dev)) goto err_out; if (adf_setup_bh(accel_dev)) goto err_out; if (adf_request_irqs(accel_dev)) goto err_out; return 0; err_out: adf_isr_resource_free(accel_dev); return -EFAULT; }