[rt2x00-users] [PATCH] rt2x00pci: Use PCI MSIs whenever possible

Jakub Kicinski kubakici at wp.pl
Thu Oct 4 05:32:38 AEST 2012


All PCIe devices must support MSIs, make use of them.

Signed-off-by: Jakub Kicinski <kubakici at wp.pl>
---
Hi,

just a little tweak. I think MSIs should work just ok,
as legacy driver is using them.

I will repost this to linux-wireless if I have your ack's.

 drivers/net/wireless/rt2x00/rt2x00pci.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index a0c8cae..7eb500a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -281,11 +281,13 @@ int rt2x00pci_probe(struct pci_dev *pci_dev, const struct rt2x00_ops *ops)
 		goto exit_release_regions;
 	}

+	pci_enable_msi(pci_dev);
+
 	hw = ieee80211_alloc_hw(sizeof(struct rt2x00_dev), ops->hw);
 	if (!hw) {
 		ERROR_PROBE("Failed to allocate hardware.\n");
 		retval = -ENOMEM;
-		goto exit_release_regions;
+		goto exit_disable_msi;
 	}

 	pci_set_drvdata(pci_dev, hw);
@@ -326,6 +328,9 @@ exit_free_reg:
 exit_free_device:
 	ieee80211_free_hw(hw);

+exit_disable_msi:
+	pci_disable_msi(pci_dev);
+
 exit_release_regions:
 	pci_release_regions(pci_dev);

@@ -350,6 +355,8 @@ void rt2x00pci_remove(struct pci_dev *pci_dev)
 	rt2x00pci_free_reg(rt2x00dev);
 	ieee80211_free_hw(hw);

+	pci_disable_msi(pci_dev);
+
 	/*
 	 * Free the PCI device data.
 	 */
--
1.7.11.4



More information about the users mailing list