Lines Matching refs:nvec

28 static int pci_msi_supported(struct pci_dev *dev, int nvec)  in pci_msi_supported()  argument
44 if (nvec < 1) in pci_msi_supported()
281 static int msi_setup_msi_desc(struct pci_dev *dev, int nvec, in msi_setup_msi_desc() argument
298 desc.nvec_used = nvec; in msi_setup_msi_desc()
303 desc.pci.msi_attrib.multiple = ilog2(__roundup_pow_of_two(nvec)); in msi_setup_msi_desc()
347 static int msi_capability_init(struct pci_dev *dev, int nvec, in msi_capability_init() argument
355 if (nvec > 1 && !pci_msi_domain_supports(dev, MSI_FLAG_MULTI_PCI_MSI, ALLOW_LEGACY)) in msi_capability_init()
366 masks = irq_create_affinity_masks(nvec, affd); in msi_capability_init()
369 ret = msi_setup_msi_desc(dev, nvec, masks); in msi_capability_init()
378 ret = pci_msi_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSI); in msi_capability_init()
408 int nvec; in __pci_enable_msi_range() local
426 nvec = pci_msi_vec_count(dev); in __pci_enable_msi_range()
427 if (nvec < 0) in __pci_enable_msi_range()
428 return nvec; in __pci_enable_msi_range()
429 if (nvec < minvec) in __pci_enable_msi_range()
432 if (nvec > maxvec) in __pci_enable_msi_range()
433 nvec = maxvec; in __pci_enable_msi_range()
444 nvec = irq_calc_affinity_vectors(minvec, nvec, affd); in __pci_enable_msi_range()
445 if (nvec < minvec) in __pci_enable_msi_range()
449 rc = msi_capability_init(dev, nvec, affd); in __pci_enable_msi_range()
451 return nvec; in __pci_enable_msi_range()
458 nvec = rc; in __pci_enable_msi_range()
608 int nvec, struct irq_affinity_desc *masks) in msix_setup_msi_descs() argument
616 for (i = 0, curmsk = masks; i < nvec; i++, curmsk++) { in msix_setup_msi_descs()
655 int nvec, struct irq_affinity *affd) in msix_setup_interrupts() argument
661 masks = irq_create_affinity_masks(nvec, affd); in msix_setup_interrupts()
664 ret = msix_setup_msi_descs(dev, entries, nvec, masks); in msix_setup_interrupts()
668 ret = pci_msi_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX); in msix_setup_interrupts()
700 int nvec, struct irq_affinity *affd) in msix_capability_init() argument
725 ret = msix_setup_interrupts(dev, entries, nvec, affd); in msix_capability_init()
753 static bool pci_msix_validate_entries(struct pci_dev *dev, struct msix_entry *entries, int nvec) in pci_msix_validate_entries() argument
763 for (i = 0; i < nvec; i++) { in pci_msix_validate_entries()
765 for (j = i + 1; j < nvec; j++) { in pci_msix_validate_entries()
779 int hwsize, rc, nvec = maxvec; in __pci_enable_msix_range() local
796 if (!pci_msi_supported(dev, nvec) || dev->current_state != PCI_D0) in __pci_enable_msix_range()
803 if (!pci_msix_validate_entries(dev, entries, nvec)) in __pci_enable_msix_range()
806 if (hwsize < nvec) { in __pci_enable_msix_range()
809 hwsize = nvec; in __pci_enable_msix_range()
811 nvec = hwsize; in __pci_enable_msix_range()
814 if (nvec < minvec) in __pci_enable_msix_range()
826 nvec = irq_calc_affinity_vectors(minvec, nvec, affd); in __pci_enable_msix_range()
827 if (nvec < minvec) in __pci_enable_msix_range()
831 rc = msix_capability_init(dev, entries, nvec, affd); in __pci_enable_msix_range()
833 return nvec; in __pci_enable_msix_range()
840 nvec = rc; in __pci_enable_msix_range()