aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ewrk3.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/ewrk3.c
parent7a291083225af6e22ffaa46b3d91cfc1a1ccaab4 (diff)
drivers/net: Trim trailing whitespace
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ewrk3.c')
-rw-r--r--drivers/net/ewrk3.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/drivers/net/ewrk3.c b/drivers/net/ewrk3.c
index b987f9474730..78a1c425a9ab 100644
--- a/drivers/net/ewrk3.c
+++ b/drivers/net/ewrk3.c
@@ -359,13 +359,13 @@ struct net_device * __init ewrk3_probe(int unit)
359 SET_MODULE_OWNER(dev); 359 SET_MODULE_OWNER(dev);
360 360
361 err = ewrk3_probe1(dev, dev->base_addr, dev->irq); 361 err = ewrk3_probe1(dev, dev->base_addr, dev->irq);
362 if (err) 362 if (err)
363 goto out; 363 goto out;
364 return dev; 364 return dev;
365out: 365out:
366 free_netdev(dev); 366 free_netdev(dev);
367 return ERR_PTR(err); 367 return ERR_PTR(err);
368 368
369} 369}
370#endif 370#endif
371 371
@@ -378,7 +378,7 @@ static int __init ewrk3_probe1(struct net_device *dev, u_long iobase, int irq)
378 378
379 /* Address PROM pattern */ 379 /* Address PROM pattern */
380 err = isa_probe(dev, iobase); 380 err = isa_probe(dev, iobase);
381 if (err != 0) 381 if (err != 0)
382 err = eisa_probe(dev, iobase); 382 err = eisa_probe(dev, iobase);
383 383
384 if (err) 384 if (err)
@@ -391,7 +391,7 @@ static int __init ewrk3_probe1(struct net_device *dev, u_long iobase, int irq)
391 return err; 391 return err;
392} 392}
393 393
394static int __init 394static int __init
395ewrk3_hw_init(struct net_device *dev, u_long iobase) 395ewrk3_hw_init(struct net_device *dev, u_long iobase)
396{ 396{
397 struct ewrk3_private *lp; 397 struct ewrk3_private *lp;
@@ -435,19 +435,19 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
435 printk("%s: Device has a bad on-board EEPROM.\n", dev->name); 435 printk("%s: Device has a bad on-board EEPROM.\n", dev->name);
436 return -ENXIO; 436 return -ENXIO;
437 } 437 }
438 438
439 EthwrkSignature(name, eeprom_image); 439 EthwrkSignature(name, eeprom_image);
440 if (*name == '\0') 440 if (*name == '\0')
441 return -ENXIO; 441 return -ENXIO;
442 442
443 dev->base_addr = iobase; 443 dev->base_addr = iobase;
444 444
445 if (iobase > 0x400) { 445 if (iobase > 0x400) {
446 outb(eisa_cr, EISA_CR); /* Rewrite the EISA CR */ 446 outb(eisa_cr, EISA_CR); /* Rewrite the EISA CR */
447 } 447 }
448 lemac = eeprom_image[EEPROM_CHIPVER]; 448 lemac = eeprom_image[EEPROM_CHIPVER];
449 cmr = inb(EWRK3_CMR); 449 cmr = inb(EWRK3_CMR);
450 450
451 if (((lemac == LeMAC) && ((cmr & CMR_NO_EEPROM) != CMR_NO_EEPROM)) || 451 if (((lemac == LeMAC) && ((cmr & CMR_NO_EEPROM) != CMR_NO_EEPROM)) ||
452 ((lemac == LeMAC2) && !(cmr & CMR_HS))) { 452 ((lemac == LeMAC2) && !(cmr & CMR_HS))) {
453 printk("%s: %s at %#4lx", dev->name, name, iobase); 453 printk("%s: %s at %#4lx", dev->name, name, iobase);
@@ -468,7 +468,7 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
468 printk("%2.2x:", dev->dev_addr[i]); 468 printk("%2.2x:", dev->dev_addr[i]);
469 } 469 }
470 printk("%2.2x,\n", dev->dev_addr[i]); 470 printk("%2.2x,\n", dev->dev_addr[i]);
471 471
472 if (status) { 472 if (status) {
473 printk(" which has an EEPROM CRC error.\n"); 473 printk(" which has an EEPROM CRC error.\n");
474 return -ENXIO; 474 return -ENXIO;
@@ -490,7 +490,7 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
490 if (eeprom_image[EEPROM_SETUP] & SETUP_DRAM) 490 if (eeprom_image[EEPROM_SETUP] & SETUP_DRAM)
491 cmr |= CMR_DRAM; 491 cmr |= CMR_DRAM;
492 outb(cmr, EWRK3_CMR); 492 outb(cmr, EWRK3_CMR);
493 493
494 cr = inb(EWRK3_CR); /* Set up the Control Register */ 494 cr = inb(EWRK3_CR); /* Set up the Control Register */
495 cr |= eeprom_image[EEPROM_SETUP] & SETUP_APD; 495 cr |= eeprom_image[EEPROM_SETUP] & SETUP_APD;
496 if (cr & SETUP_APD) 496 if (cr & SETUP_APD)
@@ -524,7 +524,7 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
524 ** uncommenting this line. 524 ** uncommenting this line.
525 */ 525 */
526/* FORCE_2K_MODE; */ 526/* FORCE_2K_MODE; */
527 527
528 if (hard_strapped) { 528 if (hard_strapped) {
529 printk(" is hard strapped.\n"); 529 printk(" is hard strapped.\n");
530 } else if (mem_start) { 530 } else if (mem_start) {
@@ -544,44 +544,44 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
544 lp->hard_strapped = hard_strapped; 544 lp->hard_strapped = hard_strapped;
545 lp->led_mask = CR_LED; 545 lp->led_mask = CR_LED;
546 spin_lock_init(&lp->hw_lock); 546 spin_lock_init(&lp->hw_lock);
547 547
548 lp->mPage = 64; 548 lp->mPage = 64;
549 if (cmr & CMR_DRAM) 549 if (cmr & CMR_DRAM)
550 lp->mPage <<= 1; /* 2 DRAMS on module */ 550 lp->mPage <<= 1; /* 2 DRAMS on module */
551 551
552 sprintf(lp->adapter_name, "%s (%s)", name, dev->name); 552 sprintf(lp->adapter_name, "%s (%s)", name, dev->name);
553 553
554 lp->irq_mask = ICR_TNEM | ICR_TXDM | ICR_RNEM | ICR_RXDM; 554 lp->irq_mask = ICR_TNEM | ICR_TXDM | ICR_RNEM | ICR_RXDM;
555 555
556 if (!hard_strapped) { 556 if (!hard_strapped) {
557 /* 557 /*
558 ** Enable EWRK3 board interrupts for autoprobing 558 ** Enable EWRK3 board interrupts for autoprobing
559 */ 559 */
560 icr |= ICR_IE; /* Enable interrupts */ 560 icr |= ICR_IE; /* Enable interrupts */
561 outb(icr, EWRK3_ICR); 561 outb(icr, EWRK3_ICR);
562 562
563 /* The DMA channel may be passed in on this parameter. */ 563 /* The DMA channel may be passed in on this parameter. */
564 dev->dma = 0; 564 dev->dma = 0;
565 565
566 /* To auto-IRQ we enable the initialization-done and DMA err, 566 /* To auto-IRQ we enable the initialization-done and DMA err,
567 interrupts. For now we will always get a DMA error. */ 567 interrupts. For now we will always get a DMA error. */
568 if (dev->irq < 2) { 568 if (dev->irq < 2) {
569#ifndef MODULE 569#ifndef MODULE
570 u_char irqnum; 570 u_char irqnum;
571 unsigned long irq_mask; 571 unsigned long irq_mask;
572 572
573 573
574 irq_mask = probe_irq_on(); 574 irq_mask = probe_irq_on();
575 575
576 /* 576 /*
577 ** Trigger a TNE interrupt. 577 ** Trigger a TNE interrupt.
578 */ 578 */
579 icr |= ICR_TNEM; 579 icr |= ICR_TNEM;
580 outb(1, EWRK3_TDQ); /* Write to the TX done queue */ 580 outb(1, EWRK3_TDQ); /* Write to the TX done queue */
581 outb(icr, EWRK3_ICR); /* Unmask the TXD interrupt */ 581 outb(icr, EWRK3_ICR); /* Unmask the TXD interrupt */
582 582
583 irqnum = irq[((icr & IRQ_SEL) >> 4)]; 583 irqnum = irq[((icr & IRQ_SEL) >> 4)];
584 584
585 mdelay(20); 585 mdelay(20);
586 dev->irq = probe_irq_off(irq_mask); 586 dev->irq = probe_irq_off(irq_mask);
587 if ((dev->irq) && (irqnum == dev->irq)) { 587 if ((dev->irq) && (irqnum == dev->irq)) {
@@ -622,12 +622,12 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
622 SET_ETHTOOL_OPS(dev, &ethtool_ops); 622 SET_ETHTOOL_OPS(dev, &ethtool_ops);
623 dev->tx_timeout = ewrk3_timeout; 623 dev->tx_timeout = ewrk3_timeout;
624 dev->watchdog_timeo = QUEUE_PKT_TIMEOUT; 624 dev->watchdog_timeo = QUEUE_PKT_TIMEOUT;
625 625
626 dev->mem_start = 0; 626 dev->mem_start = 0;
627 627
628 return 0; 628 return 0;
629} 629}
630 630
631 631
632static int ewrk3_open(struct net_device *dev) 632static int ewrk3_open(struct net_device *dev)
633{ 633{
@@ -732,14 +732,14 @@ static void ewrk3_init(struct net_device *dev)
732/* 732/*
733 * Transmit timeout 733 * Transmit timeout
734 */ 734 */
735 735
736static void ewrk3_timeout(struct net_device *dev) 736static void ewrk3_timeout(struct net_device *dev)
737{ 737{
738 struct ewrk3_private *lp = netdev_priv(dev); 738 struct ewrk3_private *lp = netdev_priv(dev);
739 u_char icr, csr; 739 u_char icr, csr;
740 u_long iobase = dev->base_addr; 740 u_long iobase = dev->base_addr;
741 741
742 if (!lp->hard_strapped) 742 if (!lp->hard_strapped)
743 { 743 {
744 printk(KERN_WARNING"%s: transmit timed/locked out, status %04x, resetting.\n", 744 printk(KERN_WARNING"%s: transmit timed/locked out, status %04x, resetting.\n",
745 dev->name, inb(EWRK3_CSR)); 745 dev->name, inb(EWRK3_CSR));
@@ -1108,7 +1108,7 @@ static int ewrk3_close(struct net_device *dev)
1108 u_char icr, csr; 1108 u_char icr, csr;
1109 1109
1110 netif_stop_queue(dev); 1110 netif_stop_queue(dev);
1111 1111
1112 if (ewrk3_debug > 1) { 1112 if (ewrk3_debug > 1) {
1113 printk("%s: Shutting down ethercard, status was %2.2x.\n", 1113 printk("%s: Shutting down ethercard, status was %2.2x.\n",
1114 dev->name, inb(EWRK3_CSR)); 1114 dev->name, inb(EWRK3_CSR));
@@ -1697,7 +1697,7 @@ static int ewrk3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1697 u_char addr[HASH_TABLE_LEN * ETH_ALEN]; 1697 u_char addr[HASH_TABLE_LEN * ETH_ALEN];
1698 u_short val[(HASH_TABLE_LEN * ETH_ALEN) >> 1]; 1698 u_short val[(HASH_TABLE_LEN * ETH_ALEN) >> 1];
1699 }; 1699 };
1700 1700
1701 union ewrk3_addr *tmp; 1701 union ewrk3_addr *tmp;
1702 1702
1703 /* All we handle are private IOCTLs */ 1703 /* All we handle are private IOCTLs */
@@ -1717,7 +1717,7 @@ static int ewrk3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1717 if (copy_to_user(ioc->data, tmp->addr, ioc->len)) 1717 if (copy_to_user(ioc->data, tmp->addr, ioc->len))
1718 status = -EFAULT; 1718 status = -EFAULT;
1719 break; 1719 break;
1720 1720
1721 case EWRK3_SET_HWADDR: /* Set the hardware address */ 1721 case EWRK3_SET_HWADDR: /* Set the hardware address */
1722 if (capable(CAP_NET_ADMIN)) { 1722 if (capable(CAP_NET_ADMIN)) {
1723 spin_lock_irqsave(&lp->hw_lock, flags); 1723 spin_lock_irqsave(&lp->hw_lock, flags);
@@ -1990,7 +1990,7 @@ module_init(ewrk3_init_module);
1990#endif /* MODULE */ 1990#endif /* MODULE */
1991MODULE_LICENSE("GPL"); 1991MODULE_LICENSE("GPL");
1992 1992
1993 1993
1994 1994
1995/* 1995/*
1996 * Local variables: 1996 * Local variables: