diff options
-rw-r--r-- | drivers/net/tg3.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index cad519910767..ddeaa0c78305 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -12464,6 +12464,28 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
12464 | goto err_out_iounmap; | 12464 | goto err_out_iounmap; |
12465 | } | 12465 | } |
12466 | 12466 | ||
12467 | if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) { | ||
12468 | if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM)) { | ||
12469 | printk(KERN_ERR PFX "Cannot find proper PCI device " | ||
12470 | "base address for APE, aborting.\n"); | ||
12471 | err = -ENODEV; | ||
12472 | goto err_out_iounmap; | ||
12473 | } | ||
12474 | |||
12475 | tg3reg_base = pci_resource_start(pdev, 2); | ||
12476 | tg3reg_len = pci_resource_len(pdev, 2); | ||
12477 | |||
12478 | tp->aperegs = ioremap_nocache(tg3reg_base, tg3reg_len); | ||
12479 | if (tp->aperegs == 0UL) { | ||
12480 | printk(KERN_ERR PFX "Cannot map APE registers, " | ||
12481 | "aborting.\n"); | ||
12482 | err = -ENOMEM; | ||
12483 | goto err_out_iounmap; | ||
12484 | } | ||
12485 | |||
12486 | tg3_ape_lock_init(tp); | ||
12487 | } | ||
12488 | |||
12467 | /* | 12489 | /* |
12468 | * Reset chip in case UNDI or EFI driver did not shutdown | 12490 | * Reset chip in case UNDI or EFI driver did not shutdown |
12469 | * DMA self test will enable WDMAC and we'll see (spurious) | 12491 | * DMA self test will enable WDMAC and we'll see (spurious) |
@@ -12478,7 +12500,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
12478 | err = tg3_test_dma(tp); | 12500 | err = tg3_test_dma(tp); |
12479 | if (err) { | 12501 | if (err) { |
12480 | printk(KERN_ERR PFX "DMA engine test failed, aborting.\n"); | 12502 | printk(KERN_ERR PFX "DMA engine test failed, aborting.\n"); |
12481 | goto err_out_iounmap; | 12503 | goto err_out_apeunmap; |
12482 | } | 12504 | } |
12483 | 12505 | ||
12484 | /* Tigon3 can do ipv4 only... and some chips have buggy | 12506 | /* Tigon3 can do ipv4 only... and some chips have buggy |
@@ -12501,28 +12523,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
12501 | 12523 | ||
12502 | tg3_init_coal(tp); | 12524 | tg3_init_coal(tp); |
12503 | 12525 | ||
12504 | if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) { | ||
12505 | if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM)) { | ||
12506 | printk(KERN_ERR PFX "Cannot find proper PCI device " | ||
12507 | "base address for APE, aborting.\n"); | ||
12508 | err = -ENODEV; | ||
12509 | goto err_out_iounmap; | ||
12510 | } | ||
12511 | |||
12512 | tg3reg_base = pci_resource_start(pdev, 2); | ||
12513 | tg3reg_len = pci_resource_len(pdev, 2); | ||
12514 | |||
12515 | tp->aperegs = ioremap_nocache(tg3reg_base, tg3reg_len); | ||
12516 | if (tp->aperegs == 0UL) { | ||
12517 | printk(KERN_ERR PFX "Cannot map APE registers, " | ||
12518 | "aborting.\n"); | ||
12519 | err = -ENOMEM; | ||
12520 | goto err_out_iounmap; | ||
12521 | } | ||
12522 | |||
12523 | tg3_ape_lock_init(tp); | ||
12524 | } | ||
12525 | |||
12526 | pci_set_drvdata(pdev, dev); | 12526 | pci_set_drvdata(pdev, dev); |
12527 | 12527 | ||
12528 | err = register_netdev(dev); | 12528 | err = register_netdev(dev); |