Lines Matching +full:pci +full:- +full:domain
1 /* SPDX-License-Identifier: GPL-2.0 */
8 * - Interrupt core code
9 * - PCI/MSI core code
10 * - MSI interrupt domain implementations
11 * - IOMMU, low level VFIO, NTB and other justified exceptions
52 * msi_msg - Representation of a MSI message
94 * pci_msi_desc - PCI/MSI specific MSI descriptor data
96 * @msi_mask: [PCI MSI] MSI cached mask bits
97 * @msix_ctrl: [PCI MSI-X] MSI-X cached per vector control bits
98 * @is_msix: [PCI MSI/X] True if MSI-X
99 * @multiple: [PCI MSI/X] log2 num of messages allocated
100 * @multi_cap: [PCI MSI/X] log2 num of messages supported
101 * @can_mask: [PCI MSI/X] Masking supported?
102 * @is_64: [PCI MSI/X] Address size: 0=32bit 1=64bit
103 * @default_irq:[PCI MSI/X] The default pre-assigned non-MSI irq
104 * @mask_pos: [PCI MSI] Mask register position
105 * @mask_base: [PCI MSI-X] Mask register base address
128 * union msi_domain_cookie - Opaque MSI domain specific data
130 * @ptr: Pointer to domain specific data
131 * @iobase: Domain specific IOmem pointer
134 * domain to store domain specific information which is requried for
144 * struct msi_desc_data - Generic MSI descriptor data
145 * @dcookie: Cookie for MSI domain specific data which is required
150 * The content of this data is implementation defined, e.g. PCI/IMS
162 * struct msi_desc - Descriptor structure for MSI based interrupts
179 * @pci: PCI specific msi descriptor data
202 struct pci_msi_desc pci; member
221 * struct msi_dev_domain - The internals of MSI domain info per device
223 * @irqdomain: Pointer to a per device interrupt domain
227 struct irq_domain *domain; member
239 * msi_first_desc - Get the first MSI descriptor of the default irqdomain
259 * msi_domain_for_each_desc - Iterate the MSI descriptors in a specific domain
262 * @dev: struct device pointer - device to iterate
263 * @domid: The id of the interrupt domain which should be walked.
267 * - The loop must be protected with a msi_lock_descs()/msi_unlock_descs()
269 * - It is safe to remove a retrieved MSI descriptor in the loop.
276 * msi_for_each_desc - Iterate the MSI descriptors in the default irqdomain
279 * @dev: struct device pointer - device to iterate
283 * - The loop must be protected with a msi_lock_descs()/msi_unlock_descs()
285 * - It is safe to remove a retrieved MSI descriptor in the loop.
290 #define msi_desc_to_dev(desc) ((desc)->dev)
296 desc->iommu_msi_iova = msi_iova >> msi_shift; in msi_desc_set_iommu_msi_iova()
297 desc->iommu_msi_shift = msi_shift; in msi_desc_set_iommu_msi_iova()
302 * msi_msg_set_addr() - Set MSI address in an MSI message
309 * - Override @msi_addr using the IOVA base address in the @desc if @iommu_msi_shift is set
310 * - Otherwise, simply set @msi_addr to @msg
316 if (desc->iommu_msi_shift) { in msi_msg_set_addr()
317 u64 msi_iova = desc->iommu_msi_iova << desc->iommu_msi_shift; in msi_msg_set_addr()
319 msg->address_hi = upper_32_bits(msi_iova); in msi_msg_set_addr()
320 msg->address_lo = lower_32_bits(msi_iova) | in msi_msg_set_addr()
321 (msi_addr & ((1 << desc->iommu_msi_shift) - 1)); in msi_msg_set_addr()
325 msg->address_hi = upper_32_bits(msi_addr); in msi_msg_set_addr()
326 msg->address_lo = lower_32_bits(msi_addr); in msi_msg_set_addr()
332 * msi_insert_msi_desc - Allocate and initialize a MSI descriptor in the
333 * default irqdomain and insert it at @init_desc->msi_index
348 * msi_free_msi_descs_range - Free a range of MSI descriptors of a device
362 * msi_free_msi_descs - Free all MSI descriptors of a device in the default irqdomain
386 * Xen uses non-default msi_domain_ops and hence needs a way to populate sysfs
400 * The restore hook is still available even for fully irq domain based
418 * struct msi_domain_ops - MSI interrupt domain callbacks
420 * @msi_init: Domain specific init function for MSI interrupts
421 * @msi_free: Domain specific function to free a MSI interrupts
422 * @msi_prepare: Prepare the allocation of the interrupts in the domain
424 * in the domain
451 int (*msi_init)(struct irq_domain *domain,
455 void (*msi_free)(struct irq_domain *domain,
458 int (*msi_prepare)(struct irq_domain *domain,
461 void (*prepare_desc)(struct irq_domain *domain, msi_alloc_info_t *arg,
465 int (*domain_alloc_irqs)(struct irq_domain *domain,
467 void (*domain_free_irqs)(struct irq_domain *domain,
469 void (*msi_post_free)(struct irq_domain *domain,
471 int (*msi_translate)(struct irq_domain *domain, struct irq_fwspec *fwspec,
476 * struct msi_domain_info - MSI interrupt domain data
478 * @bus_token: The domain bus token
482 * by the domain creation code.
489 * @data: Optional: domain specific data
505 * struct msi_domain_template - Template for MSI device domains
507 * @chip: Interrupt chip for this domain
508 * @ops: MSI domain ops
509 * @info: MSI domain info data
521 * Bit 0-15: Generic MSI functionality which is not subject to restriction
524 * Bit 16-31: Functionality which depends on the underlying parent domain and
526 * a device MSI domain is initialized.
530 * Init non implemented ops callbacks with default MSI domain
539 /* Needs early activate, required for PCI */
552 /* Use dev->fwnode for MSI device domain creation */
554 /* Set parent->dev into domain->pm_dev on device domain creation */
562 /* Mask for the domain specific functionality */
565 /* Support multiple PCI MSI interrupts */
567 /* Support PCI MSIX interrupts */
569 /* Is level-triggered capable, using two messages */
571 /* MSI-X entries must be contiguous */
573 /* PCI/MSI-X vectors can be dynamically allocated/freed post MSI-X enable */
575 /* PCI MSIs cannot be steered separately to CPU cores */
590 * struct msi_parent_ops - MSI parent domain callbacks and configuration info
592 * @supported_flags: Required: The supported MSI flags of the parent domain
593 * @required_flags: Optional: The required MSI flags of the parent MSI domain
596 * @bus_select_token: Optional: The bus token of the real parent domain for
600 * @prefix: Optional: Prefix for the domain and chip name
602 * domain specific domain flags, domain ops and interrupt chip
603 * callbacks when a per device domain is created.
612 bool (*init_dev_msi_info)(struct device *dev, struct irq_domain *domain,
617 bool msi_parent_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
654 struct msi_domain_info *msi_get_domain_info(struct irq_domain *domain);
665 return msi_domain_alloc_irqs_range(dev, domid, 0, nirqs - 1); in msi_domain_alloc_irqs()
681 /* PCI specific interfaces */
692 u32 pci_msi_domain_get_msi_rid(struct irq_domain *domain, struct pci_dev *pdev);