~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/msi_api.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef LINUX_MSI_API_H
  3 #define LINUX_MSI_API_H
  4 
  5 /*
  6  * APIs which are relevant for device driver code for allocating and
  7  * freeing MSI interrupts and querying the associations between
  8  * hardware/software MSI indices and the Linux interrupt number.
  9  */
 10 
 11 struct device;
 12 
 13 /*
 14  * Per device interrupt domain related constants.
 15  */
 16 enum msi_domain_ids {
 17         MSI_DEFAULT_DOMAIN,
 18         MSI_MAX_DEVICE_IRQDOMAINS,
 19 };
 20 
 21 /**
 22  * union msi_instance_cookie - MSI instance cookie
 23  * @value:      u64 value store
 24  * @ptr:        Pointer to usage site specific data
 25  *
 26  * This cookie is handed to the IMS allocation function and stored in the
 27  * MSI descriptor for the interrupt chip callbacks.
 28  *
 29  * The content of this cookie is MSI domain implementation defined.  For
 30  * PCI/IMS implementations this could be a PASID or a pointer to queue
 31  * memory.
 32  */
 33 union msi_instance_cookie {
 34         u64     value;
 35         void    *ptr;
 36 };
 37 
 38 /**
 39  * msi_map - Mapping between MSI index and Linux interrupt number
 40  * @index:      The MSI index, e.g. slot in the MSI-X table or
 41  *              a software managed index if >= 0. If negative
 42  *              the allocation function failed and it contains
 43  *              the error code.
 44  * @virq:       The associated Linux interrupt number
 45  */
 46 struct msi_map {
 47         int     index;
 48         int     virq;
 49 };
 50 
 51 /*
 52  * Constant to be used for dynamic allocations when the allocation is any
 53  * free MSI index, which is either an entry in a hardware table or a
 54  * software managed index.
 55  */
 56 #define MSI_ANY_INDEX           UINT_MAX
 57 
 58 unsigned int msi_domain_get_virq(struct device *dev, unsigned int domid, unsigned int index);
 59 
 60 /**
 61  * msi_get_virq - Lookup the Linux interrupt number for a MSI index on the default interrupt domain
 62  * @dev:        Device for which the lookup happens
 63  * @index:      The MSI index to lookup
 64  *
 65  * Return: The Linux interrupt number on success (> 0), 0 if not found
 66  */
 67 static inline unsigned int msi_get_virq(struct device *dev, unsigned int index)
 68 {
 69         return msi_domain_get_virq(dev, MSI_DEFAULT_DOMAIN, index);
 70 }
 71 
 72 #endif
 73 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php