Home | History | Annotate | Download | only in pci

Lines Matching defs:counts

427 	int counts[PCI_INTR_TYPE_SIZE];
431 memset(counts, 0, sizeof(counts));
437 counts[PCI_INTR_TYPE_MSIX] = uimin(pci_msix_count(pa->pa_pc, pa->pa_tag),
439 if (counts[PCI_INTR_TYPE_MSIX] < 1) {
440 counts[PCI_INTR_TYPE_MSIX] = 0;
442 if (counts[PCI_INTR_TYPE_MSIX] > 2)
443 counts[PCI_INTR_TYPE_MSIX] = 2; /* adminq + 1 ioq */
449 counts[PCI_INTR_TYPE_MSI] = pci_msi_count(pa->pa_pc, pa->pa_tag);
450 if (counts[PCI_INTR_TYPE_MSI] > 0) {
451 while (counts[PCI_INTR_TYPE_MSI] > ncpu + 1) {
452 if (counts[PCI_INTR_TYPE_MSI] / 2 <= ncpu + 1)
454 counts[PCI_INTR_TYPE_MSI] /= 2;
457 if (counts[PCI_INTR_TYPE_MSI] < 1) {
458 counts[PCI_INTR_TYPE_MSI] = 0;
460 if (counts[PCI_INTR_TYPE_MSI] > 2)
461 counts[PCI_INTR_TYPE_MSI] = 2; /* adminq + 1 ioq */
466 counts[PCI_INTR_TYPE_INTX] = 1;
468 error = pci_intr_alloc(pa, &ihps, counts, PCI_INTR_TYPE_MSIX);
475 psc->psc_nintrs = counts[intr_type];
477 if (counts[intr_type] > ncpu + 1)
478 counts[intr_type] = ncpu + 1;
480 sc->sc_use_mq = counts[intr_type] > 1;
481 sc->sc_nq = sc->sc_use_mq ? counts[intr_type] - 1 : 1;