| 529 | } |
| 530 | |
| 531 | int |
| 532 | ionic_intr_alloc(struct ionic_lif *lif, struct ionic_intr_info *intr) |
| 533 | { |
| 534 | struct ionic_adapter *adapter = lif->adapter; |
| 535 | struct ionic_dev *idev = &adapter->idev; |
| 536 | unsigned long index; |
| 537 | |
| 538 | /* |
| 539 | * Note: interrupt handler is called for index = 0 only |
| 540 | * (we use interrupts for the notifyq only anyway, |
| 541 | * which has index = 0) |
| 542 | */ |
| 543 | |
| 544 | for (index = 0; index < adapter->nintrs; index++) |
| 545 | if (!adapter->intrs[index]) |
| 546 | break; |
| 547 | |
| 548 | if (index == adapter->nintrs) |
| 549 | return -ENOSPC; |
| 550 | |
| 551 | adapter->intrs[index] = true; |
| 552 | |
| 553 | ionic_intr_init(idev, intr, index); |
| 554 | |
| 555 | return 0; |
| 556 | } |
| 557 | |
| 558 | static int |
| 559 | ionic_qcq_alloc(struct ionic_lif *lif, |
no test coverage detected