aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrice Goglin <brice@myri.com>2007-03-07 14:02:32 -0500
committerJeff Garzik <jeff@garzik.org>2007-03-09 11:51:32 -0500
commit276e26c3160602efea1d0acc9fe7b45bb4c2c8e1 (patch)
tree726a984f8059f0441b1afeb4ccd9026d2760ce5c
parent4c882dd808b907652c9a8fe4f7d345cb4dee6a92 (diff)
myri10ge: add a wc_enabled flag to myri10ge_priv
Add a wc_enabled flag in the myri10ge_priv instead of relying on mtrr >= 0. Signed-off-by: Brice Goglin <brice@myri.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/net/myri10ge/myri10ge.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 68fd38b291fd..ac02b3b60f92 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -181,6 +181,7 @@ struct myri10ge_priv {
181 int intr_coal_delay; 181 int intr_coal_delay;
182 __be32 __iomem *intr_coal_delay_ptr; 182 __be32 __iomem *intr_coal_delay_ptr;
183 int mtrr; 183 int mtrr;
184 int wc_enabled;
184 int wake_queue; 185 int wake_queue;
185 int stop_queue; 186 int stop_queue;
186 int down_cnt; 187 int down_cnt;
@@ -1385,7 +1386,7 @@ myri10ge_get_ethtool_stats(struct net_device *netdev,
1385 data[i] = ((unsigned long *)&mgp->stats)[i]; 1386 data[i] = ((unsigned long *)&mgp->stats)[i];
1386 1387
1387 data[i++] = (unsigned int)mgp->tx.boundary; 1388 data[i++] = (unsigned int)mgp->tx.boundary;
1388 data[i++] = (unsigned int)(mgp->mtrr >= 0); 1389 data[i++] = (unsigned int)mgp->wc_enabled;
1389 data[i++] = (unsigned int)mgp->pdev->irq; 1390 data[i++] = (unsigned int)mgp->pdev->irq;
1390 data[i++] = (unsigned int)mgp->msi_enabled; 1391 data[i++] = (unsigned int)mgp->msi_enabled;
1391 data[i++] = (unsigned int)mgp->read_dma; 1392 data[i++] = (unsigned int)mgp->read_dma;
@@ -1749,7 +1750,7 @@ static int myri10ge_open(struct net_device *dev)
1749 goto abort_with_irq; 1750 goto abort_with_irq;
1750 } 1751 }
1751 1752
1752 if (myri10ge_wcfifo && mgp->mtrr >= 0) { 1753 if (myri10ge_wcfifo && mgp->wc_enabled) {
1753 mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + MXGEFW_ETH_SEND_4; 1754 mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + MXGEFW_ETH_SEND_4;
1754 mgp->rx_small.wc_fifo = 1755 mgp->rx_small.wc_fifo =
1755 (u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_SMALL; 1756 (u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_SMALL;
@@ -2850,9 +2851,12 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2850 mgp->board_span = pci_resource_len(pdev, 0); 2851 mgp->board_span = pci_resource_len(pdev, 0);
2851 mgp->iomem_base = pci_resource_start(pdev, 0); 2852 mgp->iomem_base = pci_resource_start(pdev, 0);
2852 mgp->mtrr = -1; 2853 mgp->mtrr = -1;
2854 mgp->wc_enabled = 0;
2853#ifdef CONFIG_MTRR 2855#ifdef CONFIG_MTRR
2854 mgp->mtrr = mtrr_add(mgp->iomem_base, mgp->board_span, 2856 mgp->mtrr = mtrr_add(mgp->iomem_base, mgp->board_span,
2855 MTRR_TYPE_WRCOMB, 1); 2857 MTRR_TYPE_WRCOMB, 1);
2858 if (mgp->mtrr >= 0)
2859 mgp->wc_enabled = 1;
2856#endif 2860#endif
2857 /* Hack. need to get rid of these magic numbers */ 2861 /* Hack. need to get rid of these magic numbers */
2858 mgp->sram_size = 2862 mgp->sram_size =
@@ -2947,7 +2951,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2947 dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n", 2951 dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n",
2948 (mgp->msi_enabled ? "MSI" : "xPIC"), 2952 (mgp->msi_enabled ? "MSI" : "xPIC"),
2949 netdev->irq, mgp->tx.boundary, mgp->fw_name, 2953 netdev->irq, mgp->tx.boundary, mgp->fw_name,
2950 (mgp->mtrr >= 0 ? "Enabled" : "Disabled")); 2954 (mgp->wc_enabled ? "Enabled" : "Disabled"));
2951 2955
2952 return 0; 2956 return 0;
2953 2957