aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/dscc4.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-06-26 15:01:32 -0400
committerDavid S. Miller <davem@davemloft.net>2011-06-27 03:09:47 -0400
commit09a1732bee89fc31e63b1bd999f93acd58843f35 (patch)
tree43b223a18d31431646d7297c49f361ea825b2524 /drivers/net/wan/dscc4.c
parent86fb0ccf90cc34642daf6cd902ee26516a0ff0a2 (diff)
dscc4: Update to current logging forms
Use pr_fmt, pr_<level> and netdev_<level> as appropriate. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan/dscc4.c')
-rw-r--r--drivers/net/wan/dscc4.c80
1 files changed, 38 insertions, 42 deletions
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index 3590d588327c..058e1697c174 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -80,6 +80,8 @@
80 * - misc crapectomy. 80 * - misc crapectomy.
81 */ 81 */
82 82
83#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
84
83#include <linux/module.h> 85#include <linux/module.h>
84#include <linux/sched.h> 86#include <linux/sched.h>
85#include <linux/types.h> 87#include <linux/types.h>
@@ -553,7 +555,7 @@ static int dscc4_wait_ack_cec(struct dscc4_dev_priv *dpriv,
553 schedule_timeout_uninterruptible(10); 555 schedule_timeout_uninterruptible(10);
554 rmb(); 556 rmb();
555 } while (++i > 0); 557 } while (++i > 0);
556 printk(KERN_ERR "%s: %s timeout\n", dev->name, msg); 558 netdev_err(dev, "%s timeout\n", msg);
557done: 559done:
558 return (i >= 0) ? i : -EAGAIN; 560 return (i >= 0) ? i : -EAGAIN;
559} 561}
@@ -569,18 +571,18 @@ static int dscc4_do_action(struct net_device *dev, char *msg)
569 u32 state = readl(ioaddr); 571 u32 state = readl(ioaddr);
570 572
571 if (state & ArAck) { 573 if (state & ArAck) {
572 printk(KERN_DEBUG "%s: %s ack\n", dev->name, msg); 574 netdev_dbg(dev, "%s ack\n", msg);
573 writel(ArAck, ioaddr); 575 writel(ArAck, ioaddr);
574 goto done; 576 goto done;
575 } else if (state & Arf) { 577 } else if (state & Arf) {
576 printk(KERN_ERR "%s: %s failed\n", dev->name, msg); 578 netdev_err(dev, "%s failed\n", msg);
577 writel(Arf, ioaddr); 579 writel(Arf, ioaddr);
578 i = -1; 580 i = -1;
579 goto done; 581 goto done;
580 } 582 }
581 rmb(); 583 rmb();
582 } while (++i > 0); 584 } while (++i > 0);
583 printk(KERN_ERR "%s: %s timeout\n", dev->name, msg); 585 netdev_err(dev, "%s timeout\n", msg);
584done: 586done:
585 return i; 587 return i;
586} 588}
@@ -636,7 +638,7 @@ static void dscc4_tx_reset(struct dscc4_dev_priv *dpriv, struct net_device *dev)
636 638
637 writel(MTFi|Rdt, dpriv->base_addr + dpriv->dev_id*0x0c + CH0CFG); 639 writel(MTFi|Rdt, dpriv->base_addr + dpriv->dev_id*0x0c + CH0CFG);
638 if (dscc4_do_action(dev, "Rdt") < 0) 640 if (dscc4_do_action(dev, "Rdt") < 0)
639 printk(KERN_ERR "%s: Tx reset failed\n", dev->name); 641 netdev_err(dev, "Tx reset failed\n");
640} 642}
641#endif 643#endif
642 644
@@ -722,22 +724,20 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,
722 724
723 rc = pci_request_region(pdev, 0, "registers"); 725 rc = pci_request_region(pdev, 0, "registers");
724 if (rc < 0) { 726 if (rc < 0) {
725 printk(KERN_ERR "%s: can't reserve MMIO region (regs)\n", 727 pr_err("can't reserve MMIO region (regs)\n");
726 DRV_NAME);
727 goto err_disable_0; 728 goto err_disable_0;
728 } 729 }
729 rc = pci_request_region(pdev, 1, "LBI interface"); 730 rc = pci_request_region(pdev, 1, "LBI interface");
730 if (rc < 0) { 731 if (rc < 0) {
731 printk(KERN_ERR "%s: can't reserve MMIO region (lbi)\n", 732 pr_err("can't reserve MMIO region (lbi)\n");
732 DRV_NAME);
733 goto err_free_mmio_region_1; 733 goto err_free_mmio_region_1;
734 } 734 }
735 735
736 ioaddr = pci_ioremap_bar(pdev, 0); 736 ioaddr = pci_ioremap_bar(pdev, 0);
737 if (!ioaddr) { 737 if (!ioaddr) {
738 printk(KERN_ERR "%s: cannot remap MMIO region %llx @ %llx\n", 738 pr_err("cannot remap MMIO region %llx @ %llx\n",
739 DRV_NAME, (unsigned long long)pci_resource_len(pdev, 0), 739 (unsigned long long)pci_resource_len(pdev, 0),
740 (unsigned long long)pci_resource_start(pdev, 0)); 740 (unsigned long long)pci_resource_start(pdev, 0));
741 rc = -EIO; 741 rc = -EIO;
742 goto err_free_mmio_regions_2; 742 goto err_free_mmio_regions_2;
743 } 743 }
@@ -757,7 +757,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,
757 757
758 rc = request_irq(pdev->irq, dscc4_irq, IRQF_SHARED, DRV_NAME, priv->root); 758 rc = request_irq(pdev->irq, dscc4_irq, IRQF_SHARED, DRV_NAME, priv->root);
759 if (rc < 0) { 759 if (rc < 0) {
760 printk(KERN_WARNING "%s: IRQ %d busy\n", DRV_NAME, pdev->irq); 760 pr_warn("IRQ %d busy\n", pdev->irq);
761 goto err_release_4; 761 goto err_release_4;
762 } 762 }
763 763
@@ -904,7 +904,7 @@ static int dscc4_found1(struct pci_dev *pdev, void __iomem *ioaddr)
904 904
905 root = kcalloc(dev_per_card, sizeof(*root), GFP_KERNEL); 905 root = kcalloc(dev_per_card, sizeof(*root), GFP_KERNEL);
906 if (!root) { 906 if (!root) {
907 printk(KERN_ERR "%s: can't allocate data\n", DRV_NAME); 907 pr_err("can't allocate data\n");
908 goto err_out; 908 goto err_out;
909 } 909 }
910 910
@@ -916,7 +916,7 @@ static int dscc4_found1(struct pci_dev *pdev, void __iomem *ioaddr)
916 916
917 ppriv = kzalloc(sizeof(*ppriv), GFP_KERNEL); 917 ppriv = kzalloc(sizeof(*ppriv), GFP_KERNEL);
918 if (!ppriv) { 918 if (!ppriv) {
919 printk(KERN_ERR "%s: can't allocate private data\n", DRV_NAME); 919 pr_err("can't allocate private data\n");
920 goto err_free_dev; 920 goto err_free_dev;
921 } 921 }
922 922
@@ -952,7 +952,7 @@ static int dscc4_found1(struct pci_dev *pdev, void __iomem *ioaddr)
952 952
953 ret = register_hdlc_device(d); 953 ret = register_hdlc_device(d);
954 if (ret < 0) { 954 if (ret < 0) {
955 printk(KERN_ERR "%s: unable to register\n", DRV_NAME); 955 pr_err("unable to register\n");
956 dscc4_release_ring(dpriv); 956 dscc4_release_ring(dpriv);
957 goto err_unregister; 957 goto err_unregister;
958 } 958 }
@@ -1005,7 +1005,7 @@ static int dscc4_loopback_check(struct dscc4_dev_priv *dpriv)
1005 if (settings->loopback && (settings->clock_type != CLOCK_INT)) { 1005 if (settings->loopback && (settings->clock_type != CLOCK_INT)) {
1006 struct net_device *dev = dscc4_to_dev(dpriv); 1006 struct net_device *dev = dscc4_to_dev(dpriv);
1007 1007
1008 printk(KERN_INFO "%s: loopback requires clock\n", dev->name); 1008 netdev_info(dev, "loopback requires clock\n");
1009 return -1; 1009 return -1;
1010 } 1010 }
1011 return 0; 1011 return 0;
@@ -1078,7 +1078,7 @@ static int dscc4_open(struct net_device *dev)
1078 scc_patchl(0, PowerUp, dpriv, dev, CCR0); 1078 scc_patchl(0, PowerUp, dpriv, dev, CCR0);
1079 scc_patchl(0, 0x00050000, dpriv, dev, CCR2); 1079 scc_patchl(0, 0x00050000, dpriv, dev, CCR2);
1080 scc_writel(EventsMask, dpriv, dev, IMR); 1080 scc_writel(EventsMask, dpriv, dev, IMR);
1081 printk(KERN_INFO "%s: up again.\n", dev->name); 1081 netdev_info(dev, "up again\n");
1082 goto done; 1082 goto done;
1083 } 1083 }
1084 1084
@@ -1095,11 +1095,11 @@ static int dscc4_open(struct net_device *dev)
1095 * situations. 1095 * situations.
1096 */ 1096 */
1097 if (scc_readl_star(dpriv, dev) & SccBusy) { 1097 if (scc_readl_star(dpriv, dev) & SccBusy) {
1098 printk(KERN_ERR "%s busy. Try later\n", dev->name); 1098 netdev_err(dev, "busy - try later\n");
1099 ret = -EAGAIN; 1099 ret = -EAGAIN;
1100 goto err_out; 1100 goto err_out;
1101 } else 1101 } else
1102 printk(KERN_INFO "%s: available. Good\n", dev->name); 1102 netdev_info(dev, "available - good\n");
1103 1103
1104 scc_writel(EventsMask, dpriv, dev, IMR); 1104 scc_writel(EventsMask, dpriv, dev, IMR);
1105 1105
@@ -1117,7 +1117,7 @@ static int dscc4_open(struct net_device *dev)
1117 * reset is needed. Suggestions anyone ? 1117 * reset is needed. Suggestions anyone ?
1118 */ 1118 */
1119 if ((ret = dscc4_xpr_ack(dpriv)) < 0) { 1119 if ((ret = dscc4_xpr_ack(dpriv)) < 0) {
1120 printk(KERN_ERR "%s: %s timeout\n", DRV_NAME, "XPR"); 1120 pr_err("XPR timeout\n");
1121 goto err_disable_scc_events; 1121 goto err_disable_scc_events;
1122 } 1122 }
1123 1123
@@ -1342,8 +1342,7 @@ static int dscc4_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1342 return -EPERM; 1342 return -EPERM;
1343 1343
1344 if (dpriv->flags & FakeReset) { 1344 if (dpriv->flags & FakeReset) {
1345 printk(KERN_INFO "%s: please reset the device" 1345 netdev_info(dev, "please reset the device before this command\n");
1346 " before this command\n", dev->name);
1347 return -EPERM; 1346 return -EPERM;
1348 } 1347 }
1349 if (copy_from_user(&dpriv->settings, line, size)) 1348 if (copy_from_user(&dpriv->settings, line, size))
@@ -1506,8 +1505,7 @@ static irqreturn_t dscc4_irq(int irq, void *token)
1506 writel(state, ioaddr + GSTAR); 1505 writel(state, ioaddr + GSTAR);
1507 1506
1508 if (state & Arf) { 1507 if (state & Arf) {
1509 printk(KERN_ERR "%s: failure (Arf). Harass the maintener\n", 1508 netdev_err(dev, "failure (Arf). Harass the maintainer\n");
1510 dev->name);
1511 goto out; 1509 goto out;
1512 } 1510 }
1513 state &= ~ArAck; 1511 state &= ~ArAck;
@@ -1515,7 +1513,7 @@ static irqreturn_t dscc4_irq(int irq, void *token)
1515 if (debug > 0) 1513 if (debug > 0)
1516 printk(KERN_DEBUG "%s: CfgIV\n", DRV_NAME); 1514 printk(KERN_DEBUG "%s: CfgIV\n", DRV_NAME);
1517 if (priv->iqcfg[priv->cfg_cur++%IRQ_RING_SIZE] & cpu_to_le32(Arf)) 1515 if (priv->iqcfg[priv->cfg_cur++%IRQ_RING_SIZE] & cpu_to_le32(Arf))
1518 printk(KERN_ERR "%s: %s failed\n", dev->name, "CFG"); 1516 netdev_err(dev, "CFG failed\n");
1519 if (!(state &= ~Cfg)) 1517 if (!(state &= ~Cfg))
1520 goto out; 1518 goto out;
1521 } 1519 }
@@ -1596,8 +1594,8 @@ try:
1596 ++dpriv->tx_dirty; 1594 ++dpriv->tx_dirty;
1597 } else { 1595 } else {
1598 if (debug > 1) 1596 if (debug > 1)
1599 printk(KERN_ERR "%s Tx: NULL skb %d\n", 1597 netdev_err(dev, "Tx: NULL skb %d\n",
1600 dev->name, cur); 1598 cur);
1601 } 1599 }
1602 /* 1600 /*
1603 * If the driver ends sending crap on the wire, it 1601 * If the driver ends sending crap on the wire, it
@@ -1616,7 +1614,7 @@ try:
1616 * Transmit Data Underrun 1614 * Transmit Data Underrun
1617 */ 1615 */
1618 if (state & Xdu) { 1616 if (state & Xdu) {
1619 printk(KERN_ERR "%s: XDU. Ask maintainer\n", DRV_NAME); 1617 netdev_err(dev, "Tx Data Underrun. Ask maintainer\n");
1620 dpriv->flags = NeedIDT; 1618 dpriv->flags = NeedIDT;
1621 /* Tx reset */ 1619 /* Tx reset */
1622 writel(MTFi | Rdt, 1620 writel(MTFi | Rdt,
@@ -1625,13 +1623,13 @@ try:
1625 return; 1623 return;
1626 } 1624 }
1627 if (state & Cts) { 1625 if (state & Cts) {
1628 printk(KERN_INFO "%s: CTS transition\n", dev->name); 1626 netdev_info(dev, "CTS transition\n");
1629 if (!(state &= ~Cts)) /* DEBUG */ 1627 if (!(state &= ~Cts)) /* DEBUG */
1630 goto try; 1628 goto try;
1631 } 1629 }
1632 if (state & Xmr) { 1630 if (state & Xmr) {
1633 /* Frame needs to be sent again - FIXME */ 1631 /* Frame needs to be sent again - FIXME */
1634 printk(KERN_ERR "%s: Xmr. Ask maintainer\n", DRV_NAME); 1632 netdev_err(dev, "Tx ReTx. Ask maintainer\n");
1635 if (!(state &= ~Xmr)) /* DEBUG */ 1633 if (!(state &= ~Xmr)) /* DEBUG */
1636 goto try; 1634 goto try;
1637 } 1635 }
@@ -1649,7 +1647,7 @@ try:
1649 break; 1647 break;
1650 } 1648 }
1651 if (!i) 1649 if (!i)
1652 printk(KERN_INFO "%s busy in irq\n", dev->name); 1650 netdev_info(dev, "busy in irq\n");
1653 1651
1654 scc_addr = dpriv->base_addr + 0x0c*dpriv->dev_id; 1652 scc_addr = dpriv->base_addr + 0x0c*dpriv->dev_id;
1655 /* Keep this order: IDT before IDR */ 1653 /* Keep this order: IDT before IDR */
@@ -1686,7 +1684,7 @@ try:
1686 } 1684 }
1687 if (state & Cd) { 1685 if (state & Cd) {
1688 if (debug > 0) 1686 if (debug > 0)
1689 printk(KERN_INFO "%s: CD transition\n", dev->name); 1687 netdev_info(dev, "CD transition\n");
1690 if (!(state &= ~Cd)) /* DEBUG */ 1688 if (!(state &= ~Cd)) /* DEBUG */
1691 goto try; 1689 goto try;
1692 } 1690 }
@@ -1695,11 +1693,11 @@ try:
1695#ifdef DSCC4_POLLING 1693#ifdef DSCC4_POLLING
1696 while (!dscc4_tx_poll(dpriv, dev)); 1694 while (!dscc4_tx_poll(dpriv, dev));
1697#endif 1695#endif
1698 printk(KERN_INFO "%s: Tx Hi\n", dev->name); 1696 netdev_info(dev, "Tx Hi\n");
1699 state &= ~Hi; 1697 state &= ~Hi;
1700 } 1698 }
1701 if (state & Err) { 1699 if (state & Err) {
1702 printk(KERN_INFO "%s: Tx ERR\n", dev->name); 1700 netdev_info(dev, "Tx ERR\n");
1703 dev->stats.tx_errors++; 1701 dev->stats.tx_errors++;
1704 state &= ~Err; 1702 state &= ~Err;
1705 } 1703 }
@@ -1769,7 +1767,7 @@ try:
1769 goto try; 1767 goto try;
1770 } 1768 }
1771 if (state & Hi ) { /* HI bit */ 1769 if (state & Hi ) { /* HI bit */
1772 printk(KERN_INFO "%s: Rx Hi\n", dev->name); 1770 netdev_info(dev, "Rx Hi\n");
1773 state &= ~Hi; 1771 state &= ~Hi;
1774 goto try; 1772 goto try;
1775 } 1773 }
@@ -1800,7 +1798,7 @@ try:
1800 goto try; 1798 goto try;
1801 } 1799 }
1802 if (state & Cts) { 1800 if (state & Cts) {
1803 printk(KERN_INFO "%s: CTS transition\n", dev->name); 1801 netdev_info(dev, "CTS transition\n");
1804 if (!(state &= ~Cts)) /* DEBUG */ 1802 if (!(state &= ~Cts)) /* DEBUG */
1805 goto try; 1803 goto try;
1806 } 1804 }
@@ -1859,14 +1857,12 @@ try:
1859 sizeof(struct RxFD), scc_addr + CH0BRDA); 1857 sizeof(struct RxFD), scc_addr + CH0BRDA);
1860 writel(MTFi|Rdr|Idr, scc_addr + CH0CFG); 1858 writel(MTFi|Rdr|Idr, scc_addr + CH0CFG);
1861 if (dscc4_do_action(dev, "RDR") < 0) { 1859 if (dscc4_do_action(dev, "RDR") < 0) {
1862 printk(KERN_ERR "%s: RDO recovery failed(%s)\n", 1860 netdev_err(dev, "RDO recovery failed(RDR)\n");
1863 dev->name, "RDR");
1864 goto rdo_end; 1861 goto rdo_end;
1865 } 1862 }
1866 writel(MTFi|Idr, scc_addr + CH0CFG); 1863 writel(MTFi|Idr, scc_addr + CH0CFG);
1867 if (dscc4_do_action(dev, "IDR") < 0) { 1864 if (dscc4_do_action(dev, "IDR") < 0) {
1868 printk(KERN_ERR "%s: RDO recovery failed(%s)\n", 1865 netdev_err(dev, "RDO recovery failed(IDR)\n");
1869 dev->name, "IDR");
1870 goto rdo_end; 1866 goto rdo_end;
1871 } 1867 }
1872 rdo_end: 1868 rdo_end:
@@ -1875,7 +1871,7 @@ try:
1875 goto try; 1871 goto try;
1876 } 1872 }
1877 if (state & Cd) { 1873 if (state & Cd) {
1878 printk(KERN_INFO "%s: CD transition\n", dev->name); 1874 netdev_info(dev, "CD transition\n");
1879 if (!(state &= ~Cd)) /* DEBUG */ 1875 if (!(state &= ~Cd)) /* DEBUG */
1880 goto try; 1876 goto try;
1881 } 1877 }