diff options
author | Ben Boeckel <mathstuf@gmail.com> | 2013-11-01 08:53:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-11-02 01:19:24 -0400 |
commit | 6389aa458ed99545aa60038f28aa6c0602ecb11a (patch) | |
tree | 6e8ccba8410e5c75ee574f2dbe8cc3822866b265 /drivers/net/ethernet/smsc | |
parent | 3ee307dee23ec8aa103f76fc80aba6b6904f3add (diff) |
smc91x: replace printk with netdev_ calls
Also snipes some whitespace errors.
Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/smsc')
-rw-r--r-- | drivers/net/ethernet/smsc/smc91x.c | 237 | ||||
-rw-r--r-- | drivers/net/ethernet/smsc/smc91x.h | 4 |
2 files changed, 118 insertions, 123 deletions
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c index 73be7f3982e6..0c9b5d94154f 100644 --- a/drivers/net/ethernet/smsc/smc91x.c +++ b/drivers/net/ethernet/smsc/smc91x.c | |||
@@ -58,7 +58,7 @@ | |||
58 | * 22/09/04 Nicolas Pitre big update (see commit log for details) | 58 | * 22/09/04 Nicolas Pitre big update (see commit log for details) |
59 | */ | 59 | */ |
60 | static const char version[] = | 60 | static const char version[] = |
61 | "smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@fluxnic.net>\n"; | 61 | "smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@fluxnic.net>"; |
62 | 62 | ||
63 | /* Debugging level */ | 63 | /* Debugging level */ |
64 | #ifndef SMC_DEBUG | 64 | #ifndef SMC_DEBUG |
@@ -149,16 +149,16 @@ MODULE_ALIAS("platform:smc91x"); | |||
149 | #define MII_DELAY 1 | 149 | #define MII_DELAY 1 |
150 | 150 | ||
151 | #if SMC_DEBUG > 0 | 151 | #if SMC_DEBUG > 0 |
152 | #define DBG(n, args...) \ | 152 | #define DBG(n, dev, args...) \ |
153 | do { \ | 153 | do { \ |
154 | if (SMC_DEBUG >= (n)) \ | 154 | if (SMC_DEBUG >= (n)) \ |
155 | printk(args); \ | 155 | netdev_dbg(dev, args); \ |
156 | } while (0) | 156 | } while (0) |
157 | 157 | ||
158 | #define PRINTK(args...) printk(args) | 158 | #define PRINTK(dev, args...) netdev_info(dev, args) |
159 | #else | 159 | #else |
160 | #define DBG(n, args...) do { } while(0) | 160 | #define DBG(n, dev, args...) do { } while (0) |
161 | #define PRINTK(args...) printk(KERN_DEBUG args) | 161 | #define PRINTK(dev, args...) netdev_dbg(dev, args) |
162 | #endif | 162 | #endif |
163 | 163 | ||
164 | #if SMC_DEBUG > 3 | 164 | #if SMC_DEBUG > 3 |
@@ -173,24 +173,26 @@ static void PRINT_PKT(u_char *buf, int length) | |||
173 | 173 | ||
174 | for (i = 0; i < lines ; i ++) { | 174 | for (i = 0; i < lines ; i ++) { |
175 | int cur; | 175 | int cur; |
176 | printk(KERN_DEBUG); | ||
176 | for (cur = 0; cur < 8; cur++) { | 177 | for (cur = 0; cur < 8; cur++) { |
177 | u_char a, b; | 178 | u_char a, b; |
178 | a = *buf++; | 179 | a = *buf++; |
179 | b = *buf++; | 180 | b = *buf++; |
180 | printk("%02x%02x ", a, b); | 181 | pr_cont("%02x%02x ", a, b); |
181 | } | 182 | } |
182 | printk("\n"); | 183 | pr_cont("\n"); |
183 | } | 184 | } |
185 | printk(KERN_DEBUG); | ||
184 | for (i = 0; i < remainder/2 ; i++) { | 186 | for (i = 0; i < remainder/2 ; i++) { |
185 | u_char a, b; | 187 | u_char a, b; |
186 | a = *buf++; | 188 | a = *buf++; |
187 | b = *buf++; | 189 | b = *buf++; |
188 | printk("%02x%02x ", a, b); | 190 | pr_cont("%02x%02x ", a, b); |
189 | } | 191 | } |
190 | printk("\n"); | 192 | pr_cont("\n"); |
191 | } | 193 | } |
192 | #else | 194 | #else |
193 | #define PRINT_PKT(x...) do { } while(0) | 195 | #define PRINT_PKT(x...) do { } while (0) |
194 | #endif | 196 | #endif |
195 | 197 | ||
196 | 198 | ||
@@ -226,8 +228,8 @@ static void PRINT_PKT(u_char *buf, int length) | |||
226 | unsigned long timeout = jiffies + 2; \ | 228 | unsigned long timeout = jiffies + 2; \ |
227 | while (SMC_GET_MMU_CMD(lp) & MC_BUSY) { \ | 229 | while (SMC_GET_MMU_CMD(lp) & MC_BUSY) { \ |
228 | if (time_after(jiffies, timeout)) { \ | 230 | if (time_after(jiffies, timeout)) { \ |
229 | printk("%s: timeout %s line %d\n", \ | 231 | netdev_dbg(dev, "timeout %s line %d\n", \ |
230 | dev->name, __FILE__, __LINE__); \ | 232 | __FILE__, __LINE__); \ |
231 | break; \ | 233 | break; \ |
232 | } \ | 234 | } \ |
233 | cpu_relax(); \ | 235 | cpu_relax(); \ |
@@ -246,7 +248,7 @@ static void smc_reset(struct net_device *dev) | |||
246 | unsigned int ctl, cfg; | 248 | unsigned int ctl, cfg; |
247 | struct sk_buff *pending_skb; | 249 | struct sk_buff *pending_skb; |
248 | 250 | ||
249 | DBG(2, "%s: %s\n", dev->name, __func__); | 251 | DBG(2, dev, "%s\n", __func__); |
250 | 252 | ||
251 | /* Disable all interrupts, block TX tasklet */ | 253 | /* Disable all interrupts, block TX tasklet */ |
252 | spin_lock_irq(&lp->lock); | 254 | spin_lock_irq(&lp->lock); |
@@ -339,7 +341,7 @@ static void smc_enable(struct net_device *dev) | |||
339 | void __iomem *ioaddr = lp->base; | 341 | void __iomem *ioaddr = lp->base; |
340 | int mask; | 342 | int mask; |
341 | 343 | ||
342 | DBG(2, "%s: %s\n", dev->name, __func__); | 344 | DBG(2, dev, "%s\n", __func__); |
343 | 345 | ||
344 | /* see the header file for options in TCR/RCR DEFAULT */ | 346 | /* see the header file for options in TCR/RCR DEFAULT */ |
345 | SMC_SELECT_BANK(lp, 0); | 347 | SMC_SELECT_BANK(lp, 0); |
@@ -373,7 +375,7 @@ static void smc_shutdown(struct net_device *dev) | |||
373 | void __iomem *ioaddr = lp->base; | 375 | void __iomem *ioaddr = lp->base; |
374 | struct sk_buff *pending_skb; | 376 | struct sk_buff *pending_skb; |
375 | 377 | ||
376 | DBG(2, "%s: %s\n", CARDNAME, __func__); | 378 | DBG(2, dev, "%s: %s\n", CARDNAME, __func__); |
377 | 379 | ||
378 | /* no more interrupts for me */ | 380 | /* no more interrupts for me */ |
379 | spin_lock_irq(&lp->lock); | 381 | spin_lock_irq(&lp->lock); |
@@ -406,11 +408,11 @@ static inline void smc_rcv(struct net_device *dev) | |||
406 | void __iomem *ioaddr = lp->base; | 408 | void __iomem *ioaddr = lp->base; |
407 | unsigned int packet_number, status, packet_len; | 409 | unsigned int packet_number, status, packet_len; |
408 | 410 | ||
409 | DBG(3, "%s: %s\n", dev->name, __func__); | 411 | DBG(3, dev, "%s\n", __func__); |
410 | 412 | ||
411 | packet_number = SMC_GET_RXFIFO(lp); | 413 | packet_number = SMC_GET_RXFIFO(lp); |
412 | if (unlikely(packet_number & RXFIFO_REMPTY)) { | 414 | if (unlikely(packet_number & RXFIFO_REMPTY)) { |
413 | PRINTK("%s: smc_rcv with nothing on FIFO.\n", dev->name); | 415 | PRINTK(dev, "smc_rcv with nothing on FIFO.\n"); |
414 | return; | 416 | return; |
415 | } | 417 | } |
416 | 418 | ||
@@ -420,9 +422,8 @@ static inline void smc_rcv(struct net_device *dev) | |||
420 | /* First two words are status and packet length */ | 422 | /* First two words are status and packet length */ |
421 | SMC_GET_PKT_HDR(lp, status, packet_len); | 423 | SMC_GET_PKT_HDR(lp, status, packet_len); |
422 | packet_len &= 0x07ff; /* mask off top bits */ | 424 | packet_len &= 0x07ff; /* mask off top bits */ |
423 | DBG(2, "%s: RX PNR 0x%x STATUS 0x%04x LENGTH 0x%04x (%d)\n", | 425 | DBG(2, dev, "RX PNR 0x%x STATUS 0x%04x LENGTH 0x%04x (%d)\n", |
424 | dev->name, packet_number, status, | 426 | packet_number, status, packet_len, packet_len); |
425 | packet_len, packet_len); | ||
426 | 427 | ||
427 | back: | 428 | back: |
428 | if (unlikely(packet_len < 6 || status & RS_ERRORS)) { | 429 | if (unlikely(packet_len < 6 || status & RS_ERRORS)) { |
@@ -433,8 +434,8 @@ static inline void smc_rcv(struct net_device *dev) | |||
433 | } | 434 | } |
434 | if (packet_len < 6) { | 435 | if (packet_len < 6) { |
435 | /* bloody hardware */ | 436 | /* bloody hardware */ |
436 | printk(KERN_ERR "%s: fubar (rxlen %u status %x\n", | 437 | netdev_err(dev, "fubar (rxlen %u status %x\n", |
437 | dev->name, packet_len, status); | 438 | packet_len, status); |
438 | status |= RS_TOOSHORT; | 439 | status |= RS_TOOSHORT; |
439 | } | 440 | } |
440 | SMC_WAIT_MMU_BUSY(lp); | 441 | SMC_WAIT_MMU_BUSY(lp); |
@@ -551,7 +552,7 @@ static void smc_hardware_send_pkt(unsigned long data) | |||
551 | unsigned char *buf; | 552 | unsigned char *buf; |
552 | unsigned long flags; | 553 | unsigned long flags; |
553 | 554 | ||
554 | DBG(3, "%s: %s\n", dev->name, __func__); | 555 | DBG(3, dev, "%s\n", __func__); |
555 | 556 | ||
556 | if (!smc_special_trylock(&lp->lock, flags)) { | 557 | if (!smc_special_trylock(&lp->lock, flags)) { |
557 | netif_stop_queue(dev); | 558 | netif_stop_queue(dev); |
@@ -568,7 +569,7 @@ static void smc_hardware_send_pkt(unsigned long data) | |||
568 | 569 | ||
569 | packet_no = SMC_GET_AR(lp); | 570 | packet_no = SMC_GET_AR(lp); |
570 | if (unlikely(packet_no & AR_FAILED)) { | 571 | if (unlikely(packet_no & AR_FAILED)) { |
571 | printk("%s: Memory allocation failed.\n", dev->name); | 572 | netdev_err(dev, "Memory allocation failed.\n"); |
572 | dev->stats.tx_errors++; | 573 | dev->stats.tx_errors++; |
573 | dev->stats.tx_fifo_errors++; | 574 | dev->stats.tx_fifo_errors++; |
574 | smc_special_unlock(&lp->lock, flags); | 575 | smc_special_unlock(&lp->lock, flags); |
@@ -581,8 +582,8 @@ static void smc_hardware_send_pkt(unsigned long data) | |||
581 | 582 | ||
582 | buf = skb->data; | 583 | buf = skb->data; |
583 | len = skb->len; | 584 | len = skb->len; |
584 | DBG(2, "%s: TX PNR 0x%x LENGTH 0x%04x (%d) BUF 0x%p\n", | 585 | DBG(2, dev, "TX PNR 0x%x LENGTH 0x%04x (%d) BUF 0x%p\n", |
585 | dev->name, packet_no, len, len, buf); | 586 | packet_no, len, len, buf); |
586 | PRINT_PKT(buf, len); | 587 | PRINT_PKT(buf, len); |
587 | 588 | ||
588 | /* | 589 | /* |
@@ -637,7 +638,7 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
637 | unsigned int numPages, poll_count, status; | 638 | unsigned int numPages, poll_count, status; |
638 | unsigned long flags; | 639 | unsigned long flags; |
639 | 640 | ||
640 | DBG(3, "%s: %s\n", dev->name, __func__); | 641 | DBG(3, dev, "%s\n", __func__); |
641 | 642 | ||
642 | BUG_ON(lp->pending_tx_skb != NULL); | 643 | BUG_ON(lp->pending_tx_skb != NULL); |
643 | 644 | ||
@@ -654,7 +655,7 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
654 | */ | 655 | */ |
655 | numPages = ((skb->len & ~1) + (6 - 1)) >> 8; | 656 | numPages = ((skb->len & ~1) + (6 - 1)) >> 8; |
656 | if (unlikely(numPages > 7)) { | 657 | if (unlikely(numPages > 7)) { |
657 | printk("%s: Far too big packet error.\n", dev->name); | 658 | netdev_warn(dev, "Far too big packet error.\n"); |
658 | dev->stats.tx_errors++; | 659 | dev->stats.tx_errors++; |
659 | dev->stats.tx_dropped++; | 660 | dev->stats.tx_dropped++; |
660 | dev_kfree_skb(skb); | 661 | dev_kfree_skb(skb); |
@@ -685,7 +686,7 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
685 | if (!poll_count) { | 686 | if (!poll_count) { |
686 | /* oh well, wait until the chip finds memory later */ | 687 | /* oh well, wait until the chip finds memory later */ |
687 | netif_stop_queue(dev); | 688 | netif_stop_queue(dev); |
688 | DBG(2, "%s: TX memory allocation deferred.\n", dev->name); | 689 | DBG(2, dev, "TX memory allocation deferred.\n"); |
689 | SMC_ENABLE_INT(lp, IM_ALLOC_INT); | 690 | SMC_ENABLE_INT(lp, IM_ALLOC_INT); |
690 | } else { | 691 | } else { |
691 | /* | 692 | /* |
@@ -709,12 +710,12 @@ static void smc_tx(struct net_device *dev) | |||
709 | void __iomem *ioaddr = lp->base; | 710 | void __iomem *ioaddr = lp->base; |
710 | unsigned int saved_packet, packet_no, tx_status, pkt_len; | 711 | unsigned int saved_packet, packet_no, tx_status, pkt_len; |
711 | 712 | ||
712 | DBG(3, "%s: %s\n", dev->name, __func__); | 713 | DBG(3, dev, "%s\n", __func__); |
713 | 714 | ||
714 | /* If the TX FIFO is empty then nothing to do */ | 715 | /* If the TX FIFO is empty then nothing to do */ |
715 | packet_no = SMC_GET_TXFIFO(lp); | 716 | packet_no = SMC_GET_TXFIFO(lp); |
716 | if (unlikely(packet_no & TXFIFO_TEMPTY)) { | 717 | if (unlikely(packet_no & TXFIFO_TEMPTY)) { |
717 | PRINTK("%s: smc_tx with nothing on FIFO.\n", dev->name); | 718 | PRINTK(dev, "smc_tx with nothing on FIFO.\n"); |
718 | return; | 719 | return; |
719 | } | 720 | } |
720 | 721 | ||
@@ -725,8 +726,8 @@ static void smc_tx(struct net_device *dev) | |||
725 | /* read the first word (status word) from this packet */ | 726 | /* read the first word (status word) from this packet */ |
726 | SMC_SET_PTR(lp, PTR_AUTOINC | PTR_READ); | 727 | SMC_SET_PTR(lp, PTR_AUTOINC | PTR_READ); |
727 | SMC_GET_PKT_HDR(lp, tx_status, pkt_len); | 728 | SMC_GET_PKT_HDR(lp, tx_status, pkt_len); |
728 | DBG(2, "%s: TX STATUS 0x%04x PNR 0x%02x\n", | 729 | DBG(2, dev, "TX STATUS 0x%04x PNR 0x%02x\n", |
729 | dev->name, tx_status, packet_no); | 730 | tx_status, packet_no); |
730 | 731 | ||
731 | if (!(tx_status & ES_TX_SUC)) | 732 | if (!(tx_status & ES_TX_SUC)) |
732 | dev->stats.tx_errors++; | 733 | dev->stats.tx_errors++; |
@@ -735,14 +736,12 @@ static void smc_tx(struct net_device *dev) | |||
735 | dev->stats.tx_carrier_errors++; | 736 | dev->stats.tx_carrier_errors++; |
736 | 737 | ||
737 | if (tx_status & (ES_LATCOL | ES_16COL)) { | 738 | if (tx_status & (ES_LATCOL | ES_16COL)) { |
738 | PRINTK("%s: %s occurred on last xmit\n", dev->name, | 739 | PRINTK(dev, "%s occurred on last xmit\n", |
739 | (tx_status & ES_LATCOL) ? | 740 | (tx_status & ES_LATCOL) ? |
740 | "late collision" : "too many collisions"); | 741 | "late collision" : "too many collisions"); |
741 | dev->stats.tx_window_errors++; | 742 | dev->stats.tx_window_errors++; |
742 | if (!(dev->stats.tx_window_errors & 63) && net_ratelimit()) { | 743 | if (!(dev->stats.tx_window_errors & 63) && net_ratelimit()) { |
743 | printk(KERN_INFO "%s: unexpectedly large number of " | 744 | netdev_info(dev, "unexpectedly large number of bad collisions. Please check duplex setting.\n"); |
744 | "bad collisions. Please check duplex " | ||
745 | "setting.\n", dev->name); | ||
746 | } | 745 | } |
747 | } | 746 | } |
748 | 747 | ||
@@ -830,8 +829,8 @@ static int smc_phy_read(struct net_device *dev, int phyaddr, int phyreg) | |||
830 | /* Return to idle state */ | 829 | /* Return to idle state */ |
831 | SMC_SET_MII(lp, SMC_GET_MII(lp) & ~(MII_MCLK|MII_MDOE|MII_MDO)); | 830 | SMC_SET_MII(lp, SMC_GET_MII(lp) & ~(MII_MCLK|MII_MDOE|MII_MDO)); |
832 | 831 | ||
833 | DBG(3, "%s: phyaddr=0x%x, phyreg=0x%x, phydata=0x%x\n", | 832 | DBG(3, dev, "%s: phyaddr=0x%x, phyreg=0x%x, phydata=0x%x\n", |
834 | __func__, phyaddr, phyreg, phydata); | 833 | __func__, phyaddr, phyreg, phydata); |
835 | 834 | ||
836 | SMC_SELECT_BANK(lp, 2); | 835 | SMC_SELECT_BANK(lp, 2); |
837 | return phydata; | 836 | return phydata; |
@@ -857,8 +856,8 @@ static void smc_phy_write(struct net_device *dev, int phyaddr, int phyreg, | |||
857 | /* Return to idle state */ | 856 | /* Return to idle state */ |
858 | SMC_SET_MII(lp, SMC_GET_MII(lp) & ~(MII_MCLK|MII_MDOE|MII_MDO)); | 857 | SMC_SET_MII(lp, SMC_GET_MII(lp) & ~(MII_MCLK|MII_MDOE|MII_MDO)); |
859 | 858 | ||
860 | DBG(3, "%s: phyaddr=0x%x, phyreg=0x%x, phydata=0x%x\n", | 859 | DBG(3, dev, "%s: phyaddr=0x%x, phyreg=0x%x, phydata=0x%x\n", |
861 | __func__, phyaddr, phyreg, phydata); | 860 | __func__, phyaddr, phyreg, phydata); |
862 | 861 | ||
863 | SMC_SELECT_BANK(lp, 2); | 862 | SMC_SELECT_BANK(lp, 2); |
864 | } | 863 | } |
@@ -871,7 +870,7 @@ static void smc_phy_detect(struct net_device *dev) | |||
871 | struct smc_local *lp = netdev_priv(dev); | 870 | struct smc_local *lp = netdev_priv(dev); |
872 | int phyaddr; | 871 | int phyaddr; |
873 | 872 | ||
874 | DBG(2, "%s: %s\n", dev->name, __func__); | 873 | DBG(2, dev, "%s\n", __func__); |
875 | 874 | ||
876 | lp->phy_type = 0; | 875 | lp->phy_type = 0; |
877 | 876 | ||
@@ -886,8 +885,8 @@ static void smc_phy_detect(struct net_device *dev) | |||
886 | id1 = smc_phy_read(dev, phyaddr & 31, MII_PHYSID1); | 885 | id1 = smc_phy_read(dev, phyaddr & 31, MII_PHYSID1); |
887 | id2 = smc_phy_read(dev, phyaddr & 31, MII_PHYSID2); | 886 | id2 = smc_phy_read(dev, phyaddr & 31, MII_PHYSID2); |
888 | 887 | ||
889 | DBG(3, "%s: phy_id1=0x%x, phy_id2=0x%x\n", | 888 | DBG(3, dev, "phy_id1=0x%x, phy_id2=0x%x\n", |
890 | dev->name, id1, id2); | 889 | id1, id2); |
891 | 890 | ||
892 | /* Make sure it is a valid identifier */ | 891 | /* Make sure it is a valid identifier */ |
893 | if (id1 != 0x0000 && id1 != 0xffff && id1 != 0x8000 && | 892 | if (id1 != 0x0000 && id1 != 0xffff && id1 != 0x8000 && |
@@ -910,7 +909,7 @@ static int smc_phy_fixed(struct net_device *dev) | |||
910 | int phyaddr = lp->mii.phy_id; | 909 | int phyaddr = lp->mii.phy_id; |
911 | int bmcr, cfg1; | 910 | int bmcr, cfg1; |
912 | 911 | ||
913 | DBG(3, "%s: %s\n", dev->name, __func__); | 912 | DBG(3, dev, "%s\n", __func__); |
914 | 913 | ||
915 | /* Enter Link Disable state */ | 914 | /* Enter Link Disable state */ |
916 | cfg1 = smc_phy_read(dev, phyaddr, PHY_CFG1_REG); | 915 | cfg1 = smc_phy_read(dev, phyaddr, PHY_CFG1_REG); |
@@ -1044,7 +1043,7 @@ static void smc_phy_configure(struct work_struct *work) | |||
1044 | int my_ad_caps; /* My Advertised capabilities */ | 1043 | int my_ad_caps; /* My Advertised capabilities */ |
1045 | int status; | 1044 | int status; |
1046 | 1045 | ||
1047 | DBG(3, "%s:smc_program_phy()\n", dev->name); | 1046 | DBG(3, dev, "smc_program_phy()\n"); |
1048 | 1047 | ||
1049 | spin_lock_irq(&lp->lock); | 1048 | spin_lock_irq(&lp->lock); |
1050 | 1049 | ||
@@ -1055,7 +1054,7 @@ static void smc_phy_configure(struct work_struct *work) | |||
1055 | goto smc_phy_configure_exit; | 1054 | goto smc_phy_configure_exit; |
1056 | 1055 | ||
1057 | if (smc_phy_reset(dev, phyaddr)) { | 1056 | if (smc_phy_reset(dev, phyaddr)) { |
1058 | printk("%s: PHY reset timed out\n", dev->name); | 1057 | netdev_info(dev, "PHY reset timed out\n"); |
1059 | goto smc_phy_configure_exit; | 1058 | goto smc_phy_configure_exit; |
1060 | } | 1059 | } |
1061 | 1060 | ||
@@ -1082,7 +1081,7 @@ static void smc_phy_configure(struct work_struct *work) | |||
1082 | my_phy_caps = smc_phy_read(dev, phyaddr, MII_BMSR); | 1081 | my_phy_caps = smc_phy_read(dev, phyaddr, MII_BMSR); |
1083 | 1082 | ||
1084 | if (!(my_phy_caps & BMSR_ANEGCAPABLE)) { | 1083 | if (!(my_phy_caps & BMSR_ANEGCAPABLE)) { |
1085 | printk(KERN_INFO "Auto negotiation NOT supported\n"); | 1084 | netdev_info(dev, "Auto negotiation NOT supported\n"); |
1086 | smc_phy_fixed(dev); | 1085 | smc_phy_fixed(dev); |
1087 | goto smc_phy_configure_exit; | 1086 | goto smc_phy_configure_exit; |
1088 | } | 1087 | } |
@@ -1118,8 +1117,8 @@ static void smc_phy_configure(struct work_struct *work) | |||
1118 | */ | 1117 | */ |
1119 | status = smc_phy_read(dev, phyaddr, MII_ADVERTISE); | 1118 | status = smc_phy_read(dev, phyaddr, MII_ADVERTISE); |
1120 | 1119 | ||
1121 | DBG(2, "%s: phy caps=%x\n", dev->name, my_phy_caps); | 1120 | DBG(2, dev, "phy caps=%x\n", my_phy_caps); |
1122 | DBG(2, "%s: phy advertised caps=%x\n", dev->name, my_ad_caps); | 1121 | DBG(2, dev, "phy advertised caps=%x\n", my_ad_caps); |
1123 | 1122 | ||
1124 | /* Restart auto-negotiation process in order to advertise my caps */ | 1123 | /* Restart auto-negotiation process in order to advertise my caps */ |
1125 | smc_phy_write(dev, phyaddr, MII_BMCR, BMCR_ANENABLE | BMCR_ANRESTART); | 1124 | smc_phy_write(dev, phyaddr, MII_BMCR, BMCR_ANENABLE | BMCR_ANRESTART); |
@@ -1143,7 +1142,7 @@ static void smc_phy_interrupt(struct net_device *dev) | |||
1143 | int phyaddr = lp->mii.phy_id; | 1142 | int phyaddr = lp->mii.phy_id; |
1144 | int phy18; | 1143 | int phy18; |
1145 | 1144 | ||
1146 | DBG(2, "%s: %s\n", dev->name, __func__); | 1145 | DBG(2, dev, "%s\n", __func__); |
1147 | 1146 | ||
1148 | if (lp->phy_type == 0) | 1147 | if (lp->phy_type == 0) |
1149 | return; | 1148 | return; |
@@ -1179,8 +1178,8 @@ static void smc_10bt_check_media(struct net_device *dev, int init) | |||
1179 | netif_carrier_on(dev); | 1178 | netif_carrier_on(dev); |
1180 | } | 1179 | } |
1181 | if (netif_msg_link(lp)) | 1180 | if (netif_msg_link(lp)) |
1182 | printk(KERN_INFO "%s: link %s\n", dev->name, | 1181 | netdev_info(dev, "link %s\n", |
1183 | new_carrier ? "up" : "down"); | 1182 | new_carrier ? "up" : "down"); |
1184 | } | 1183 | } |
1185 | } | 1184 | } |
1186 | 1185 | ||
@@ -1211,7 +1210,7 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id) | |||
1211 | int status, mask, timeout, card_stats; | 1210 | int status, mask, timeout, card_stats; |
1212 | int saved_pointer; | 1211 | int saved_pointer; |
1213 | 1212 | ||
1214 | DBG(3, "%s: %s\n", dev->name, __func__); | 1213 | DBG(3, dev, "%s\n", __func__); |
1215 | 1214 | ||
1216 | spin_lock(&lp->lock); | 1215 | spin_lock(&lp->lock); |
1217 | 1216 | ||
@@ -1230,12 +1229,12 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id) | |||
1230 | do { | 1229 | do { |
1231 | status = SMC_GET_INT(lp); | 1230 | status = SMC_GET_INT(lp); |
1232 | 1231 | ||
1233 | DBG(2, "%s: INT 0x%02x MASK 0x%02x MEM 0x%04x FIFO 0x%04x\n", | 1232 | DBG(2, dev, "INT 0x%02x MASK 0x%02x MEM 0x%04x FIFO 0x%04x\n", |
1234 | dev->name, status, mask, | 1233 | status, mask, |
1235 | ({ int meminfo; SMC_SELECT_BANK(lp, 0); | 1234 | ({ int meminfo; SMC_SELECT_BANK(lp, 0); |
1236 | meminfo = SMC_GET_MIR(lp); | 1235 | meminfo = SMC_GET_MIR(lp); |
1237 | SMC_SELECT_BANK(lp, 2); meminfo; }), | 1236 | SMC_SELECT_BANK(lp, 2); meminfo; }), |
1238 | SMC_GET_FIFO(lp)); | 1237 | SMC_GET_FIFO(lp)); |
1239 | 1238 | ||
1240 | status &= mask; | 1239 | status &= mask; |
1241 | if (!status) | 1240 | if (!status) |
@@ -1243,20 +1242,20 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id) | |||
1243 | 1242 | ||
1244 | if (status & IM_TX_INT) { | 1243 | if (status & IM_TX_INT) { |
1245 | /* do this before RX as it will free memory quickly */ | 1244 | /* do this before RX as it will free memory quickly */ |
1246 | DBG(3, "%s: TX int\n", dev->name); | 1245 | DBG(3, dev, "TX int\n"); |
1247 | smc_tx(dev); | 1246 | smc_tx(dev); |
1248 | SMC_ACK_INT(lp, IM_TX_INT); | 1247 | SMC_ACK_INT(lp, IM_TX_INT); |
1249 | if (THROTTLE_TX_PKTS) | 1248 | if (THROTTLE_TX_PKTS) |
1250 | netif_wake_queue(dev); | 1249 | netif_wake_queue(dev); |
1251 | } else if (status & IM_RCV_INT) { | 1250 | } else if (status & IM_RCV_INT) { |
1252 | DBG(3, "%s: RX irq\n", dev->name); | 1251 | DBG(3, dev, "RX irq\n"); |
1253 | smc_rcv(dev); | 1252 | smc_rcv(dev); |
1254 | } else if (status & IM_ALLOC_INT) { | 1253 | } else if (status & IM_ALLOC_INT) { |
1255 | DBG(3, "%s: Allocation irq\n", dev->name); | 1254 | DBG(3, dev, "Allocation irq\n"); |
1256 | tasklet_hi_schedule(&lp->tx_task); | 1255 | tasklet_hi_schedule(&lp->tx_task); |
1257 | mask &= ~IM_ALLOC_INT; | 1256 | mask &= ~IM_ALLOC_INT; |
1258 | } else if (status & IM_TX_EMPTY_INT) { | 1257 | } else if (status & IM_TX_EMPTY_INT) { |
1259 | DBG(3, "%s: TX empty\n", dev->name); | 1258 | DBG(3, dev, "TX empty\n"); |
1260 | mask &= ~IM_TX_EMPTY_INT; | 1259 | mask &= ~IM_TX_EMPTY_INT; |
1261 | 1260 | ||
1262 | /* update stats */ | 1261 | /* update stats */ |
@@ -1271,10 +1270,10 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id) | |||
1271 | /* multiple collisions */ | 1270 | /* multiple collisions */ |
1272 | dev->stats.collisions += card_stats & 0xF; | 1271 | dev->stats.collisions += card_stats & 0xF; |
1273 | } else if (status & IM_RX_OVRN_INT) { | 1272 | } else if (status & IM_RX_OVRN_INT) { |
1274 | DBG(1, "%s: RX overrun (EPH_ST 0x%04x)\n", dev->name, | 1273 | DBG(1, dev, "RX overrun (EPH_ST 0x%04x)\n", |
1275 | ({ int eph_st; SMC_SELECT_BANK(lp, 0); | 1274 | ({ int eph_st; SMC_SELECT_BANK(lp, 0); |
1276 | eph_st = SMC_GET_EPH_STATUS(lp); | 1275 | eph_st = SMC_GET_EPH_STATUS(lp); |
1277 | SMC_SELECT_BANK(lp, 2); eph_st; })); | 1276 | SMC_SELECT_BANK(lp, 2); eph_st; })); |
1278 | SMC_ACK_INT(lp, IM_RX_OVRN_INT); | 1277 | SMC_ACK_INT(lp, IM_RX_OVRN_INT); |
1279 | dev->stats.rx_errors++; | 1278 | dev->stats.rx_errors++; |
1280 | dev->stats.rx_fifo_errors++; | 1279 | dev->stats.rx_fifo_errors++; |
@@ -1285,7 +1284,7 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id) | |||
1285 | smc_phy_interrupt(dev); | 1284 | smc_phy_interrupt(dev); |
1286 | } else if (status & IM_ERCV_INT) { | 1285 | } else if (status & IM_ERCV_INT) { |
1287 | SMC_ACK_INT(lp, IM_ERCV_INT); | 1286 | SMC_ACK_INT(lp, IM_ERCV_INT); |
1288 | PRINTK("%s: UNSUPPORTED: ERCV INTERRUPT\n", dev->name); | 1287 | PRINTK(dev, "UNSUPPORTED: ERCV INTERRUPT\n"); |
1289 | } | 1288 | } |
1290 | } while (--timeout); | 1289 | } while (--timeout); |
1291 | 1290 | ||
@@ -1296,11 +1295,11 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id) | |||
1296 | 1295 | ||
1297 | #ifndef CONFIG_NET_POLL_CONTROLLER | 1296 | #ifndef CONFIG_NET_POLL_CONTROLLER |
1298 | if (timeout == MAX_IRQ_LOOPS) | 1297 | if (timeout == MAX_IRQ_LOOPS) |
1299 | PRINTK("%s: spurious interrupt (mask = 0x%02x)\n", | 1298 | PRINTK(dev, "spurious interrupt (mask = 0x%02x)\n", |
1300 | dev->name, mask); | 1299 | mask); |
1301 | #endif | 1300 | #endif |
1302 | DBG(3, "%s: Interrupt done (%d loops)\n", | 1301 | DBG(3, dev, "Interrupt done (%d loops)\n", |
1303 | dev->name, MAX_IRQ_LOOPS - timeout); | 1302 | MAX_IRQ_LOOPS - timeout); |
1304 | 1303 | ||
1305 | /* | 1304 | /* |
1306 | * We return IRQ_HANDLED unconditionally here even if there was | 1305 | * We return IRQ_HANDLED unconditionally here even if there was |
@@ -1333,7 +1332,7 @@ static void smc_timeout(struct net_device *dev) | |||
1333 | void __iomem *ioaddr = lp->base; | 1332 | void __iomem *ioaddr = lp->base; |
1334 | int status, mask, eph_st, meminfo, fifo; | 1333 | int status, mask, eph_st, meminfo, fifo; |
1335 | 1334 | ||
1336 | DBG(2, "%s: %s\n", dev->name, __func__); | 1335 | DBG(2, dev, "%s\n", __func__); |
1337 | 1336 | ||
1338 | spin_lock_irq(&lp->lock); | 1337 | spin_lock_irq(&lp->lock); |
1339 | status = SMC_GET_INT(lp); | 1338 | status = SMC_GET_INT(lp); |
@@ -1344,9 +1343,8 @@ static void smc_timeout(struct net_device *dev) | |||
1344 | meminfo = SMC_GET_MIR(lp); | 1343 | meminfo = SMC_GET_MIR(lp); |
1345 | SMC_SELECT_BANK(lp, 2); | 1344 | SMC_SELECT_BANK(lp, 2); |
1346 | spin_unlock_irq(&lp->lock); | 1345 | spin_unlock_irq(&lp->lock); |
1347 | PRINTK( "%s: TX timeout (INT 0x%02x INTMASK 0x%02x " | 1346 | PRINTK(dev, "TX timeout (INT 0x%02x INTMASK 0x%02x MEM 0x%04x FIFO 0x%04x EPH_ST 0x%04x)\n", |
1348 | "MEM 0x%04x FIFO 0x%04x EPH_ST 0x%04x)\n", | 1347 | status, mask, meminfo, fifo, eph_st); |
1349 | dev->name, status, mask, meminfo, fifo, eph_st ); | ||
1350 | 1348 | ||
1351 | smc_reset(dev); | 1349 | smc_reset(dev); |
1352 | smc_enable(dev); | 1350 | smc_enable(dev); |
@@ -1377,10 +1375,10 @@ static void smc_set_multicast_list(struct net_device *dev) | |||
1377 | unsigned char multicast_table[8]; | 1375 | unsigned char multicast_table[8]; |
1378 | int update_multicast = 0; | 1376 | int update_multicast = 0; |
1379 | 1377 | ||
1380 | DBG(2, "%s: %s\n", dev->name, __func__); | 1378 | DBG(2, dev, "%s\n", __func__); |
1381 | 1379 | ||
1382 | if (dev->flags & IFF_PROMISC) { | 1380 | if (dev->flags & IFF_PROMISC) { |
1383 | DBG(2, "%s: RCR_PRMS\n", dev->name); | 1381 | DBG(2, dev, "RCR_PRMS\n"); |
1384 | lp->rcr_cur_mode |= RCR_PRMS; | 1382 | lp->rcr_cur_mode |= RCR_PRMS; |
1385 | } | 1383 | } |
1386 | 1384 | ||
@@ -1395,7 +1393,7 @@ static void smc_set_multicast_list(struct net_device *dev) | |||
1395 | * checked before the table is | 1393 | * checked before the table is |
1396 | */ | 1394 | */ |
1397 | else if (dev->flags & IFF_ALLMULTI || netdev_mc_count(dev) > 16) { | 1395 | else if (dev->flags & IFF_ALLMULTI || netdev_mc_count(dev) > 16) { |
1398 | DBG(2, "%s: RCR_ALMUL\n", dev->name); | 1396 | DBG(2, dev, "RCR_ALMUL\n"); |
1399 | lp->rcr_cur_mode |= RCR_ALMUL; | 1397 | lp->rcr_cur_mode |= RCR_ALMUL; |
1400 | } | 1398 | } |
1401 | 1399 | ||
@@ -1437,7 +1435,7 @@ static void smc_set_multicast_list(struct net_device *dev) | |||
1437 | /* now, the table can be loaded into the chipset */ | 1435 | /* now, the table can be loaded into the chipset */ |
1438 | update_multicast = 1; | 1436 | update_multicast = 1; |
1439 | } else { | 1437 | } else { |
1440 | DBG(2, "%s: ~(RCR_PRMS|RCR_ALMUL)\n", dev->name); | 1438 | DBG(2, dev, "~(RCR_PRMS|RCR_ALMUL)\n"); |
1441 | lp->rcr_cur_mode &= ~(RCR_PRMS | RCR_ALMUL); | 1439 | lp->rcr_cur_mode &= ~(RCR_PRMS | RCR_ALMUL); |
1442 | 1440 | ||
1443 | /* | 1441 | /* |
@@ -1470,7 +1468,7 @@ smc_open(struct net_device *dev) | |||
1470 | { | 1468 | { |
1471 | struct smc_local *lp = netdev_priv(dev); | 1469 | struct smc_local *lp = netdev_priv(dev); |
1472 | 1470 | ||
1473 | DBG(2, "%s: %s\n", dev->name, __func__); | 1471 | DBG(2, dev, "%s\n", __func__); |
1474 | 1472 | ||
1475 | /* Setup the default Register Modes */ | 1473 | /* Setup the default Register Modes */ |
1476 | lp->tcr_cur_mode = TCR_DEFAULT; | 1474 | lp->tcr_cur_mode = TCR_DEFAULT; |
@@ -1514,7 +1512,7 @@ static int smc_close(struct net_device *dev) | |||
1514 | { | 1512 | { |
1515 | struct smc_local *lp = netdev_priv(dev); | 1513 | struct smc_local *lp = netdev_priv(dev); |
1516 | 1514 | ||
1517 | DBG(2, "%s: %s\n", dev->name, __func__); | 1515 | DBG(2, dev, "%s\n", __func__); |
1518 | 1516 | ||
1519 | netif_stop_queue(dev); | 1517 | netif_stop_queue(dev); |
1520 | netif_carrier_off(dev); | 1518 | netif_carrier_off(dev); |
@@ -1694,7 +1692,7 @@ static int smc_ethtool_geteeprom(struct net_device *dev, | |||
1694 | int i; | 1692 | int i; |
1695 | int imax; | 1693 | int imax; |
1696 | 1694 | ||
1697 | DBG(1, "Reading %d bytes at %d(0x%x)\n", | 1695 | DBG(1, dev, "Reading %d bytes at %d(0x%x)\n", |
1698 | eeprom->len, eeprom->offset, eeprom->offset); | 1696 | eeprom->len, eeprom->offset, eeprom->offset); |
1699 | imax = smc_ethtool_geteeprom_len(dev); | 1697 | imax = smc_ethtool_geteeprom_len(dev); |
1700 | for (i = 0; i < eeprom->len; i += 2) { | 1698 | for (i = 0; i < eeprom->len; i += 2) { |
@@ -1706,7 +1704,7 @@ static int smc_ethtool_geteeprom(struct net_device *dev, | |||
1706 | ret = smc_read_eeprom_word(dev, offset >> 1, &wbuf); | 1704 | ret = smc_read_eeprom_word(dev, offset >> 1, &wbuf); |
1707 | if (ret != 0) | 1705 | if (ret != 0) |
1708 | return ret; | 1706 | return ret; |
1709 | DBG(2, "Read 0x%x from 0x%x\n", wbuf, offset >> 1); | 1707 | DBG(2, dev, "Read 0x%x from 0x%x\n", wbuf, offset >> 1); |
1710 | data[i] = (wbuf >> 8) & 0xff; | 1708 | data[i] = (wbuf >> 8) & 0xff; |
1711 | data[i+1] = wbuf & 0xff; | 1709 | data[i+1] = wbuf & 0xff; |
1712 | } | 1710 | } |
@@ -1719,8 +1717,8 @@ static int smc_ethtool_seteeprom(struct net_device *dev, | |||
1719 | int i; | 1717 | int i; |
1720 | int imax; | 1718 | int imax; |
1721 | 1719 | ||
1722 | DBG(1, "Writing %d bytes to %d(0x%x)\n", | 1720 | DBG(1, dev, "Writing %d bytes to %d(0x%x)\n", |
1723 | eeprom->len, eeprom->offset, eeprom->offset); | 1721 | eeprom->len, eeprom->offset, eeprom->offset); |
1724 | imax = smc_ethtool_geteeprom_len(dev); | 1722 | imax = smc_ethtool_geteeprom_len(dev); |
1725 | for (i = 0; i < eeprom->len; i += 2) { | 1723 | for (i = 0; i < eeprom->len; i += 2) { |
1726 | int ret; | 1724 | int ret; |
@@ -1729,7 +1727,7 @@ static int smc_ethtool_seteeprom(struct net_device *dev, | |||
1729 | if (offset > imax) | 1727 | if (offset > imax) |
1730 | break; | 1728 | break; |
1731 | wbuf = (data[i] << 8) | data[i + 1]; | 1729 | wbuf = (data[i] << 8) | data[i + 1]; |
1732 | DBG(2, "Writing 0x%x to 0x%x\n", wbuf, offset >> 1); | 1730 | DBG(2, dev, "Writing 0x%x to 0x%x\n", wbuf, offset >> 1); |
1733 | ret = smc_write_eeprom_word(dev, offset >> 1, wbuf); | 1731 | ret = smc_write_eeprom_word(dev, offset >> 1, wbuf); |
1734 | if (ret != 0) | 1732 | if (ret != 0) |
1735 | return ret; | 1733 | return ret; |
@@ -1784,7 +1782,7 @@ static int smc_findirq(struct smc_local *lp) | |||
1784 | int timeout = 20; | 1782 | int timeout = 20; |
1785 | unsigned long cookie; | 1783 | unsigned long cookie; |
1786 | 1784 | ||
1787 | DBG(2, "%s: %s\n", CARDNAME, __func__); | 1785 | DBG(2, dev, "%s: %s\n", CARDNAME, __func__); |
1788 | 1786 | ||
1789 | cookie = probe_irq_on(); | 1787 | cookie = probe_irq_on(); |
1790 | 1788 | ||
@@ -1856,21 +1854,21 @@ static int smc_probe(struct net_device *dev, void __iomem *ioaddr, | |||
1856 | unsigned long irq_flags) | 1854 | unsigned long irq_flags) |
1857 | { | 1855 | { |
1858 | struct smc_local *lp = netdev_priv(dev); | 1856 | struct smc_local *lp = netdev_priv(dev); |
1859 | static int version_printed = 0; | ||
1860 | int retval; | 1857 | int retval; |
1861 | unsigned int val, revision_register; | 1858 | unsigned int val, revision_register; |
1862 | const char *version_string; | 1859 | const char *version_string; |
1863 | 1860 | ||
1864 | DBG(2, "%s: %s\n", CARDNAME, __func__); | 1861 | DBG(2, dev, "%s: %s\n", CARDNAME, __func__); |
1865 | 1862 | ||
1866 | /* First, see if the high byte is 0x33 */ | 1863 | /* First, see if the high byte is 0x33 */ |
1867 | val = SMC_CURRENT_BANK(lp); | 1864 | val = SMC_CURRENT_BANK(lp); |
1868 | DBG(2, "%s: bank signature probe returned 0x%04x\n", CARDNAME, val); | 1865 | DBG(2, dev, "%s: bank signature probe returned 0x%04x\n", |
1866 | CARDNAME, val); | ||
1869 | if ((val & 0xFF00) != 0x3300) { | 1867 | if ((val & 0xFF00) != 0x3300) { |
1870 | if ((val & 0xFF) == 0x33) { | 1868 | if ((val & 0xFF) == 0x33) { |
1871 | printk(KERN_WARNING | 1869 | netdev_warn(dev, |
1872 | "%s: Detected possible byte-swapped interface" | 1870 | "%s: Detected possible byte-swapped interface at IOADDR %p\n", |
1873 | " at IOADDR %p\n", CARDNAME, ioaddr); | 1871 | CARDNAME, ioaddr); |
1874 | } | 1872 | } |
1875 | retval = -ENODEV; | 1873 | retval = -ENODEV; |
1876 | goto err_out; | 1874 | goto err_out; |
@@ -1897,8 +1895,8 @@ static int smc_probe(struct net_device *dev, void __iomem *ioaddr, | |||
1897 | val = SMC_GET_BASE(lp); | 1895 | val = SMC_GET_BASE(lp); |
1898 | val = ((val & 0x1F00) >> 3) << SMC_IO_SHIFT; | 1896 | val = ((val & 0x1F00) >> 3) << SMC_IO_SHIFT; |
1899 | if (((unsigned int)ioaddr & (0x3e0 << SMC_IO_SHIFT)) != val) { | 1897 | if (((unsigned int)ioaddr & (0x3e0 << SMC_IO_SHIFT)) != val) { |
1900 | printk("%s: IOADDR %p doesn't match configuration (%x).\n", | 1898 | netdev_warn(dev, "%s: IOADDR %p doesn't match configuration (%x).\n", |
1901 | CARDNAME, ioaddr, val); | 1899 | CARDNAME, ioaddr, val); |
1902 | } | 1900 | } |
1903 | 1901 | ||
1904 | /* | 1902 | /* |
@@ -1908,21 +1906,19 @@ static int smc_probe(struct net_device *dev, void __iomem *ioaddr, | |||
1908 | */ | 1906 | */ |
1909 | SMC_SELECT_BANK(lp, 3); | 1907 | SMC_SELECT_BANK(lp, 3); |
1910 | revision_register = SMC_GET_REV(lp); | 1908 | revision_register = SMC_GET_REV(lp); |
1911 | DBG(2, "%s: revision = 0x%04x\n", CARDNAME, revision_register); | 1909 | DBG(2, dev, "%s: revision = 0x%04x\n", CARDNAME, revision_register); |
1912 | version_string = chip_ids[ (revision_register >> 4) & 0xF]; | 1910 | version_string = chip_ids[ (revision_register >> 4) & 0xF]; |
1913 | if (!version_string || (revision_register & 0xff00) != 0x3300) { | 1911 | if (!version_string || (revision_register & 0xff00) != 0x3300) { |
1914 | /* I don't recognize this chip, so... */ | 1912 | /* I don't recognize this chip, so... */ |
1915 | printk("%s: IO %p: Unrecognized revision register 0x%04x" | 1913 | netdev_warn(dev, "%s: IO %p: Unrecognized revision register 0x%04x, Contact author.\n", |
1916 | ", Contact author.\n", CARDNAME, | 1914 | CARDNAME, ioaddr, revision_register); |
1917 | ioaddr, revision_register); | ||
1918 | 1915 | ||
1919 | retval = -ENODEV; | 1916 | retval = -ENODEV; |
1920 | goto err_out; | 1917 | goto err_out; |
1921 | } | 1918 | } |
1922 | 1919 | ||
1923 | /* At this point I'll assume that the chip is an SMC91x. */ | 1920 | /* At this point I'll assume that the chip is an SMC91x. */ |
1924 | if (version_printed++ == 0) | 1921 | pr_info_once("%s\n", version); |
1925 | printk("%s", version); | ||
1926 | 1922 | ||
1927 | /* fill in some of the fields */ | 1923 | /* fill in some of the fields */ |
1928 | dev->base_addr = (unsigned long)ioaddr; | 1924 | dev->base_addr = (unsigned long)ioaddr; |
@@ -1940,7 +1936,7 @@ static int smc_probe(struct net_device *dev, void __iomem *ioaddr, | |||
1940 | /* | 1936 | /* |
1941 | * If dev->irq is 0, then the device has to be banged on to see | 1937 | * If dev->irq is 0, then the device has to be banged on to see |
1942 | * what the IRQ is. | 1938 | * what the IRQ is. |
1943 | * | 1939 | * |
1944 | * This banging doesn't always detect the IRQ, for unknown reasons. | 1940 | * This banging doesn't always detect the IRQ, for unknown reasons. |
1945 | * a workaround is to reset the chip and try again. | 1941 | * a workaround is to reset the chip and try again. |
1946 | * | 1942 | * |
@@ -1965,8 +1961,7 @@ static int smc_probe(struct net_device *dev, void __iomem *ioaddr, | |||
1965 | } | 1961 | } |
1966 | } | 1962 | } |
1967 | if (dev->irq == 0) { | 1963 | if (dev->irq == 0) { |
1968 | printk("%s: Couldn't autodetect your IRQ. Use irq=xx.\n", | 1964 | netdev_warn(dev, "Couldn't autodetect your IRQ. Use irq=xx.\n"); |
1969 | dev->name); | ||
1970 | retval = -ENODEV; | 1965 | retval = -ENODEV; |
1971 | goto err_out; | 1966 | goto err_out; |
1972 | } | 1967 | } |
@@ -2030,32 +2025,31 @@ static int smc_probe(struct net_device *dev, void __iomem *ioaddr, | |||
2030 | retval = register_netdev(dev); | 2025 | retval = register_netdev(dev); |
2031 | if (retval == 0) { | 2026 | if (retval == 0) { |
2032 | /* now, print out the card info, in a short format.. */ | 2027 | /* now, print out the card info, in a short format.. */ |
2033 | printk("%s: %s (rev %d) at %p IRQ %d", | 2028 | netdev_info(dev, "%s (rev %d) at %p IRQ %d", |
2034 | dev->name, version_string, revision_register & 0x0f, | 2029 | version_string, revision_register & 0x0f, |
2035 | lp->base, dev->irq); | 2030 | lp->base, dev->irq); |
2036 | 2031 | ||
2037 | if (dev->dma != (unsigned char)-1) | 2032 | if (dev->dma != (unsigned char)-1) |
2038 | printk(" DMA %d", dev->dma); | 2033 | pr_cont(" DMA %d", dev->dma); |
2039 | 2034 | ||
2040 | printk("%s%s\n", | 2035 | pr_cont("%s%s\n", |
2041 | lp->cfg.flags & SMC91X_NOWAIT ? " [nowait]" : "", | 2036 | lp->cfg.flags & SMC91X_NOWAIT ? " [nowait]" : "", |
2042 | THROTTLE_TX_PKTS ? " [throttle_tx]" : ""); | 2037 | THROTTLE_TX_PKTS ? " [throttle_tx]" : ""); |
2043 | 2038 | ||
2044 | if (!is_valid_ether_addr(dev->dev_addr)) { | 2039 | if (!is_valid_ether_addr(dev->dev_addr)) { |
2045 | printk("%s: Invalid ethernet MAC address. Please " | 2040 | netdev_warn(dev, "Invalid ethernet MAC address. Please set using ifconfig\n"); |
2046 | "set using ifconfig\n", dev->name); | ||
2047 | } else { | 2041 | } else { |
2048 | /* Print the Ethernet address */ | 2042 | /* Print the Ethernet address */ |
2049 | printk("%s: Ethernet addr: %pM\n", | 2043 | netdev_info(dev, "Ethernet addr: %pM\n", |
2050 | dev->name, dev->dev_addr); | 2044 | dev->dev_addr); |
2051 | } | 2045 | } |
2052 | 2046 | ||
2053 | if (lp->phy_type == 0) { | 2047 | if (lp->phy_type == 0) { |
2054 | PRINTK("%s: No PHY found\n", dev->name); | 2048 | PRINTK(dev, "No PHY found\n"); |
2055 | } else if ((lp->phy_type & 0xfffffff0) == 0x0016f840) { | 2049 | } else if ((lp->phy_type & 0xfffffff0) == 0x0016f840) { |
2056 | PRINTK("%s: PHY LAN83C183 (LAN91C111 Internal)\n", dev->name); | 2050 | PRINTK(dev, "PHY LAN83C183 (LAN91C111 Internal)\n"); |
2057 | } else if ((lp->phy_type & 0xfffffff0) == 0x02821c50) { | 2051 | } else if ((lp->phy_type & 0xfffffff0) == 0x02821c50) { |
2058 | PRINTK("%s: PHY LAN83C180\n", dev->name); | 2052 | PRINTK(dev, "PHY LAN83C180\n"); |
2059 | } | 2053 | } |
2060 | } | 2054 | } |
2061 | 2055 | ||
@@ -2165,7 +2159,8 @@ static inline void smc_request_datacs(struct platform_device *pdev, struct net_d | |||
2165 | return; | 2159 | return; |
2166 | 2160 | ||
2167 | if(!request_mem_region(res->start, SMC_DATA_EXTENT, CARDNAME)) { | 2161 | if(!request_mem_region(res->start, SMC_DATA_EXTENT, CARDNAME)) { |
2168 | printk(KERN_INFO "%s: failed to request datacs memory region.\n", CARDNAME); | 2162 | netdev_info(ndev, "%s: failed to request datacs memory region.\n", |
2163 | CARDNAME); | ||
2169 | return; | 2164 | return; |
2170 | } | 2165 | } |
2171 | 2166 | ||
@@ -2307,7 +2302,7 @@ static int smc_drv_probe(struct platform_device *pdev) | |||
2307 | out_free_netdev: | 2302 | out_free_netdev: |
2308 | free_netdev(ndev); | 2303 | free_netdev(ndev); |
2309 | out: | 2304 | out: |
2310 | printk("%s: not found (%d).\n", CARDNAME, ret); | 2305 | pr_info("%s: not found (%d).\n", CARDNAME, ret); |
2311 | 2306 | ||
2312 | return ret; | 2307 | return ret; |
2313 | } | 2308 | } |
diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h index 98eedb90cdc3..c9d4c872e81d 100644 --- a/drivers/net/ethernet/smsc/smc91x.h +++ b/drivers/net/ethernet/smsc/smc91x.h | |||
@@ -907,8 +907,8 @@ static const char * chip_ids[ 16 ] = { | |||
907 | ({ \ | 907 | ({ \ |
908 | int __b = SMC_CURRENT_BANK(lp); \ | 908 | int __b = SMC_CURRENT_BANK(lp); \ |
909 | if (unlikely((__b & ~0xf0) != (0x3300 | bank))) { \ | 909 | if (unlikely((__b & ~0xf0) != (0x3300 | bank))) { \ |
910 | printk( "%s: bank reg screwed (0x%04x)\n", \ | 910 | pr_err("%s: bank reg screwed (0x%04x)\n", \ |
911 | CARDNAME, __b ); \ | 911 | CARDNAME, __b); \ |
912 | BUG(); \ | 912 | BUG(); \ |
913 | } \ | 913 | } \ |
914 | reg<<SMC_IO_SHIFT; \ | 914 | reg<<SMC_IO_SHIFT; \ |