Lines Matching full:nvec

23  * @nvec: how many MSIs have been requested?
29 static int pci_msi_supported(struct pci_dev *dev, int nvec) in pci_msi_supported() argument
43 * b) the list manipulation code assumes nvec >= 1. in pci_msi_supported()
45 if (nvec < 1) in pci_msi_supported()
285 static int msi_setup_msi_desc(struct pci_dev *dev, int nvec, in msi_setup_msi_desc() argument
302 desc.nvec_used = nvec; in msi_setup_msi_desc()
307 desc.pci.msi_attrib.multiple = ilog2(__roundup_pow_of_two(nvec)); in msi_setup_msi_desc()
342 * @nvec: number of interrupts to allocate
351 static int msi_capability_init(struct pci_dev *dev, int nvec, in msi_capability_init() argument
359 if (nvec > 1 && !pci_msi_domain_supports(dev, MSI_FLAG_MULTI_PCI_MSI, ALLOW_LEGACY)) in msi_capability_init()
370 masks = irq_create_affinity_masks(nvec, affd); in msi_capability_init()
373 ret = msi_setup_msi_desc(dev, nvec, masks); in msi_capability_init()
388 ret = pci_msi_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSI); in msi_capability_init()
418 int nvec; in __pci_enable_msi_range() local
436 nvec = pci_msi_vec_count(dev); in __pci_enable_msi_range()
437 if (nvec < 0) in __pci_enable_msi_range()
438 return nvec; in __pci_enable_msi_range()
439 if (nvec < minvec) in __pci_enable_msi_range()
442 if (nvec > maxvec) in __pci_enable_msi_range()
443 nvec = maxvec; in __pci_enable_msi_range()
454 nvec = irq_calc_affinity_vectors(minvec, nvec, affd); in __pci_enable_msi_range()
455 if (nvec < minvec) in __pci_enable_msi_range()
459 rc = msi_capability_init(dev, nvec, affd); in __pci_enable_msi_range()
461 return nvec; in __pci_enable_msi_range()
468 nvec = rc; in __pci_enable_msi_range()
619 int nvec, struct irq_affinity_desc *masks) in msix_setup_msi_descs() argument
627 for (i = 0, curmsk = masks; i < nvec; i++, curmsk++) { in msix_setup_msi_descs()
666 int nvec, struct irq_affinity *affd) in msix_setup_interrupts() argument
672 masks = irq_create_affinity_masks(nvec, affd); in msix_setup_interrupts()
675 ret = msix_setup_msi_descs(dev, entries, nvec, masks); in msix_setup_interrupts()
679 ret = pci_msi_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX); in msix_setup_interrupts()
703 * @nvec: number of @entries
711 int nvec, struct irq_affinity *affd) in msix_capability_init() argument
736 ret = msix_setup_interrupts(dev, entries, nvec, affd); in msix_capability_init()
764 static bool pci_msix_validate_entries(struct pci_dev *dev, struct msix_entry *entries, int nvec) in pci_msix_validate_entries() argument
774 for (i = 0; i < nvec; i++) { in pci_msix_validate_entries()
776 for (j = i + 1; j < nvec; j++) { in pci_msix_validate_entries()
790 int hwsize, rc, nvec = maxvec; in __pci_enable_msix_range() local
807 if (!pci_msi_supported(dev, nvec) || dev->current_state != PCI_D0) in __pci_enable_msix_range()
814 if (!pci_msix_validate_entries(dev, entries, nvec)) in __pci_enable_msix_range()
817 if (hwsize < nvec) { in __pci_enable_msix_range()
820 hwsize = nvec; in __pci_enable_msix_range()
822 nvec = hwsize; in __pci_enable_msix_range()
825 if (nvec < minvec) in __pci_enable_msix_range()
837 nvec = irq_calc_affinity_vectors(minvec, nvec, affd); in __pci_enable_msix_range()
838 if (nvec < minvec) in __pci_enable_msix_range()
842 rc = msix_capability_init(dev, entries, nvec, affd); in __pci_enable_msix_range()
844 return nvec; in __pci_enable_msix_range()
851 nvec = rc; in __pci_enable_msix_range()