diff options
author | Alexander Beregalov <a.beregalov@gmail.com> | 2009-05-26 08:35:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-26 23:35:02 -0400 |
commit | 646cdb32831eebe8c2f742c293d0d266326854d9 (patch) | |
tree | 43b2460ea3704f2b6e1ff0c53cc592ecaa4d3747 /drivers/net/3c507.c | |
parent | d3f65f7c3cf11b036bbc01f22ac5c958570e724c (diff) |
3c50x: convert printk() to pr_<foo>()
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/3c507.c')
-rw-r--r-- | drivers/net/3c507.c | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/drivers/net/3c507.c b/drivers/net/3c507.c index fbbaf826deff..96b86659381a 100644 --- a/drivers/net/3c507.c +++ b/drivers/net/3c507.c | |||
@@ -364,7 +364,7 @@ static const struct net_device_ops netdev_ops = { | |||
364 | 364 | ||
365 | static int __init el16_probe1(struct net_device *dev, int ioaddr) | 365 | static int __init el16_probe1(struct net_device *dev, int ioaddr) |
366 | { | 366 | { |
367 | static unsigned char init_ID_done, version_printed; | 367 | static unsigned char init_ID_done; |
368 | int i, irq, irqval, retval; | 368 | int i, irq, irqval, retval; |
369 | struct net_local *lp; | 369 | struct net_local *lp; |
370 | 370 | ||
@@ -391,10 +391,7 @@ static int __init el16_probe1(struct net_device *dev, int ioaddr) | |||
391 | goto out; | 391 | goto out; |
392 | } | 392 | } |
393 | 393 | ||
394 | if (net_debug && version_printed++ == 0) | 394 | pr_info("%s: 3c507 at %#x,", dev->name, ioaddr); |
395 | printk(version); | ||
396 | |||
397 | printk("%s: 3c507 at %#x,", dev->name, ioaddr); | ||
398 | 395 | ||
399 | /* We should make a few more checks here, like the first three octets of | 396 | /* We should make a few more checks here, like the first three octets of |
400 | the S.A. for the manufacturer's code. */ | 397 | the S.A. for the manufacturer's code. */ |
@@ -403,7 +400,8 @@ static int __init el16_probe1(struct net_device *dev, int ioaddr) | |||
403 | 400 | ||
404 | irqval = request_irq(irq, &el16_interrupt, 0, DRV_NAME, dev); | 401 | irqval = request_irq(irq, &el16_interrupt, 0, DRV_NAME, dev); |
405 | if (irqval) { | 402 | if (irqval) { |
406 | printk(KERN_ERR "3c507: unable to get IRQ %d (irqval=%d).\n", irq, irqval); | 403 | pr_cont("\n"); |
404 | pr_err("3c507: unable to get IRQ %d (irqval=%d).\n", irq, irqval); | ||
407 | retval = -EAGAIN; | 405 | retval = -EAGAIN; |
408 | goto out; | 406 | goto out; |
409 | } | 407 | } |
@@ -414,7 +412,7 @@ static int __init el16_probe1(struct net_device *dev, int ioaddr) | |||
414 | outb(0x01, ioaddr + MISC_CTRL); | 412 | outb(0x01, ioaddr + MISC_CTRL); |
415 | for (i = 0; i < 6; i++) | 413 | for (i = 0; i < 6; i++) |
416 | dev->dev_addr[i] = inb(ioaddr + i); | 414 | dev->dev_addr[i] = inb(ioaddr + i); |
417 | printk(" %pM", dev->dev_addr); | 415 | pr_cont(" %pM", dev->dev_addr); |
418 | 416 | ||
419 | if (mem_start) | 417 | if (mem_start) |
420 | net_debug = mem_start & 7; | 418 | net_debug = mem_start & 7; |
@@ -443,18 +441,18 @@ static int __init el16_probe1(struct net_device *dev, int ioaddr) | |||
443 | dev->if_port = (inb(ioaddr + ROM_CONFIG) & 0x80) ? 1 : 0; | 441 | dev->if_port = (inb(ioaddr + ROM_CONFIG) & 0x80) ? 1 : 0; |
444 | dev->irq = inb(ioaddr + IRQ_CONFIG) & 0x0f; | 442 | dev->irq = inb(ioaddr + IRQ_CONFIG) & 0x0f; |
445 | 443 | ||
446 | printk(", IRQ %d, %sternal xcvr, memory %#lx-%#lx.\n", dev->irq, | 444 | pr_cont(", IRQ %d, %sternal xcvr, memory %#lx-%#lx.\n", dev->irq, |
447 | dev->if_port ? "ex" : "in", dev->mem_start, dev->mem_end-1); | 445 | dev->if_port ? "ex" : "in", dev->mem_start, dev->mem_end-1); |
448 | 446 | ||
449 | if (net_debug) | 447 | if (net_debug) |
450 | printk(version); | 448 | pr_debug("%s", version); |
451 | 449 | ||
452 | lp = netdev_priv(dev); | 450 | lp = netdev_priv(dev); |
453 | memset(lp, 0, sizeof(*lp)); | 451 | memset(lp, 0, sizeof(*lp)); |
454 | spin_lock_init(&lp->lock); | 452 | spin_lock_init(&lp->lock); |
455 | lp->base = ioremap(dev->mem_start, RX_BUF_END); | 453 | lp->base = ioremap(dev->mem_start, RX_BUF_END); |
456 | if (!lp->base) { | 454 | if (!lp->base) { |
457 | printk(KERN_ERR "3c507: unable to remap memory\n"); | 455 | pr_err("3c507: unable to remap memory\n"); |
458 | retval = -EAGAIN; | 456 | retval = -EAGAIN; |
459 | goto out1; | 457 | goto out1; |
460 | } | 458 | } |
@@ -488,20 +486,20 @@ static void el16_tx_timeout (struct net_device *dev) | |||
488 | void __iomem *shmem = lp->base; | 486 | void __iomem *shmem = lp->base; |
489 | 487 | ||
490 | if (net_debug > 1) | 488 | if (net_debug > 1) |
491 | printk ("%s: transmit timed out, %s? ", dev->name, | 489 | pr_debug("%s: transmit timed out, %s? ", dev->name, |
492 | readw(shmem + iSCB_STATUS) & 0x8000 ? "IRQ conflict" : | 490 | readw(shmem + iSCB_STATUS) & 0x8000 ? "IRQ conflict" : |
493 | "network cable problem"); | 491 | "network cable problem"); |
494 | /* Try to restart the adaptor. */ | 492 | /* Try to restart the adaptor. */ |
495 | if (lp->last_restart == dev->stats.tx_packets) { | 493 | if (lp->last_restart == dev->stats.tx_packets) { |
496 | if (net_debug > 1) | 494 | if (net_debug > 1) |
497 | printk ("Resetting board.\n"); | 495 | pr_cont("Resetting board.\n"); |
498 | /* Completely reset the adaptor. */ | 496 | /* Completely reset the adaptor. */ |
499 | init_82586_mem (dev); | 497 | init_82586_mem (dev); |
500 | lp->tx_pkts_in_ring = 0; | 498 | lp->tx_pkts_in_ring = 0; |
501 | } else { | 499 | } else { |
502 | /* Issue the channel attention signal and hope it "gets better". */ | 500 | /* Issue the channel attention signal and hope it "gets better". */ |
503 | if (net_debug > 1) | 501 | if (net_debug > 1) |
504 | printk ("Kicking board.\n"); | 502 | pr_cont("Kicking board.\n"); |
505 | writew(0xf000 | CUC_START | RX_START, shmem + iSCB_CMD); | 503 | writew(0xf000 | CUC_START | RX_START, shmem + iSCB_CMD); |
506 | outb (0, ioaddr + SIGNAL_CA); /* Issue channel-attn. */ | 504 | outb (0, ioaddr + SIGNAL_CA); /* Issue channel-attn. */ |
507 | lp->last_restart = dev->stats.tx_packets; | 505 | lp->last_restart = dev->stats.tx_packets; |
@@ -553,7 +551,8 @@ static irqreturn_t el16_interrupt(int irq, void *dev_id) | |||
553 | void __iomem *shmem; | 551 | void __iomem *shmem; |
554 | 552 | ||
555 | if (dev == NULL) { | 553 | if (dev == NULL) { |
556 | printk ("net_interrupt(): irq %d for unknown device.\n", irq); | 554 | pr_err("%s: net_interrupt(): irq %d for unknown device.\n", |
555 | dev->name, irq); | ||
557 | return IRQ_NONE; | 556 | return IRQ_NONE; |
558 | } | 557 | } |
559 | 558 | ||
@@ -566,7 +565,7 @@ static irqreturn_t el16_interrupt(int irq, void *dev_id) | |||
566 | status = readw(shmem+iSCB_STATUS); | 565 | status = readw(shmem+iSCB_STATUS); |
567 | 566 | ||
568 | if (net_debug > 4) { | 567 | if (net_debug > 4) { |
569 | printk("%s: 3c507 interrupt, status %4.4x.\n", dev->name, status); | 568 | pr_debug("%s: 3c507 interrupt, status %4.4x.\n", dev->name, status); |
570 | } | 569 | } |
571 | 570 | ||
572 | /* Disable the 82586's input to the interrupt line. */ | 571 | /* Disable the 82586's input to the interrupt line. */ |
@@ -577,7 +576,7 @@ static irqreturn_t el16_interrupt(int irq, void *dev_id) | |||
577 | unsigned short tx_status = readw(shmem+lp->tx_reap); | 576 | unsigned short tx_status = readw(shmem+lp->tx_reap); |
578 | if (!(tx_status & 0x8000)) { | 577 | if (!(tx_status & 0x8000)) { |
579 | if (net_debug > 5) | 578 | if (net_debug > 5) |
580 | printk("Tx command incomplete (%#x).\n", lp->tx_reap); | 579 | pr_debug("Tx command incomplete (%#x).\n", lp->tx_reap); |
581 | break; | 580 | break; |
582 | } | 581 | } |
583 | /* Tx unsuccessful or some interesting status bit set. */ | 582 | /* Tx unsuccessful or some interesting status bit set. */ |
@@ -591,7 +590,7 @@ static irqreturn_t el16_interrupt(int irq, void *dev_id) | |||
591 | } | 590 | } |
592 | dev->stats.tx_packets++; | 591 | dev->stats.tx_packets++; |
593 | if (net_debug > 5) | 592 | if (net_debug > 5) |
594 | printk("Reaped %x, Tx status %04x.\n" , lp->tx_reap, tx_status); | 593 | pr_debug("Reaped %x, Tx status %04x.\n" , lp->tx_reap, tx_status); |
595 | lp->tx_reap += TX_BUF_SIZE; | 594 | lp->tx_reap += TX_BUF_SIZE; |
596 | if (lp->tx_reap > RX_BUF_START - TX_BUF_SIZE) | 595 | if (lp->tx_reap > RX_BUF_START - TX_BUF_SIZE) |
597 | lp->tx_reap = TX_BUF_START; | 596 | lp->tx_reap = TX_BUF_START; |
@@ -606,7 +605,7 @@ static irqreturn_t el16_interrupt(int irq, void *dev_id) | |||
606 | 605 | ||
607 | if (status & 0x4000) { /* Packet received. */ | 606 | if (status & 0x4000) { /* Packet received. */ |
608 | if (net_debug > 5) | 607 | if (net_debug > 5) |
609 | printk("Received packet, rx_head %04x.\n", lp->rx_head); | 608 | pr_debug("Received packet, rx_head %04x.\n", lp->rx_head); |
610 | el16_rx(dev); | 609 | el16_rx(dev); |
611 | } | 610 | } |
612 | 611 | ||
@@ -615,7 +614,7 @@ static irqreturn_t el16_interrupt(int irq, void *dev_id) | |||
615 | 614 | ||
616 | if ((status & 0x0700) != 0x0200 && netif_running(dev)) { | 615 | if ((status & 0x0700) != 0x0200 && netif_running(dev)) { |
617 | if (net_debug) | 616 | if (net_debug) |
618 | printk("%s: Command unit stopped, status %04x, restarting.\n", | 617 | pr_debug("%s: Command unit stopped, status %04x, restarting.\n", |
619 | dev->name, status); | 618 | dev->name, status); |
620 | /* If this ever occurs we should really re-write the idle loop, reset | 619 | /* If this ever occurs we should really re-write the idle loop, reset |
621 | the Tx list, and do a complete restart of the command unit. | 620 | the Tx list, and do a complete restart of the command unit. |
@@ -627,7 +626,7 @@ static irqreturn_t el16_interrupt(int irq, void *dev_id) | |||
627 | /* The Rx unit is not ready, it must be hung. Restart the receiver by | 626 | /* The Rx unit is not ready, it must be hung. Restart the receiver by |
628 | initializing the rx buffers, and issuing an Rx start command. */ | 627 | initializing the rx buffers, and issuing an Rx start command. */ |
629 | if (net_debug) | 628 | if (net_debug) |
630 | printk("%s: Rx unit stopped, status %04x, restarting.\n", | 629 | pr_debug("%s: Rx unit stopped, status %04x, restarting.\n", |
631 | dev->name, status); | 630 | dev->name, status); |
632 | init_rx_bufs(dev); | 631 | init_rx_bufs(dev); |
633 | writew(RX_BUF_START,shmem+iSCB_RFA); | 632 | writew(RX_BUF_START,shmem+iSCB_RFA); |
@@ -753,9 +752,8 @@ static void init_82586_mem(struct net_device *dev) | |||
753 | int boguscnt = 50; | 752 | int boguscnt = 50; |
754 | while (readw(shmem+iSCB_STATUS) == 0) | 753 | while (readw(shmem+iSCB_STATUS) == 0) |
755 | if (--boguscnt == 0) { | 754 | if (--boguscnt == 0) { |
756 | printk("%s: i82586 initialization timed out with status %04x, " | 755 | pr_warning("%s: i82586 initialization timed out with status %04x, cmd %04x.\n", |
757 | "cmd %04x.\n", dev->name, | 756 | dev->name, readw(shmem+iSCB_STATUS), readw(shmem+iSCB_CMD)); |
758 | readw(shmem+iSCB_STATUS), readw(shmem+iSCB_CMD)); | ||
759 | break; | 757 | break; |
760 | } | 758 | } |
761 | /* Issue channel-attn -- the 82586 won't start. */ | 759 | /* Issue channel-attn -- the 82586 won't start. */ |
@@ -765,7 +763,7 @@ static void init_82586_mem(struct net_device *dev) | |||
765 | /* Disable loopback and enable interrupts. */ | 763 | /* Disable loopback and enable interrupts. */ |
766 | outb(0x84, ioaddr + MISC_CTRL); | 764 | outb(0x84, ioaddr + MISC_CTRL); |
767 | if (net_debug > 4) | 765 | if (net_debug > 4) |
768 | printk("%s: Initialized 82586, status %04x.\n", dev->name, | 766 | pr_debug("%s: Initialized 82586, status %04x.\n", dev->name, |
769 | readw(shmem+iSCB_STATUS)); | 767 | readw(shmem+iSCB_STATUS)); |
770 | return; | 768 | return; |
771 | } | 769 | } |
@@ -810,7 +808,7 @@ static void hardware_send_packet(struct net_device *dev, void *buf, short length | |||
810 | lp->tx_head = TX_BUF_START; | 808 | lp->tx_head = TX_BUF_START; |
811 | 809 | ||
812 | if (net_debug > 4) { | 810 | if (net_debug > 4) { |
813 | printk("%s: 3c507 @%x send length = %d, tx_block %3x, next %3x.\n", | 811 | pr_debug("%s: 3c507 @%x send length = %d, tx_block %3x, next %3x.\n", |
814 | dev->name, ioaddr, length, tx_block, lp->tx_head); | 812 | dev->name, ioaddr, length, tx_block, lp->tx_head); |
815 | } | 813 | } |
816 | 814 | ||
@@ -838,7 +836,7 @@ static void el16_rx(struct net_device *dev) | |||
838 | 836 | ||
839 | if (rfd_cmd != 0 || data_buffer_addr != rx_head + 22 | 837 | if (rfd_cmd != 0 || data_buffer_addr != rx_head + 22 |
840 | || (pkt_len & 0xC000) != 0xC000) { | 838 | || (pkt_len & 0xC000) != 0xC000) { |
841 | printk(KERN_ERR "%s: Rx frame at %#x corrupted, " | 839 | pr_err("%s: Rx frame at %#x corrupted, " |
842 | "status %04x cmd %04x next %04x " | 840 | "status %04x cmd %04x next %04x " |
843 | "data-buf @%04x %04x.\n", | 841 | "data-buf @%04x %04x.\n", |
844 | dev->name, rx_head, frame_status, rfd_cmd, | 842 | dev->name, rx_head, frame_status, rfd_cmd, |
@@ -858,8 +856,7 @@ static void el16_rx(struct net_device *dev) | |||
858 | pkt_len &= 0x3fff; | 856 | pkt_len &= 0x3fff; |
859 | skb = dev_alloc_skb(pkt_len+2); | 857 | skb = dev_alloc_skb(pkt_len+2); |
860 | if (skb == NULL) { | 858 | if (skb == NULL) { |
861 | printk(KERN_ERR "%s: Memory squeeze, " | 859 | pr_err("%s: Memory squeeze, dropping packet.\n", |
862 | "dropping packet.\n", | ||
863 | dev->name); | 860 | dev->name); |
864 | dev->stats.rx_dropped++; | 861 | dev->stats.rx_dropped++; |
865 | break; | 862 | break; |
@@ -926,7 +923,7 @@ MODULE_PARM_DESC(irq, "(ignored)"); | |||
926 | int __init init_module(void) | 923 | int __init init_module(void) |
927 | { | 924 | { |
928 | if (io == 0) | 925 | if (io == 0) |
929 | printk("3c507: You should not use auto-probing with insmod!\n"); | 926 | pr_notice("3c507: You should not use auto-probing with insmod!\n"); |
930 | dev_3c507 = el16_probe(-1); | 927 | dev_3c507 = el16_probe(-1); |
931 | return IS_ERR(dev_3c507) ? PTR_ERR(dev_3c507) : 0; | 928 | return IS_ERR(dev_3c507) ? PTR_ERR(dev_3c507) : 0; |
932 | } | 929 | } |