diff options
-rw-r--r-- | drivers/net/lance.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/lance.c b/drivers/net/lance.c index d1d714faa6ce..bb5ad479210b 100644 --- a/drivers/net/lance.c +++ b/drivers/net/lance.c | |||
@@ -464,20 +464,25 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int | |||
464 | static int did_version; /* Already printed version info. */ | 464 | static int did_version; /* Already printed version info. */ |
465 | unsigned long flags; | 465 | unsigned long flags; |
466 | int err = -ENOMEM; | 466 | int err = -ENOMEM; |
467 | void __iomem *bios; | ||
467 | 468 | ||
468 | /* First we look for special cases. | 469 | /* First we look for special cases. |
469 | Check for HP's on-board ethernet by looking for 'HP' in the BIOS. | 470 | Check for HP's on-board ethernet by looking for 'HP' in the BIOS. |
470 | There are two HP versions, check the BIOS for the configuration port. | 471 | There are two HP versions, check the BIOS for the configuration port. |
471 | This method provided by L. Julliard, Laurent_Julliard@grenoble.hp.com. | 472 | This method provided by L. Julliard, Laurent_Julliard@grenoble.hp.com. |
472 | */ | 473 | */ |
473 | if (isa_readw(0x000f0102) == 0x5048) { | 474 | bios = ioremap(0xf00f0, 0x14); |
475 | if (!bios) | ||
476 | return -ENOMEM; | ||
477 | if (readw(bios + 0x12) == 0x5048) { | ||
474 | static const short ioaddr_table[] = { 0x300, 0x320, 0x340, 0x360}; | 478 | static const short ioaddr_table[] = { 0x300, 0x320, 0x340, 0x360}; |
475 | int hp_port = (isa_readl(0x000f00f1) & 1) ? 0x499 : 0x99; | 479 | int hp_port = (readl(bios + 1) & 1) ? 0x499 : 0x99; |
476 | /* We can have boards other than the built-in! Verify this is on-board. */ | 480 | /* We can have boards other than the built-in! Verify this is on-board. */ |
477 | if ((inb(hp_port) & 0xc0) == 0x80 | 481 | if ((inb(hp_port) & 0xc0) == 0x80 |
478 | && ioaddr_table[inb(hp_port) & 3] == ioaddr) | 482 | && ioaddr_table[inb(hp_port) & 3] == ioaddr) |
479 | hp_builtin = hp_port; | 483 | hp_builtin = hp_port; |
480 | } | 484 | } |
485 | iounmap(bios); | ||
481 | /* We also recognize the HP Vectra on-board here, but check below. */ | 486 | /* We also recognize the HP Vectra on-board here, but check below. */ |
482 | hpJ2405A = (inb(ioaddr) == 0x08 && inb(ioaddr+1) == 0x00 | 487 | hpJ2405A = (inb(ioaddr) == 0x08 && inb(ioaddr+1) == 0x00 |
483 | && inb(ioaddr+2) == 0x09); | 488 | && inb(ioaddr+2) == 0x09); |