Lines Matching +full:device +full:- +full:specific
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
14 * Regular device drivers have no business with any of these functions and
18 * Device driver relevant functions are available in <linux/msi_api.h>
56 * msi_msg - Representation of a MSI message
58 * @arch_addrlo: Architecture specific shadow of @address_lo
60 * (only used when device supports it)
61 * @arch_addrhi: Architecture specific shadow of @address_hi
63 * @arch_data: Architecture specific shadow of @data
100 * pci_msi_desc - PCI/MSI specific MSI descriptor data
103 * @msix_ctrl: [PCI MSI-X] MSI-X cached per vector control bits
104 * @is_msix: [PCI MSI/X] True if MSI-X
109 * @default_irq:[PCI MSI/X] The default pre-assigned non-MSI irq
111 * @mask_base: [PCI MSI-X] Mask register base address
134 * union msi_domain_cookie - Opaque MSI domain specific data
136 * @ptr: Pointer to domain specific data
137 * @iobase: Domain specific IOmem pointer
140 * domain to store domain specific information which is requried for
150 * struct msi_desc_data - Generic MSI descriptor data
151 * @dcookie: Cookie for MSI domain specific data which is required
168 * struct msi_desc - Descriptor structure for MSI based interrupts
171 * @dev: Pointer to the device which uses this descriptor
174 * @sysfs_attr: Pointer to sysfs device attribute
181 * @pci: PCI specific msi descriptor data
185 /* Shared device/bus type independent data */
188 struct device *dev;
222 * struct msi_dev_domain - The internals of MSI domain info per device
224 * @irqdomain: Pointer to a per device interrupt domain
232 * msi_device_data - MSI per device data
234 * @platform_data: Platform-MSI specific data
236 * @__domains: Internal data for per device MSI domains
247 int msi_setup_device_data(struct device *dev);
249 void msi_lock_descs(struct device *dev);
250 void msi_unlock_descs(struct device *dev);
252 struct msi_desc *msi_domain_first_desc(struct device *dev, unsigned int domid,
256 * msi_first_desc - Get the first MSI descriptor of the default irqdomain
257 * @dev: Device to operate on
266 static inline struct msi_desc *msi_first_desc(struct device *dev, in msi_first_desc()
272 struct msi_desc *msi_next_desc(struct device *dev, unsigned int domid,
276 * msi_domain_for_each_desc - Iterate the MSI descriptors in a specific domain
279 * @dev: struct device pointer - device to iterate
284 * - The loop must be protected with a msi_lock_descs()/msi_unlock_descs()
286 * - It is safe to remove a retrieved MSI descriptor in the loop.
293 * msi_for_each_desc - Iterate the MSI descriptors in the default irqdomain
296 * @dev: struct device pointer - device to iterate
300 * - The loop must be protected with a msi_lock_descs()/msi_unlock_descs()
302 * - It is safe to remove a retrieved MSI descriptor in the loop.
307 #define msi_desc_to_dev(desc) ((desc)->dev)
312 return desc->iommu_cookie; in msi_desc_get_iommu_cookie()
318 desc->iommu_cookie = iommu_cookie; in msi_desc_set_iommu_cookie()
332 int msi_domain_insert_msi_desc(struct device *dev, unsigned int domid,
335 * msi_insert_msi_desc - Allocate and initialize a MSI descriptor in the
336 * default irqdomain and insert it at @init_desc->msi_index
337 * @dev: Pointer to the device for which the descriptor is allocated
342 static inline int msi_insert_msi_desc(struct device *dev, struct msi_desc *init_desc) in msi_insert_msi_desc()
347 void msi_domain_free_msi_descs_range(struct device *dev, unsigned int domid,
351 * msi_free_msi_descs_range - Free a range of MSI descriptors of a device
354 * @dev: Device for which to free the descriptors
358 static inline void msi_free_msi_descs_range(struct device *dev, unsigned int first, in msi_free_msi_descs_range()
365 * msi_free_msi_descs - Free all MSI descriptors of a device in the default irqdomain
366 * @dev: Device to free the descriptors
368 static inline void msi_free_msi_descs(struct device *dev) in msi_free_msi_descs()
375 * as weak symbols so that they /can/ be overriden by architecture specific
389 * Xen uses non-default msi_domain_ops and hence needs a way to populate sysfs
394 int msi_device_populate_sysfs(struct device *dev);
395 void msi_device_destroy_sysfs(struct device *dev);
397 static inline int msi_device_populate_sysfs(struct device *dev) { return 0; } in msi_device_populate_sysfs()
398 static inline void msi_device_destroy_sysfs(struct device *dev) { } in msi_device_destroy_sysfs()
420 * struct msi_domain_ops - MSI interrupt domain callbacks
422 * @msi_init: Domain specific init function for MSI interrupts
423 * @msi_free: Domain specific function to free a MSI interrupts
459 struct device *dev, int nvec,
466 struct device *dev, int nvec);
468 struct device *dev);
470 struct device *dev);
474 * struct msi_domain_info - MSI interrupt domain data
487 * @data: Optional: domain specific data
503 * struct msi_domain_template - Template for MSI device domains
519 * Bit 0-15: Generic MSI functionality which is not subject to restriction
522 * Bit 16-31: Functionality which depends on the underlying parent domain and
524 * a device MSI domain is initialized.
554 /* Mask for the domain specific functionality */
561 /* Is level-triggered capable, using two messages */
563 /* MSI-X entries must be contiguous */
565 /* PCI/MSI-X vectors can be dynamically allocated/freed post MSI-X enable */
572 * struct msi_parent_ops - MSI parent domain callbacks and configuration info
577 * domain specific domain flags, domain ops and interrupt chip
578 * callbacks when a per device domain is created.
583 bool (*init_dev_msi_info)(struct device *dev, struct irq_domain *domain,
588 bool msi_parent_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
599 bool msi_create_device_irq_domain(struct device *dev, unsigned int domid,
603 void msi_remove_device_irq_domain(struct device *dev, unsigned int domid);
605 bool msi_match_device_irq_domain(struct device *dev, unsigned int domid,
608 int msi_domain_alloc_irqs_range_locked(struct device *dev, unsigned int domid,
610 int msi_domain_alloc_irqs_range(struct device *dev, unsigned int domid,
612 int msi_domain_alloc_irqs_all_locked(struct device *dev, unsigned int domid, int nirqs);
614 struct msi_map msi_domain_alloc_irq_at(struct device *dev, unsigned int domid, unsigned int index,
618 void msi_domain_free_irqs_range_locked(struct device *dev, unsigned int domid,
620 void msi_domain_free_irqs_range(struct device *dev, unsigned int domid,
622 void msi_domain_free_irqs_all_locked(struct device *dev, unsigned int domid);
623 void msi_domain_free_irqs_all(struct device *dev, unsigned int domid);
630 int platform_msi_domain_alloc_irqs(struct device *dev, unsigned int nvec,
632 void platform_msi_domain_free_irqs(struct device *dev);
635 int msi_domain_prepare_irqs(struct irq_domain *domain, struct device *dev,
637 int msi_domain_populate_irqs(struct irq_domain *domain, struct device *dev,
639 void msi_domain_depopulate_descs(struct device *dev, int virq, int nvec);
642 __platform_msi_create_device_domain(struct device *dev,
660 bool msi_device_has_isolated_msi(struct device *dev);
662 static inline bool msi_device_has_isolated_msi(struct device *dev) in msi_device_has_isolated_msi()
674 /* PCI specific interfaces */