aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/3c59x.c85
-rw-r--r--drivers/net/8139cp.c11
-rw-r--r--drivers/net/8139too.c6
-rw-r--r--drivers/net/dl2k.h12
-rw-r--r--drivers/net/dm9000.c34
-rw-r--r--drivers/net/e100.c4
-rw-r--r--drivers/net/eepro100.c5
-rw-r--r--drivers/net/epic100.c20
-rw-r--r--drivers/net/fealnx.c10
-rw-r--r--drivers/net/fec.c310
-rw-r--r--drivers/net/fs_enet/fs_enet-mii.c3
-rw-r--r--drivers/net/hamradio/dmascc.c2
-rw-r--r--drivers/net/natsemi.c100
-rw-r--r--drivers/net/pcnet32.c6
-rw-r--r--drivers/net/phy/lxt.c8
-rw-r--r--drivers/net/ppp_generic.c9
-rw-r--r--drivers/net/skge.c4
-rw-r--r--drivers/net/sky2.c6
-rw-r--r--drivers/net/tulip/de2104x.c9
-rw-r--r--drivers/net/tulip/tulip_core.c6
-rw-r--r--drivers/net/tulip/winbond-840.c26
-rw-r--r--drivers/net/tun.c1
-rw-r--r--drivers/net/typhoon.c5
-rw-r--r--drivers/net/wan/c101.c2
-rw-r--r--drivers/net/wan/cosa.c14
-rw-r--r--drivers/net/wan/dscc4.c12
-rw-r--r--drivers/net/wan/n2.c2
-rw-r--r--drivers/net/wan/pc300_drv.c4
-rw-r--r--drivers/net/wan/pci200syn.c2
-rw-r--r--drivers/net/wireless/ipw2200.c22
-rw-r--r--drivers/net/yellowfin.c24
31 files changed, 425 insertions, 339 deletions
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index e27778926eba..d2f808979a2b 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -375,8 +375,7 @@ limit of 4K.
375 of the drivers, and will likely be provided by some future kernel. 375 of the drivers, and will likely be provided by some future kernel.
376*/ 376*/
377enum pci_flags_bit { 377enum pci_flags_bit {
378 PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4, 378 PCI_USES_MASTER=4,
379 PCI_ADDR0=0x10<<0, PCI_ADDR1=0x10<<1, PCI_ADDR2=0x10<<2, PCI_ADDR3=0x10<<3,
380}; 379};
381 380
382enum { IS_VORTEX=1, IS_BOOMERANG=2, IS_CYCLONE=4, IS_TORNADO=8, 381enum { IS_VORTEX=1, IS_BOOMERANG=2, IS_CYCLONE=4, IS_TORNADO=8,
@@ -446,95 +445,95 @@ static struct vortex_chip_info {
446 int io_size; 445 int io_size;
447} vortex_info_tbl[] __devinitdata = { 446} vortex_info_tbl[] __devinitdata = {
448 {"3c590 Vortex 10Mbps", 447 {"3c590 Vortex 10Mbps",
449 PCI_USES_IO|PCI_USES_MASTER, IS_VORTEX, 32, }, 448 PCI_USES_MASTER, IS_VORTEX, 32, },
450 {"3c592 EISA 10Mbps Demon/Vortex", /* AKPM: from Don's 3c59x_cb.c 0.49H */ 449 {"3c592 EISA 10Mbps Demon/Vortex", /* AKPM: from Don's 3c59x_cb.c 0.49H */
451 PCI_USES_IO|PCI_USES_MASTER, IS_VORTEX, 32, }, 450 PCI_USES_MASTER, IS_VORTEX, 32, },
452 {"3c597 EISA Fast Demon/Vortex", /* AKPM: from Don's 3c59x_cb.c 0.49H */ 451 {"3c597 EISA Fast Demon/Vortex", /* AKPM: from Don's 3c59x_cb.c 0.49H */
453 PCI_USES_IO|PCI_USES_MASTER, IS_VORTEX, 32, }, 452 PCI_USES_MASTER, IS_VORTEX, 32, },
454 {"3c595 Vortex 100baseTx", 453 {"3c595 Vortex 100baseTx",
455 PCI_USES_IO|PCI_USES_MASTER, IS_VORTEX, 32, }, 454 PCI_USES_MASTER, IS_VORTEX, 32, },
456 {"3c595 Vortex 100baseT4", 455 {"3c595 Vortex 100baseT4",
457 PCI_USES_IO|PCI_USES_MASTER, IS_VORTEX, 32, }, 456 PCI_USES_MASTER, IS_VORTEX, 32, },
458 457
459 {"3c595 Vortex 100base-MII", 458 {"3c595 Vortex 100base-MII",
460 PCI_USES_IO|PCI_USES_MASTER, IS_VORTEX, 32, }, 459 PCI_USES_MASTER, IS_VORTEX, 32, },
461 {"3c900 Boomerang 10baseT", 460 {"3c900 Boomerang 10baseT",
462 PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|EEPROM_RESET, 64, }, 461 PCI_USES_MASTER, IS_BOOMERANG|EEPROM_RESET, 64, },
463 {"3c900 Boomerang 10Mbps Combo", 462 {"3c900 Boomerang 10Mbps Combo",
464 PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|EEPROM_RESET, 64, }, 463 PCI_USES_MASTER, IS_BOOMERANG|EEPROM_RESET, 64, },
465 {"3c900 Cyclone 10Mbps TPO", /* AKPM: from Don's 0.99M */ 464 {"3c900 Cyclone 10Mbps TPO", /* AKPM: from Don's 0.99M */
466 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, }, 465 PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
467 {"3c900 Cyclone 10Mbps Combo", 466 {"3c900 Cyclone 10Mbps Combo",
468 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, }, 467 PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
469 468
470 {"3c900 Cyclone 10Mbps TPC", /* AKPM: from Don's 0.99M */ 469 {"3c900 Cyclone 10Mbps TPC", /* AKPM: from Don's 0.99M */
471 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, }, 470 PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
472 {"3c900B-FL Cyclone 10base-FL", 471 {"3c900B-FL Cyclone 10base-FL",
473 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, }, 472 PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
474 {"3c905 Boomerang 100baseTx", 473 {"3c905 Boomerang 100baseTx",
475 PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_RESET, 64, }, 474 PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_RESET, 64, },
476 {"3c905 Boomerang 100baseT4", 475 {"3c905 Boomerang 100baseT4",
477 PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_RESET, 64, }, 476 PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_RESET, 64, },
478 {"3c905B Cyclone 100baseTx", 477 {"3c905B Cyclone 100baseTx",
479 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, }, 478 PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
480 479
481 {"3c905B Cyclone 10/100/BNC", 480 {"3c905B Cyclone 10/100/BNC",
482 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, }, 481 PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, },
483 {"3c905B-FX Cyclone 100baseFx", 482 {"3c905B-FX Cyclone 100baseFx",
484 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, }, 483 PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
485 {"3c905C Tornado", 484 {"3c905C Tornado",
486 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, }, 485 PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
487 {"3c920B-EMB-WNM (ATI Radeon 9100 IGP)", 486 {"3c920B-EMB-WNM (ATI Radeon 9100 IGP)",
488 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_MII|HAS_HWCKSM, 128, }, 487 PCI_USES_MASTER, IS_TORNADO|HAS_MII|HAS_HWCKSM, 128, },
489 {"3c980 Cyclone", 488 {"3c980 Cyclone",
490 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, }, 489 PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
491 490
492 {"3c980C Python-T", 491 {"3c980C Python-T",
493 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, }, 492 PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, },
494 {"3cSOHO100-TX Hurricane", 493 {"3cSOHO100-TX Hurricane",
495 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, }, 494 PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, },
496 {"3c555 Laptop Hurricane", 495 {"3c555 Laptop Hurricane",
497 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|EEPROM_8BIT|HAS_HWCKSM, 128, }, 496 PCI_USES_MASTER, IS_CYCLONE|EEPROM_8BIT|HAS_HWCKSM, 128, },
498 {"3c556 Laptop Tornado", 497 {"3c556 Laptop Tornado",
499 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|EEPROM_8BIT|HAS_CB_FNS|INVERT_MII_PWR| 498 PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|EEPROM_8BIT|HAS_CB_FNS|INVERT_MII_PWR|
500 HAS_HWCKSM, 128, }, 499 HAS_HWCKSM, 128, },
501 {"3c556B Laptop Hurricane", 500 {"3c556B Laptop Hurricane",
502 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|EEPROM_OFFSET|HAS_CB_FNS|INVERT_MII_PWR| 501 PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|EEPROM_OFFSET|HAS_CB_FNS|INVERT_MII_PWR|
503 WNO_XCVR_PWR|HAS_HWCKSM, 128, }, 502 WNO_XCVR_PWR|HAS_HWCKSM, 128, },
504 503
505 {"3c575 [Megahertz] 10/100 LAN CardBus", 504 {"3c575 [Megahertz] 10/100 LAN CardBus",
506 PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_8BIT, 128, }, 505 PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_8BIT, 128, },
507 {"3c575 Boomerang CardBus", 506 {"3c575 Boomerang CardBus",
508 PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_8BIT, 128, }, 507 PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_8BIT, 128, },
509 {"3CCFE575BT Cyclone CardBus", 508 {"3CCFE575BT Cyclone CardBus",
510 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT| 509 PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|
511 INVERT_LED_PWR|HAS_HWCKSM, 128, }, 510 INVERT_LED_PWR|HAS_HWCKSM, 128, },
512 {"3CCFE575CT Tornado CardBus", 511 {"3CCFE575CT Tornado CardBus",
513 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR| 512 PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR|
514 MAX_COLLISION_RESET|HAS_HWCKSM, 128, }, 513 MAX_COLLISION_RESET|HAS_HWCKSM, 128, },
515 {"3CCFE656 Cyclone CardBus", 514 {"3CCFE656 Cyclone CardBus",
516 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR| 515 PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR|
517 INVERT_LED_PWR|HAS_HWCKSM, 128, }, 516 INVERT_LED_PWR|HAS_HWCKSM, 128, },
518 517
519 {"3CCFEM656B Cyclone+Winmodem CardBus", 518 {"3CCFEM656B Cyclone+Winmodem CardBus",
520 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR| 519 PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR|
521 INVERT_LED_PWR|HAS_HWCKSM, 128, }, 520 INVERT_LED_PWR|HAS_HWCKSM, 128, },
522 {"3CXFEM656C Tornado+Winmodem CardBus", /* From pcmcia-cs-3.1.5 */ 521 {"3CXFEM656C Tornado+Winmodem CardBus", /* From pcmcia-cs-3.1.5 */
523 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR| 522 PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR|
524 MAX_COLLISION_RESET|HAS_HWCKSM, 128, }, 523 MAX_COLLISION_RESET|HAS_HWCKSM, 128, },
525 {"3c450 HomePNA Tornado", /* AKPM: from Don's 0.99Q */ 524 {"3c450 HomePNA Tornado", /* AKPM: from Don's 0.99Q */
526 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, }, 525 PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, },
527 {"3c920 Tornado", 526 {"3c920 Tornado",
528 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, }, 527 PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, },
529 {"3c982 Hydra Dual Port A", 528 {"3c982 Hydra Dual Port A",
530 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_HWCKSM|HAS_NWAY, 128, }, 529 PCI_USES_MASTER, IS_TORNADO|HAS_HWCKSM|HAS_NWAY, 128, },
531 530
532 {"3c982 Hydra Dual Port B", 531 {"3c982 Hydra Dual Port B",
533 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_HWCKSM|HAS_NWAY, 128, }, 532 PCI_USES_MASTER, IS_TORNADO|HAS_HWCKSM|HAS_NWAY, 128, },
534 {"3c905B-T4", 533 {"3c905B-T4",
535 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, }, 534 PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
536 {"3c920B-EMB-WNM Tornado", 535 {"3c920B-EMB-WNM Tornado",
537 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, }, 536 PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, },
538 537
539 {NULL,}, /* NULL terminated list. */ 538 {NULL,}, /* NULL terminated list. */
540}; 539};
@@ -1408,8 +1407,10 @@ static int __devinit vortex_probe1(struct device *gendev,
1408 } 1407 }
1409 1408
1410 if (print_info) { 1409 if (print_info) {
1411 printk(KERN_INFO "%s: CardBus functions mapped %8.8lx->%p\n", 1410 printk(KERN_INFO "%s: CardBus functions mapped "
1412 print_name, pci_resource_start(pdev, 2), 1411 "%16.16llx->%p\n",
1412 print_name,
1413 (unsigned long long)pci_resource_start(pdev, 2),
1413 vp->cb_fn_base); 1414 vp->cb_fn_base);
1414 } 1415 }
1415 EL3WINDOW(2); 1416 EL3WINDOW(2);
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index 0cdc830449d8..d26dd6a7062d 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -1823,7 +1823,7 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1823 struct cp_private *cp; 1823 struct cp_private *cp;
1824 int rc; 1824 int rc;
1825 void __iomem *regs; 1825 void __iomem *regs;
1826 long pciaddr; 1826 resource_size_t pciaddr;
1827 unsigned int addr_len, i, pci_using_dac; 1827 unsigned int addr_len, i, pci_using_dac;
1828 u8 pci_rev; 1828 u8 pci_rev;
1829 1829
@@ -1883,8 +1883,8 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1883 } 1883 }
1884 if (pci_resource_len(pdev, 1) < CP_REGS_SIZE) { 1884 if (pci_resource_len(pdev, 1) < CP_REGS_SIZE) {
1885 rc = -EIO; 1885 rc = -EIO;
1886 printk(KERN_ERR PFX "MMIO resource (%lx) too small on pci dev %s\n", 1886 printk(KERN_ERR PFX "MMIO resource (%llx) too small on pci dev %s\n",
1887 pci_resource_len(pdev, 1), pci_name(pdev)); 1887 (unsigned long long)pci_resource_len(pdev, 1), pci_name(pdev));
1888 goto err_out_res; 1888 goto err_out_res;
1889 } 1889 }
1890 1890
@@ -1916,8 +1916,9 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1916 regs = ioremap(pciaddr, CP_REGS_SIZE); 1916 regs = ioremap(pciaddr, CP_REGS_SIZE);
1917 if (!regs) { 1917 if (!regs) {
1918 rc = -EIO; 1918 rc = -EIO;
1919 printk(KERN_ERR PFX "Cannot map PCI MMIO (%lx@%lx) on pci dev %s\n", 1919 printk(KERN_ERR PFX "Cannot map PCI MMIO (%llx@%llx) on pci dev %s\n",
1920 pci_resource_len(pdev, 1), pciaddr, pci_name(pdev)); 1920 (unsigned long long)pci_resource_len(pdev, 1),
1921 (unsigned long long)pciaddr, pci_name(pdev));
1921 goto err_out_res; 1922 goto err_out_res;
1922 } 1923 }
1923 dev->base_addr = (unsigned long) regs; 1924 dev->base_addr = (unsigned long) regs;
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index abd6261465f1..ed2e3c03bc88 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -1341,9 +1341,9 @@ static int rtl8139_open (struct net_device *dev)
1341 netif_start_queue (dev); 1341 netif_start_queue (dev);
1342 1342
1343 if (netif_msg_ifup(tp)) 1343 if (netif_msg_ifup(tp))
1344 printk(KERN_DEBUG "%s: rtl8139_open() ioaddr %#lx IRQ %d" 1344 printk(KERN_DEBUG "%s: rtl8139_open() ioaddr %#llx IRQ %d"
1345 " GP Pins %2.2x %s-duplex.\n", 1345 " GP Pins %2.2x %s-duplex.\n", dev->name,
1346 dev->name, pci_resource_start (tp->pci_dev, 1), 1346 (unsigned long long)pci_resource_start (tp->pci_dev, 1),
1347 dev->irq, RTL_R8 (MediaStatus), 1347 dev->irq, RTL_R8 (MediaStatus),
1348 tp->mii.full_duplex ? "full" : "half"); 1348 tp->mii.full_duplex ? "full" : "half");
1349 1349
diff --git a/drivers/net/dl2k.h b/drivers/net/dl2k.h
index 6e75482d75f2..53449207e53b 100644
--- a/drivers/net/dl2k.h
+++ b/drivers/net/dl2k.h
@@ -683,11 +683,6 @@ struct netdev_private {
683}; 683};
684 684
685/* The station address location in the EEPROM. */ 685/* The station address location in the EEPROM. */
686#ifdef MEM_MAPPING
687#define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_MEM | PCI_ADDR1)
688#else
689#define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_IO | PCI_ADDR0)
690#endif
691/* The struct pci_device_id consist of: 686/* The struct pci_device_id consist of:
692 vendor, device Vendor and device ID to match (or PCI_ANY_ID) 687 vendor, device Vendor and device ID to match (or PCI_ANY_ID)
693 subvendor, subdevice Subsystem vendor and device ID to match (or PCI_ANY_ID) 688 subvendor, subdevice Subsystem vendor and device ID to match (or PCI_ANY_ID)
@@ -695,9 +690,10 @@ struct netdev_private {
695 class_mask of the class are honored during the comparison. 690 class_mask of the class are honored during the comparison.
696 driver_data Data private to the driver. 691 driver_data Data private to the driver.
697*/ 692*/
698static struct pci_device_id rio_pci_tbl[] = { 693
699 {0x1186, 0x4000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 694static const struct pci_device_id rio_pci_tbl[] = {
700 {0,} 695 {0x1186, 0x4000, PCI_ANY_ID, PCI_ANY_ID, },
696 { }
701}; 697};
702MODULE_DEVICE_TABLE (pci, rio_pci_tbl); 698MODULE_DEVICE_TABLE (pci, rio_pci_tbl);
703#define TX_TIMEOUT (4*HZ) 699#define TX_TIMEOUT (4*HZ)
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 24996da4c1c4..7965a9b08e79 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -410,10 +410,7 @@ dm9000_probe(struct platform_device *pdev)
410 if (pdev->num_resources < 2) { 410 if (pdev->num_resources < 2) {
411 ret = -ENODEV; 411 ret = -ENODEV;
412 goto out; 412 goto out;
413 } 413 } else if (pdev->num_resources == 2) {
414
415 switch (pdev->num_resources) {
416 case 2:
417 base = pdev->resource[0].start; 414 base = pdev->resource[0].start;
418 415
419 if (!request_mem_region(base, 4, ndev->name)) { 416 if (!request_mem_region(base, 4, ndev->name)) {
@@ -423,17 +420,16 @@ dm9000_probe(struct platform_device *pdev)
423 420
424 ndev->base_addr = base; 421 ndev->base_addr = base;
425 ndev->irq = pdev->resource[1].start; 422 ndev->irq = pdev->resource[1].start;
426 db->io_addr = (void *)base; 423 db->io_addr = (void __iomem *)base;
427 db->io_data = (void *)(base + 4); 424 db->io_data = (void __iomem *)(base + 4);
428
429 break;
430 425
431 case 3: 426 } else {
432 db->addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 427 db->addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
433 db->data_res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 428 db->data_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
434 db->irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 429 db->irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
435 430
436 if (db->addr_res == NULL || db->data_res == NULL) { 431 if (db->addr_res == NULL || db->data_res == NULL ||
432 db->irq_res == NULL) {
437 printk(KERN_ERR PFX "insufficient resources\n"); 433 printk(KERN_ERR PFX "insufficient resources\n");
438 ret = -ENOENT; 434 ret = -ENOENT;
439 goto out; 435 goto out;
@@ -482,7 +478,6 @@ dm9000_probe(struct platform_device *pdev)
482 478
483 /* ensure at least we have a default set of IO routines */ 479 /* ensure at least we have a default set of IO routines */
484 dm9000_set_io(db, iosize); 480 dm9000_set_io(db, iosize);
485
486 } 481 }
487 482
488 /* check to see if anything is being over-ridden */ 483 /* check to see if anything is being over-ridden */
@@ -564,6 +559,13 @@ dm9000_probe(struct platform_device *pdev)
564 for (i = 0; i < 6; i++) 559 for (i = 0; i < 6; i++)
565 ndev->dev_addr[i] = db->srom[i]; 560 ndev->dev_addr[i] = db->srom[i];
566 561
562 if (!is_valid_ether_addr(ndev->dev_addr)) {
563 /* try reading from mac */
564
565 for (i = 0; i < 6; i++)
566 ndev->dev_addr[i] = ior(db, i+DM9000_PAR);
567 }
568
567 if (!is_valid_ether_addr(ndev->dev_addr)) 569 if (!is_valid_ether_addr(ndev->dev_addr))
568 printk("%s: Invalid ethernet MAC address. Please " 570 printk("%s: Invalid ethernet MAC address. Please "
569 "set using ifconfig\n", ndev->name); 571 "set using ifconfig\n", ndev->name);
@@ -663,7 +665,6 @@ dm9000_init_dm9000(struct net_device *dev)
663 db->tx_pkt_cnt = 0; 665 db->tx_pkt_cnt = 0;
664 db->queue_pkt_len = 0; 666 db->queue_pkt_len = 0;
665 dev->trans_start = 0; 667 dev->trans_start = 0;
666 spin_lock_init(&db->lock);
667} 668}
668 669
669/* 670/*
@@ -767,7 +768,7 @@ dm9000_stop(struct net_device *ndev)
767 * receive the packet to upper layer, free the transmitted packet 768 * receive the packet to upper layer, free the transmitted packet
768 */ 769 */
769 770
770void 771static void
771dm9000_tx_done(struct net_device *dev, board_info_t * db) 772dm9000_tx_done(struct net_device *dev, board_info_t * db)
772{ 773{
773 int tx_status = ior(db, DM9000_NSR); /* Got TX status */ 774 int tx_status = ior(db, DM9000_NSR); /* Got TX status */
@@ -1187,13 +1188,14 @@ dm9000_drv_remove(struct platform_device *pdev)
1187} 1188}
1188 1189
1189static struct platform_driver dm9000_driver = { 1190static struct platform_driver dm9000_driver = {
1191 .driver = {
1192 .name = "dm9000",
1193 .owner = THIS_MODULE,
1194 },
1190 .probe = dm9000_probe, 1195 .probe = dm9000_probe,
1191 .remove = dm9000_drv_remove, 1196 .remove = dm9000_drv_remove,
1192 .suspend = dm9000_drv_suspend, 1197 .suspend = dm9000_drv_suspend,
1193 .resume = dm9000_drv_resume, 1198 .resume = dm9000_drv_resume,
1194 .driver = {
1195 .name = "dm9000",
1196 },
1197}; 1199};
1198 1200
1199static int __init 1201static int __init
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index f37170cc1a37..93a286570923 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2678,9 +2678,9 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2678 goto err_out_free; 2678 goto err_out_free;
2679 } 2679 }
2680 2680
2681 DPRINTK(PROBE, INFO, "addr 0x%lx, irq %d, " 2681 DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, "
2682 "MAC addr %02X:%02X:%02X:%02X:%02X:%02X\n", 2682 "MAC addr %02X:%02X:%02X:%02X:%02X:%02X\n",
2683 pci_resource_start(pdev, 0), pdev->irq, 2683 (unsigned long long)pci_resource_start(pdev, 0), pdev->irq,
2684 netdev->dev_addr[0], netdev->dev_addr[1], netdev->dev_addr[2], 2684 netdev->dev_addr[0], netdev->dev_addr[1], netdev->dev_addr[2],
2685 netdev->dev_addr[3], netdev->dev_addr[4], netdev->dev_addr[5]); 2685 netdev->dev_addr[3], netdev->dev_addr[4], netdev->dev_addr[5]);
2686 2686
diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
index 467fc861360d..ecf5ad85a684 100644
--- a/drivers/net/eepro100.c
+++ b/drivers/net/eepro100.c
@@ -278,11 +278,6 @@ having to sign an Intel NDA when I'm helping Intel sell their own product!
278 278
279static int speedo_found1(struct pci_dev *pdev, void __iomem *ioaddr, int fnd_cnt, int acpi_idle_state); 279static int speedo_found1(struct pci_dev *pdev, void __iomem *ioaddr, int fnd_cnt, int acpi_idle_state);
280 280
281enum pci_flags_bit {
282 PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4,
283 PCI_ADDR0=0x10<<0, PCI_ADDR1=0x10<<1, PCI_ADDR2=0x10<<2, PCI_ADDR3=0x10<<3,
284};
285
286/* Offsets to the various registers. 281/* Offsets to the various registers.
287 All accesses need not be longword aligned. */ 282 All accesses need not be longword aligned. */
288enum speedo_offsets { 283enum speedo_offsets {
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
index 724d7dc35fa3..ee34a16eb4e2 100644
--- a/drivers/net/epic100.c
+++ b/drivers/net/epic100.c
@@ -191,23 +191,10 @@ IVc. Errata
191*/ 191*/
192 192
193 193
194enum pci_id_flags_bits {
195 /* Set PCI command register bits before calling probe1(). */
196 PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4,
197 /* Read and map the single following PCI BAR. */
198 PCI_ADDR0=0<<4, PCI_ADDR1=1<<4, PCI_ADDR2=2<<4, PCI_ADDR3=3<<4,
199 PCI_ADDR_64BITS=0x100, PCI_NO_ACPI_WAKE=0x200, PCI_NO_MIN_LATENCY=0x400,
200};
201
202enum chip_capability_flags { MII_PWRDWN=1, TYPE2_INTR=2, NO_MII=4 }; 194enum chip_capability_flags { MII_PWRDWN=1, TYPE2_INTR=2, NO_MII=4 };
203 195
204#define EPIC_TOTAL_SIZE 0x100 196#define EPIC_TOTAL_SIZE 0x100
205#define USE_IO_OPS 1 197#define USE_IO_OPS 1
206#ifdef USE_IO_OPS
207#define EPIC_IOTYPE PCI_USES_MASTER|PCI_USES_IO|PCI_ADDR0
208#else
209#define EPIC_IOTYPE PCI_USES_MASTER|PCI_USES_MEM|PCI_ADDR1
210#endif
211 198
212typedef enum { 199typedef enum {
213 SMSC_83C170_0, 200 SMSC_83C170_0,
@@ -218,7 +205,6 @@ typedef enum {
218 205
219struct epic_chip_info { 206struct epic_chip_info {
220 const char *name; 207 const char *name;
221 enum pci_id_flags_bits pci_flags;
222 int io_size; /* Needed for I/O region check or ioremap(). */ 208 int io_size; /* Needed for I/O region check or ioremap(). */
223 int drv_flags; /* Driver use, intended as capability flags. */ 209 int drv_flags; /* Driver use, intended as capability flags. */
224}; 210};
@@ -227,11 +213,11 @@ struct epic_chip_info {
227/* indexed by chip_t */ 213/* indexed by chip_t */
228static const struct epic_chip_info pci_id_tbl[] = { 214static const struct epic_chip_info pci_id_tbl[] = {
229 { "SMSC EPIC/100 83c170", 215 { "SMSC EPIC/100 83c170",
230 EPIC_IOTYPE, EPIC_TOTAL_SIZE, TYPE2_INTR | NO_MII | MII_PWRDWN }, 216 EPIC_TOTAL_SIZE, TYPE2_INTR | NO_MII | MII_PWRDWN },
231 { "SMSC EPIC/100 83c170", 217 { "SMSC EPIC/100 83c170",
232 EPIC_IOTYPE, EPIC_TOTAL_SIZE, TYPE2_INTR }, 218 EPIC_TOTAL_SIZE, TYPE2_INTR },
233 { "SMSC EPIC/C 83c175", 219 { "SMSC EPIC/C 83c175",
234 EPIC_IOTYPE, EPIC_TOTAL_SIZE, TYPE2_INTR | MII_PWRDWN }, 220 EPIC_TOTAL_SIZE, TYPE2_INTR | MII_PWRDWN },
235}; 221};
236 222
237 223
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index a8449265e5fd..13eca7ede2af 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -126,16 +126,6 @@ MODULE_PARM_DESC(full_duplex, "fealnx full duplex setting(s) (1)");
126 126
127#define MIN_REGION_SIZE 136 127#define MIN_REGION_SIZE 136
128 128
129enum pci_flags_bit {
130 PCI_USES_IO = 1,
131 PCI_USES_MEM = 2,
132 PCI_USES_MASTER = 4,
133 PCI_ADDR0 = 0x10 << 0,
134 PCI_ADDR1 = 0x10 << 1,
135 PCI_ADDR2 = 0x10 << 2,
136 PCI_ADDR3 = 0x10 << 3,
137};
138
139/* A chip capabilities table, matching the entries in pci_tbl[] above. */ 129/* A chip capabilities table, matching the entries in pci_tbl[] above. */
140enum chip_capability_flags { 130enum chip_capability_flags {
141 HAS_MII_XCVR, 131 HAS_MII_XCVR,
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index bd6983d1afba..db694c832989 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -22,7 +22,7 @@
22 * Copyright (c) 2001-2005 Greg Ungerer (gerg@snapgear.com) 22 * Copyright (c) 2001-2005 Greg Ungerer (gerg@snapgear.com)
23 * 23 *
24 * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be) 24 * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be)
25 * Copyright (c) 2004-2005 Macq Electronique SA. 25 * Copyright (c) 2004-2006 Macq Electronique SA.
26 */ 26 */
27 27
28#include <linux/config.h> 28#include <linux/config.h>
@@ -51,7 +51,7 @@
51 51
52#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || \ 52#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || \
53 defined(CONFIG_M5272) || defined(CONFIG_M528x) || \ 53 defined(CONFIG_M5272) || defined(CONFIG_M528x) || \
54 defined(CONFIG_M520x) 54 defined(CONFIG_M520x) || defined(CONFIG_M532x)
55#include <asm/coldfire.h> 55#include <asm/coldfire.h>
56#include <asm/mcfsim.h> 56#include <asm/mcfsim.h>
57#include "fec.h" 57#include "fec.h"
@@ -80,6 +80,8 @@ static unsigned int fec_hw[] = {
80 (MCF_MBAR + 0x1000), 80 (MCF_MBAR + 0x1000),
81#elif defined(CONFIG_M520x) 81#elif defined(CONFIG_M520x)
82 (MCF_MBAR+0x30000), 82 (MCF_MBAR+0x30000),
83#elif defined(CONFIG_M532x)
84 (MCF_MBAR+0xfc030000),
83#else 85#else
84 &(((immap_t *)IMAP_ADDR)->im_cpm.cp_fec), 86 &(((immap_t *)IMAP_ADDR)->im_cpm.cp_fec),
85#endif 87#endif
@@ -143,7 +145,7 @@ typedef struct {
143#define TX_RING_MOD_MASK 15 /* for this to work */ 145#define TX_RING_MOD_MASK 15 /* for this to work */
144 146
145#if (((RX_RING_SIZE + TX_RING_SIZE) * 8) > PAGE_SIZE) 147#if (((RX_RING_SIZE + TX_RING_SIZE) * 8) > PAGE_SIZE)
146#error "FEC: descriptor ring size contants too large" 148#error "FEC: descriptor ring size constants too large"
147#endif 149#endif
148 150
149/* Interrupt events/masks. 151/* Interrupt events/masks.
@@ -167,12 +169,12 @@ typedef struct {
167 169
168 170
169/* 171/*
170 * The 5270/5271/5280/5282 RX control register also contains maximum frame 172 * The 5270/5271/5280/5282/532x RX control register also contains maximum frame
171 * size bits. Other FEC hardware does not, so we need to take that into 173 * size bits. Other FEC hardware does not, so we need to take that into
172 * account when setting it. 174 * account when setting it.
173 */ 175 */
174#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ 176#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
175 defined(CONFIG_M520x) 177 defined(CONFIG_M520x) || defined(CONFIG_M532x)
176#define OPT_FRAME_SIZE (PKT_MAXBUF_SIZE << 16) 178#define OPT_FRAME_SIZE (PKT_MAXBUF_SIZE << 16)
177#else 179#else
178#define OPT_FRAME_SIZE 0 180#define OPT_FRAME_SIZE 0
@@ -308,6 +310,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
308 struct fec_enet_private *fep; 310 struct fec_enet_private *fep;
309 volatile fec_t *fecp; 311 volatile fec_t *fecp;
310 volatile cbd_t *bdp; 312 volatile cbd_t *bdp;
313 unsigned short status;
311 314
312 fep = netdev_priv(dev); 315 fep = netdev_priv(dev);
313 fecp = (volatile fec_t*)dev->base_addr; 316 fecp = (volatile fec_t*)dev->base_addr;
@@ -320,8 +323,9 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
320 /* Fill in a Tx ring entry */ 323 /* Fill in a Tx ring entry */
321 bdp = fep->cur_tx; 324 bdp = fep->cur_tx;
322 325
326 status = bdp->cbd_sc;
323#ifndef final_version 327#ifndef final_version
324 if (bdp->cbd_sc & BD_ENET_TX_READY) { 328 if (status & BD_ENET_TX_READY) {
325 /* Ooops. All transmit buffers are full. Bail out. 329 /* Ooops. All transmit buffers are full. Bail out.
326 * This should not happen, since dev->tbusy should be set. 330 * This should not happen, since dev->tbusy should be set.
327 */ 331 */
@@ -332,7 +336,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
332 336
333 /* Clear all of the status flags. 337 /* Clear all of the status flags.
334 */ 338 */
335 bdp->cbd_sc &= ~BD_ENET_TX_STATS; 339 status &= ~BD_ENET_TX_STATS;
336 340
337 /* Set buffer length and buffer pointer. 341 /* Set buffer length and buffer pointer.
338 */ 342 */
@@ -366,21 +370,22 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
366 370
367 spin_lock_irq(&fep->lock); 371 spin_lock_irq(&fep->lock);
368 372
369 /* Send it on its way. Tell FEC its ready, interrupt when done, 373 /* Send it on its way. Tell FEC it's ready, interrupt when done,
370 * its the last BD of the frame, and to put the CRC on the end. 374 * it's the last BD of the frame, and to put the CRC on the end.
371 */ 375 */
372 376
373 bdp->cbd_sc |= (BD_ENET_TX_READY | BD_ENET_TX_INTR 377 status |= (BD_ENET_TX_READY | BD_ENET_TX_INTR
374 | BD_ENET_TX_LAST | BD_ENET_TX_TC); 378 | BD_ENET_TX_LAST | BD_ENET_TX_TC);
379 bdp->cbd_sc = status;
375 380
376 dev->trans_start = jiffies; 381 dev->trans_start = jiffies;
377 382
378 /* Trigger transmission start */ 383 /* Trigger transmission start */
379 fecp->fec_x_des_active = 0x01000000; 384 fecp->fec_x_des_active = 0;
380 385
381 /* If this was the last BD in the ring, start at the beginning again. 386 /* If this was the last BD in the ring, start at the beginning again.
382 */ 387 */
383 if (bdp->cbd_sc & BD_ENET_TX_WRAP) { 388 if (status & BD_ENET_TX_WRAP) {
384 bdp = fep->tx_bd_base; 389 bdp = fep->tx_bd_base;
385 } else { 390 } else {
386 bdp++; 391 bdp++;
@@ -491,43 +496,44 @@ fec_enet_tx(struct net_device *dev)
491{ 496{
492 struct fec_enet_private *fep; 497 struct fec_enet_private *fep;
493 volatile cbd_t *bdp; 498 volatile cbd_t *bdp;
499 unsigned short status;
494 struct sk_buff *skb; 500 struct sk_buff *skb;
495 501
496 fep = netdev_priv(dev); 502 fep = netdev_priv(dev);
497 spin_lock(&fep->lock); 503 spin_lock(&fep->lock);
498 bdp = fep->dirty_tx; 504 bdp = fep->dirty_tx;
499 505
500 while ((bdp->cbd_sc&BD_ENET_TX_READY) == 0) { 506 while (((status = bdp->cbd_sc) & BD_ENET_TX_READY) == 0) {
501 if (bdp == fep->cur_tx && fep->tx_full == 0) break; 507 if (bdp == fep->cur_tx && fep->tx_full == 0) break;
502 508
503 skb = fep->tx_skbuff[fep->skb_dirty]; 509 skb = fep->tx_skbuff[fep->skb_dirty];
504 /* Check for errors. */ 510 /* Check for errors. */
505 if (bdp->cbd_sc & (BD_ENET_TX_HB | BD_ENET_TX_LC | 511 if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC |
506 BD_ENET_TX_RL | BD_ENET_TX_UN | 512 BD_ENET_TX_RL | BD_ENET_TX_UN |
507 BD_ENET_TX_CSL)) { 513 BD_ENET_TX_CSL)) {
508 fep->stats.tx_errors++; 514 fep->stats.tx_errors++;
509 if (bdp->cbd_sc & BD_ENET_TX_HB) /* No heartbeat */ 515 if (status & BD_ENET_TX_HB) /* No heartbeat */
510 fep->stats.tx_heartbeat_errors++; 516 fep->stats.tx_heartbeat_errors++;
511 if (bdp->cbd_sc & BD_ENET_TX_LC) /* Late collision */ 517 if (status & BD_ENET_TX_LC) /* Late collision */
512 fep->stats.tx_window_errors++; 518 fep->stats.tx_window_errors++;
513 if (bdp->cbd_sc & BD_ENET_TX_RL) /* Retrans limit */ 519 if (status & BD_ENET_TX_RL) /* Retrans limit */
514 fep->stats.tx_aborted_errors++; 520 fep->stats.tx_aborted_errors++;
515 if (bdp->cbd_sc & BD_ENET_TX_UN) /* Underrun */ 521 if (status & BD_ENET_TX_UN) /* Underrun */
516 fep->stats.tx_fifo_errors++; 522 fep->stats.tx_fifo_errors++;
517 if (bdp->cbd_sc & BD_ENET_TX_CSL) /* Carrier lost */ 523 if (status & BD_ENET_TX_CSL) /* Carrier lost */
518 fep->stats.tx_carrier_errors++; 524 fep->stats.tx_carrier_errors++;
519 } else { 525 } else {
520 fep->stats.tx_packets++; 526 fep->stats.tx_packets++;
521 } 527 }
522 528
523#ifndef final_version 529#ifndef final_version
524 if (bdp->cbd_sc & BD_ENET_TX_READY) 530 if (status & BD_ENET_TX_READY)
525 printk("HEY! Enet xmit interrupt and TX_READY.\n"); 531 printk("HEY! Enet xmit interrupt and TX_READY.\n");
526#endif 532#endif
527 /* Deferred means some collisions occurred during transmit, 533 /* Deferred means some collisions occurred during transmit,
528 * but we eventually sent the packet OK. 534 * but we eventually sent the packet OK.
529 */ 535 */
530 if (bdp->cbd_sc & BD_ENET_TX_DEF) 536 if (status & BD_ENET_TX_DEF)
531 fep->stats.collisions++; 537 fep->stats.collisions++;
532 538
533 /* Free the sk buffer associated with this last transmit. 539 /* Free the sk buffer associated with this last transmit.
@@ -538,7 +544,7 @@ fec_enet_tx(struct net_device *dev)
538 544
539 /* Update pointer to next buffer descriptor to be transmitted. 545 /* Update pointer to next buffer descriptor to be transmitted.
540 */ 546 */
541 if (bdp->cbd_sc & BD_ENET_TX_WRAP) 547 if (status & BD_ENET_TX_WRAP)
542 bdp = fep->tx_bd_base; 548 bdp = fep->tx_bd_base;
543 else 549 else
544 bdp++; 550 bdp++;
@@ -568,9 +574,14 @@ fec_enet_rx(struct net_device *dev)
568 struct fec_enet_private *fep; 574 struct fec_enet_private *fep;
569 volatile fec_t *fecp; 575 volatile fec_t *fecp;
570 volatile cbd_t *bdp; 576 volatile cbd_t *bdp;
577 unsigned short status;
571 struct sk_buff *skb; 578 struct sk_buff *skb;
572 ushort pkt_len; 579 ushort pkt_len;
573 __u8 *data; 580 __u8 *data;
581
582#ifdef CONFIG_M532x
583 flush_cache_all();
584#endif
574 585
575 fep = netdev_priv(dev); 586 fep = netdev_priv(dev);
576 fecp = (volatile fec_t*)dev->base_addr; 587 fecp = (volatile fec_t*)dev->base_addr;
@@ -580,13 +591,13 @@ fec_enet_rx(struct net_device *dev)
580 */ 591 */
581 bdp = fep->cur_rx; 592 bdp = fep->cur_rx;
582 593
583while (!(bdp->cbd_sc & BD_ENET_RX_EMPTY)) { 594while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) {
584 595
585#ifndef final_version 596#ifndef final_version
586 /* Since we have allocated space to hold a complete frame, 597 /* Since we have allocated space to hold a complete frame,
587 * the last indicator should be set. 598 * the last indicator should be set.
588 */ 599 */
589 if ((bdp->cbd_sc & BD_ENET_RX_LAST) == 0) 600 if ((status & BD_ENET_RX_LAST) == 0)
590 printk("FEC ENET: rcv is not +last\n"); 601 printk("FEC ENET: rcv is not +last\n");
591#endif 602#endif
592 603
@@ -594,26 +605,26 @@ while (!(bdp->cbd_sc & BD_ENET_RX_EMPTY)) {
594 goto rx_processing_done; 605 goto rx_processing_done;
595 606
596 /* Check for errors. */ 607 /* Check for errors. */
597 if (bdp->cbd_sc & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO | 608 if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO |
598 BD_ENET_RX_CR | BD_ENET_RX_OV)) { 609 BD_ENET_RX_CR | BD_ENET_RX_OV)) {
599 fep->stats.rx_errors++; 610 fep->stats.rx_errors++;
600 if (bdp->cbd_sc & (BD_ENET_RX_LG | BD_ENET_RX_SH)) { 611 if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH)) {
601 /* Frame too long or too short. */ 612 /* Frame too long or too short. */
602 fep->stats.rx_length_errors++; 613 fep->stats.rx_length_errors++;
603 } 614 }
604 if (bdp->cbd_sc & BD_ENET_RX_NO) /* Frame alignment */ 615 if (status & BD_ENET_RX_NO) /* Frame alignment */
605 fep->stats.rx_frame_errors++; 616 fep->stats.rx_frame_errors++;
606 if (bdp->cbd_sc & BD_ENET_RX_CR) /* CRC Error */ 617 if (status & BD_ENET_RX_CR) /* CRC Error */
607 fep->stats.rx_crc_errors++;
608 if (bdp->cbd_sc & BD_ENET_RX_OV) /* FIFO overrun */
609 fep->stats.rx_crc_errors++; 618 fep->stats.rx_crc_errors++;
619 if (status & BD_ENET_RX_OV) /* FIFO overrun */
620 fep->stats.rx_fifo_errors++;
610 } 621 }
611 622
612 /* Report late collisions as a frame error. 623 /* Report late collisions as a frame error.
613 * On this error, the BD is closed, but we don't know what we 624 * On this error, the BD is closed, but we don't know what we
614 * have in the buffer. So, just drop this frame on the floor. 625 * have in the buffer. So, just drop this frame on the floor.
615 */ 626 */
616 if (bdp->cbd_sc & BD_ENET_RX_CL) { 627 if (status & BD_ENET_RX_CL) {
617 fep->stats.rx_errors++; 628 fep->stats.rx_errors++;
618 fep->stats.rx_frame_errors++; 629 fep->stats.rx_frame_errors++;
619 goto rx_processing_done; 630 goto rx_processing_done;
@@ -639,9 +650,7 @@ while (!(bdp->cbd_sc & BD_ENET_RX_EMPTY)) {
639 } else { 650 } else {
640 skb->dev = dev; 651 skb->dev = dev;
641 skb_put(skb,pkt_len-4); /* Make room */ 652 skb_put(skb,pkt_len-4); /* Make room */
642 eth_copy_and_sum(skb, 653 eth_copy_and_sum(skb, data, pkt_len-4, 0);
643 (unsigned char *)__va(bdp->cbd_bufaddr),
644 pkt_len-4, 0);
645 skb->protocol=eth_type_trans(skb,dev); 654 skb->protocol=eth_type_trans(skb,dev);
646 netif_rx(skb); 655 netif_rx(skb);
647 } 656 }
@@ -649,15 +658,16 @@ while (!(bdp->cbd_sc & BD_ENET_RX_EMPTY)) {
649 658
650 /* Clear the status flags for this buffer. 659 /* Clear the status flags for this buffer.
651 */ 660 */
652 bdp->cbd_sc &= ~BD_ENET_RX_STATS; 661 status &= ~BD_ENET_RX_STATS;
653 662
654 /* Mark the buffer empty. 663 /* Mark the buffer empty.
655 */ 664 */
656 bdp->cbd_sc |= BD_ENET_RX_EMPTY; 665 status |= BD_ENET_RX_EMPTY;
666 bdp->cbd_sc = status;
657 667
658 /* Update BD pointer to next entry. 668 /* Update BD pointer to next entry.
659 */ 669 */
660 if (bdp->cbd_sc & BD_ENET_RX_WRAP) 670 if (status & BD_ENET_RX_WRAP)
661 bdp = fep->rx_bd_base; 671 bdp = fep->rx_bd_base;
662 else 672 else
663 bdp++; 673 bdp++;
@@ -667,9 +677,9 @@ while (!(bdp->cbd_sc & BD_ENET_RX_EMPTY)) {
667 * incoming frames. On a heavily loaded network, we should be 677 * incoming frames. On a heavily loaded network, we should be
668 * able to keep up at the expense of system resources. 678 * able to keep up at the expense of system resources.
669 */ 679 */
670 fecp->fec_r_des_active = 0x01000000; 680 fecp->fec_r_des_active = 0;
671#endif 681#endif
672 } /* while (!(bdp->cbd_sc & BD_ENET_RX_EMPTY)) */ 682 } /* while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) */
673 fep->cur_rx = (cbd_t *)bdp; 683 fep->cur_rx = (cbd_t *)bdp;
674 684
675#if 0 685#if 0
@@ -680,11 +690,12 @@ while (!(bdp->cbd_sc & BD_ENET_RX_EMPTY)) {
680 * our way back to the interrupt return only to come right back 690 * our way back to the interrupt return only to come right back
681 * here. 691 * here.
682 */ 692 */
683 fecp->fec_r_des_active = 0x01000000; 693 fecp->fec_r_des_active = 0;
684#endif 694#endif
685} 695}
686 696
687 697
698/* called from interrupt context */
688static void 699static void
689fec_enet_mii(struct net_device *dev) 700fec_enet_mii(struct net_device *dev)
690{ 701{
@@ -696,10 +707,12 @@ fec_enet_mii(struct net_device *dev)
696 fep = netdev_priv(dev); 707 fep = netdev_priv(dev);
697 ep = fep->hwp; 708 ep = fep->hwp;
698 mii_reg = ep->fec_mii_data; 709 mii_reg = ep->fec_mii_data;
710
711 spin_lock(&fep->lock);
699 712
700 if ((mip = mii_head) == NULL) { 713 if ((mip = mii_head) == NULL) {
701 printk("MII and no head!\n"); 714 printk("MII and no head!\n");
702 return; 715 goto unlock;
703 } 716 }
704 717
705 if (mip->mii_func != NULL) 718 if (mip->mii_func != NULL)
@@ -711,6 +724,9 @@ fec_enet_mii(struct net_device *dev)
711 724
712 if ((mip = mii_head) != NULL) 725 if ((mip = mii_head) != NULL)
713 ep->fec_mii_data = mip->mii_regval; 726 ep->fec_mii_data = mip->mii_regval;
727
728unlock:
729 spin_unlock(&fep->lock);
714} 730}
715 731
716static int 732static int
@@ -728,8 +744,7 @@ mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_devi
728 744
729 retval = 0; 745 retval = 0;
730 746
731 save_flags(flags); 747 spin_lock_irqsave(&fep->lock,flags);
732 cli();
733 748
734 if ((mip = mii_free) != NULL) { 749 if ((mip = mii_free) != NULL) {
735 mii_free = mip->mii_next; 750 mii_free = mip->mii_next;
@@ -749,7 +764,7 @@ mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_devi
749 retval = 1; 764 retval = 1;
750 } 765 }
751 766
752 restore_flags(flags); 767 spin_unlock_irqrestore(&fep->lock,flags);
753 768
754 return(retval); 769 return(retval);
755} 770}
@@ -1216,7 +1231,7 @@ static phy_info_t const * const phy_info[] = {
1216}; 1231};
1217 1232
1218/* ------------------------------------------------------------------------- */ 1233/* ------------------------------------------------------------------------- */
1219 1234#if !defined(CONFIG_M532x)
1220#ifdef CONFIG_RPXCLASSIC 1235#ifdef CONFIG_RPXCLASSIC
1221static void 1236static void
1222mii_link_interrupt(void *dev_id); 1237mii_link_interrupt(void *dev_id);
@@ -1224,6 +1239,7 @@ mii_link_interrupt(void *dev_id);
1224static irqreturn_t 1239static irqreturn_t
1225mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs); 1240mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs);
1226#endif 1241#endif
1242#endif
1227 1243
1228#if defined(CONFIG_M5272) 1244#if defined(CONFIG_M5272)
1229 1245
@@ -1384,13 +1400,13 @@ static void __inline__ fec_request_intrs(struct net_device *dev)
1384 { 1400 {
1385 volatile unsigned char *icrp; 1401 volatile unsigned char *icrp;
1386 volatile unsigned long *imrp; 1402 volatile unsigned long *imrp;
1387 int i; 1403 int i, ilip;
1388 1404
1389 b = (fep->index) ? MCFICM_INTC1 : MCFICM_INTC0; 1405 b = (fep->index) ? MCFICM_INTC1 : MCFICM_INTC0;
1390 icrp = (volatile unsigned char *) (MCF_IPSBAR + b + 1406 icrp = (volatile unsigned char *) (MCF_IPSBAR + b +
1391 MCFINTC_ICR0); 1407 MCFINTC_ICR0);
1392 for (i = 23; (i < 36); i++) 1408 for (i = 23, ilip = 0x28; (i < 36); i++)
1393 icrp[i] = 0x23; 1409 icrp[i] = ilip--;
1394 1410
1395 imrp = (volatile unsigned long *) (MCF_IPSBAR + b + 1411 imrp = (volatile unsigned long *) (MCF_IPSBAR + b +
1396 MCFINTC_IMRH); 1412 MCFINTC_IMRH);
@@ -1618,6 +1634,159 @@ static void __inline__ fec_uncache(unsigned long addr)
1618 1634
1619/* ------------------------------------------------------------------------- */ 1635/* ------------------------------------------------------------------------- */
1620 1636
1637#elif defined(CONFIG_M532x)
1638/*
1639 * Code specific for M532x
1640 */
1641static void __inline__ fec_request_intrs(struct net_device *dev)
1642{
1643 struct fec_enet_private *fep;
1644 int b;
1645 static const struct idesc {
1646 char *name;
1647 unsigned short irq;
1648 } *idp, id[] = {
1649 { "fec(TXF)", 36 },
1650 { "fec(TXB)", 37 },
1651 { "fec(TXFIFO)", 38 },
1652 { "fec(TXCR)", 39 },
1653 { "fec(RXF)", 40 },
1654 { "fec(RXB)", 41 },
1655 { "fec(MII)", 42 },
1656 { "fec(LC)", 43 },
1657 { "fec(HBERR)", 44 },
1658 { "fec(GRA)", 45 },
1659 { "fec(EBERR)", 46 },
1660 { "fec(BABT)", 47 },
1661 { "fec(BABR)", 48 },
1662 { NULL },
1663 };
1664
1665 fep = netdev_priv(dev);
1666 b = (fep->index) ? 128 : 64;
1667
1668 /* Setup interrupt handlers. */
1669 for (idp = id; idp->name; idp++) {
1670 if (request_irq(b+idp->irq,fec_enet_interrupt,0,idp->name,dev)!=0)
1671 printk("FEC: Could not allocate %s IRQ(%d)!\n",
1672 idp->name, b+idp->irq);
1673 }
1674
1675 /* Unmask interrupts */
1676 MCF_INTC0_ICR36 = 0x2;
1677 MCF_INTC0_ICR37 = 0x2;
1678 MCF_INTC0_ICR38 = 0x2;
1679 MCF_INTC0_ICR39 = 0x2;
1680 MCF_INTC0_ICR40 = 0x2;
1681 MCF_INTC0_ICR41 = 0x2;
1682 MCF_INTC0_ICR42 = 0x2;
1683 MCF_INTC0_ICR43 = 0x2;
1684 MCF_INTC0_ICR44 = 0x2;
1685 MCF_INTC0_ICR45 = 0x2;
1686 MCF_INTC0_ICR46 = 0x2;
1687 MCF_INTC0_ICR47 = 0x2;
1688 MCF_INTC0_ICR48 = 0x2;
1689
1690 MCF_INTC0_IMRH &= ~(
1691 MCF_INTC_IMRH_INT_MASK36 |
1692 MCF_INTC_IMRH_INT_MASK37 |
1693 MCF_INTC_IMRH_INT_MASK38 |
1694 MCF_INTC_IMRH_INT_MASK39 |
1695 MCF_INTC_IMRH_INT_MASK40 |
1696 MCF_INTC_IMRH_INT_MASK41 |
1697 MCF_INTC_IMRH_INT_MASK42 |
1698 MCF_INTC_IMRH_INT_MASK43 |
1699 MCF_INTC_IMRH_INT_MASK44 |
1700 MCF_INTC_IMRH_INT_MASK45 |
1701 MCF_INTC_IMRH_INT_MASK46 |
1702 MCF_INTC_IMRH_INT_MASK47 |
1703 MCF_INTC_IMRH_INT_MASK48 );
1704
1705 /* Set up gpio outputs for MII lines */
1706 MCF_GPIO_PAR_FECI2C |= (0 |
1707 MCF_GPIO_PAR_FECI2C_PAR_MDC_EMDC |
1708 MCF_GPIO_PAR_FECI2C_PAR_MDIO_EMDIO);
1709 MCF_GPIO_PAR_FEC = (0 |
1710 MCF_GPIO_PAR_FEC_PAR_FEC_7W_FEC |
1711 MCF_GPIO_PAR_FEC_PAR_FEC_MII_FEC);
1712}
1713
1714static void __inline__ fec_set_mii(struct net_device *dev, struct fec_enet_private *fep)
1715{
1716 volatile fec_t *fecp;
1717
1718 fecp = fep->hwp;
1719 fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x04;
1720 fecp->fec_x_cntrl = 0x00;
1721
1722 /*
1723 * Set MII speed to 2.5 MHz
1724 */
1725 fep->phy_speed = ((((MCF_CLK / 2) / (2500000 / 10)) + 5) / 10) * 2;
1726 fecp->fec_mii_speed = fep->phy_speed;
1727
1728 fec_restart(dev, 0);
1729}
1730
1731static void __inline__ fec_get_mac(struct net_device *dev)
1732{
1733 struct fec_enet_private *fep = netdev_priv(dev);
1734 volatile fec_t *fecp;
1735 unsigned char *iap, tmpaddr[ETH_ALEN];
1736
1737 fecp = fep->hwp;
1738
1739 if (FEC_FLASHMAC) {
1740 /*
1741 * Get MAC address from FLASH.
1742 * If it is all 1's or 0's, use the default.
1743 */
1744 iap = FEC_FLASHMAC;
1745 if ((iap[0] == 0) && (iap[1] == 0) && (iap[2] == 0) &&
1746 (iap[3] == 0) && (iap[4] == 0) && (iap[5] == 0))
1747 iap = fec_mac_default;
1748 if ((iap[0] == 0xff) && (iap[1] == 0xff) && (iap[2] == 0xff) &&
1749 (iap[3] == 0xff) && (iap[4] == 0xff) && (iap[5] == 0xff))
1750 iap = fec_mac_default;
1751 } else {
1752 *((unsigned long *) &tmpaddr[0]) = fecp->fec_addr_low;
1753 *((unsigned short *) &tmpaddr[4]) = (fecp->fec_addr_high >> 16);
1754 iap = &tmpaddr[0];
1755 }
1756
1757 memcpy(dev->dev_addr, iap, ETH_ALEN);
1758
1759 /* Adjust MAC if using default MAC address */
1760 if (iap == fec_mac_default)
1761 dev->dev_addr[ETH_ALEN-1] = fec_mac_default[ETH_ALEN-1] + fep->index;
1762}
1763
1764static void __inline__ fec_enable_phy_intr(void)
1765{
1766}
1767
1768static void __inline__ fec_disable_phy_intr(void)
1769{
1770}
1771
1772static void __inline__ fec_phy_ack_intr(void)
1773{
1774}
1775
1776static void __inline__ fec_localhw_setup(void)
1777{
1778}
1779
1780/*
1781 * Do not need to make region uncached on 532x.
1782 */
1783static void __inline__ fec_uncache(unsigned long addr)
1784{
1785}
1786
1787/* ------------------------------------------------------------------------- */
1788
1789
1621#else 1790#else
1622 1791
1623/* 1792/*
@@ -1985,9 +2154,12 @@ fec_enet_open(struct net_device *dev)
1985 mii_do_cmd(dev, fep->phy->config); 2154 mii_do_cmd(dev, fep->phy->config);
1986 mii_do_cmd(dev, phy_cmd_config); /* display configuration */ 2155 mii_do_cmd(dev, phy_cmd_config); /* display configuration */
1987 2156
1988 /* FIXME: use netif_carrier_{on,off} ; this polls 2157 /* Poll until the PHY tells us its configuration
1989 * until link is up which is wrong... could be 2158 * (not link state).
1990 * 30 seconds or more we are trapped in here. -jgarzik 2159 * Request is initiated by mii_do_cmd above, but answer
2160 * comes by interrupt.
2161 * This should take about 25 usec per register at 2.5 MHz,
2162 * and we read approximately 5 registers.
1991 */ 2163 */
1992 while(!fep->sequence_done) 2164 while(!fep->sequence_done)
1993 schedule(); 2165 schedule();
@@ -2253,15 +2425,11 @@ int __init fec_enet_init(struct net_device *dev)
2253 */ 2425 */
2254 fec_request_intrs(dev); 2426 fec_request_intrs(dev);
2255 2427
2256 /* Clear and enable interrupts */
2257 fecp->fec_ievent = 0xffc00000;
2258 fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_TXB |
2259 FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII);
2260 fecp->fec_hash_table_high = 0; 2428 fecp->fec_hash_table_high = 0;
2261 fecp->fec_hash_table_low = 0; 2429 fecp->fec_hash_table_low = 0;
2262 fecp->fec_r_buff_size = PKT_MAXBLR_SIZE; 2430 fecp->fec_r_buff_size = PKT_MAXBLR_SIZE;
2263 fecp->fec_ecntrl = 2; 2431 fecp->fec_ecntrl = 2;
2264 fecp->fec_r_des_active = 0x01000000; 2432 fecp->fec_r_des_active = 0;
2265 2433
2266 dev->base_addr = (unsigned long)fecp; 2434 dev->base_addr = (unsigned long)fecp;
2267 2435
@@ -2281,6 +2449,11 @@ int __init fec_enet_init(struct net_device *dev)
2281 /* setup MII interface */ 2449 /* setup MII interface */
2282 fec_set_mii(dev, fep); 2450 fec_set_mii(dev, fep);
2283 2451
2452 /* Clear and enable interrupts */
2453 fecp->fec_ievent = 0xffc00000;
2454 fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_TXB |
2455 FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII);
2456
2284 /* Queue up command to detect the PHY and initialize the 2457 /* Queue up command to detect the PHY and initialize the
2285 * remainder of the interface. 2458 * remainder of the interface.
2286 */ 2459 */
@@ -2312,11 +2485,6 @@ fec_restart(struct net_device *dev, int duplex)
2312 fecp->fec_ecntrl = 1; 2485 fecp->fec_ecntrl = 1;
2313 udelay(10); 2486 udelay(10);
2314 2487
2315 /* Enable interrupts we wish to service.
2316 */
2317 fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_TXB |
2318 FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII);
2319
2320 /* Clear any outstanding interrupt. 2488 /* Clear any outstanding interrupt.
2321 */ 2489 */
2322 fecp->fec_ievent = 0xffc00000; 2490 fecp->fec_ievent = 0xffc00000;
@@ -2408,7 +2576,12 @@ fec_restart(struct net_device *dev, int duplex)
2408 /* And last, enable the transmit and receive processing. 2576 /* And last, enable the transmit and receive processing.
2409 */ 2577 */
2410 fecp->fec_ecntrl = 2; 2578 fecp->fec_ecntrl = 2;
2411 fecp->fec_r_des_active = 0x01000000; 2579 fecp->fec_r_des_active = 0;
2580
2581 /* Enable interrupts we wish to service.
2582 */
2583 fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_TXB |
2584 FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII);
2412} 2585}
2413 2586
2414static void 2587static void
@@ -2420,9 +2593,16 @@ fec_stop(struct net_device *dev)
2420 fep = netdev_priv(dev); 2593 fep = netdev_priv(dev);
2421 fecp = fep->hwp; 2594 fecp = fep->hwp;
2422 2595
2423 fecp->fec_x_cntrl = 0x01; /* Graceful transmit stop */ 2596 /*
2424 2597 ** We cannot expect a graceful transmit stop without link !!!
2425 while(!(fecp->fec_ievent & FEC_ENET_GRA)); 2598 */
2599 if (fep->link)
2600 {
2601 fecp->fec_x_cntrl = 0x01; /* Graceful transmit stop */
2602 udelay(10);
2603 if (!(fecp->fec_ievent & FEC_ENET_GRA))
2604 printk("fec_stop : Graceful transmit stop did not complete !\n");
2605 }
2426 2606
2427 /* Whack a reset. We should wait for this. 2607 /* Whack a reset. We should wait for this.
2428 */ 2608 */
diff --git a/drivers/net/fs_enet/fs_enet-mii.c b/drivers/net/fs_enet/fs_enet-mii.c
index c6770377ef87..0cd07150bf4a 100644
--- a/drivers/net/fs_enet/fs_enet-mii.c
+++ b/drivers/net/fs_enet/fs_enet-mii.c
@@ -431,8 +431,7 @@ static struct fs_enet_mii_bus *create_bus(const struct fs_mii_bus_info *bi)
431 return bus; 431 return bus;
432 432
433err: 433err:
434 if (bus) 434 kfree(bus);
435 kfree(bus);
436 return ERR_PTR(ret); 435 return ERR_PTR(ret);
437} 436}
438 437
diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c
index 0d5fccc984bb..c9a46b89942a 100644
--- a/drivers/net/hamradio/dmascc.c
+++ b/drivers/net/hamradio/dmascc.c
@@ -436,7 +436,7 @@ static int __init dmascc_init(void)
436module_init(dmascc_init); 436module_init(dmascc_init);
437module_exit(dmascc_exit); 437module_exit(dmascc_exit);
438 438
439static void dev_setup(struct net_device *dev) 439static void __init dev_setup(struct net_device *dev)
440{ 440{
441 dev->type = ARPHRD_AX25; 441 dev->type = ARPHRD_AX25;
442 dev->hard_header_len = AX25_MAX_HEADER_LEN; 442 dev->hard_header_len = AX25_MAX_HEADER_LEN;
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 2e4ecedba057..5657049c2160 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -226,7 +226,6 @@ static int full_duplex[MAX_UNITS];
226 NATSEMI_PG1_NREGS) 226 NATSEMI_PG1_NREGS)
227#define NATSEMI_REGS_VER 1 /* v1 added RFDR registers */ 227#define NATSEMI_REGS_VER 1 /* v1 added RFDR registers */
228#define NATSEMI_REGS_SIZE (NATSEMI_NREGS * sizeof(u32)) 228#define NATSEMI_REGS_SIZE (NATSEMI_NREGS * sizeof(u32))
229#define NATSEMI_DEF_EEPROM_SIZE 24 /* 12 16-bit values */
230 229
231/* Buffer sizes: 230/* Buffer sizes:
232 * The nic writes 32-bit values, even if the upper bytes of 231 * The nic writes 32-bit values, even if the upper bytes of
@@ -344,18 +343,6 @@ None characterised.
344 343
345 344
346 345
347enum pcistuff {
348 PCI_USES_IO = 0x01,
349 PCI_USES_MEM = 0x02,
350 PCI_USES_MASTER = 0x04,
351 PCI_ADDR0 = 0x08,
352 PCI_ADDR1 = 0x10,
353};
354
355/* MMIO operations required */
356#define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_MEM | PCI_ADDR1)
357
358
359/* 346/*
360 * Support for fibre connections on Am79C874: 347 * Support for fibre connections on Am79C874:
361 * This phy needs a special setup when connected to a fibre cable. 348 * This phy needs a special setup when connected to a fibre cable.
@@ -363,22 +350,25 @@ enum pcistuff {
363 */ 350 */
364#define PHYID_AM79C874 0x0022561b 351#define PHYID_AM79C874 0x0022561b
365 352
366#define MII_MCTRL 0x15 /* mode control register */ 353enum {
367#define MII_FX_SEL 0x0001 /* 100BASE-FX (fiber) */ 354 MII_MCTRL = 0x15, /* mode control register */
368#define MII_EN_SCRM 0x0004 /* enable scrambler (tp) */ 355 MII_FX_SEL = 0x0001, /* 100BASE-FX (fiber) */
356 MII_EN_SCRM = 0x0004, /* enable scrambler (tp) */
357};
369 358
370 359
371/* array of board data directly indexed by pci_tbl[x].driver_data */ 360/* array of board data directly indexed by pci_tbl[x].driver_data */
372static const struct { 361static const struct {
373 const char *name; 362 const char *name;
374 unsigned long flags; 363 unsigned long flags;
364 unsigned int eeprom_size;
375} natsemi_pci_info[] __devinitdata = { 365} natsemi_pci_info[] __devinitdata = {
376 { "NatSemi DP8381[56]", PCI_IOTYPE }, 366 { "NatSemi DP8381[56]", 0, 24 },
377}; 367};
378 368
379static struct pci_device_id natsemi_pci_tbl[] = { 369static const struct pci_device_id natsemi_pci_tbl[] __devinitdata = {
380 { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_83815, PCI_ANY_ID, PCI_ANY_ID, }, 370 { PCI_VENDOR_ID_NS, 0x0020, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
381 { 0, }, 371 { } /* terminate list */
382}; 372};
383MODULE_DEVICE_TABLE(pci, natsemi_pci_tbl); 373MODULE_DEVICE_TABLE(pci, natsemi_pci_tbl);
384 374
@@ -813,6 +803,42 @@ static void move_int_phy(struct net_device *dev, int addr)
813 udelay(1); 803 udelay(1);
814} 804}
815 805
806static void __devinit natsemi_init_media (struct net_device *dev)
807{
808 struct netdev_private *np = netdev_priv(dev);
809 u32 tmp;
810
811 netif_carrier_off(dev);
812
813 /* get the initial settings from hardware */
814 tmp = mdio_read(dev, MII_BMCR);
815 np->speed = (tmp & BMCR_SPEED100)? SPEED_100 : SPEED_10;
816 np->duplex = (tmp & BMCR_FULLDPLX)? DUPLEX_FULL : DUPLEX_HALF;
817 np->autoneg = (tmp & BMCR_ANENABLE)? AUTONEG_ENABLE: AUTONEG_DISABLE;
818 np->advertising= mdio_read(dev, MII_ADVERTISE);
819
820 if ((np->advertising & ADVERTISE_ALL) != ADVERTISE_ALL
821 && netif_msg_probe(np)) {
822 printk(KERN_INFO "natsemi %s: Transceiver default autonegotiation %s "
823 "10%s %s duplex.\n",
824 pci_name(np->pci_dev),
825 (mdio_read(dev, MII_BMCR) & BMCR_ANENABLE)?
826 "enabled, advertise" : "disabled, force",
827 (np->advertising &
828 (ADVERTISE_100FULL|ADVERTISE_100HALF))?
829 "0" : "",
830 (np->advertising &
831 (ADVERTISE_100FULL|ADVERTISE_10FULL))?
832 "full" : "half");
833 }
834 if (netif_msg_probe(np))
835 printk(KERN_INFO
836 "natsemi %s: Transceiver status %#04x advertising %#04x.\n",
837 pci_name(np->pci_dev), mdio_read(dev, MII_BMSR),
838 np->advertising);
839
840}
841
816static int __devinit natsemi_probe1 (struct pci_dev *pdev, 842static int __devinit natsemi_probe1 (struct pci_dev *pdev,
817 const struct pci_device_id *ent) 843 const struct pci_device_id *ent)
818{ 844{
@@ -852,8 +878,7 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
852 iosize = pci_resource_len(pdev, pcibar); 878 iosize = pci_resource_len(pdev, pcibar);
853 irq = pdev->irq; 879 irq = pdev->irq;
854 880
855 if (natsemi_pci_info[chip_idx].flags & PCI_USES_MASTER) 881 pci_set_master(pdev);
856 pci_set_master(pdev);
857 882
858 dev = alloc_etherdev(sizeof (struct netdev_private)); 883 dev = alloc_etherdev(sizeof (struct netdev_private));
859 if (!dev) 884 if (!dev)
@@ -892,7 +917,7 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
892 np->msg_enable = (debug >= 0) ? (1<<debug)-1 : NATSEMI_DEF_MSG; 917 np->msg_enable = (debug >= 0) ? (1<<debug)-1 : NATSEMI_DEF_MSG;
893 np->hands_off = 0; 918 np->hands_off = 0;
894 np->intr_status = 0; 919 np->intr_status = 0;
895 np->eeprom_size = NATSEMI_DEF_EEPROM_SIZE; 920 np->eeprom_size = natsemi_pci_info[chip_idx].eeprom_size;
896 921
897 /* Initial port: 922 /* Initial port:
898 * - If the nic was configured to use an external phy and if find_mii 923 * - If the nic was configured to use an external phy and if find_mii
@@ -957,34 +982,7 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
957 if (mtu) 982 if (mtu)
958 dev->mtu = mtu; 983 dev->mtu = mtu;
959 984
960 netif_carrier_off(dev); 985 natsemi_init_media(dev);
961
962 /* get the initial settings from hardware */
963 tmp = mdio_read(dev, MII_BMCR);
964 np->speed = (tmp & BMCR_SPEED100)? SPEED_100 : SPEED_10;
965 np->duplex = (tmp & BMCR_FULLDPLX)? DUPLEX_FULL : DUPLEX_HALF;
966 np->autoneg = (tmp & BMCR_ANENABLE)? AUTONEG_ENABLE: AUTONEG_DISABLE;
967 np->advertising= mdio_read(dev, MII_ADVERTISE);
968
969 if ((np->advertising & ADVERTISE_ALL) != ADVERTISE_ALL
970 && netif_msg_probe(np)) {
971 printk(KERN_INFO "natsemi %s: Transceiver default autonegotiation %s "
972 "10%s %s duplex.\n",
973 pci_name(np->pci_dev),
974 (mdio_read(dev, MII_BMCR) & BMCR_ANENABLE)?
975 "enabled, advertise" : "disabled, force",
976 (np->advertising &
977 (ADVERTISE_100FULL|ADVERTISE_100HALF))?
978 "0" : "",
979 (np->advertising &
980 (ADVERTISE_100FULL|ADVERTISE_10FULL))?
981 "full" : "half");
982 }
983 if (netif_msg_probe(np))
984 printk(KERN_INFO
985 "natsemi %s: Transceiver status %#04x advertising %#04x.\n",
986 pci_name(np->pci_dev), mdio_read(dev, MII_BMSR),
987 np->advertising);
988 986
989 /* save the silicon revision for later querying */ 987 /* save the silicon revision for later querying */
990 np->srr = readl(ioaddr + SiliconRev); 988 np->srr = readl(ioaddr + SiliconRev);
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index fc08c4af506c..0e01c75da429 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -309,12 +309,6 @@ static int pcnet32_alloc_ring(struct net_device *dev, char *name);
309static void pcnet32_free_ring(struct net_device *dev); 309static void pcnet32_free_ring(struct net_device *dev);
310static void pcnet32_check_media(struct net_device *dev, int verbose); 310static void pcnet32_check_media(struct net_device *dev, int verbose);
311 311
312enum pci_flags_bit {
313 PCI_USES_IO = 1, PCI_USES_MEM = 2, PCI_USES_MASTER = 4,
314 PCI_ADDR0 = 0x10 << 0, PCI_ADDR1 = 0x10 << 1, PCI_ADDR2 =
315 0x10 << 2, PCI_ADDR3 = 0x10 << 3,
316};
317
318static u16 pcnet32_wio_read_csr(unsigned long addr, int index) 312static u16 pcnet32_wio_read_csr(unsigned long addr, int index)
319{ 313{
320 outw(index, addr + PCNET32_WIO_RAP); 314 outw(index, addr + PCNET32_WIO_RAP);
diff --git a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c
index bef79e454c33..3f702c503afe 100644
--- a/drivers/net/phy/lxt.c
+++ b/drivers/net/phy/lxt.c
@@ -123,9 +123,9 @@ static int lxt971_config_intr(struct phy_device *phydev)
123} 123}
124 124
125static struct phy_driver lxt970_driver = { 125static struct phy_driver lxt970_driver = {
126 .phy_id = 0x07810000, 126 .phy_id = 0x78100000,
127 .name = "LXT970", 127 .name = "LXT970",
128 .phy_id_mask = 0x0fffffff, 128 .phy_id_mask = 0xfffffff0,
129 .features = PHY_BASIC_FEATURES, 129 .features = PHY_BASIC_FEATURES,
130 .flags = PHY_HAS_INTERRUPT, 130 .flags = PHY_HAS_INTERRUPT,
131 .config_init = lxt970_config_init, 131 .config_init = lxt970_config_init,
@@ -137,9 +137,9 @@ static struct phy_driver lxt970_driver = {
137}; 137};
138 138
139static struct phy_driver lxt971_driver = { 139static struct phy_driver lxt971_driver = {
140 .phy_id = 0x0001378e, 140 .phy_id = 0x001378e0,
141 .name = "LXT971", 141 .name = "LXT971",
142 .phy_id_mask = 0x0fffffff, 142 .phy_id_mask = 0xfffffff0,
143 .features = PHY_BASIC_FEATURES, 143 .features = PHY_BASIC_FEATURES,
144 .flags = PHY_HAS_INTERRUPT, 144 .flags = PHY_HAS_INTERRUPT,
145 .config_aneg = genphy_config_aneg, 145 .config_aneg = genphy_config_aneg,
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index d643a097faa5..425ff5b117f1 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -28,7 +28,6 @@
28#include <linux/kmod.h> 28#include <linux/kmod.h>
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/list.h> 30#include <linux/list.h>
31#include <linux/devfs_fs_kernel.h>
32#include <linux/netdevice.h> 31#include <linux/netdevice.h>
33#include <linux/poll.h> 32#include <linux/poll.h>
34#include <linux/ppp_defs.h> 33#include <linux/ppp_defs.h>
@@ -863,10 +862,6 @@ static int __init ppp_init(void)
863 goto out_chrdev; 862 goto out_chrdev;
864 } 863 }
865 class_device_create(ppp_class, NULL, MKDEV(PPP_MAJOR, 0), NULL, "ppp"); 864 class_device_create(ppp_class, NULL, MKDEV(PPP_MAJOR, 0), NULL, "ppp");
866 err = devfs_mk_cdev(MKDEV(PPP_MAJOR, 0),
867 S_IFCHR|S_IRUSR|S_IWUSR, "ppp");
868 if (err)
869 goto out_class;
870 } 865 }
871 866
872out: 867out:
@@ -874,9 +869,6 @@ out:
874 printk(KERN_ERR "failed to register PPP device (%d)\n", err); 869 printk(KERN_ERR "failed to register PPP device (%d)\n", err);
875 return err; 870 return err;
876 871
877out_class:
878 class_device_destroy(ppp_class, MKDEV(PPP_MAJOR,0));
879 class_destroy(ppp_class);
880out_chrdev: 872out_chrdev:
881 unregister_chrdev(PPP_MAJOR, "ppp"); 873 unregister_chrdev(PPP_MAJOR, "ppp");
882 goto out; 874 goto out;
@@ -2681,7 +2673,6 @@ static void __exit ppp_cleanup(void)
2681 cardmap_destroy(&all_ppp_units); 2673 cardmap_destroy(&all_ppp_units);
2682 if (unregister_chrdev(PPP_MAJOR, "ppp") != 0) 2674 if (unregister_chrdev(PPP_MAJOR, "ppp") != 0)
2683 printk(KERN_ERR "PPP: failed to unregister PPP device\n"); 2675 printk(KERN_ERR "PPP: failed to unregister PPP device\n");
2684 devfs_remove("ppp");
2685 class_device_destroy(ppp_class, MKDEV(PPP_MAJOR, 0)); 2676 class_device_destroy(ppp_class, MKDEV(PPP_MAJOR, 0));
2686 class_destroy(ppp_class); 2677 class_destroy(ppp_class);
2687} 2678}
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 19a4a16055dc..1608efab4e3d 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -3354,8 +3354,8 @@ static int __devinit skge_probe(struct pci_dev *pdev,
3354 if (err) 3354 if (err)
3355 goto err_out_free_irq; 3355 goto err_out_free_irq;
3356 3356
3357 printk(KERN_INFO PFX DRV_VERSION " addr 0x%lx irq %d chip %s rev %d\n", 3357 printk(KERN_INFO PFX DRV_VERSION " addr 0x%llx irq %d chip %s rev %d\n",
3358 pci_resource_start(pdev, 0), pdev->irq, 3358 (unsigned long long)pci_resource_start(pdev, 0), pdev->irq,
3359 skge_board_name(hw), hw->chip_rev); 3359 skge_board_name(hw), hw->chip_rev);
3360 3360
3361 if ((dev = skge_devinit(hw, 0, using_dac)) == NULL) 3361 if ((dev = skge_devinit(hw, 0, using_dac)) == NULL)
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index d3577871be28..e122007e16da 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3311,9 +3311,9 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
3311 if (err) 3311 if (err)
3312 goto err_out_iounmap; 3312 goto err_out_iounmap;
3313 3313
3314 printk(KERN_INFO PFX "v%s addr 0x%lx irq %d Yukon-%s (0x%x) rev %d\n", 3314 printk(KERN_INFO PFX "v%s addr 0x%llx irq %d Yukon-%s (0x%x) rev %d\n",
3315 DRV_VERSION, pci_resource_start(pdev, 0), pdev->irq, 3315 DRV_VERSION, (unsigned long long)pci_resource_start(pdev, 0),
3316 yukon2_name[hw->chip_id - CHIP_ID_YUKON_XL], 3316 pdev->irq, yukon2_name[hw->chip_id - CHIP_ID_YUKON_XL],
3317 hw->chip_id, hw->chip_rev); 3317 hw->chip_id, hw->chip_rev);
3318 3318
3319 dev = sky2_init_netdev(hw, 0, using_dac); 3319 dev = sky2_init_netdev(hw, 0, using_dac);
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index 5f743b972949..fc2468ecce0b 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -2007,8 +2007,8 @@ static int __init de_init_one (struct pci_dev *pdev,
2007 } 2007 }
2008 if (pci_resource_len(pdev, 1) < DE_REGS_SIZE) { 2008 if (pci_resource_len(pdev, 1) < DE_REGS_SIZE) {
2009 rc = -EIO; 2009 rc = -EIO;
2010 printk(KERN_ERR PFX "MMIO resource (%lx) too small on pci dev %s\n", 2010 printk(KERN_ERR PFX "MMIO resource (%llx) too small on pci dev %s\n",
2011 pci_resource_len(pdev, 1), pci_name(pdev)); 2011 (unsigned long long)pci_resource_len(pdev, 1), pci_name(pdev));
2012 goto err_out_res; 2012 goto err_out_res;
2013 } 2013 }
2014 2014
@@ -2016,8 +2016,9 @@ static int __init de_init_one (struct pci_dev *pdev,
2016 regs = ioremap_nocache(pciaddr, DE_REGS_SIZE); 2016 regs = ioremap_nocache(pciaddr, DE_REGS_SIZE);
2017 if (!regs) { 2017 if (!regs) {
2018 rc = -EIO; 2018 rc = -EIO;
2019 printk(KERN_ERR PFX "Cannot map PCI MMIO (%lx@%lx) on pci dev %s\n", 2019 printk(KERN_ERR PFX "Cannot map PCI MMIO (%llx@%lx) on pci dev %s\n",
2020 pci_resource_len(pdev, 1), pciaddr, pci_name(pdev)); 2020 (unsigned long long)pci_resource_len(pdev, 1),
2021 pciaddr, pci_name(pdev));
2021 goto err_out_res; 2022 goto err_out_res;
2022 } 2023 }
2023 dev->base_addr = (unsigned long) regs; 2024 dev->base_addr = (unsigned long) regs;
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index e0de66739a42..53fd9b56d0bd 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -1350,10 +1350,10 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
1350 SET_MODULE_OWNER(dev); 1350 SET_MODULE_OWNER(dev);
1351 SET_NETDEV_DEV(dev, &pdev->dev); 1351 SET_NETDEV_DEV(dev, &pdev->dev);
1352 if (pci_resource_len (pdev, 0) < tulip_tbl[chip_idx].io_size) { 1352 if (pci_resource_len (pdev, 0) < tulip_tbl[chip_idx].io_size) {
1353 printk (KERN_ERR PFX "%s: I/O region (0x%lx@0x%lx) too small, " 1353 printk (KERN_ERR PFX "%s: I/O region (0x%llx@0x%llx) too small, "
1354 "aborting\n", pci_name(pdev), 1354 "aborting\n", pci_name(pdev),
1355 pci_resource_len (pdev, 0), 1355 (unsigned long long)pci_resource_len (pdev, 0),
1356 pci_resource_start (pdev, 0)); 1356 (unsigned long long)pci_resource_start (pdev, 0));
1357 goto err_out_free_netdev; 1357 goto err_out_free_netdev;
1358 } 1358 }
1359 1359
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index 8fea2aa455d4..602a6e5002a0 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -212,26 +212,15 @@ Test with 'ping -s 10000' on a fast computer.
212/* 212/*
213 PCI probe table. 213 PCI probe table.
214*/ 214*/
215enum pci_id_flags_bits {
216 /* Set PCI command register bits before calling probe1(). */
217 PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4,
218 /* Read and map the single following PCI BAR. */
219 PCI_ADDR0=0<<4, PCI_ADDR1=1<<4, PCI_ADDR2=2<<4, PCI_ADDR3=3<<4,
220 PCI_ADDR_64BITS=0x100, PCI_NO_ACPI_WAKE=0x200, PCI_NO_MIN_LATENCY=0x400,
221};
222enum chip_capability_flags { 215enum chip_capability_flags {
223 CanHaveMII=1, HasBrokenTx=2, AlwaysFDX=4, FDXOnNoMII=8,}; 216 CanHaveMII=1, HasBrokenTx=2, AlwaysFDX=4, FDXOnNoMII=8,
224#ifdef USE_IO_OPS 217};
225#define W840_FLAGS (PCI_USES_IO | PCI_ADDR0 | PCI_USES_MASTER)
226#else
227#define W840_FLAGS (PCI_USES_MEM | PCI_ADDR1 | PCI_USES_MASTER)
228#endif
229 218
230static struct pci_device_id w840_pci_tbl[] = { 219static const struct pci_device_id w840_pci_tbl[] = {
231 { 0x1050, 0x0840, PCI_ANY_ID, 0x8153, 0, 0, 0 }, 220 { 0x1050, 0x0840, PCI_ANY_ID, 0x8153, 0, 0, 0 },
232 { 0x1050, 0x0840, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, 221 { 0x1050, 0x0840, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
233 { 0x11f6, 0x2011, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2 }, 222 { 0x11f6, 0x2011, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2 },
234 { 0, } 223 { }
235}; 224};
236MODULE_DEVICE_TABLE(pci, w840_pci_tbl); 225MODULE_DEVICE_TABLE(pci, w840_pci_tbl);
237 226
@@ -241,18 +230,17 @@ struct pci_id_info {
241 int pci, pci_mask, subsystem, subsystem_mask; 230 int pci, pci_mask, subsystem, subsystem_mask;
242 int revision, revision_mask; /* Only 8 bits. */ 231 int revision, revision_mask; /* Only 8 bits. */
243 } id; 232 } id;
244 enum pci_id_flags_bits pci_flags;
245 int io_size; /* Needed for I/O region check or ioremap(). */ 233 int io_size; /* Needed for I/O region check or ioremap(). */
246 int drv_flags; /* Driver use, intended as capability flags. */ 234 int drv_flags; /* Driver use, intended as capability flags. */
247}; 235};
248static struct pci_id_info pci_id_tbl[] = { 236static struct pci_id_info pci_id_tbl[] = {
249 {"Winbond W89c840", /* Sometime a Level-One switch card. */ 237 {"Winbond W89c840", /* Sometime a Level-One switch card. */
250 { 0x08401050, 0xffffffff, 0x81530000, 0xffff0000 }, 238 { 0x08401050, 0xffffffff, 0x81530000, 0xffff0000 },
251 W840_FLAGS, 128, CanHaveMII | HasBrokenTx | FDXOnNoMII}, 239 128, CanHaveMII | HasBrokenTx | FDXOnNoMII},
252 {"Winbond W89c840", { 0x08401050, 0xffffffff, }, 240 {"Winbond W89c840", { 0x08401050, 0xffffffff, },
253 W840_FLAGS, 128, CanHaveMII | HasBrokenTx}, 241 128, CanHaveMII | HasBrokenTx},
254 {"Compex RL100-ATX", { 0x201111F6, 0xffffffff,}, 242 {"Compex RL100-ATX", { 0x201111F6, 0xffffffff,},
255 W840_FLAGS, 128, CanHaveMII | HasBrokenTx}, 243 128, CanHaveMII | HasBrokenTx},
256 {NULL,}, /* 0 terminated list. */ 244 {NULL,}, /* 0 terminated list. */
257}; 245};
258 246
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 6c62d5c88268..732c5edec2e5 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -780,7 +780,6 @@ static struct miscdevice tun_miscdev = {
780 .minor = TUN_MINOR, 780 .minor = TUN_MINOR,
781 .name = "tun", 781 .name = "tun",
782 .fops = &tun_fops, 782 .fops = &tun_fops,
783 .devfs_name = "net/tun",
784}; 783};
785 784
786/* ethtool interface */ 785/* ethtool interface */
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index e49e8b520c28..e24d2dafcf6c 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -2568,9 +2568,10 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2568 2568
2569 pci_set_drvdata(pdev, dev); 2569 pci_set_drvdata(pdev, dev);
2570 2570
2571 printk(KERN_INFO "%s: %s at %s 0x%lx, ", 2571 printk(KERN_INFO "%s: %s at %s 0x%llx, ",
2572 dev->name, typhoon_card_info[card_id].name, 2572 dev->name, typhoon_card_info[card_id].name,
2573 use_mmio ? "MMIO" : "IO", pci_resource_start(pdev, use_mmio)); 2573 use_mmio ? "MMIO" : "IO",
2574 (unsigned long long)pci_resource_start(pdev, use_mmio));
2574 for(i = 0; i < 5; i++) 2575 for(i = 0; i < 5; i++)
2575 printk("%2.2x:", dev->dev_addr[i]); 2576 printk("%2.2x:", dev->dev_addr[i]);
2576 printk("%2.2x\n", dev->dev_addr[i]); 2577 printk("%2.2x\n", dev->dev_addr[i]);
diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c
index b60ef02db7b0..c92ac9fde083 100644
--- a/drivers/net/wan/c101.c
+++ b/drivers/net/wan/c101.c
@@ -7,7 +7,7 @@
7 * under the terms of version 2 of the GNU General Public License 7 * under the terms of version 2 of the GNU General Public License
8 * as published by the Free Software Foundation. 8 * as published by the Free Software Foundation.
9 * 9 *
10 * For information see http://hq.pm.waw.pl/hdlc/ 10 * For information see <http://www.kernel.org/pub/linux/utils/net/hdlc/>
11 * 11 *
12 * Sources of information: 12 * Sources of information:
13 * Hitachi HD64570 SCA User's Manual 13 * Hitachi HD64570 SCA User's Manual
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index e392ee8b37a1..be5e33814cb1 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -85,7 +85,6 @@
85#include <linux/slab.h> 85#include <linux/slab.h>
86#include <linux/poll.h> 86#include <linux/poll.h>
87#include <linux/fs.h> 87#include <linux/fs.h>
88#include <linux/devfs_fs_kernel.h>
89#include <linux/interrupt.h> 88#include <linux/interrupt.h>
90#include <linux/delay.h> 89#include <linux/delay.h>
91#include <linux/errno.h> 90#include <linux/errno.h>
@@ -393,7 +392,6 @@ static int __init cosa_init(void)
393 err = -ENODEV; 392 err = -ENODEV;
394 goto out; 393 goto out;
395 } 394 }
396 devfs_mk_dir("cosa");
397 cosa_class = class_create(THIS_MODULE, "cosa"); 395 cosa_class = class_create(THIS_MODULE, "cosa");
398 if (IS_ERR(cosa_class)) { 396 if (IS_ERR(cosa_class)) {
399 err = PTR_ERR(cosa_class); 397 err = PTR_ERR(cosa_class);
@@ -402,13 +400,6 @@ static int __init cosa_init(void)
402 for (i=0; i<nr_cards; i++) { 400 for (i=0; i<nr_cards; i++) {
403 class_device_create(cosa_class, NULL, MKDEV(cosa_major, i), 401 class_device_create(cosa_class, NULL, MKDEV(cosa_major, i),
404 NULL, "cosa%d", i); 402 NULL, "cosa%d", i);
405 err = devfs_mk_cdev(MKDEV(cosa_major, i),
406 S_IFCHR|S_IRUSR|S_IWUSR,
407 "cosa/%d", i);
408 if (err) {
409 class_device_destroy(cosa_class, MKDEV(cosa_major, i));
410 goto out_chrdev;
411 }
412 } 403 }
413 err = 0; 404 err = 0;
414 goto out; 405 goto out;
@@ -426,12 +417,9 @@ static void __exit cosa_exit(void)
426 int i; 417 int i;
427 printk(KERN_INFO "Unloading the cosa module\n"); 418 printk(KERN_INFO "Unloading the cosa module\n");
428 419
429 for (i=0; i<nr_cards; i++) { 420 for (i=0; i<nr_cards; i++)
430 class_device_destroy(cosa_class, MKDEV(cosa_major, i)); 421 class_device_destroy(cosa_class, MKDEV(cosa_major, i));
431 devfs_remove("cosa/%d", i);
432 }
433 class_destroy(cosa_class); 422 class_destroy(cosa_class);
434 devfs_remove("cosa");
435 for (cosa=cosa_cards; nr_cards--; cosa++) { 423 for (cosa=cosa_cards; nr_cards--; cosa++) {
436 /* Clean up the per-channel data */ 424 /* Clean up the per-channel data */
437 for (i=0; i<cosa->nchannels; i++) { 425 for (i=0; i<cosa->nchannels; i++) {
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index 4505540e3c59..04a376ec0ed8 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -732,15 +732,15 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,
732 ioaddr = ioremap(pci_resource_start(pdev, 0), 732 ioaddr = ioremap(pci_resource_start(pdev, 0),
733 pci_resource_len(pdev, 0)); 733 pci_resource_len(pdev, 0));
734 if (!ioaddr) { 734 if (!ioaddr) {
735 printk(KERN_ERR "%s: cannot remap MMIO region %lx @ %lx\n", 735 printk(KERN_ERR "%s: cannot remap MMIO region %llx @ %llx\n",
736 DRV_NAME, pci_resource_len(pdev, 0), 736 DRV_NAME, (unsigned long long)pci_resource_len(pdev, 0),
737 pci_resource_start(pdev, 0)); 737 (unsigned long long)pci_resource_start(pdev, 0));
738 rc = -EIO; 738 rc = -EIO;
739 goto err_free_mmio_regions_2; 739 goto err_free_mmio_regions_2;
740 } 740 }
741 printk(KERN_DEBUG "Siemens DSCC4, MMIO at %#lx (regs), %#lx (lbi), IRQ %d\n", 741 printk(KERN_DEBUG "Siemens DSCC4, MMIO at %#llx (regs), %#llx (lbi), IRQ %d\n",
742 pci_resource_start(pdev, 0), 742 (unsigned long long)pci_resource_start(pdev, 0),
743 pci_resource_start(pdev, 1), pdev->irq); 743 (unsigned long long)pci_resource_start(pdev, 1), pdev->irq);
744 744
745 /* Cf errata DS5 p.2 */ 745 /* Cf errata DS5 p.2 */
746 pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xf8); 746 pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xf8);
diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c
index b7d88db89a5c..e013b817cab8 100644
--- a/drivers/net/wan/n2.c
+++ b/drivers/net/wan/n2.c
@@ -7,7 +7,7 @@
7 * under the terms of version 2 of the GNU General Public License 7 * under the terms of version 2 of the GNU General Public License
8 * as published by the Free Software Foundation. 8 * as published by the Free Software Foundation.
9 * 9 *
10 * For information see http://hq.pm.waw.pl/hdlc/ 10 * For information see <http://www.kernel.org/pub/linux/utils/net/hdlc/>
11 * 11 *
12 * Note: integrated CSU/DSU/DDS are not supported by this driver 12 * Note: integrated CSU/DSU/DDS are not supported by this driver
13 * 13 *
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c
index a3e65d1bc19b..d7897ae89f90 100644
--- a/drivers/net/wan/pc300_drv.c
+++ b/drivers/net/wan/pc300_drv.c
@@ -3445,9 +3445,9 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3445 3445
3446 card = (pc300_t *) kmalloc(sizeof(pc300_t), GFP_KERNEL); 3446 card = (pc300_t *) kmalloc(sizeof(pc300_t), GFP_KERNEL);
3447 if (card == NULL) { 3447 if (card == NULL) {
3448 printk("PC300 found at RAM 0x%08lx, " 3448 printk("PC300 found at RAM 0x%016llx, "
3449 "but could not allocate card structure.\n", 3449 "but could not allocate card structure.\n",
3450 pci_resource_start(pdev, 3)); 3450 (unsigned long long)pci_resource_start(pdev, 3));
3451 err = -ENOMEM; 3451 err = -ENOMEM;
3452 goto err_disable_dev; 3452 goto err_disable_dev;
3453 } 3453 }
diff --git a/drivers/net/wan/pci200syn.c b/drivers/net/wan/pci200syn.c
index 670e8bd2245c..24c3c57c13c9 100644
--- a/drivers/net/wan/pci200syn.c
+++ b/drivers/net/wan/pci200syn.c
@@ -7,7 +7,7 @@
7 * under the terms of version 2 of the GNU General Public License 7 * under the terms of version 2 of the GNU General Public License
8 * as published by the Free Software Foundation. 8 * as published by the Free Software Foundation.
9 * 9 *
10 * For information see http://hq.pm.waw.pl/hdlc/ 10 * For information see <http://www.kernel.org/pub/linux/utils/net/hdlc/>
11 * 11 *
12 * Sources of information: 12 * Sources of information:
13 * Hitachi HD64572 SCA-II User's Manual 13 * Hitachi HD64572 SCA-II User's Manual
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 081a8999666e..a8a8f975432f 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -1229,12 +1229,6 @@ static struct ipw_fw_error *ipw_alloc_error_log(struct ipw_priv *priv)
1229 return error; 1229 return error;
1230} 1230}
1231 1231
1232static void ipw_free_error_log(struct ipw_fw_error *error)
1233{
1234 if (error)
1235 kfree(error);
1236}
1237
1238static ssize_t show_event_log(struct device *d, 1232static ssize_t show_event_log(struct device *d,
1239 struct device_attribute *attr, char *buf) 1233 struct device_attribute *attr, char *buf)
1240{ 1234{
@@ -1296,10 +1290,9 @@ static ssize_t clear_error(struct device *d,
1296 const char *buf, size_t count) 1290 const char *buf, size_t count)
1297{ 1291{
1298 struct ipw_priv *priv = dev_get_drvdata(d); 1292 struct ipw_priv *priv = dev_get_drvdata(d);
1299 if (priv->error) { 1293
1300 ipw_free_error_log(priv->error); 1294 kfree(priv->error);
1301 priv->error = NULL; 1295 priv->error = NULL;
1302 }
1303 return count; 1296 return count;
1304} 1297}
1305 1298
@@ -1970,8 +1963,7 @@ static void ipw_irq_tasklet(struct ipw_priv *priv)
1970 struct ipw_fw_error *error = 1963 struct ipw_fw_error *error =
1971 ipw_alloc_error_log(priv); 1964 ipw_alloc_error_log(priv);
1972 ipw_dump_error_log(priv, error); 1965 ipw_dump_error_log(priv, error);
1973 if (error) 1966 kfree(error);
1974 ipw_free_error_log(error);
1975 } 1967 }
1976#endif 1968#endif
1977 } else { 1969 } else {
@@ -11693,10 +11685,8 @@ static void ipw_pci_remove(struct pci_dev *pdev)
11693 } 11685 }
11694 } 11686 }
11695 11687
11696 if (priv->error) { 11688 kfree(priv->error);
11697 ipw_free_error_log(priv->error); 11689 priv->error = NULL;
11698 priv->error = NULL;
11699 }
11700 11690
11701#ifdef CONFIG_IPW2200_PROMISCUOUS 11691#ifdef CONFIG_IPW2200_PROMISCUOUS
11702 ipw_prom_free(priv); 11692 ipw_prom_free(priv);
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c
index ecec8e5db786..569305f57561 100644
--- a/drivers/net/yellowfin.c
+++ b/drivers/net/yellowfin.c
@@ -234,14 +234,6 @@ See Packet Engines confidential appendix (prototype chips only).
234 234
235 235
236 236
237enum pci_id_flags_bits {
238 /* Set PCI command register bits before calling probe1(). */
239 PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4,
240 /* Read and map the single following PCI BAR. */
241 PCI_ADDR0=0<<4, PCI_ADDR1=1<<4, PCI_ADDR2=2<<4, PCI_ADDR3=3<<4,
242 PCI_ADDR_64BITS=0x100, PCI_NO_ACPI_WAKE=0x200, PCI_NO_MIN_LATENCY=0x400,
243 PCI_UNUSED_IRQ=0x800,
244};
245enum capability_flags { 237enum capability_flags {
246 HasMII=1, FullTxStatus=2, IsGigabit=4, HasMulticastBug=8, FullRxStatus=16, 238 HasMII=1, FullTxStatus=2, IsGigabit=4, HasMulticastBug=8, FullRxStatus=16,
247 HasMACAddrBug=32, /* Only on early revs. */ 239 HasMACAddrBug=32, /* Only on early revs. */
@@ -249,11 +241,6 @@ enum capability_flags {
249}; 241};
250/* The PCI I/O space extent. */ 242/* The PCI I/O space extent. */
251#define YELLOWFIN_SIZE 0x100 243#define YELLOWFIN_SIZE 0x100
252#ifdef USE_IO_OPS
253#define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_IO | PCI_ADDR0)
254#else
255#define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_MEM | PCI_ADDR1)
256#endif
257 244
258struct pci_id_info { 245struct pci_id_info {
259 const char *name; 246 const char *name;
@@ -261,24 +248,23 @@ struct pci_id_info {
261 int pci, pci_mask, subsystem, subsystem_mask; 248 int pci, pci_mask, subsystem, subsystem_mask;
262 int revision, revision_mask; /* Only 8 bits. */ 249 int revision, revision_mask; /* Only 8 bits. */
263 } id; 250 } id;
264 enum pci_id_flags_bits pci_flags;
265 int io_size; /* Needed for I/O region check or ioremap(). */ 251 int io_size; /* Needed for I/O region check or ioremap(). */
266 int drv_flags; /* Driver use, intended as capability flags. */ 252 int drv_flags; /* Driver use, intended as capability flags. */
267}; 253};
268 254
269static const struct pci_id_info pci_id_tbl[] = { 255static const struct pci_id_info pci_id_tbl[] = {
270 {"Yellowfin G-NIC Gigabit Ethernet", { 0x07021000, 0xffffffff}, 256 {"Yellowfin G-NIC Gigabit Ethernet", { 0x07021000, 0xffffffff},
271 PCI_IOTYPE, YELLOWFIN_SIZE, 257 YELLOWFIN_SIZE,
272 FullTxStatus | IsGigabit | HasMulticastBug | HasMACAddrBug | DontUseEeprom}, 258 FullTxStatus | IsGigabit | HasMulticastBug | HasMACAddrBug | DontUseEeprom},
273 {"Symbios SYM83C885", { 0x07011000, 0xffffffff}, 259 {"Symbios SYM83C885", { 0x07011000, 0xffffffff},
274 PCI_IOTYPE, YELLOWFIN_SIZE, HasMII | DontUseEeprom }, 260 YELLOWFIN_SIZE, HasMII | DontUseEeprom },
275 {NULL,}, 261 { }
276}; 262};
277 263
278static struct pci_device_id yellowfin_pci_tbl[] = { 264static const struct pci_device_id yellowfin_pci_tbl[] = {
279 { 0x1000, 0x0702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 265 { 0x1000, 0x0702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
280 { 0x1000, 0x0701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, 266 { 0x1000, 0x0701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
281 { 0, } 267 { }
282}; 268};
283MODULE_DEVICE_TABLE (pci, yellowfin_pci_tbl); 269MODULE_DEVICE_TABLE (pci, yellowfin_pci_tbl);
284 270