On Thu, 31 Aug 2017 12:22:29 +0200
Markus Theil <markus.th...@tu-ilmenau.de> 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()?

Reply via email to