aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tlan.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-09-13 13:24:59 -0400
committerJeff Garzik <jeff@garzik.org>2006-09-13 13:24:59 -0400
commit6aa20a2235535605db6d6d2bd850298b2fe7f31e (patch)
treedf0b855043407b831d57f2f2c271f8aab48444f4 /drivers/net/tlan.c
parent7a291083225af6e22ffaa46b3d91cfc1a1ccaab4 (diff)
drivers/net: Trim trailing whitespace
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/tlan.c')
-rw-r--r--drivers/net/tlan.c344
1 files changed, 172 insertions, 172 deletions
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c
index 23c0017f25a9..8d807bf603a0 100644
--- a/drivers/net/tlan.c
+++ b/drivers/net/tlan.c
@@ -33,33 +33,33 @@
33 * new PCI BIOS interface. 33 * new PCI BIOS interface.
34 * Alan Cox <alan@redhat.com>: Fixed the out of memory 34 * Alan Cox <alan@redhat.com>: Fixed the out of memory
35 * handling. 35 * handling.
36 * 36 *
37 * Torben Mathiasen <torben.mathiasen@compaq.com> New Maintainer! 37 * Torben Mathiasen <torben.mathiasen@compaq.com> New Maintainer!
38 * 38 *
39 * v1.1 Dec 20, 1999 - Removed linux version checking 39 * v1.1 Dec 20, 1999 - Removed linux version checking
40 * Patch from Tigran Aivazian. 40 * Patch from Tigran Aivazian.
41 * - v1.1 includes Alan's SMP updates. 41 * - v1.1 includes Alan's SMP updates.
42 * - We still have problems on SMP though, 42 * - We still have problems on SMP though,
43 * but I'm looking into that. 43 * but I'm looking into that.
44 * 44 *
45 * v1.2 Jan 02, 2000 - Hopefully fixed the SMP deadlock. 45 * v1.2 Jan 02, 2000 - Hopefully fixed the SMP deadlock.
46 * - Removed dependency of HZ being 100. 46 * - Removed dependency of HZ being 100.
47 * - We now allow higher priority timers to 47 * - We now allow higher priority timers to
48 * overwrite timers like TLAN_TIMER_ACTIVITY 48 * overwrite timers like TLAN_TIMER_ACTIVITY
49 * Patch from John Cagle <john.cagle@compaq.com>. 49 * Patch from John Cagle <john.cagle@compaq.com>.
50 * - Fixed a few compiler warnings. 50 * - Fixed a few compiler warnings.
51 * 51 *
52 * v1.3 Feb 04, 2000 - Fixed the remaining HZ issues. 52 * v1.3 Feb 04, 2000 - Fixed the remaining HZ issues.
53 * - Removed call to pci_present(). 53 * - Removed call to pci_present().
54 * - Removed SA_INTERRUPT flag from irq handler. 54 * - Removed SA_INTERRUPT flag from irq handler.
55 * - Added __init and __initdata to reduce resisdent 55 * - Added __init and __initdata to reduce resisdent
56 * code size. 56 * code size.
57 * - Driver now uses module_init/module_exit. 57 * - Driver now uses module_init/module_exit.
58 * - Rewrote init_module and tlan_probe to 58 * - Rewrote init_module and tlan_probe to
59 * share a lot more code. We now use tlan_probe 59 * share a lot more code. We now use tlan_probe
60 * with builtin and module driver. 60 * with builtin and module driver.
61 * - Driver ported to new net API. 61 * - Driver ported to new net API.
62 * - tlan.txt has been reworked to reflect current 62 * - tlan.txt has been reworked to reflect current
63 * driver (almost) 63 * driver (almost)
64 * - Other minor stuff 64 * - Other minor stuff
65 * 65 *
@@ -74,11 +74,11 @@
74 * Auto-Neg fallback. 74 * Auto-Neg fallback.
75 * 75 *
76 * v1.6 April 04, 2000 - Fixed driver support for kernel-parameters. Haven't 76 * v1.6 April 04, 2000 - Fixed driver support for kernel-parameters. Haven't
77 * tested it though, as the kernel support is currently 77 * tested it though, as the kernel support is currently
78 * broken (2.3.99p4p3). 78 * broken (2.3.99p4p3).
79 * - Updated tlan.txt accordingly. 79 * - Updated tlan.txt accordingly.
80 * - Adjusted minimum/maximum frame length. 80 * - Adjusted minimum/maximum frame length.
81 * - There is now a TLAN website up at 81 * - There is now a TLAN website up at
82 * http://tlan.kernel.dk 82 * http://tlan.kernel.dk
83 * 83 *
84 * v1.7 April 07, 2000 - Started to implement custom ioctls. Driver now 84 * v1.7 April 07, 2000 - Started to implement custom ioctls. Driver now
@@ -92,10 +92,10 @@
92 * link partner abilities. When forced link is used, 92 * link partner abilities. When forced link is used,
93 * the driver will report status of the established 93 * the driver will report status of the established
94 * link. 94 * link.
95 * Please read tlan.txt for additional information. 95 * Please read tlan.txt for additional information.
96 * - Removed call to check_region(), and used 96 * - Removed call to check_region(), and used
97 * return value of request_region() instead. 97 * return value of request_region() instead.
98 * 98 *
99 * v1.8a May 28, 2000 - Minor updates. 99 * v1.8a May 28, 2000 - Minor updates.
100 * 100 *
101 * v1.9 July 25, 2000 - Fixed a few remaining Full-Duplex issues. 101 * v1.9 July 25, 2000 - Fixed a few remaining Full-Duplex issues.
@@ -104,25 +104,25 @@
104 * - Added routine to monitor PHY status. 104 * - Added routine to monitor PHY status.
105 * - Added activity led support for Proliant devices. 105 * - Added activity led support for Proliant devices.
106 * 106 *
107 * v1.10 Aug 30, 2000 - Added support for EISA based tlan controllers 107 * v1.10 Aug 30, 2000 - Added support for EISA based tlan controllers
108 * like the Compaq NetFlex3/E. 108 * like the Compaq NetFlex3/E.
109 * - Rewrote tlan_probe to better handle multiple 109 * - Rewrote tlan_probe to better handle multiple
110 * bus probes. Probing and device setup is now 110 * bus probes. Probing and device setup is now
111 * done through TLan_Probe and TLan_init_one. Actual 111 * done through TLan_Probe and TLan_init_one. Actual
112 * hardware probe is done with kernel API and 112 * hardware probe is done with kernel API and
113 * TLan_EisaProbe. 113 * TLan_EisaProbe.
114 * - Adjusted debug information for probing. 114 * - Adjusted debug information for probing.
115 * - Fixed bug that would cause general debug information 115 * - Fixed bug that would cause general debug information
116 * to be printed after driver removal. 116 * to be printed after driver removal.
117 * - Added transmit timeout handling. 117 * - Added transmit timeout handling.
118 * - Fixed OOM return values in tlan_probe. 118 * - Fixed OOM return values in tlan_probe.
119 * - Fixed possible mem leak in tlan_exit 119 * - Fixed possible mem leak in tlan_exit
120 * (now tlan_remove_one). 120 * (now tlan_remove_one).
121 * - Fixed timer bug in TLan_phyMonitor. 121 * - Fixed timer bug in TLan_phyMonitor.
122 * - This driver version is alpha quality, please 122 * - This driver version is alpha quality, please
123 * send me any bug issues you may encounter. 123 * send me any bug issues you may encounter.
124 * 124 *
125 * v1.11 Aug 31, 2000 - Do not try to register irq 0 if no irq line was 125 * v1.11 Aug 31, 2000 - Do not try to register irq 0 if no irq line was
126 * set for EISA cards. 126 * set for EISA cards.
127 * - Added support for NetFlex3/E with nibble-rate 127 * - Added support for NetFlex3/E with nibble-rate
128 * 10Base-T PHY. This is untestet as I haven't got 128 * 10Base-T PHY. This is untestet as I haven't got
@@ -142,7 +142,7 @@
142 * - Added the bbuf option as a kernel parameter. 142 * - Added the bbuf option as a kernel parameter.
143 * - Fixed ioaddr probe bug. 143 * - Fixed ioaddr probe bug.
144 * - Fixed stupid deadlock with MII interrupts. 144 * - Fixed stupid deadlock with MII interrupts.
145 * - Added support for speed/duplex selection with 145 * - Added support for speed/duplex selection with
146 * multiple nics. 146 * multiple nics.
147 * - Added partly fix for TX Channel lockup with 147 * - Added partly fix for TX Channel lockup with
148 * TLAN v1.0 silicon. This needs to be investigated 148 * TLAN v1.0 silicon. This needs to be investigated
@@ -226,7 +226,7 @@ static int tlan_have_pci;
226static int tlan_have_eisa; 226static int tlan_have_eisa;
227 227
228static const char *media[] = { 228static const char *media[] = {
229 "10BaseT-HD ", "10BaseT-FD ","100baseTx-HD ", 229 "10BaseT-HD ", "10BaseT-FD ","100baseTx-HD ",
230 "100baseTx-FD", "100baseT4", NULL 230 "100baseTx-FD", "100baseT4", NULL
231}; 231};
232 232
@@ -249,7 +249,7 @@ static struct board {
249 { "Compaq Netelligent 10/100 TX UTP", TLAN_ADAPTER_ACTIVITY_LED, 0x83 }, 249 { "Compaq Netelligent 10/100 TX UTP", TLAN_ADAPTER_ACTIVITY_LED, 0x83 },
250 { "Compaq Netelligent 10 T/2 PCI UTP/Coax", TLAN_ADAPTER_NONE, 0x83 }, 250 { "Compaq Netelligent 10 T/2 PCI UTP/Coax", TLAN_ADAPTER_NONE, 0x83 },
251 { "Compaq NetFlex-3/E", TLAN_ADAPTER_ACTIVITY_LED | /* EISA card */ 251 { "Compaq NetFlex-3/E", TLAN_ADAPTER_ACTIVITY_LED | /* EISA card */
252 TLAN_ADAPTER_UNMANAGED_PHY | TLAN_ADAPTER_BIT_RATE_PHY, 0x83 }, 252 TLAN_ADAPTER_UNMANAGED_PHY | TLAN_ADAPTER_BIT_RATE_PHY, 0x83 },
253 { "Compaq NetFlex-3/E", TLAN_ADAPTER_ACTIVITY_LED, 0x83 }, /* EISA card */ 253 { "Compaq NetFlex-3/E", TLAN_ADAPTER_ACTIVITY_LED, 0x83 }, /* EISA card */
254}; 254};
255 255
@@ -282,7 +282,7 @@ static struct pci_device_id tlan_pci_tbl[] = {
282 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12 }, 282 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12 },
283 { 0,} 283 { 0,}
284}; 284};
285MODULE_DEVICE_TABLE(pci, tlan_pci_tbl); 285MODULE_DEVICE_TABLE(pci, tlan_pci_tbl);
286 286
287static void TLan_EisaProbe( void ); 287static void TLan_EisaProbe( void );
288static void TLan_Eisa_Cleanup( void ); 288static void TLan_Eisa_Cleanup( void );
@@ -347,7 +347,7 @@ static void TLan_EeReceiveByte( u16, u8 *, int );
347static int TLan_EeReadByte( struct net_device *, u8, u8 * ); 347static int TLan_EeReadByte( struct net_device *, u8, u8 * );
348 348
349 349
350static void 350static void
351TLan_StoreSKB( struct tlan_list_tag *tag, struct sk_buff *skb) 351TLan_StoreSKB( struct tlan_list_tag *tag, struct sk_buff *skb)
352{ 352{
353 unsigned long addr = (unsigned long)skb; 353 unsigned long addr = (unsigned long)skb;
@@ -384,11 +384,11 @@ TLan_SetTimer( struct net_device *dev, u32 ticks, u32 type )
384{ 384{
385 TLanPrivateInfo *priv = netdev_priv(dev); 385 TLanPrivateInfo *priv = netdev_priv(dev);
386 unsigned long flags = 0; 386 unsigned long flags = 0;
387 387
388 if (!in_irq()) 388 if (!in_irq())
389 spin_lock_irqsave(&priv->lock, flags); 389 spin_lock_irqsave(&priv->lock, flags);
390 if ( priv->timer.function != NULL && 390 if ( priv->timer.function != NULL &&
391 priv->timerType != TLAN_TIMER_ACTIVITY ) { 391 priv->timerType != TLAN_TIMER_ACTIVITY ) {
392 if (!in_irq()) 392 if (!in_irq())
393 spin_unlock_irqrestore(&priv->lock, flags); 393 spin_unlock_irqrestore(&priv->lock, flags);
394 return; 394 return;
@@ -401,7 +401,7 @@ TLan_SetTimer( struct net_device *dev, u32 ticks, u32 type )
401 priv->timerSetAt = jiffies; 401 priv->timerSetAt = jiffies;
402 priv->timerType = type; 402 priv->timerType = type;
403 mod_timer(&priv->timer, jiffies + ticks); 403 mod_timer(&priv->timer, jiffies + ticks);
404 404
405} /* TLan_SetTimer */ 405} /* TLan_SetTimer */
406 406
407 407
@@ -439,7 +439,7 @@ static void __devexit tlan_remove_one( struct pci_dev *pdev)
439{ 439{
440 struct net_device *dev = pci_get_drvdata( pdev ); 440 struct net_device *dev = pci_get_drvdata( pdev );
441 TLanPrivateInfo *priv = netdev_priv(dev); 441 TLanPrivateInfo *priv = netdev_priv(dev);
442 442
443 unregister_netdev( dev ); 443 unregister_netdev( dev );
444 444
445 if ( priv->dmaStorage ) { 445 if ( priv->dmaStorage ) {
@@ -449,25 +449,25 @@ static void __devexit tlan_remove_one( struct pci_dev *pdev)
449#ifdef CONFIG_PCI 449#ifdef CONFIG_PCI
450 pci_release_regions(pdev); 450 pci_release_regions(pdev);
451#endif 451#endif
452 452
453 free_netdev( dev ); 453 free_netdev( dev );
454 454
455 pci_set_drvdata( pdev, NULL ); 455 pci_set_drvdata( pdev, NULL );
456} 456}
457 457
458static struct pci_driver tlan_driver = { 458static struct pci_driver tlan_driver = {
459 .name = "tlan", 459 .name = "tlan",
460 .id_table = tlan_pci_tbl, 460 .id_table = tlan_pci_tbl,
461 .probe = tlan_init_one, 461 .probe = tlan_init_one,
462 .remove = __devexit_p(tlan_remove_one), 462 .remove = __devexit_p(tlan_remove_one),
463}; 463};
464 464
465static int __init tlan_probe(void) 465static int __init tlan_probe(void)
466{ 466{
467 static int pad_allocated; 467 static int pad_allocated;
468 468
469 printk(KERN_INFO "%s", tlan_banner); 469 printk(KERN_INFO "%s", tlan_banner);
470 470
471 TLanPadBuffer = (u8 *) pci_alloc_consistent(NULL, TLAN_MIN_FRAME_SIZE, &TLanPadBufferDMA); 471 TLanPadBuffer = (u8 *) pci_alloc_consistent(NULL, TLAN_MIN_FRAME_SIZE, &TLanPadBufferDMA);
472 472
473 if (TLanPadBuffer == NULL) { 473 if (TLanPadBuffer == NULL) {
@@ -479,15 +479,15 @@ static int __init tlan_probe(void)
479 pad_allocated = 1; 479 pad_allocated = 1;
480 480
481 TLAN_DBG(TLAN_DEBUG_PROBE, "Starting PCI Probe....\n"); 481 TLAN_DBG(TLAN_DEBUG_PROBE, "Starting PCI Probe....\n");
482 482
483 /* Use new style PCI probing. Now the kernel will 483 /* Use new style PCI probing. Now the kernel will
484 do most of this for us */ 484 do most of this for us */
485 pci_register_driver(&tlan_driver); 485 pci_register_driver(&tlan_driver);
486 486
487 TLAN_DBG(TLAN_DEBUG_PROBE, "Starting EISA Probe....\n"); 487 TLAN_DBG(TLAN_DEBUG_PROBE, "Starting EISA Probe....\n");
488 TLan_EisaProbe(); 488 TLan_EisaProbe();
489 489
490 printk(KERN_INFO "TLAN: %d device%s installed, PCI: %d EISA: %d\n", 490 printk(KERN_INFO "TLAN: %d device%s installed, PCI: %d EISA: %d\n",
491 TLanDevicesInstalled, TLanDevicesInstalled == 1 ? "" : "s", 491 TLanDevicesInstalled, TLanDevicesInstalled == 1 ? "" : "s",
492 tlan_have_pci, tlan_have_eisa); 492 tlan_have_pci, tlan_have_eisa);
493 493
@@ -498,7 +498,7 @@ static int __init tlan_probe(void)
498 } 498 }
499 return 0; 499 return 0;
500} 500}
501 501
502 502
503static int __devinit tlan_init_one( struct pci_dev *pdev, 503static int __devinit tlan_init_one( struct pci_dev *pdev,
504 const struct pci_device_id *ent) 504 const struct pci_device_id *ent)
@@ -513,11 +513,11 @@ static int __devinit tlan_init_one( struct pci_dev *pdev,
513 * 513 *
514 * Returns: 514 * Returns:
515 * 0 on success, error code on error 515 * 0 on success, error code on error
516 * Parms: 516 * Parms:
517 * none 517 * none
518 * 518 *
519 * The name is lower case to fit in with all the rest of 519 * The name is lower case to fit in with all the rest of
520 * the netcard_probe names. This function looks for 520 * the netcard_probe names. This function looks for
521 * another TLan based adapter, setting it up with the 521 * another TLan based adapter, setting it up with the
522 * allocated device struct if one is found. 522 * allocated device struct if one is found.
523 * tlan_probe has been ported to the new net API and 523 * tlan_probe has been ported to the new net API and
@@ -526,7 +526,7 @@ static int __devinit tlan_init_one( struct pci_dev *pdev,
526 * 526 *
527 **************************************************************/ 527 **************************************************************/
528 528
529static int __devinit TLan_probe1(struct pci_dev *pdev, 529static int __devinit TLan_probe1(struct pci_dev *pdev,
530 long ioaddr, int irq, int rev, const struct pci_device_id *ent ) 530 long ioaddr, int irq, int rev, const struct pci_device_id *ent )
531{ 531{
532 532
@@ -558,11 +558,11 @@ static int __devinit TLan_probe1(struct pci_dev *pdev,
558 } 558 }
559 SET_MODULE_OWNER(dev); 559 SET_MODULE_OWNER(dev);
560 SET_NETDEV_DEV(dev, &pdev->dev); 560 SET_NETDEV_DEV(dev, &pdev->dev);
561 561
562 priv = netdev_priv(dev); 562 priv = netdev_priv(dev);
563 563
564 priv->pciDev = pdev; 564 priv->pciDev = pdev;
565 565
566 /* Is this a PCI device? */ 566 /* Is this a PCI device? */
567 if (pdev) { 567 if (pdev) {
568 u32 pci_io_base = 0; 568 u32 pci_io_base = 0;
@@ -590,10 +590,10 @@ static int __devinit TLan_probe1(struct pci_dev *pdev,
590 rc = -EIO; 590 rc = -EIO;
591 goto err_out_free_dev; 591 goto err_out_free_dev;
592 } 592 }
593 593
594 dev->base_addr = pci_io_base; 594 dev->base_addr = pci_io_base;
595 dev->irq = pdev->irq; 595 dev->irq = pdev->irq;
596 priv->adapterRev = pci_rev; 596 priv->adapterRev = pci_rev;
597 pci_set_master(pdev); 597 pci_set_master(pdev);
598 pci_set_drvdata(pdev, dev); 598 pci_set_drvdata(pdev, dev);
599 599
@@ -618,7 +618,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev,
618 priv->aui = dev->mem_start & 0x01; 618 priv->aui = dev->mem_start & 0x01;
619 priv->duplex = ((dev->mem_start & 0x06) == 0x06) ? 0 : (dev->mem_start & 0x06) >> 1; 619 priv->duplex = ((dev->mem_start & 0x06) == 0x06) ? 0 : (dev->mem_start & 0x06) >> 1;
620 priv->speed = ((dev->mem_start & 0x18) == 0x18) ? 0 : (dev->mem_start & 0x18) >> 3; 620 priv->speed = ((dev->mem_start & 0x18) == 0x18) ? 0 : (dev->mem_start & 0x18) >> 3;
621 621
622 if (priv->speed == 0x1) { 622 if (priv->speed == 0x1) {
623 priv->speed = TLAN_SPEED_10; 623 priv->speed = TLAN_SPEED_10;
624 } else if (priv->speed == 0x2) { 624 } else if (priv->speed == 0x2) {
@@ -631,13 +631,13 @@ static int __devinit TLan_probe1(struct pci_dev *pdev,
631 priv->duplex = duplex[boards_found]; 631 priv->duplex = duplex[boards_found];
632 priv->debug = debug; 632 priv->debug = debug;
633 } 633 }
634 634
635 /* This will be used when we get an adapter error from 635 /* This will be used when we get an adapter error from
636 * within our irq handler */ 636 * within our irq handler */
637 INIT_WORK(&priv->tlan_tqueue, (void *)(void*)TLan_tx_timeout, dev); 637 INIT_WORK(&priv->tlan_tqueue, (void *)(void*)TLan_tx_timeout, dev);
638 638
639 spin_lock_init(&priv->lock); 639 spin_lock_init(&priv->lock);
640 640
641 rc = TLan_Init(dev); 641 rc = TLan_Init(dev);
642 if (rc) { 642 if (rc) {
643 printk(KERN_ERR "TLAN: Could not set up device.\n"); 643 printk(KERN_ERR "TLAN: Could not set up device.\n");
@@ -650,10 +650,10 @@ static int __devinit TLan_probe1(struct pci_dev *pdev,
650 goto err_out_uninit; 650 goto err_out_uninit;
651 } 651 }
652 652
653 653
654 TLanDevicesInstalled++; 654 TLanDevicesInstalled++;
655 boards_found++; 655 boards_found++;
656 656
657 /* pdev is NULL if this is an EISA device */ 657 /* pdev is NULL if this is an EISA device */
658 if (pdev) 658 if (pdev)
659 tlan_have_pci++; 659 tlan_have_pci++;
@@ -662,7 +662,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev,
662 TLan_Eisa_Devices = dev; 662 TLan_Eisa_Devices = dev;
663 tlan_have_eisa++; 663 tlan_have_eisa++;
664 } 664 }
665 665
666 printk(KERN_INFO "TLAN: %s irq=%2d, io=%04x, %s, Rev. %d\n", 666 printk(KERN_INFO "TLAN: %s irq=%2d, io=%04x, %s, Rev. %d\n",
667 dev->name, 667 dev->name,
668 (int) dev->irq, 668 (int) dev->irq,
@@ -692,7 +692,7 @@ static void TLan_Eisa_Cleanup(void)
692{ 692{
693 struct net_device *dev; 693 struct net_device *dev;
694 TLanPrivateInfo *priv; 694 TLanPrivateInfo *priv;
695 695
696 while( tlan_have_eisa ) { 696 while( tlan_have_eisa ) {
697 dev = TLan_Eisa_Devices; 697 dev = TLan_Eisa_Devices;
698 priv = netdev_priv(dev); 698 priv = netdev_priv(dev);
@@ -706,8 +706,8 @@ static void TLan_Eisa_Cleanup(void)
706 tlan_have_eisa--; 706 tlan_have_eisa--;
707 } 707 }
708} 708}
709 709
710 710
711static void __exit tlan_exit(void) 711static void __exit tlan_exit(void)
712{ 712{
713 pci_unregister_driver(&tlan_driver); 713 pci_unregister_driver(&tlan_driver);
@@ -734,52 +734,52 @@ module_exit(tlan_exit);
734 * Parms: None 734 * Parms: None
735 * 735 *
736 * 736 *
737 * This functions probes for EISA devices and calls 737 * This functions probes for EISA devices and calls
738 * TLan_probe1 when one is found. 738 * TLan_probe1 when one is found.
739 * 739 *
740 *************************************************************/ 740 *************************************************************/
741 741
742static void __init TLan_EisaProbe (void) 742static void __init TLan_EisaProbe (void)
743{ 743{
744 long ioaddr; 744 long ioaddr;
745 int rc = -ENODEV; 745 int rc = -ENODEV;
746 int irq; 746 int irq;
747 u16 device_id; 747 u16 device_id;
748 748
749 if (!EISA_bus) { 749 if (!EISA_bus) {
750 TLAN_DBG(TLAN_DEBUG_PROBE, "No EISA bus present\n"); 750 TLAN_DBG(TLAN_DEBUG_PROBE, "No EISA bus present\n");
751 return; 751 return;
752 } 752 }
753 753
754 /* Loop through all slots of the EISA bus */ 754 /* Loop through all slots of the EISA bus */
755 for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) { 755 for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) {
756 756
757 TLAN_DBG(TLAN_DEBUG_PROBE,"EISA_ID 0x%4x: 0x%4x\n", (int) ioaddr + 0xC80, inw(ioaddr + EISA_ID)); 757 TLAN_DBG(TLAN_DEBUG_PROBE,"EISA_ID 0x%4x: 0x%4x\n", (int) ioaddr + 0xC80, inw(ioaddr + EISA_ID));
758 TLAN_DBG(TLAN_DEBUG_PROBE,"EISA_ID 0x%4x: 0x%4x\n", (int) ioaddr + 0xC82, inw(ioaddr + EISA_ID2)); 758 TLAN_DBG(TLAN_DEBUG_PROBE,"EISA_ID 0x%4x: 0x%4x\n", (int) ioaddr + 0xC82, inw(ioaddr + EISA_ID2));
759 759
760 760
761 TLAN_DBG(TLAN_DEBUG_PROBE, "Probing for EISA adapter at IO: 0x%4x : ", 761 TLAN_DBG(TLAN_DEBUG_PROBE, "Probing for EISA adapter at IO: 0x%4x : ",
762 (int) ioaddr); 762 (int) ioaddr);
763 if (request_region(ioaddr, 0x10, TLanSignature) == NULL) 763 if (request_region(ioaddr, 0x10, TLanSignature) == NULL)
764 goto out; 764 goto out;
765 765
766 if (inw(ioaddr + EISA_ID) != 0x110E) { 766 if (inw(ioaddr + EISA_ID) != 0x110E) {
767 release_region(ioaddr, 0x10); 767 release_region(ioaddr, 0x10);
768 goto out; 768 goto out;
769 } 769 }
770 770
771 device_id = inw(ioaddr + EISA_ID2); 771 device_id = inw(ioaddr + EISA_ID2);
772 if (device_id != 0x20F1 && device_id != 0x40F1) { 772 if (device_id != 0x20F1 && device_id != 0x40F1) {
773 release_region (ioaddr, 0x10); 773 release_region (ioaddr, 0x10);
774 goto out; 774 goto out;
775 } 775 }
776 776
777 if (inb(ioaddr + EISA_CR) != 0x1) { /* Check if adapter is enabled */ 777 if (inb(ioaddr + EISA_CR) != 0x1) { /* Check if adapter is enabled */
778 release_region (ioaddr, 0x10); 778 release_region (ioaddr, 0x10);
779 goto out2; 779 goto out2;
780 } 780 }
781 781
782 if (debug == 0x10) 782 if (debug == 0x10)
783 printk("Found one\n"); 783 printk("Found one\n");
784 784
785 785
@@ -799,14 +799,14 @@ static void __init TLan_EisaProbe (void)
799 break; 799 break;
800 default: 800 default:
801 goto out; 801 goto out;
802 } 802 }
803 803
804 804
805 /* Setup the newly found eisa adapter */ 805 /* Setup the newly found eisa adapter */
806 rc = TLan_probe1( NULL, ioaddr, irq, 806 rc = TLan_probe1( NULL, ioaddr, irq,
807 12, NULL); 807 12, NULL);
808 continue; 808 continue;
809 809
810 out: 810 out:
811 if (debug == 0x10) 811 if (debug == 0x10)
812 printk("None found\n"); 812 printk("None found\n");
@@ -815,7 +815,7 @@ static void __init TLan_EisaProbe (void)
815 out2: if (debug == 0x10) 815 out2: if (debug == 0x10)
816 printk("Card found but it is not enabled, skipping\n"); 816 printk("Card found but it is not enabled, skipping\n");
817 continue; 817 continue;
818 818
819 } 819 }
820 820
821} /* TLan_EisaProbe */ 821} /* TLan_EisaProbe */
@@ -829,7 +829,7 @@ static void TLan_Poll(struct net_device *dev)
829} 829}
830#endif 830#endif
831 831
832 832
833 833
834 834
835 /*************************************************************** 835 /***************************************************************
@@ -846,7 +846,7 @@ static void TLan_Poll(struct net_device *dev)
846 * addresses, allocates memory for the lists and bounce 846 * addresses, allocates memory for the lists and bounce
847 * buffers, retrieves the MAC address from the eeprom 847 * buffers, retrieves the MAC address from the eeprom
848 * and assignes the device's methods. 848 * and assignes the device's methods.
849 * 849 *
850 **************************************************************/ 850 **************************************************************/
851 851
852static int TLan_Init( struct net_device *dev ) 852static int TLan_Init( struct net_device *dev )
@@ -857,7 +857,7 @@ static int TLan_Init( struct net_device *dev )
857 TLanPrivateInfo *priv; 857 TLanPrivateInfo *priv;
858 858
859 priv = netdev_priv(dev); 859 priv = netdev_priv(dev);
860 860
861 if ( bbuf ) { 861 if ( bbuf ) {
862 dma_size = ( TLAN_NUM_RX_LISTS + TLAN_NUM_TX_LISTS ) 862 dma_size = ( TLAN_NUM_RX_LISTS + TLAN_NUM_TX_LISTS )
863 * ( sizeof(TLanList) + TLAN_MAX_FRAME_SIZE ); 863 * ( sizeof(TLanList) + TLAN_MAX_FRAME_SIZE );
@@ -867,14 +867,14 @@ static int TLan_Init( struct net_device *dev )
867 } 867 }
868 priv->dmaStorage = pci_alloc_consistent(priv->pciDev, dma_size, &priv->dmaStorageDMA); 868 priv->dmaStorage = pci_alloc_consistent(priv->pciDev, dma_size, &priv->dmaStorageDMA);
869 priv->dmaSize = dma_size; 869 priv->dmaSize = dma_size;
870 870
871 if ( priv->dmaStorage == NULL ) { 871 if ( priv->dmaStorage == NULL ) {
872 printk(KERN_ERR "TLAN: Could not allocate lists and buffers for %s.\n", 872 printk(KERN_ERR "TLAN: Could not allocate lists and buffers for %s.\n",
873 dev->name ); 873 dev->name );
874 return -ENOMEM; 874 return -ENOMEM;
875 } 875 }
876 memset( priv->dmaStorage, 0, dma_size ); 876 memset( priv->dmaStorage, 0, dma_size );
877 priv->rxList = (TLanList *) 877 priv->rxList = (TLanList *)
878 ( ( ( (u32) priv->dmaStorage ) + 7 ) & 0xFFFFFFF8 ); 878 ( ( ( (u32) priv->dmaStorage ) + 7 ) & 0xFFFFFFF8 );
879 priv->rxListDMA = ( ( ( (u32) priv->dmaStorageDMA ) + 7 ) & 0xFFFFFFF8 ); 879 priv->rxListDMA = ( ( ( (u32) priv->dmaStorageDMA ) + 7 ) & 0xFFFFFFF8 );
880 priv->txList = priv->rxList + TLAN_NUM_RX_LISTS; 880 priv->txList = priv->rxList + TLAN_NUM_RX_LISTS;
@@ -941,18 +941,18 @@ static int TLan_Open( struct net_device *dev )
941{ 941{
942 TLanPrivateInfo *priv = netdev_priv(dev); 942 TLanPrivateInfo *priv = netdev_priv(dev);
943 int err; 943 int err;
944 944
945 priv->tlanRev = TLan_DioRead8( dev->base_addr, TLAN_DEF_REVISION ); 945 priv->tlanRev = TLan_DioRead8( dev->base_addr, TLAN_DEF_REVISION );
946 err = request_irq( dev->irq, TLan_HandleInterrupt, IRQF_SHARED, TLanSignature, dev ); 946 err = request_irq( dev->irq, TLan_HandleInterrupt, IRQF_SHARED, TLanSignature, dev );
947 947
948 if ( err ) { 948 if ( err ) {
949 printk(KERN_ERR "TLAN: Cannot open %s because IRQ %d is already in use.\n", dev->name, dev->irq ); 949 printk(KERN_ERR "TLAN: Cannot open %s because IRQ %d is already in use.\n", dev->name, dev->irq );
950 return err; 950 return err;
951 } 951 }
952 952
953 init_timer(&priv->timer); 953 init_timer(&priv->timer);
954 netif_start_queue(dev); 954 netif_start_queue(dev);
955 955
956 /* NOTE: It might not be necessary to read the stats before a 956 /* NOTE: It might not be necessary to read the stats before a
957 reset if you don't care what the values are. 957 reset if you don't care what the values are.
958 */ 958 */
@@ -970,12 +970,12 @@ static int TLan_Open( struct net_device *dev )
970 970
971 /************************************************************** 971 /**************************************************************
972 * TLan_ioctl 972 * TLan_ioctl
973 * 973 *
974 * Returns: 974 * Returns:
975 * 0 on success, error code otherwise 975 * 0 on success, error code otherwise
976 * Params: 976 * Params:
977 * dev structure of device to receive ioctl. 977 * dev structure of device to receive ioctl.
978 * 978 *
979 * rq ifreq structure to hold userspace data. 979 * rq ifreq structure to hold userspace data.
980 * 980 *
981 * cmd ioctl command. 981 * cmd ioctl command.
@@ -988,7 +988,7 @@ static int TLan_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
988 TLanPrivateInfo *priv = netdev_priv(dev); 988 TLanPrivateInfo *priv = netdev_priv(dev);
989 struct mii_ioctl_data *data = if_mii(rq); 989 struct mii_ioctl_data *data = if_mii(rq);
990 u32 phy = priv->phy[priv->phyNum]; 990 u32 phy = priv->phy[priv->phyNum];
991 991
992 if (!priv->phyOnline) 992 if (!priv->phyOnline)
993 return -EAGAIN; 993 return -EAGAIN;
994 994
@@ -1000,7 +1000,7 @@ static int TLan_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1000 case SIOCGMIIREG: /* Read MII PHY register. */ 1000 case SIOCGMIIREG: /* Read MII PHY register. */
1001 TLan_MiiReadReg(dev, data->phy_id & 0x1f, data->reg_num & 0x1f, &data->val_out); 1001 TLan_MiiReadReg(dev, data->phy_id & 0x1f, data->reg_num & 0x1f, &data->val_out);
1002 return 0; 1002 return 0;
1003 1003
1004 1004
1005 case SIOCSMIIREG: /* Write MII PHY register. */ 1005 case SIOCSMIIREG: /* Write MII PHY register. */
1006 if (!capable(CAP_NET_ADMIN)) 1006 if (!capable(CAP_NET_ADMIN))
@@ -1019,31 +1019,31 @@ static int TLan_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1019 * Returns: nothing 1019 * Returns: nothing
1020 * 1020 *
1021 * Params: 1021 * Params:
1022 * dev structure of device which timed out 1022 * dev structure of device which timed out
1023 * during transmit. 1023 * during transmit.
1024 * 1024 *
1025 **************************************************************/ 1025 **************************************************************/
1026 1026
1027static void TLan_tx_timeout(struct net_device *dev) 1027static void TLan_tx_timeout(struct net_device *dev)
1028{ 1028{
1029 1029
1030 TLAN_DBG( TLAN_DEBUG_GNRL, "%s: Transmit timed out.\n", dev->name); 1030 TLAN_DBG( TLAN_DEBUG_GNRL, "%s: Transmit timed out.\n", dev->name);
1031 1031
1032 /* Ok so we timed out, lets see what we can do about it...*/ 1032 /* Ok so we timed out, lets see what we can do about it...*/
1033 TLan_FreeLists( dev ); 1033 TLan_FreeLists( dev );
1034 TLan_ResetLists( dev ); 1034 TLan_ResetLists( dev );
1035 TLan_ReadAndClearStats( dev, TLAN_IGNORE ); 1035 TLan_ReadAndClearStats( dev, TLAN_IGNORE );
1036 TLan_ResetAdapter( dev ); 1036 TLan_ResetAdapter( dev );
1037 dev->trans_start = jiffies; 1037 dev->trans_start = jiffies;
1038 netif_wake_queue( dev ); 1038 netif_wake_queue( dev );
1039 1039
1040} 1040}
1041 1041
1042 1042
1043 1043
1044 /*************************************************************** 1044 /***************************************************************
1045 * TLan_StartTx 1045 * TLan_StartTx
1046 * 1046 *
1047 * Returns: 1047 * Returns:
1048 * 0 on success, non-zero on failure. 1048 * 0 on success, non-zero on failure.
1049 * Parms: 1049 * Parms:
@@ -1079,7 +1079,7 @@ static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev )
1079 1079
1080 tail_list = priv->txList + priv->txTail; 1080 tail_list = priv->txList + priv->txTail;
1081 tail_list_phys = priv->txListDMA + sizeof(TLanList) * priv->txTail; 1081 tail_list_phys = priv->txListDMA + sizeof(TLanList) * priv->txTail;
1082 1082
1083 if ( tail_list->cStat != TLAN_CSTAT_UNUSED ) { 1083 if ( tail_list->cStat != TLAN_CSTAT_UNUSED ) {
1084 TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT: %s is busy (Head=%d Tail=%d)\n", dev->name, priv->txHead, priv->txTail ); 1084 TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT: %s is busy (Head=%d Tail=%d)\n", dev->name, priv->txHead, priv->txTail );
1085 netif_stop_queue(dev); 1085 netif_stop_queue(dev);
@@ -1132,7 +1132,7 @@ static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev )
1132 1132
1133 if ( bbuf ) 1133 if ( bbuf )
1134 dev_kfree_skb_any(skb); 1134 dev_kfree_skb_any(skb);
1135 1135
1136 dev->trans_start = jiffies; 1136 dev->trans_start = jiffies;
1137 return 0; 1137 return 0;
1138 1138
@@ -1143,8 +1143,8 @@ static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev )
1143 1143
1144 /*************************************************************** 1144 /***************************************************************
1145 * TLan_HandleInterrupt 1145 * TLan_HandleInterrupt
1146 * 1146 *
1147 * Returns: 1147 * Returns:
1148 * Nothing 1148 * Nothing
1149 * Parms: 1149 * Parms:
1150 * irq The line on which the interrupt 1150 * irq The line on which the interrupt
@@ -1198,7 +1198,7 @@ static irqreturn_t TLan_HandleInterrupt(int irq, void *dev_id, struct pt_regs *r
1198 1198
1199 /*************************************************************** 1199 /***************************************************************
1200 * TLan_Close 1200 * TLan_Close
1201 * 1201 *
1202 * Returns: 1202 * Returns:
1203 * An error code. 1203 * An error code.
1204 * Parms: 1204 * Parms:
@@ -1224,7 +1224,7 @@ static int TLan_Close(struct net_device *dev)
1224 del_timer_sync( &priv->timer ); 1224 del_timer_sync( &priv->timer );
1225 priv->timer.function = NULL; 1225 priv->timer.function = NULL;
1226 } 1226 }
1227 1227
1228 free_irq( dev->irq, dev ); 1228 free_irq( dev->irq, dev );
1229 TLan_FreeLists( dev ); 1229 TLan_FreeLists( dev );
1230 TLAN_DBG( TLAN_DEBUG_GNRL, "Device %s closed.\n", dev->name ); 1230 TLAN_DBG( TLAN_DEBUG_GNRL, "Device %s closed.\n", dev->name );
@@ -1238,7 +1238,7 @@ static int TLan_Close(struct net_device *dev)
1238 1238
1239 /*************************************************************** 1239 /***************************************************************
1240 * TLan_GetStats 1240 * TLan_GetStats
1241 * 1241 *
1242 * Returns: 1242 * Returns:
1243 * A pointer to the device's statistics structure. 1243 * A pointer to the device's statistics structure.
1244 * Parms: 1244 * Parms:
@@ -1263,7 +1263,7 @@ static struct net_device_stats *TLan_GetStats( struct net_device *dev )
1263 TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT: %s Busy count = %d\n", dev->name, priv->txBusyCount ); 1263 TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT: %s Busy count = %d\n", dev->name, priv->txBusyCount );
1264 if ( debug & TLAN_DEBUG_GNRL ) { 1264 if ( debug & TLAN_DEBUG_GNRL ) {
1265 TLan_PrintDio( dev->base_addr ); 1265 TLan_PrintDio( dev->base_addr );
1266 TLan_PhyPrint( dev ); 1266 TLan_PhyPrint( dev );
1267 } 1267 }
1268 if ( debug & TLAN_DEBUG_LIST ) { 1268 if ( debug & TLAN_DEBUG_LIST ) {
1269 for ( i = 0; i < TLAN_NUM_RX_LISTS; i++ ) 1269 for ( i = 0; i < TLAN_NUM_RX_LISTS; i++ )
@@ -1271,7 +1271,7 @@ static struct net_device_stats *TLan_GetStats( struct net_device *dev )
1271 for ( i = 0; i < TLAN_NUM_TX_LISTS; i++ ) 1271 for ( i = 0; i < TLAN_NUM_TX_LISTS; i++ )
1272 TLan_PrintList( priv->txList + i, "TX", i ); 1272 TLan_PrintList( priv->txList + i, "TX", i );
1273 } 1273 }
1274 1274
1275 return ( &( (TLanPrivateInfo *) netdev_priv(dev) )->stats ); 1275 return ( &( (TLanPrivateInfo *) netdev_priv(dev) )->stats );
1276 1276
1277} /* TLan_GetStats */ 1277} /* TLan_GetStats */
@@ -1281,7 +1281,7 @@ static struct net_device_stats *TLan_GetStats( struct net_device *dev )
1281 1281
1282 /*************************************************************** 1282 /***************************************************************
1283 * TLan_SetMulticastList 1283 * TLan_SetMulticastList
1284 * 1284 *
1285 * Returns: 1285 * Returns:
1286 * Nothing 1286 * Nothing
1287 * Parms: 1287 * Parms:
@@ -1300,7 +1300,7 @@ static struct net_device_stats *TLan_GetStats( struct net_device *dev )
1300 **************************************************************/ 1300 **************************************************************/
1301 1301
1302static void TLan_SetMulticastList( struct net_device *dev ) 1302static void TLan_SetMulticastList( struct net_device *dev )
1303{ 1303{
1304 struct dev_mc_list *dmi = dev->mc_list; 1304 struct dev_mc_list *dmi = dev->mc_list;
1305 u32 hash1 = 0; 1305 u32 hash1 = 0;
1306 u32 hash2 = 0; 1306 u32 hash2 = 0;
@@ -1315,7 +1315,7 @@ static void TLan_SetMulticastList( struct net_device *dev )
1315 tmp = TLan_DioRead8( dev->base_addr, TLAN_NET_CMD ); 1315 tmp = TLan_DioRead8( dev->base_addr, TLAN_NET_CMD );
1316 TLan_DioWrite8( dev->base_addr, TLAN_NET_CMD, tmp & ~TLAN_NET_CMD_CAF ); 1316 TLan_DioWrite8( dev->base_addr, TLAN_NET_CMD, tmp & ~TLAN_NET_CMD_CAF );
1317 if ( dev->flags & IFF_ALLMULTI ) { 1317 if ( dev->flags & IFF_ALLMULTI ) {
1318 for ( i = 0; i < 3; i++ ) 1318 for ( i = 0; i < 3; i++ )
1319 TLan_SetMac( dev, i + 1, NULL ); 1319 TLan_SetMac( dev, i + 1, NULL );
1320 TLan_DioWrite32( dev->base_addr, TLAN_HASH_1, 0xFFFFFFFF ); 1320 TLan_DioWrite32( dev->base_addr, TLAN_HASH_1, 0xFFFFFFFF );
1321 TLan_DioWrite32( dev->base_addr, TLAN_HASH_2, 0xFFFFFFFF ); 1321 TLan_DioWrite32( dev->base_addr, TLAN_HASH_2, 0xFFFFFFFF );
@@ -1325,14 +1325,14 @@ static void TLan_SetMulticastList( struct net_device *dev )
1325 TLan_SetMac( dev, i + 1, (char *) &dmi->dmi_addr ); 1325 TLan_SetMac( dev, i + 1, (char *) &dmi->dmi_addr );
1326 } else { 1326 } else {
1327 offset = TLan_HashFunc( (u8 *) &dmi->dmi_addr ); 1327 offset = TLan_HashFunc( (u8 *) &dmi->dmi_addr );
1328 if ( offset < 32 ) 1328 if ( offset < 32 )
1329 hash1 |= ( 1 << offset ); 1329 hash1 |= ( 1 << offset );
1330 else 1330 else
1331 hash2 |= ( 1 << ( offset - 32 ) ); 1331 hash2 |= ( 1 << ( offset - 32 ) );
1332 } 1332 }
1333 dmi = dmi->next; 1333 dmi = dmi->next;
1334 } 1334 }
1335 for ( ; i < 3; i++ ) 1335 for ( ; i < 3; i++ )
1336 TLan_SetMac( dev, i + 1, NULL ); 1336 TLan_SetMac( dev, i + 1, NULL );
1337 TLan_DioWrite32( dev->base_addr, TLAN_HASH_1, hash1 ); 1337 TLan_DioWrite32( dev->base_addr, TLAN_HASH_1, hash1 );
1338 TLan_DioWrite32( dev->base_addr, TLAN_HASH_2, hash2 ); 1338 TLan_DioWrite32( dev->base_addr, TLAN_HASH_2, hash2 );
@@ -1350,7 +1350,7 @@ static void TLan_SetMulticastList( struct net_device *dev )
1350 1350
1351 Please see Chap. 4, "Interrupt Handling" of the "ThunderLAN 1351 Please see Chap. 4, "Interrupt Handling" of the "ThunderLAN
1352 Programmer's Guide" for more informations on handling interrupts 1352 Programmer's Guide" for more informations on handling interrupts
1353 generated by TLAN based adapters. 1353 generated by TLAN based adapters.
1354 1354
1355****************************************************************************** 1355******************************************************************************
1356*****************************************************************************/ 1356*****************************************************************************/
@@ -1413,7 +1413,7 @@ u32 TLan_HandleTxEOF( struct net_device *dev, u16 host_int )
1413 dma_addr_t head_list_phys; 1413 dma_addr_t head_list_phys;
1414 u32 ack = 0; 1414 u32 ack = 0;
1415 u16 tmpCStat; 1415 u16 tmpCStat;
1416 1416
1417 TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT: Handling TX EOF (Head=%d Tail=%d)\n", priv->txHead, priv->txTail ); 1417 TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT: Handling TX EOF (Head=%d Tail=%d)\n", priv->txHead, priv->txTail );
1418 head_list = priv->txList + priv->txHead; 1418 head_list = priv->txList + priv->txHead;
1419 1419
@@ -1426,21 +1426,21 @@ u32 TLan_HandleTxEOF( struct net_device *dev, u16 host_int )
1426 head_list->buffer[8].address = 0; 1426 head_list->buffer[8].address = 0;
1427 head_list->buffer[9].address = 0; 1427 head_list->buffer[9].address = 0;
1428 } 1428 }
1429 1429
1430 if ( tmpCStat & TLAN_CSTAT_EOC ) 1430 if ( tmpCStat & TLAN_CSTAT_EOC )
1431 eoc = 1; 1431 eoc = 1;
1432 1432
1433 priv->stats.tx_bytes += head_list->frameSize; 1433 priv->stats.tx_bytes += head_list->frameSize;
1434 1434
1435 head_list->cStat = TLAN_CSTAT_UNUSED; 1435 head_list->cStat = TLAN_CSTAT_UNUSED;
1436 netif_start_queue(dev); 1436 netif_start_queue(dev);
1437 CIRC_INC( priv->txHead, TLAN_NUM_TX_LISTS ); 1437 CIRC_INC( priv->txHead, TLAN_NUM_TX_LISTS );
1438 head_list = priv->txList + priv->txHead; 1438 head_list = priv->txList + priv->txHead;
1439 } 1439 }
1440 1440
1441 if (!ack) 1441 if (!ack)
1442 printk(KERN_INFO "TLAN: Received interrupt for uncompleted TX frame.\n"); 1442 printk(KERN_INFO "TLAN: Received interrupt for uncompleted TX frame.\n");
1443 1443
1444 if ( eoc ) { 1444 if ( eoc ) {
1445 TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT: Handling TX EOC (Head=%d Tail=%d)\n", priv->txHead, priv->txTail ); 1445 TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT: Handling TX EOC (Head=%d Tail=%d)\n", priv->txHead, priv->txTail );
1446 head_list = priv->txList + priv->txHead; 1446 head_list = priv->txList + priv->txHead;
@@ -1452,7 +1452,7 @@ u32 TLan_HandleTxEOF( struct net_device *dev, u16 host_int )
1452 priv->txInProgress = 0; 1452 priv->txInProgress = 0;
1453 } 1453 }
1454 } 1454 }
1455 1455
1456 if ( priv->adapter->flags & TLAN_ADAPTER_ACTIVITY_LED ) { 1456 if ( priv->adapter->flags & TLAN_ADAPTER_ACTIVITY_LED ) {
1457 TLan_DioWrite8( dev->base_addr, TLAN_LED_REG, TLAN_LED_LINK | TLAN_LED_ACT ); 1457 TLan_DioWrite8( dev->base_addr, TLAN_LED_REG, TLAN_LED_LINK | TLAN_LED_ACT );
1458 if ( priv->timer.function == NULL ) { 1458 if ( priv->timer.function == NULL ) {
@@ -1544,13 +1544,13 @@ u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int )
1544 TLAN_DBG( TLAN_DEBUG_RX, "RECEIVE: Handling RX EOF (Head=%d Tail=%d)\n", priv->rxHead, priv->rxTail ); 1544 TLAN_DBG( TLAN_DEBUG_RX, "RECEIVE: Handling RX EOF (Head=%d Tail=%d)\n", priv->rxHead, priv->rxTail );
1545 head_list = priv->rxList + priv->rxHead; 1545 head_list = priv->rxList + priv->rxHead;
1546 head_list_phys = priv->rxListDMA + sizeof(TLanList) * priv->rxHead; 1546 head_list_phys = priv->rxListDMA + sizeof(TLanList) * priv->rxHead;
1547 1547
1548 while (((tmpCStat = head_list->cStat) & TLAN_CSTAT_FRM_CMP) && (ack < 255)) { 1548 while (((tmpCStat = head_list->cStat) & TLAN_CSTAT_FRM_CMP) && (ack < 255)) {
1549 frameSize = head_list->frameSize; 1549 frameSize = head_list->frameSize;
1550 ack++; 1550 ack++;
1551 if (tmpCStat & TLAN_CSTAT_EOC) 1551 if (tmpCStat & TLAN_CSTAT_EOC)
1552 eoc = 1; 1552 eoc = 1;
1553 1553
1554 if (bbuf) { 1554 if (bbuf) {
1555 skb = dev_alloc_skb(frameSize + 7); 1555 skb = dev_alloc_skb(frameSize + 7);
1556 if (skb == NULL) 1556 if (skb == NULL)
@@ -1560,7 +1560,7 @@ u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int )
1560 skb->dev = dev; 1560 skb->dev = dev;
1561 skb_reserve(skb, 2); 1561 skb_reserve(skb, 2);
1562 t = (void *) skb_put(skb, frameSize); 1562 t = (void *) skb_put(skb, frameSize);
1563 1563
1564 priv->stats.rx_bytes += head_list->frameSize; 1564 priv->stats.rx_bytes += head_list->frameSize;
1565 1565
1566 memcpy( t, head_buffer, frameSize ); 1566 memcpy( t, head_buffer, frameSize );
@@ -1569,15 +1569,15 @@ u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int )
1569 } 1569 }
1570 } else { 1570 } else {
1571 struct sk_buff *new_skb; 1571 struct sk_buff *new_skb;
1572 1572
1573 /* 1573 /*
1574 * I changed the algorithm here. What we now do 1574 * I changed the algorithm here. What we now do
1575 * is allocate the new frame. If this fails we 1575 * is allocate the new frame. If this fails we
1576 * simply recycle the frame. 1576 * simply recycle the frame.
1577 */ 1577 */
1578 1578
1579 new_skb = dev_alloc_skb( TLAN_MAX_FRAME_SIZE + 7 ); 1579 new_skb = dev_alloc_skb( TLAN_MAX_FRAME_SIZE + 7 );
1580 1580
1581 if ( new_skb != NULL ) { 1581 if ( new_skb != NULL ) {
1582 skb = TLan_GetSKB(head_list); 1582 skb = TLan_GetSKB(head_list);
1583 pci_unmap_single(priv->pciDev, head_list->buffer[0].address, TLAN_MAX_FRAME_SIZE, PCI_DMA_FROMDEVICE); 1583 pci_unmap_single(priv->pciDev, head_list->buffer[0].address, TLAN_MAX_FRAME_SIZE, PCI_DMA_FROMDEVICE);
@@ -1587,14 +1587,14 @@ u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int )
1587 1587
1588 skb->protocol = eth_type_trans( skb, dev ); 1588 skb->protocol = eth_type_trans( skb, dev );
1589 netif_rx( skb ); 1589 netif_rx( skb );
1590 1590
1591 new_skb->dev = dev; 1591 new_skb->dev = dev;
1592 skb_reserve( new_skb, 2 ); 1592 skb_reserve( new_skb, 2 );
1593 t = (void *) skb_put( new_skb, TLAN_MAX_FRAME_SIZE ); 1593 t = (void *) skb_put( new_skb, TLAN_MAX_FRAME_SIZE );
1594 head_list->buffer[0].address = pci_map_single(priv->pciDev, new_skb->data, TLAN_MAX_FRAME_SIZE, PCI_DMA_FROMDEVICE); 1594 head_list->buffer[0].address = pci_map_single(priv->pciDev, new_skb->data, TLAN_MAX_FRAME_SIZE, PCI_DMA_FROMDEVICE);
1595 head_list->buffer[8].address = (u32) t; 1595 head_list->buffer[8].address = (u32) t;
1596 TLan_StoreSKB(head_list, new_skb); 1596 TLan_StoreSKB(head_list, new_skb);
1597 } else 1597 } else
1598 printk(KERN_WARNING "TLAN: Couldn't allocate memory for received data.\n" ); 1598 printk(KERN_WARNING "TLAN: Couldn't allocate memory for received data.\n" );
1599 } 1599 }
1600 1600
@@ -1611,11 +1611,11 @@ u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int )
1611 1611
1612 if (!ack) 1612 if (!ack)
1613 printk(KERN_INFO "TLAN: Received interrupt for uncompleted RX frame.\n"); 1613 printk(KERN_INFO "TLAN: Received interrupt for uncompleted RX frame.\n");
1614
1615 1614
1616 1615
1617 1616
1618 if ( eoc ) { 1617
1618 if ( eoc ) {
1619 TLAN_DBG( TLAN_DEBUG_RX, "RECEIVE: Handling RX EOC (Head=%d Tail=%d)\n", priv->rxHead, priv->rxTail ); 1619 TLAN_DBG( TLAN_DEBUG_RX, "RECEIVE: Handling RX EOC (Head=%d Tail=%d)\n", priv->rxHead, priv->rxTail );
1620 head_list = priv->rxList + priv->rxHead; 1620 head_list = priv->rxList + priv->rxHead;
1621 head_list_phys = priv->rxListDMA + sizeof(TLanList) * priv->rxHead; 1621 head_list_phys = priv->rxListDMA + sizeof(TLanList) * priv->rxHead;
@@ -1639,7 +1639,7 @@ u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int )
1639 } 1639 }
1640 1640
1641 dev->last_rx = jiffies; 1641 dev->last_rx = jiffies;
1642 1642
1643 return ack; 1643 return ack;
1644 1644
1645} /* TLan_HandleRxEOF */ 1645} /* TLan_HandleRxEOF */
@@ -1700,7 +1700,7 @@ u32 TLan_HandleTxEOC( struct net_device *dev, u16 host_int )
1700 TLanList *head_list; 1700 TLanList *head_list;
1701 dma_addr_t head_list_phys; 1701 dma_addr_t head_list_phys;
1702 u32 ack = 1; 1702 u32 ack = 1;
1703 1703
1704 host_int = 0; 1704 host_int = 0;
1705 if ( priv->tlanRev < 0x30 ) { 1705 if ( priv->tlanRev < 0x30 ) {
1706 TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT: Handling TX EOC (Head=%d Tail=%d) -- IRQ\n", priv->txHead, priv->txTail ); 1706 TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT: Handling TX EOC (Head=%d Tail=%d) -- IRQ\n", priv->txHead, priv->txTail );
@@ -1743,7 +1743,7 @@ u32 TLan_HandleTxEOC( struct net_device *dev, u16 host_int )
1743 **************************************************************/ 1743 **************************************************************/
1744 1744
1745u32 TLan_HandleStatusCheck( struct net_device *dev, u16 host_int ) 1745u32 TLan_HandleStatusCheck( struct net_device *dev, u16 host_int )
1746{ 1746{
1747 TLanPrivateInfo *priv = netdev_priv(dev); 1747 TLanPrivateInfo *priv = netdev_priv(dev);
1748 u32 ack; 1748 u32 ack;
1749 u32 error; 1749 u32 error;
@@ -1751,7 +1751,7 @@ u32 TLan_HandleStatusCheck( struct net_device *dev, u16 host_int )
1751 u32 phy; 1751 u32 phy;
1752 u16 tlphy_ctl; 1752 u16 tlphy_ctl;
1753 u16 tlphy_sts; 1753 u16 tlphy_sts;
1754 1754
1755 ack = 1; 1755 ack = 1;
1756 if ( host_int & TLAN_HI_IV_MASK ) { 1756 if ( host_int & TLAN_HI_IV_MASK ) {
1757 netif_stop_queue( dev ); 1757 netif_stop_queue( dev );
@@ -1785,7 +1785,7 @@ u32 TLan_HandleStatusCheck( struct net_device *dev, u16 host_int )
1785 } 1785 }
1786 1786
1787 if (debug) { 1787 if (debug) {
1788 TLan_PhyPrint( dev ); 1788 TLan_PhyPrint( dev );
1789 } 1789 }
1790 } 1790 }
1791 } 1791 }
@@ -1887,7 +1887,7 @@ void TLan_Timer( unsigned long data )
1887 priv->timer.function = NULL; 1887 priv->timer.function = NULL;
1888 1888
1889 switch ( priv->timerType ) { 1889 switch ( priv->timerType ) {
1890#ifdef MONITOR 1890#ifdef MONITOR
1891 case TLAN_TIMER_LINK_BEAT: 1891 case TLAN_TIMER_LINK_BEAT:
1892 TLan_PhyMonitor( dev ); 1892 TLan_PhyMonitor( dev );
1893 break; 1893 break;
@@ -1946,7 +1946,7 @@ void TLan_Timer( unsigned long data )
1946 1946
1947 /*************************************************************** 1947 /***************************************************************
1948 * TLan_ResetLists 1948 * TLan_ResetLists
1949 * 1949 *
1950 * Returns: 1950 * Returns:
1951 * Nothing 1951 * Nothing
1952 * Parms: 1952 * Parms:
@@ -2055,7 +2055,7 @@ void TLan_FreeLists( struct net_device *dev )
2055 2055
2056 /*************************************************************** 2056 /***************************************************************
2057 * TLan_PrintDio 2057 * TLan_PrintDio
2058 * 2058 *
2059 * Returns: 2059 * Returns:
2060 * Nothing 2060 * Nothing
2061 * Parms: 2061 * Parms:
@@ -2087,7 +2087,7 @@ void TLan_PrintDio( u16 io_base )
2087 2087
2088 /*************************************************************** 2088 /***************************************************************
2089 * TLan_PrintList 2089 * TLan_PrintList
2090 * 2090 *
2091 * Returns: 2091 * Returns:
2092 * Nothing 2092 * Nothing
2093 * Parms: 2093 * Parms:
@@ -2128,7 +2128,7 @@ void TLan_PrintList( TLanList *list, char *type, int num)
2128 * Parms: 2128 * Parms:
2129 * dev Pointer to device structure of adapter 2129 * dev Pointer to device structure of adapter
2130 * to which to read stats. 2130 * to which to read stats.
2131 * record Flag indicating whether to add 2131 * record Flag indicating whether to add
2132 * 2132 *
2133 * This functions reads all the internal status registers 2133 * This functions reads all the internal status registers
2134 * of the TLAN chip, which clears them as a side effect. 2134 * of the TLAN chip, which clears them as a side effect.
@@ -2158,13 +2158,13 @@ void TLan_ReadAndClearStats( struct net_device *dev, int record )
2158 rx_good += inb( dev->base_addr + TLAN_DIO_DATA + 1 ) << 8; 2158 rx_good += inb( dev->base_addr + TLAN_DIO_DATA + 1 ) << 8;
2159 rx_good += inb( dev->base_addr + TLAN_DIO_DATA + 2 ) << 16; 2159 rx_good += inb( dev->base_addr + TLAN_DIO_DATA + 2 ) << 16;
2160 rx_over = inb( dev->base_addr + TLAN_DIO_DATA + 3 ); 2160 rx_over = inb( dev->base_addr + TLAN_DIO_DATA + 3 );
2161 2161
2162 outw( TLAN_DEFERRED_TX, dev->base_addr + TLAN_DIO_ADR ); 2162 outw( TLAN_DEFERRED_TX, dev->base_addr + TLAN_DIO_ADR );
2163 def_tx = inb( dev->base_addr + TLAN_DIO_DATA ); 2163 def_tx = inb( dev->base_addr + TLAN_DIO_DATA );
2164 def_tx += inb( dev->base_addr + TLAN_DIO_DATA + 1 ) << 8; 2164 def_tx += inb( dev->base_addr + TLAN_DIO_DATA + 1 ) << 8;
2165 crc = inb( dev->base_addr + TLAN_DIO_DATA + 2 ); 2165 crc = inb( dev->base_addr + TLAN_DIO_DATA + 2 );
2166 code = inb( dev->base_addr + TLAN_DIO_DATA + 3 ); 2166 code = inb( dev->base_addr + TLAN_DIO_DATA + 3 );
2167 2167
2168 outw( TLAN_MULTICOL_FRMS, dev->base_addr + TLAN_DIO_ADR ); 2168 outw( TLAN_MULTICOL_FRMS, dev->base_addr + TLAN_DIO_ADR );
2169 multi_col = inb( dev->base_addr + TLAN_DIO_DATA ); 2169 multi_col = inb( dev->base_addr + TLAN_DIO_DATA );
2170 multi_col += inb( dev->base_addr + TLAN_DIO_DATA + 1 ) << 8; 2170 multi_col += inb( dev->base_addr + TLAN_DIO_DATA + 1 ) << 8;
@@ -2190,7 +2190,7 @@ void TLan_ReadAndClearStats( struct net_device *dev, int record )
2190 priv->stats.tx_aborted_errors += tx_under; 2190 priv->stats.tx_aborted_errors += tx_under;
2191 priv->stats.tx_carrier_errors += loss; 2191 priv->stats.tx_carrier_errors += loss;
2192 } 2192 }
2193 2193
2194} /* TLan_ReadAndClearStats */ 2194} /* TLan_ReadAndClearStats */
2195 2195
2196 2196
@@ -2231,7 +2231,7 @@ TLan_ResetAdapter( struct net_device *dev )
2231 data = inl(dev->base_addr + TLAN_HOST_CMD); 2231 data = inl(dev->base_addr + TLAN_HOST_CMD);
2232 data |= TLAN_HC_AD_RST; 2232 data |= TLAN_HC_AD_RST;
2233 outl(data, dev->base_addr + TLAN_HOST_CMD); 2233 outl(data, dev->base_addr + TLAN_HOST_CMD);
2234 2234
2235 udelay(1000); 2235 udelay(1000);
2236 2236
2237/* 2. Turn off interrupts. ( Probably isn't necessary ) */ 2237/* 2. Turn off interrupts. ( Probably isn't necessary ) */
@@ -2270,7 +2270,7 @@ TLan_ResetAdapter( struct net_device *dev )
2270 } 2270 }
2271 TLan_PhyDetect( dev ); 2271 TLan_PhyDetect( dev );
2272 data = TLAN_NET_CFG_1FRAG | TLAN_NET_CFG_1CHAN; 2272 data = TLAN_NET_CFG_1FRAG | TLAN_NET_CFG_1CHAN;
2273 2273
2274 if ( priv->adapter->flags & TLAN_ADAPTER_BIT_RATE_PHY ) { 2274 if ( priv->adapter->flags & TLAN_ADAPTER_BIT_RATE_PHY ) {
2275 data |= TLAN_NET_CFG_BIT; 2275 data |= TLAN_NET_CFG_BIT;
2276 if ( priv->aui == 1 ) { 2276 if ( priv->aui == 1 ) {
@@ -2320,15 +2320,15 @@ TLan_FinishReset( struct net_device *dev )
2320 data |= TLAN_NET_CMD_DUPLEX; 2320 data |= TLAN_NET_CMD_DUPLEX;
2321 } 2321 }
2322 TLan_DioWrite8( dev->base_addr, TLAN_NET_CMD, data ); 2322 TLan_DioWrite8( dev->base_addr, TLAN_NET_CMD, data );
2323 data = TLAN_NET_MASK_MASK4 | TLAN_NET_MASK_MASK5; 2323 data = TLAN_NET_MASK_MASK4 | TLAN_NET_MASK_MASK5;
2324 if ( priv->phyNum == 0 ) { 2324 if ( priv->phyNum == 0 ) {
2325 data |= TLAN_NET_MASK_MASK7; 2325 data |= TLAN_NET_MASK_MASK7;
2326 } 2326 }
2327 TLan_DioWrite8( dev->base_addr, TLAN_NET_MASK, data ); 2327 TLan_DioWrite8( dev->base_addr, TLAN_NET_MASK, data );
2328 TLan_DioWrite16( dev->base_addr, TLAN_MAX_RX, ((1536)+7)&~7 ); 2328 TLan_DioWrite16( dev->base_addr, TLAN_MAX_RX, ((1536)+7)&~7 );
2329 TLan_MiiReadReg( dev, phy, MII_GEN_ID_HI, &tlphy_id1 ); 2329 TLan_MiiReadReg( dev, phy, MII_GEN_ID_HI, &tlphy_id1 );
2330 TLan_MiiReadReg( dev, phy, MII_GEN_ID_LO, &tlphy_id2 ); 2330 TLan_MiiReadReg( dev, phy, MII_GEN_ID_LO, &tlphy_id2 );
2331 2331
2332 if ( ( priv->adapter->flags & TLAN_ADAPTER_UNMANAGED_PHY ) || ( priv->aui ) ) { 2332 if ( ( priv->adapter->flags & TLAN_ADAPTER_UNMANAGED_PHY ) || ( priv->aui ) ) {
2333 status = MII_GS_LINK; 2333 status = MII_GS_LINK;
2334 printk( "TLAN: %s: Link forced.\n", dev->name ); 2334 printk( "TLAN: %s: Link forced.\n", dev->name );
@@ -2336,15 +2336,15 @@ TLan_FinishReset( struct net_device *dev )
2336 TLan_MiiReadReg( dev, phy, MII_GEN_STS, &status ); 2336 TLan_MiiReadReg( dev, phy, MII_GEN_STS, &status );
2337 udelay( 1000 ); 2337 udelay( 1000 );
2338 TLan_MiiReadReg( dev, phy, MII_GEN_STS, &status ); 2338 TLan_MiiReadReg( dev, phy, MII_GEN_STS, &status );
2339 if ( (status & MII_GS_LINK) && /* We only support link info on Nat.Sem. PHY's */ 2339 if ( (status & MII_GS_LINK) && /* We only support link info on Nat.Sem. PHY's */
2340 (tlphy_id1 == NAT_SEM_ID1) && 2340 (tlphy_id1 == NAT_SEM_ID1) &&
2341 (tlphy_id2 == NAT_SEM_ID2) ) { 2341 (tlphy_id2 == NAT_SEM_ID2) ) {
2342 TLan_MiiReadReg( dev, phy, MII_AN_LPA, &partner ); 2342 TLan_MiiReadReg( dev, phy, MII_AN_LPA, &partner );
2343 TLan_MiiReadReg( dev, phy, TLAN_TLPHY_PAR, &tlphy_par ); 2343 TLan_MiiReadReg( dev, phy, TLAN_TLPHY_PAR, &tlphy_par );
2344 2344
2345 printk( "TLAN: %s: Link active with ", dev->name ); 2345 printk( "TLAN: %s: Link active with ", dev->name );
2346 if (!(tlphy_par & TLAN_PHY_AN_EN_STAT)) { 2346 if (!(tlphy_par & TLAN_PHY_AN_EN_STAT)) {
2347 printk( "forced 10%sMbps %s-Duplex\n", 2347 printk( "forced 10%sMbps %s-Duplex\n",
2348 tlphy_par & TLAN_PHY_SPEED_100 ? "" : "0", 2348 tlphy_par & TLAN_PHY_SPEED_100 ? "" : "0",
2349 tlphy_par & TLAN_PHY_DUPLEX_FULL ? "Full" : "Half"); 2349 tlphy_par & TLAN_PHY_DUPLEX_FULL ? "Full" : "Half");
2350 } else { 2350 } else {
@@ -2359,12 +2359,12 @@ TLan_FinishReset( struct net_device *dev )
2359 } 2359 }
2360 2360
2361 TLan_DioWrite8( dev->base_addr, TLAN_LED_REG, TLAN_LED_LINK ); 2361 TLan_DioWrite8( dev->base_addr, TLAN_LED_REG, TLAN_LED_LINK );
2362#ifdef MONITOR 2362#ifdef MONITOR
2363 /* We have link beat..for now anyway */ 2363 /* We have link beat..for now anyway */
2364 priv->link = 1; 2364 priv->link = 1;
2365 /*Enabling link beat monitoring */ 2365 /*Enabling link beat monitoring */
2366 TLan_SetTimer( dev, (10*HZ), TLAN_TIMER_LINK_BEAT ); 2366 TLan_SetTimer( dev, (10*HZ), TLAN_TIMER_LINK_BEAT );
2367#endif 2367#endif
2368 } else if (status & MII_GS_LINK) { 2368 } else if (status & MII_GS_LINK) {
2369 printk( "TLAN: %s: Link active\n", dev->name ); 2369 printk( "TLAN: %s: Link active\n", dev->name );
2370 TLan_DioWrite8( dev->base_addr, TLAN_LED_REG, TLAN_LED_LINK ); 2370 TLan_DioWrite8( dev->base_addr, TLAN_LED_REG, TLAN_LED_LINK );
@@ -2426,7 +2426,7 @@ TLan_FinishReset( struct net_device *dev )
2426void TLan_SetMac( struct net_device *dev, int areg, char *mac ) 2426void TLan_SetMac( struct net_device *dev, int areg, char *mac )
2427{ 2427{
2428 int i; 2428 int i;
2429 2429
2430 areg *= 6; 2430 areg *= 6;
2431 2431
2432 if ( mac != NULL ) { 2432 if ( mac != NULL ) {
@@ -2460,7 +2460,7 @@ void TLan_SetMac( struct net_device *dev, int areg, char *mac )
2460 * Parms: 2460 * Parms:
2461 * dev A pointer to the device structure of the 2461 * dev A pointer to the device structure of the
2462 * TLAN device having the PHYs to be detailed. 2462 * TLAN device having the PHYs to be detailed.
2463 * 2463 *
2464 * This function prints the registers a PHY (aka transceiver). 2464 * This function prints the registers a PHY (aka transceiver).
2465 * 2465 *
2466 ********************************************************************/ 2466 ********************************************************************/
@@ -2528,7 +2528,7 @@ void TLan_PhyDetect( struct net_device *dev )
2528 } 2528 }
2529 2529
2530 TLan_MiiReadReg( dev, TLAN_PHY_MAX_ADDR, MII_GEN_ID_HI, &hi ); 2530 TLan_MiiReadReg( dev, TLAN_PHY_MAX_ADDR, MII_GEN_ID_HI, &hi );
2531 2531
2532 if ( hi != 0xFFFF ) { 2532 if ( hi != 0xFFFF ) {
2533 priv->phy[0] = TLAN_PHY_MAX_ADDR; 2533 priv->phy[0] = TLAN_PHY_MAX_ADDR;
2534 } else { 2534 } else {
@@ -2650,10 +2650,10 @@ void TLan_PhyStartLink( struct net_device *dev )
2650 TLan_MiiReadReg( dev, phy, MII_GEN_STS, &status ); 2650 TLan_MiiReadReg( dev, phy, MII_GEN_STS, &status );
2651 TLan_MiiReadReg( dev, phy, MII_GEN_STS, &ability ); 2651 TLan_MiiReadReg( dev, phy, MII_GEN_STS, &ability );
2652 2652
2653 if ( ( status & MII_GS_AUTONEG ) && 2653 if ( ( status & MII_GS_AUTONEG ) &&
2654 ( ! priv->aui ) ) { 2654 ( ! priv->aui ) ) {
2655 ability = status >> 11; 2655 ability = status >> 11;
2656 if ( priv->speed == TLAN_SPEED_10 && 2656 if ( priv->speed == TLAN_SPEED_10 &&
2657 priv->duplex == TLAN_DUPLEX_HALF) { 2657 priv->duplex == TLAN_DUPLEX_HALF) {
2658 TLan_MiiWriteReg( dev, phy, MII_GEN_CTL, 0x0000); 2658 TLan_MiiWriteReg( dev, phy, MII_GEN_CTL, 0x0000);
2659 } else if ( priv->speed == TLAN_SPEED_10 && 2659 } else if ( priv->speed == TLAN_SPEED_10 &&
@@ -2668,7 +2668,7 @@ void TLan_PhyStartLink( struct net_device *dev )
2668 priv->tlanFullDuplex = TRUE; 2668 priv->tlanFullDuplex = TRUE;
2669 TLan_MiiWriteReg( dev, phy, MII_GEN_CTL, 0x2100); 2669 TLan_MiiWriteReg( dev, phy, MII_GEN_CTL, 0x2100);
2670 } else { 2670 } else {
2671 2671
2672 /* Set Auto-Neg advertisement */ 2672 /* Set Auto-Neg advertisement */
2673 TLan_MiiWriteReg( dev, phy, MII_AN_ADV, (ability << 5) | 1); 2673 TLan_MiiWriteReg( dev, phy, MII_AN_ADV, (ability << 5) | 1);
2674 /* Enablee Auto-Neg */ 2674 /* Enablee Auto-Neg */
@@ -2684,9 +2684,9 @@ void TLan_PhyStartLink( struct net_device *dev )
2684 TLan_SetTimer( dev, (2*HZ), TLAN_TIMER_PHY_FINISH_AN ); 2684 TLan_SetTimer( dev, (2*HZ), TLAN_TIMER_PHY_FINISH_AN );
2685 return; 2685 return;
2686 } 2686 }
2687 2687
2688 } 2688 }
2689 2689
2690 if ( ( priv->aui ) && ( priv->phyNum != 0 ) ) { 2690 if ( ( priv->aui ) && ( priv->phyNum != 0 ) ) {
2691 priv->phyNum = 0; 2691 priv->phyNum = 0;
2692 data = TLAN_NET_CFG_1FRAG | TLAN_NET_CFG_1CHAN | TLAN_NET_CFG_PHY_EN; 2692 data = TLAN_NET_CFG_1FRAG | TLAN_NET_CFG_1CHAN | TLAN_NET_CFG_PHY_EN;
@@ -2698,7 +2698,7 @@ void TLan_PhyStartLink( struct net_device *dev )
2698 TLan_MiiReadReg( dev, phy, TLAN_TLPHY_CTL, &tctl ); 2698 TLan_MiiReadReg( dev, phy, TLAN_TLPHY_CTL, &tctl );
2699 if ( priv->aui ) { 2699 if ( priv->aui ) {
2700 tctl |= TLAN_TC_AUISEL; 2700 tctl |= TLAN_TC_AUISEL;
2701 } else { 2701 } else {
2702 tctl &= ~TLAN_TC_AUISEL; 2702 tctl &= ~TLAN_TC_AUISEL;
2703 if ( priv->duplex == TLAN_DUPLEX_FULL ) { 2703 if ( priv->duplex == TLAN_DUPLEX_FULL ) {
2704 control |= MII_GC_DUPLEX; 2704 control |= MII_GC_DUPLEX;
@@ -2731,7 +2731,7 @@ void TLan_PhyFinishAutoNeg( struct net_device *dev )
2731 u16 mode; 2731 u16 mode;
2732 u16 phy; 2732 u16 phy;
2733 u16 status; 2733 u16 status;
2734 2734
2735 phy = priv->phy[priv->phyNum]; 2735 phy = priv->phy[priv->phyNum];
2736 2736
2737 TLan_MiiReadReg( dev, phy, MII_GEN_STS, &status ); 2737 TLan_MiiReadReg( dev, phy, MII_GEN_STS, &status );
@@ -2783,7 +2783,7 @@ void TLan_PhyFinishAutoNeg( struct net_device *dev )
2783 /* Wait for 100 ms. No reason in partiticular. 2783 /* Wait for 100 ms. No reason in partiticular.
2784 */ 2784 */
2785 TLan_SetTimer( dev, (HZ/10), TLAN_TIMER_FINISH_RESET ); 2785 TLan_SetTimer( dev, (HZ/10), TLAN_TIMER_FINISH_RESET );
2786 2786
2787} /* TLan_PhyFinishAutoNeg */ 2787} /* TLan_PhyFinishAutoNeg */
2788 2788
2789#ifdef MONITOR 2789#ifdef MONITOR
@@ -2792,13 +2792,13 @@ void TLan_PhyFinishAutoNeg( struct net_device *dev )
2792 * 2792 *
2793 * TLan_phyMonitor 2793 * TLan_phyMonitor
2794 * 2794 *
2795 * Returns: 2795 * Returns:
2796 * None 2796 * None
2797 * 2797 *
2798 * Params: 2798 * Params:
2799 * dev The device structure of this device. 2799 * dev The device structure of this device.
2800 * 2800 *
2801 * 2801 *
2802 * This function monitors PHY condition by reading the status 2802 * This function monitors PHY condition by reading the status
2803 * register via the MII bus. This can be used to give info 2803 * register via the MII bus. This can be used to give info
2804 * about link changes (up/down), and possible switch to alternate 2804 * about link changes (up/down), and possible switch to alternate
@@ -2818,7 +2818,7 @@ void TLan_PhyMonitor( struct net_device *dev )
2818 TLan_MiiReadReg( dev, phy, MII_GEN_STS, &phy_status ); 2818 TLan_MiiReadReg( dev, phy, MII_GEN_STS, &phy_status );
2819 2819
2820 /* Check if link has been lost */ 2820 /* Check if link has been lost */
2821 if (!(phy_status & MII_GS_LINK)) { 2821 if (!(phy_status & MII_GS_LINK)) {
2822 if (priv->link) { 2822 if (priv->link) {
2823 priv->link = 0; 2823 priv->link = 0;
2824 printk(KERN_DEBUG "TLAN: %s has lost link\n", dev->name); 2824 printk(KERN_DEBUG "TLAN: %s has lost link\n", dev->name);
@@ -2837,7 +2837,7 @@ void TLan_PhyMonitor( struct net_device *dev )
2837 2837
2838 /* Setup a new monitor */ 2838 /* Setup a new monitor */
2839 TLan_SetTimer( dev, (2*HZ), TLAN_TIMER_LINK_BEAT ); 2839 TLan_SetTimer( dev, (2*HZ), TLAN_TIMER_LINK_BEAT );
2840} 2840}
2841 2841
2842#endif /* MONITOR */ 2842#endif /* MONITOR */
2843 2843
@@ -2891,7 +2891,7 @@ int TLan_MiiReadReg( struct net_device *dev, u16 phy, u16 reg, u16 *val )
2891 err = FALSE; 2891 err = FALSE;
2892 outw(TLAN_NET_SIO, dev->base_addr + TLAN_DIO_ADR); 2892 outw(TLAN_NET_SIO, dev->base_addr + TLAN_DIO_ADR);
2893 sio = dev->base_addr + TLAN_DIO_DATA + TLAN_NET_SIO; 2893 sio = dev->base_addr + TLAN_DIO_DATA + TLAN_NET_SIO;
2894 2894
2895 if (!in_irq()) 2895 if (!in_irq())
2896 spin_lock_irqsave(&priv->lock, flags); 2896 spin_lock_irqsave(&priv->lock, flags);
2897 2897
@@ -2939,7 +2939,7 @@ int TLan_MiiReadReg( struct net_device *dev, u16 phy, u16 reg, u16 *val )
2939 TLan_SetBit(TLAN_NET_SIO_MINTEN, sio); 2939 TLan_SetBit(TLAN_NET_SIO_MINTEN, sio);
2940 2940
2941 *val = tmp; 2941 *val = tmp;
2942 2942
2943 if (!in_irq()) 2943 if (!in_irq())
2944 spin_unlock_irqrestore(&priv->lock, flags); 2944 spin_unlock_irqrestore(&priv->lock, flags);
2945 2945
@@ -3058,7 +3058,7 @@ void TLan_MiiWriteReg( struct net_device *dev, u16 phy, u16 reg, u16 val )
3058 3058
3059 outw(TLAN_NET_SIO, dev->base_addr + TLAN_DIO_ADR); 3059 outw(TLAN_NET_SIO, dev->base_addr + TLAN_DIO_ADR);
3060 sio = dev->base_addr + TLAN_DIO_DATA + TLAN_NET_SIO; 3060 sio = dev->base_addr + TLAN_DIO_DATA + TLAN_NET_SIO;
3061 3061
3062 if (!in_irq()) 3062 if (!in_irq())
3063 spin_lock_irqsave(&priv->lock, flags); 3063 spin_lock_irqsave(&priv->lock, flags);
3064 3064
@@ -3081,7 +3081,7 @@ void TLan_MiiWriteReg( struct net_device *dev, u16 phy, u16 reg, u16 val )
3081 3081
3082 if ( minten ) 3082 if ( minten )
3083 TLan_SetBit( TLAN_NET_SIO_MINTEN, sio ); 3083 TLan_SetBit( TLAN_NET_SIO_MINTEN, sio );
3084 3084
3085 if (!in_irq()) 3085 if (!in_irq())
3086 spin_unlock_irqrestore(&priv->lock, flags); 3086 spin_unlock_irqrestore(&priv->lock, flags);
3087 3087
@@ -3109,7 +3109,7 @@ void TLan_MiiWriteReg( struct net_device *dev, u16 phy, u16 reg, u16 val )
3109 * 3109 *
3110 * Returns: 3110 * Returns:
3111 * Nothing 3111 * Nothing
3112 * Parms: 3112 * Parms:
3113 * io_base The IO port base address for the 3113 * io_base The IO port base address for the
3114 * TLAN device with the EEPROM to 3114 * TLAN device with the EEPROM to
3115 * use. 3115 * use.