aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_main.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-02-04 22:16:39 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-02-04 22:16:39 -0500
commit8e04221029067cbaff3fc8f4daf991532afbcbaf (patch)
tree18cf757bcd315c76f5f458aa72a0a57db0a78985 /drivers/net/benet/be_main.c
parent9ad62ec4f752c82b39aa5927f23d894b46ae10b9 (diff)
parent2c940db250c1610d95ea5331dc819b8bd4db96ae (diff)
Merge branch 'sh/stable-updates'
Diffstat (limited to 'drivers/net/benet/be_main.c')
-rw-r--r--drivers/net/benet/be_main.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 33ab8c7f14fe..626b76c0ebc7 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1350,7 +1350,7 @@ static irqreturn_t be_intx(int irq, void *dev)
1350 int isr; 1350 int isr;
1351 1351
1352 isr = ioread32(adapter->csr + CEV_ISR0_OFFSET + 1352 isr = ioread32(adapter->csr + CEV_ISR0_OFFSET +
1353 be_pci_func(adapter) * CEV_ISR_SIZE); 1353 (adapter->tx_eq.q.id/ 8) * CEV_ISR_SIZE);
1354 if (!isr) 1354 if (!isr)
1355 return IRQ_NONE; 1355 return IRQ_NONE;
1356 1356
@@ -2051,6 +2051,7 @@ static void be_unmap_pci_bars(struct be_adapter *adapter)
2051static int be_map_pci_bars(struct be_adapter *adapter) 2051static int be_map_pci_bars(struct be_adapter *adapter)
2052{ 2052{
2053 u8 __iomem *addr; 2053 u8 __iomem *addr;
2054 int pcicfg_reg;
2054 2055
2055 addr = ioremap_nocache(pci_resource_start(adapter->pdev, 2), 2056 addr = ioremap_nocache(pci_resource_start(adapter->pdev, 2),
2056 pci_resource_len(adapter->pdev, 2)); 2057 pci_resource_len(adapter->pdev, 2));
@@ -2064,8 +2065,13 @@ static int be_map_pci_bars(struct be_adapter *adapter)
2064 goto pci_map_err; 2065 goto pci_map_err;
2065 adapter->db = addr; 2066 adapter->db = addr;
2066 2067
2067 addr = ioremap_nocache(pci_resource_start(adapter->pdev, 1), 2068 if (adapter->generation == BE_GEN2)
2068 pci_resource_len(adapter->pdev, 1)); 2069 pcicfg_reg = 1;
2070 else
2071 pcicfg_reg = 0;
2072
2073 addr = ioremap_nocache(pci_resource_start(adapter->pdev, pcicfg_reg),
2074 pci_resource_len(adapter->pdev, pcicfg_reg));
2069 if (addr == NULL) 2075 if (addr == NULL)
2070 goto pci_map_err; 2076 goto pci_map_err;
2071 adapter->pcicfg = addr; 2077 adapter->pcicfg = addr;
@@ -2162,6 +2168,7 @@ static int be_stats_init(struct be_adapter *adapter)
2162 cmd->va = pci_alloc_consistent(adapter->pdev, cmd->size, &cmd->dma); 2168 cmd->va = pci_alloc_consistent(adapter->pdev, cmd->size, &cmd->dma);
2163 if (cmd->va == NULL) 2169 if (cmd->va == NULL)
2164 return -1; 2170 return -1;
2171 memset(cmd->va, 0, cmd->size);
2165 return 0; 2172 return 0;
2166} 2173}
2167 2174
@@ -2240,6 +2247,20 @@ static int __devinit be_probe(struct pci_dev *pdev,
2240 goto rel_reg; 2247 goto rel_reg;
2241 } 2248 }
2242 adapter = netdev_priv(netdev); 2249 adapter = netdev_priv(netdev);
2250
2251 switch (pdev->device) {
2252 case BE_DEVICE_ID1:
2253 case OC_DEVICE_ID1:
2254 adapter->generation = BE_GEN2;
2255 break;
2256 case BE_DEVICE_ID2:
2257 case OC_DEVICE_ID2:
2258 adapter->generation = BE_GEN3;
2259 break;
2260 default:
2261 adapter->generation = 0;
2262 }
2263
2243 adapter->pdev = pdev; 2264 adapter->pdev = pdev;
2244 pci_set_drvdata(pdev, adapter); 2265 pci_set_drvdata(pdev, adapter);
2245 adapter->netdev = netdev; 2266 adapter->netdev = netdev;