diff options
author | Matthew Wilcox <willy@linux.intel.com> | 2009-03-17 08:54:09 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-03-20 13:48:13 -0400 |
commit | f2440d9acbe866b917b16cc0f927366341ce9215 (patch) | |
tree | ed868ca5b61fcadaf782f85c9a900b06e77fc3ce /include/linux/msi.h | |
parent | 264d9caaa1c574c0274b019a810abfe957391005 (diff) |
PCI MSI: Refactor interrupt masking code
Since most of the callers already know whether they have an MSI or
an MSI-X capability, split msi_set_mask_bits() into msi_mask_irq()
and msix_mask_irq(). The only callers which don't (mask_msi_irq()
and unmask_msi_irq()) can share code in msi_set_mask_bit(). This then
becomes the only caller of msix_flush_writes(), so we can inline it.
The flushing read can be to any address that belongs to the device,
so we can eliminate the calculation too.
We can also get rid of maskbits_mask from struct msi_desc and simply
recalculate it on the rare occasion that we need it. The single-bit
'masked' element is replaced by a copy of the 32-bit 'masked' register,
so this patch does not affect the size of msi_desc.
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'include/linux/msi.h')
-rw-r--r-- | include/linux/msi.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/msi.h b/include/linux/msi.h index 5025ca4d91e4..37c1bbe546e5 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
@@ -22,14 +22,13 @@ struct msi_desc { | |||
22 | struct { | 22 | struct { |
23 | __u8 is_msix : 1; | 23 | __u8 is_msix : 1; |
24 | __u8 maskbit : 1; /* mask-pending bit supported ? */ | 24 | __u8 maskbit : 1; /* mask-pending bit supported ? */ |
25 | __u8 masked : 1; | ||
26 | __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ | 25 | __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ |
27 | __u8 pos; /* Location of the msi capability */ | 26 | __u8 pos; /* Location of the msi capability */ |
28 | __u16 entry_nr; /* specific enabled entry */ | 27 | __u16 entry_nr; /* specific enabled entry */ |
29 | __u32 maskbits_mask; /* mask bits mask */ | ||
30 | unsigned default_irq; /* default pre-assigned irq */ | 28 | unsigned default_irq; /* default pre-assigned irq */ |
31 | }msi_attrib; | 29 | } msi_attrib; |
32 | 30 | ||
31 | u32 masked; /* mask bits */ | ||
33 | unsigned int irq; | 32 | unsigned int irq; |
34 | struct list_head list; | 33 | struct list_head list; |
35 | 34 | ||