mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-25 00:52:45 -04:00
genirq/msi, treewide: Use a named struct for PCI/MSI attributes
The unnamed struct sucks and is in the way of further cleanups. Stick the PCI related MSI data into a real data structure and cleanup all users. No functional change. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Juergen Gross <jgross@suse.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20211206210224.374863119@linutronix.de
This commit is contained in:
@@ -68,6 +68,42 @@ static inline void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg)
|
||||
typedef void (*irq_write_msi_msg_t)(struct msi_desc *desc,
|
||||
struct msi_msg *msg);
|
||||
|
||||
/**
|
||||
* pci_msi_desc - PCI/MSI specific MSI descriptor data
|
||||
*
|
||||
* @msi_mask: [PCI MSI] MSI cached mask bits
|
||||
* @msix_ctrl: [PCI MSI-X] MSI-X cached per vector control bits
|
||||
* @is_msix: [PCI MSI/X] True if MSI-X
|
||||
* @multiple: [PCI MSI/X] log2 num of messages allocated
|
||||
* @multi_cap: [PCI MSI/X] log2 num of messages supported
|
||||
* @can_mask: [PCI MSI/X] Masking supported?
|
||||
* @is_64: [PCI MSI/X] Address size: 0=32bit 1=64bit
|
||||
* @entry_nr: [PCI MSI/X] Entry which is described by this descriptor
|
||||
* @default_irq:[PCI MSI/X] The default pre-assigned non-MSI irq
|
||||
* @mask_pos: [PCI MSI] Mask register position
|
||||
* @mask_base: [PCI MSI-X] Mask register base address
|
||||
*/
|
||||
struct pci_msi_desc {
|
||||
union {
|
||||
u32 msi_mask;
|
||||
u32 msix_ctrl;
|
||||
};
|
||||
struct {
|
||||
u8 is_msix : 1;
|
||||
u8 multiple : 3;
|
||||
u8 multi_cap : 3;
|
||||
u8 can_mask : 1;
|
||||
u8 is_64 : 1;
|
||||
u8 is_virtual : 1;
|
||||
u16 entry_nr;
|
||||
unsigned default_irq;
|
||||
} msi_attrib;
|
||||
union {
|
||||
u8 mask_pos;
|
||||
void __iomem *mask_base;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* platform_msi_desc - Platform device specific msi descriptor data
|
||||
* @msi_priv_data: Pointer to platform private data
|
||||
@@ -107,17 +143,7 @@ struct ti_sci_inta_msi_desc {
|
||||
* address or data changes
|
||||
* @write_msi_msg_data: Data parameter for the callback.
|
||||
*
|
||||
* @msi_mask: [PCI MSI] MSI cached mask bits
|
||||
* @msix_ctrl: [PCI MSI-X] MSI-X cached per vector control bits
|
||||
* @is_msix: [PCI MSI/X] True if MSI-X
|
||||
* @multiple: [PCI MSI/X] log2 num of messages allocated
|
||||
* @multi_cap: [PCI MSI/X] log2 num of messages supported
|
||||
* @maskbit: [PCI MSI/X] Mask-Pending bit supported?
|
||||
* @is_64: [PCI MSI/X] Address size: 0=32bit 1=64bit
|
||||
* @entry_nr: [PCI MSI/X] Entry which is described by this descriptor
|
||||
* @default_irq:[PCI MSI/X] The default pre-assigned non-MSI irq
|
||||
* @mask_pos: [PCI MSI] Mask register position
|
||||
* @mask_base: [PCI MSI-X] Mask register base address
|
||||
* @pci: [PCI] PCI speficic msi descriptor data
|
||||
* @platform: [platform] Platform device specific msi descriptor data
|
||||
* @fsl_mc: [fsl-mc] FSL MC device specific msi descriptor data
|
||||
* @inta: [INTA] TISCI based INTA specific msi descriptor data
|
||||
@@ -138,38 +164,10 @@ struct msi_desc {
|
||||
void *write_msi_msg_data;
|
||||
|
||||
union {
|
||||
/* PCI MSI/X specific data */
|
||||
struct {
|
||||
union {
|
||||
u32 msi_mask;
|
||||
u32 msix_ctrl;
|
||||
};
|
||||
struct {
|
||||
u8 is_msix : 1;
|
||||
u8 multiple : 3;
|
||||
u8 multi_cap : 3;
|
||||
u8 can_mask : 1;
|
||||
u8 is_64 : 1;
|
||||
u8 is_virtual : 1;
|
||||
u16 entry_nr;
|
||||
unsigned default_irq;
|
||||
} msi_attrib;
|
||||
union {
|
||||
u8 mask_pos;
|
||||
void __iomem *mask_base;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
* Non PCI variants add their data structure here. New
|
||||
* entries need to use a named structure. We want
|
||||
* proper name spaces for this. The PCI part is
|
||||
* anonymous for now as it would require an immediate
|
||||
* tree wide cleanup.
|
||||
*/
|
||||
struct platform_msi_desc platform;
|
||||
struct fsl_mc_msi_desc fsl_mc;
|
||||
struct ti_sci_inta_msi_desc inta;
|
||||
struct pci_msi_desc pci;
|
||||
struct platform_msi_desc platform;
|
||||
struct fsl_mc_msi_desc fsl_mc;
|
||||
struct ti_sci_inta_msi_desc inta;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user