Thread (56 messages) 56 messages, 8 authors, 2017-10-13

Re: [PATCH v4 3/3] igb_uio: MSI IRQ mode

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2017-08-31 15:32:11

On Thu, 31 Aug 2017 12:22:29 +0200
Markus Theil [off-list ref] wrote:
+/*
+ * It masks the msi on/off of generating MSI messages.
+ */
+static void
+igbuio_msi_mask_irq(struct pci_dev *pdev, struct msi_desc *desc, int32_t state)
+{
+	u32 mask_bits = desc->masked;
+	u32 offset = desc->irq - pdev->irq;
+	u32 mask = 1 << offset;
+	u32 flag = !!state << offset;
+
+	if (!desc->msi_attrib.maskbit)
+		return;
+
+	mask_bits &= ~mask;
+	mask_bits |= flag;
+
+	if (mask_bits != desc->masked) {
+		pci_write_config_dword(pdev, desc->mask_pos, mask_bits);
+		desc->masked = mask_bits;
+	}
+}
+
Why not use the existing kernel API pci_msi_mask_irq()?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help