Lines Matching refs:desc
110 void pci_msi_update_mask(struct msi_desc *desc, u32 clear, u32 set) in pci_msi_update_mask() argument
112 raw_spinlock_t *lock = &to_pci_dev(desc->dev)->msi_lock; in pci_msi_update_mask()
115 if (!desc->pci.msi_attrib.can_mask) in pci_msi_update_mask()
119 desc->pci.msi_mask &= ~clear; in pci_msi_update_mask()
120 desc->pci.msi_mask |= set; in pci_msi_update_mask()
121 pci_write_config_dword(msi_desc_to_pci_dev(desc), desc->pci.mask_pos, in pci_msi_update_mask()
122 desc->pci.msi_mask); in pci_msi_update_mask()
132 struct msi_desc *desc = irq_data_get_msi_desc(data); in pci_msi_mask_irq() local
134 __pci_msi_mask_desc(desc, BIT(data->irq - desc->irq)); in pci_msi_mask_irq()
144 struct msi_desc *desc = irq_data_get_msi_desc(data); in pci_msi_unmask_irq() local
146 __pci_msi_unmask_desc(desc, BIT(data->irq - desc->irq)); in pci_msi_unmask_irq()
183 static inline void pci_write_msg_msi(struct pci_dev *dev, struct msi_desc *desc, in pci_write_msg_msi() argument
191 msgctl |= desc->pci.msi_attrib.multiple << 4; in pci_write_msg_msi()
195 if (desc->pci.msi_attrib.is_64) { in pci_write_msg_msi()
205 static inline void pci_write_msg_msix(struct msi_desc *desc, struct msi_msg *msg) in pci_write_msg_msix() argument
207 void __iomem *base = pci_msix_desc_addr(desc); in pci_write_msg_msix()
208 u32 ctrl = desc->pci.msix_ctrl; in pci_write_msg_msix()
211 if (desc->pci.msi_attrib.is_virtual) in pci_write_msg_msix()
222 pci_msix_write_vector_ctrl(desc, ctrl | PCI_MSIX_ENTRY_CTRL_MASKBIT); in pci_write_msg_msix()
229 pci_msix_write_vector_ctrl(desc, ctrl); in pci_write_msg_msix()
284 struct msi_desc desc; in msi_setup_msi_desc() local
288 memset(&desc, 0, sizeof(desc)); in msi_setup_msi_desc()
298 desc.nvec_used = nvec; in msi_setup_msi_desc()
299 desc.pci.msi_attrib.is_64 = !!(control & PCI_MSI_FLAGS_64BIT); in msi_setup_msi_desc()
300 desc.pci.msi_attrib.can_mask = !!(control & PCI_MSI_FLAGS_MASKBIT); in msi_setup_msi_desc()
301 desc.pci.msi_attrib.default_irq = dev->irq; in msi_setup_msi_desc()
302 desc.pci.msi_attrib.multi_cap = (control & PCI_MSI_FLAGS_QMASK) >> 1; in msi_setup_msi_desc()
303 desc.pci.msi_attrib.multiple = ilog2(__roundup_pow_of_two(nvec)); in msi_setup_msi_desc()
304 desc.affinity = masks; in msi_setup_msi_desc()
307 desc.pci.mask_pos = dev->msi_cap + PCI_MSI_MASK_64; in msi_setup_msi_desc()
309 desc.pci.mask_pos = dev->msi_cap + PCI_MSI_MASK_32; in msi_setup_msi_desc()
312 if (desc.pci.msi_attrib.can_mask) in msi_setup_msi_desc()
313 pci_read_config_dword(dev, desc.pci.mask_pos, &desc.pci.msi_mask); in msi_setup_msi_desc()
315 return msi_insert_msi_desc(&dev->dev, &desc); in msi_setup_msi_desc()
351 struct msi_desc *entry, desc; in msi_capability_init() local
381 memcpy(&desc, entry, sizeof(desc)); in msi_capability_init()
401 pci_msi_unmask(&desc, msi_multi_mask(&desc)); in msi_capability_init()
526 struct msi_desc *desc; in pci_msi_shutdown() local
536 desc = msi_first_desc(&dev->dev, MSI_DESC_ALL); in pci_msi_shutdown()
537 if (!WARN_ON_ONCE(!desc)) in pci_msi_shutdown()
538 pci_msi_unmask(desc, msi_multi_mask(desc)); in pci_msi_shutdown()
541 dev->irq = desc->pci.msi_attrib.default_irq; in pci_msi_shutdown()
596 void msix_prepare_msi_desc(struct pci_dev *dev, struct msi_desc *desc) in msix_prepare_msi_desc() argument
598 desc->nvec_used = 1; in msix_prepare_msi_desc()
599 desc->pci.msi_attrib.is_msix = 1; in msix_prepare_msi_desc()
600 desc->pci.msi_attrib.is_64 = 1; in msix_prepare_msi_desc()
601 desc->pci.msi_attrib.default_irq = dev->irq; in msix_prepare_msi_desc()
602 desc->pci.mask_base = dev->msix_base; in msix_prepare_msi_desc()
603 desc->pci.msi_attrib.can_mask = !pci_msi_ignore_mask && in msix_prepare_msi_desc()
604 !desc->pci.msi_attrib.is_virtual; in msix_prepare_msi_desc()
606 if (desc->pci.msi_attrib.can_mask) { in msix_prepare_msi_desc()
607 void __iomem *addr = pci_msix_desc_addr(desc); in msix_prepare_msi_desc()
609 desc->pci.msix_ctrl = readl(addr + PCI_MSIX_ENTRY_VECTOR_CTRL); in msix_prepare_msi_desc()
618 struct msi_desc desc; in msix_setup_msi_descs() local
620 memset(&desc, 0, sizeof(desc)); in msix_setup_msi_descs()
623 desc.msi_index = entries ? entries[i].entry : i; in msix_setup_msi_descs()
624 desc.affinity = masks ? curmsk : NULL; in msix_setup_msi_descs()
625 desc.pci.msi_attrib.is_virtual = desc.msi_index >= vec_count; in msix_setup_msi_descs()
627 msix_prepare_msi_desc(dev, &desc); in msix_setup_msi_descs()
629 ret = msi_insert_msi_desc(&dev->dev, &desc); in msix_setup_msi_descs()
638 struct msi_desc *desc; in msix_update_entries() local
641 msi_for_each_desc(desc, &dev->dev, MSI_DESC_ALL) { in msix_update_entries()
642 entries->vector = desc->irq; in msix_update_entries()
878 struct msi_desc *desc; in pci_msix_shutdown() local
889 msi_for_each_desc(desc, &dev->dev, MSI_DESC_ALL) in pci_msix_shutdown()
890 pci_msix_mask(desc); in pci_msix_shutdown()
912 struct pci_dev *msi_desc_to_pci_dev(struct msi_desc *desc) in msi_desc_to_pci_dev() argument
914 return to_pci_dev(desc->dev); in msi_desc_to_pci_dev()