/* If you want to use msi see pci_enable_msi and friends. This is a lower level primitive that allows us to disable msi operation at the device level.  */
void pci_msi_off(struct pci_dev *dev)
/* If you want to use msi see pci_enable_msi and friends. This is a lower level primitive that allows us to disable msi operation at the device level.  */
void pci_msi_off(struct pci_dev *dev)
{
	int pos;
	u16 control;
	pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
	if (pos) {
		pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &control);
		control &= ~PCI_MSI_FLAGS_ENABLE;
		pci_write_config_word(dev, pos + PCI_MSI_FLAGS, control);
	}
	pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
	if (pos) {
		pci_read_config_word(dev, pos + PCI_MSIX_FLAGS, &control);
		control &= ~PCI_MSIX_FLAGS_ENABLE;
		pci_write_config_word(dev, pos + PCI_MSIX_FLAGS, control);
	}
}