diff options
Diffstat (limited to 'drivers/net/pcmcia/nmclan_cs.c')
-rw-r--r-- | drivers/net/pcmcia/nmclan_cs.c | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index 68f2deeb3ad..c1d8ce9e4a6 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c | |||
@@ -111,6 +111,8 @@ Log: nmclan_cs.c,v | |||
111 | 111 | ||
112 | ---------------------------------------------------------------------------- */ | 112 | ---------------------------------------------------------------------------- */ |
113 | 113 | ||
114 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
115 | |||
114 | #define DRV_NAME "nmclan_cs" | 116 | #define DRV_NAME "nmclan_cs" |
115 | #define DRV_VERSION "0.16" | 117 | #define DRV_VERSION "0.16" |
116 | 118 | ||
@@ -519,7 +521,7 @@ static int mace_read(mace_private *lp, unsigned int ioaddr, int reg) | |||
519 | spin_unlock_irqrestore(&lp->bank_lock, flags); | 521 | spin_unlock_irqrestore(&lp->bank_lock, flags); |
520 | break; | 522 | break; |
521 | } | 523 | } |
522 | return (data & 0xFF); | 524 | return data & 0xFF; |
523 | } /* mace_read */ | 525 | } /* mace_read */ |
524 | 526 | ||
525 | /* ---------------------------------------------------------------------------- | 527 | /* ---------------------------------------------------------------------------- |
@@ -563,7 +565,7 @@ static int mace_init(mace_private *lp, unsigned int ioaddr, char *enet_addr) | |||
563 | /* Wait for reset bit to be cleared automatically after <= 200ns */; | 565 | /* Wait for reset bit to be cleared automatically after <= 200ns */; |
564 | if(++ct > 500) | 566 | if(++ct > 500) |
565 | { | 567 | { |
566 | printk(KERN_ERR "mace: reset failed, card removed ?\n"); | 568 | pr_err("reset failed, card removed?\n"); |
567 | return -1; | 569 | return -1; |
568 | } | 570 | } |
569 | udelay(1); | 571 | udelay(1); |
@@ -610,7 +612,7 @@ static int mace_init(mace_private *lp, unsigned int ioaddr, char *enet_addr) | |||
610 | { | 612 | { |
611 | if(++ ct > 500) | 613 | if(++ ct > 500) |
612 | { | 614 | { |
613 | printk(KERN_ERR "mace: ADDRCHG timeout, card removed ?\n"); | 615 | pr_err("ADDRCHG timeout, card removed?\n"); |
614 | return -1; | 616 | return -1; |
615 | } | 617 | } |
616 | } | 618 | } |
@@ -678,8 +680,8 @@ static int nmclan_config(struct pcmcia_device *link) | |||
678 | dev_dbg(&link->dev, "nmclan_cs configured: mace id=%x %x\n", | 680 | dev_dbg(&link->dev, "nmclan_cs configured: mace id=%x %x\n", |
679 | sig[0], sig[1]); | 681 | sig[0], sig[1]); |
680 | } else { | 682 | } else { |
681 | printk(KERN_NOTICE "nmclan_cs: mace id not found: %x %x should" | 683 | pr_notice("mace id not found: %x %x should be 0x40 0x?9\n", |
682 | " be 0x40 0x?9\n", sig[0], sig[1]); | 684 | sig[0], sig[1]); |
683 | return -ENODEV; | 685 | return -ENODEV; |
684 | } | 686 | } |
685 | } | 687 | } |
@@ -691,20 +693,18 @@ static int nmclan_config(struct pcmcia_device *link) | |||
691 | if (if_port <= 2) | 693 | if (if_port <= 2) |
692 | dev->if_port = if_port; | 694 | dev->if_port = if_port; |
693 | else | 695 | else |
694 | printk(KERN_NOTICE "nmclan_cs: invalid if_port requested\n"); | 696 | pr_notice("invalid if_port requested\n"); |
695 | 697 | ||
696 | SET_NETDEV_DEV(dev, &link->dev); | 698 | SET_NETDEV_DEV(dev, &link->dev); |
697 | 699 | ||
698 | i = register_netdev(dev); | 700 | i = register_netdev(dev); |
699 | if (i != 0) { | 701 | if (i != 0) { |
700 | printk(KERN_NOTICE "nmclan_cs: register_netdev() failed\n"); | 702 | pr_notice("register_netdev() failed\n"); |
701 | goto failed; | 703 | goto failed; |
702 | } | 704 | } |
703 | 705 | ||
704 | printk(KERN_INFO "%s: nmclan: port %#3lx, irq %d, %s port," | 706 | netdev_info(dev, "nmclan: port %#3lx, irq %d, %s port, hw_addr %pM\n", |
705 | " hw_addr %pM\n", | 707 | dev->base_addr, dev->irq, if_names[dev->if_port], dev->dev_addr); |
706 | dev->name, dev->base_addr, dev->irq, if_names[dev->if_port], | ||
707 | dev->dev_addr); | ||
708 | return 0; | 708 | return 0; |
709 | 709 | ||
710 | failed: | 710 | failed: |
@@ -798,8 +798,7 @@ static int mace_config(struct net_device *dev, struct ifmap *map) | |||
798 | if ((map->port != (u_char)(-1)) && (map->port != dev->if_port)) { | 798 | if ((map->port != (u_char)(-1)) && (map->port != dev->if_port)) { |
799 | if (map->port <= 2) { | 799 | if (map->port <= 2) { |
800 | dev->if_port = map->port; | 800 | dev->if_port = map->port; |
801 | printk(KERN_INFO "%s: switched to %s port\n", dev->name, | 801 | netdev_info(dev, "switched to %s port\n", if_names[dev->if_port]); |
802 | if_names[dev->if_port]); | ||
803 | } else | 802 | } else |
804 | return -EINVAL; | 803 | return -EINVAL; |
805 | } | 804 | } |
@@ -878,12 +877,12 @@ static void mace_tx_timeout(struct net_device *dev) | |||
878 | mace_private *lp = netdev_priv(dev); | 877 | mace_private *lp = netdev_priv(dev); |
879 | struct pcmcia_device *link = lp->p_dev; | 878 | struct pcmcia_device *link = lp->p_dev; |
880 | 879 | ||
881 | printk(KERN_NOTICE "%s: transmit timed out -- ", dev->name); | 880 | netdev_notice(dev, "transmit timed out -- "); |
882 | #if RESET_ON_TIMEOUT | 881 | #if RESET_ON_TIMEOUT |
883 | printk("resetting card\n"); | 882 | pr_cont("resetting card\n"); |
884 | pcmcia_reset_card(link->socket); | 883 | pcmcia_reset_card(link->socket); |
885 | #else /* #if RESET_ON_TIMEOUT */ | 884 | #else /* #if RESET_ON_TIMEOUT */ |
886 | printk("NOT resetting card\n"); | 885 | pr_cont("NOT resetting card\n"); |
887 | #endif /* #if RESET_ON_TIMEOUT */ | 886 | #endif /* #if RESET_ON_TIMEOUT */ |
888 | dev->trans_start = jiffies; /* prevent tx timeout */ | 887 | dev->trans_start = jiffies; /* prevent tx timeout */ |
889 | netif_wake_queue(dev); | 888 | netif_wake_queue(dev); |
@@ -965,22 +964,21 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id) | |||
965 | ioaddr = dev->base_addr; | 964 | ioaddr = dev->base_addr; |
966 | 965 | ||
967 | if (lp->tx_irq_disabled) { | 966 | if (lp->tx_irq_disabled) { |
968 | printk( | 967 | const char *msg; |
969 | (lp->tx_irq_disabled? | 968 | if (lp->tx_irq_disabled) |
970 | KERN_NOTICE "%s: Interrupt with tx_irq_disabled " | 969 | msg = "Interrupt with tx_irq_disabled"; |
971 | "[isr=%02X, imr=%02X]\n": | 970 | else |
972 | KERN_NOTICE "%s: Re-entering the interrupt handler " | 971 | msg = "Re-entering the interrupt handler"; |
973 | "[isr=%02X, imr=%02X]\n"), | 972 | netdev_notice(dev, "%s [isr=%02X, imr=%02X]\n", |
974 | dev->name, | 973 | msg, |
975 | inb(ioaddr + AM2150_MACE_BASE + MACE_IR), | 974 | inb(ioaddr + AM2150_MACE_BASE + MACE_IR), |
976 | inb(ioaddr + AM2150_MACE_BASE + MACE_IMR) | 975 | inb(ioaddr + AM2150_MACE_BASE + MACE_IMR)); |
977 | ); | ||
978 | /* WARNING: MACE_IR has been read! */ | 976 | /* WARNING: MACE_IR has been read! */ |
979 | return IRQ_NONE; | 977 | return IRQ_NONE; |
980 | } | 978 | } |
981 | 979 | ||
982 | if (!netif_device_present(dev)) { | 980 | if (!netif_device_present(dev)) { |
983 | pr_debug("%s: interrupt from dead card\n", dev->name); | 981 | netdev_dbg(dev, "interrupt from dead card\n"); |
984 | return IRQ_NONE; | 982 | return IRQ_NONE; |
985 | } | 983 | } |
986 | 984 | ||
@@ -1378,8 +1376,8 @@ static void BuildLAF(int *ladrf, int *adr) | |||
1378 | printk(KERN_DEBUG " adr =%pM\n", adr); | 1376 | printk(KERN_DEBUG " adr =%pM\n", adr); |
1379 | printk(KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63] =", hashcode); | 1377 | printk(KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63] =", hashcode); |
1380 | for (i = 0; i < 8; i++) | 1378 | for (i = 0; i < 8; i++) |
1381 | printk(KERN_CONT " %02X", ladrf[i]); | 1379 | pr_cont(" %02X", ladrf[i]); |
1382 | printk(KERN_CONT "\n"); | 1380 | pr_cont("\n"); |
1383 | #endif | 1381 | #endif |
1384 | } /* BuildLAF */ | 1382 | } /* BuildLAF */ |
1385 | 1383 | ||