diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-23 14:47:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-23 14:47:02 -0400 |
commit | 5f05647dd81c11a6a165ccc8f0c1370b16f3bcb0 (patch) | |
tree | 7851ef1c93aa1aba7ef327ca4b75fd35e6d10f29 /drivers/net/pcmcia | |
parent | 02f36038c568111ad4fc433f6fa760ff5e38fab4 (diff) | |
parent | ec37a48d1d16c30b655ac5280209edf52a6775d4 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1699 commits)
bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL.
vlan: Calling vlan_hwaccel_do_receive() is always valid.
tproxy: use the interface primary IP address as a default value for --on-ip
tproxy: added IPv6 support to the socket match
cxgb3: function namespace cleanup
tproxy: added IPv6 support to the TPROXY target
tproxy: added IPv6 socket lookup function to nf_tproxy_core
be2net: Changes to use only priority codes allowed by f/w
tproxy: allow non-local binds of IPv6 sockets if IP_TRANSPARENT is enabled
tproxy: added tproxy sockopt interface in the IPV6 layer
tproxy: added udp6_lib_lookup function
tproxy: added const specifiers to udp lookup functions
tproxy: split off ipv6 defragmentation to a separate module
l2tp: small cleanup
nf_nat: restrict ICMP translation for embedded header
can: mcp251x: fix generation of error frames
can: mcp251x: fix endless loop in interrupt handler if CANINTF_MERRF is set
can-raw: add msg_flags to distinguish local traffic
9p: client code cleanup
rds: make local functions/variables static
...
Fix up conflicts in net/core/dev.c, drivers/net/pcmcia/smc91c92_cs.c and
drivers/net/wireless/ath/ath9k/debug.c as per David
Diffstat (limited to 'drivers/net/pcmcia')
-rw-r--r-- | drivers/net/pcmcia/3c574_cs.c | 88 | ||||
-rw-r--r-- | drivers/net/pcmcia/3c589_cs.c | 17 | ||||
-rw-r--r-- | drivers/net/pcmcia/axnet_cs.c | 187 | ||||
-rw-r--r-- | drivers/net/pcmcia/com20020_cs.c | 32 | ||||
-rw-r--r-- | drivers/net/pcmcia/fmvj18x_cs.c | 60 | ||||
-rw-r--r-- | drivers/net/pcmcia/ibmtr_cs.c | 26 | ||||
-rw-r--r-- | drivers/net/pcmcia/nmclan_cs.c | 56 | ||||
-rw-r--r-- | drivers/net/pcmcia/pcnet_cs.c | 106 | ||||
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 105 | ||||
-rw-r--r-- | drivers/net/pcmcia/xirc2ps_cs.c | 104 |
10 files changed, 353 insertions, 428 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index ff824e11f0b6..2807a0fcadc4 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c | |||
@@ -69,6 +69,8 @@ earlier 3Com products. | |||
69 | 69 | ||
70 | */ | 70 | */ |
71 | 71 | ||
72 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
73 | |||
72 | #include <linux/module.h> | 74 | #include <linux/module.h> |
73 | #include <linux/kernel.h> | 75 | #include <linux/kernel.h> |
74 | #include <linux/init.h> | 76 | #include <linux/init.h> |
@@ -83,7 +85,6 @@ earlier 3Com products. | |||
83 | #include <linux/skbuff.h> | 85 | #include <linux/skbuff.h> |
84 | #include <linux/if_arp.h> | 86 | #include <linux/if_arp.h> |
85 | #include <linux/ioport.h> | 87 | #include <linux/ioport.h> |
86 | #include <linux/ethtool.h> | ||
87 | #include <linux/bitops.h> | 88 | #include <linux/bitops.h> |
88 | #include <linux/mii.h> | 89 | #include <linux/mii.h> |
89 | 90 | ||
@@ -237,7 +238,6 @@ static int el3_rx(struct net_device *dev, int worklimit); | |||
237 | static int el3_close(struct net_device *dev); | 238 | static int el3_close(struct net_device *dev); |
238 | static void el3_tx_timeout(struct net_device *dev); | 239 | static void el3_tx_timeout(struct net_device *dev); |
239 | static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 240 | static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
240 | static const struct ethtool_ops netdev_ethtool_ops; | ||
241 | static void set_rx_mode(struct net_device *dev); | 241 | static void set_rx_mode(struct net_device *dev); |
242 | static void set_multicast_list(struct net_device *dev); | 242 | static void set_multicast_list(struct net_device *dev); |
243 | 243 | ||
@@ -283,7 +283,6 @@ static int tc574_probe(struct pcmcia_device *link) | |||
283 | link->config_index = 1; | 283 | link->config_index = 1; |
284 | 284 | ||
285 | dev->netdev_ops = &el3_netdev_ops; | 285 | dev->netdev_ops = &el3_netdev_ops; |
286 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | ||
287 | dev->watchdog_timeo = TX_TIMEOUT; | 286 | dev->watchdog_timeo = TX_TIMEOUT; |
288 | 287 | ||
289 | return tc574_config(link); | 288 | return tc574_config(link); |
@@ -359,8 +358,8 @@ static int tc574_config(struct pcmcia_device *link) | |||
359 | for (i = 0; i < 3; i++) | 358 | for (i = 0; i < 3; i++) |
360 | phys_addr[i] = htons(read_eeprom(ioaddr, i + 10)); | 359 | phys_addr[i] = htons(read_eeprom(ioaddr, i + 10)); |
361 | if (phys_addr[0] == htons(0x6060)) { | 360 | if (phys_addr[0] == htons(0x6060)) { |
362 | printk(KERN_NOTICE "3c574_cs: IO port conflict at 0x%03lx" | 361 | pr_notice("IO port conflict at 0x%03lx-0x%03lx\n", |
363 | "-0x%03lx\n", dev->base_addr, dev->base_addr+15); | 362 | dev->base_addr, dev->base_addr+15); |
364 | goto failed; | 363 | goto failed; |
365 | } | 364 | } |
366 | } | 365 | } |
@@ -374,7 +373,7 @@ static int tc574_config(struct pcmcia_device *link) | |||
374 | outw(2<<11, ioaddr + RunnerRdCtrl); | 373 | outw(2<<11, ioaddr + RunnerRdCtrl); |
375 | mcr = inb(ioaddr + 2); | 374 | mcr = inb(ioaddr + 2); |
376 | outw(0<<11, ioaddr + RunnerRdCtrl); | 375 | outw(0<<11, ioaddr + RunnerRdCtrl); |
377 | printk(KERN_INFO " ASIC rev %d,", mcr>>3); | 376 | pr_info(" ASIC rev %d,", mcr>>3); |
378 | EL3WINDOW(3); | 377 | EL3WINDOW(3); |
379 | config = inl(ioaddr + Wn3_Config); | 378 | config = inl(ioaddr + Wn3_Config); |
380 | lp->default_media = (config & Xcvr) >> Xcvr_shift; | 379 | lp->default_media = (config & Xcvr) >> Xcvr_shift; |
@@ -411,7 +410,7 @@ static int tc574_config(struct pcmcia_device *link) | |||
411 | } | 410 | } |
412 | } | 411 | } |
413 | if (phy > 32) { | 412 | if (phy > 32) { |
414 | printk(KERN_NOTICE " No MII transceivers found!\n"); | 413 | pr_notice(" No MII transceivers found!\n"); |
415 | goto failed; | 414 | goto failed; |
416 | } | 415 | } |
417 | i = mdio_read(ioaddr, lp->phys, 16) | 0x40; | 416 | i = mdio_read(ioaddr, lp->phys, 16) | 0x40; |
@@ -427,18 +426,16 @@ static int tc574_config(struct pcmcia_device *link) | |||
427 | SET_NETDEV_DEV(dev, &link->dev); | 426 | SET_NETDEV_DEV(dev, &link->dev); |
428 | 427 | ||
429 | if (register_netdev(dev) != 0) { | 428 | if (register_netdev(dev) != 0) { |
430 | printk(KERN_NOTICE "3c574_cs: register_netdev() failed\n"); | 429 | pr_notice("register_netdev() failed\n"); |
431 | goto failed; | 430 | goto failed; |
432 | } | 431 | } |
433 | 432 | ||
434 | printk(KERN_INFO "%s: %s at io %#3lx, irq %d, " | 433 | netdev_info(dev, "%s at io %#3lx, irq %d, hw_addr %pM\n", |
435 | "hw_addr %pM.\n", | 434 | cardname, dev->base_addr, dev->irq, dev->dev_addr); |
436 | dev->name, cardname, dev->base_addr, dev->irq, | 435 | netdev_info(dev, " %dK FIFO split %s Rx:Tx, %sMII interface.\n", |
437 | dev->dev_addr); | 436 | 8 << config & Ram_size, |
438 | printk(" %dK FIFO split %s Rx:Tx, %sMII interface.\n", | 437 | ram_split[(config & Ram_split) >> Ram_split_shift], |
439 | 8 << config & Ram_size, | 438 | config & Autoselect ? "autoselect " : ""); |
440 | ram_split[(config & Ram_split) >> Ram_split_shift], | ||
441 | config & Autoselect ? "autoselect " : ""); | ||
442 | 439 | ||
443 | return 0; | 440 | return 0; |
444 | 441 | ||
@@ -479,14 +476,14 @@ static void dump_status(struct net_device *dev) | |||
479 | { | 476 | { |
480 | unsigned int ioaddr = dev->base_addr; | 477 | unsigned int ioaddr = dev->base_addr; |
481 | EL3WINDOW(1); | 478 | EL3WINDOW(1); |
482 | printk(KERN_INFO " irq status %04x, rx status %04x, tx status " | 479 | netdev_info(dev, " irq status %04x, rx status %04x, tx status %02x, tx free %04x\n", |
483 | "%02x, tx free %04x\n", inw(ioaddr+EL3_STATUS), | 480 | inw(ioaddr+EL3_STATUS), |
484 | inw(ioaddr+RxStatus), inb(ioaddr+TxStatus), | 481 | inw(ioaddr+RxStatus), inb(ioaddr+TxStatus), |
485 | inw(ioaddr+TxFree)); | 482 | inw(ioaddr+TxFree)); |
486 | EL3WINDOW(4); | 483 | EL3WINDOW(4); |
487 | printk(KERN_INFO " diagnostics: fifo %04x net %04x ethernet %04x" | 484 | netdev_info(dev, " diagnostics: fifo %04x net %04x ethernet %04x media %04x\n", |
488 | " media %04x\n", inw(ioaddr+0x04), inw(ioaddr+0x06), | 485 | inw(ioaddr+0x04), inw(ioaddr+0x06), |
489 | inw(ioaddr+0x08), inw(ioaddr+0x0a)); | 486 | inw(ioaddr+0x08), inw(ioaddr+0x0a)); |
490 | EL3WINDOW(1); | 487 | EL3WINDOW(1); |
491 | } | 488 | } |
492 | 489 | ||
@@ -500,7 +497,7 @@ static void tc574_wait_for_completion(struct net_device *dev, int cmd) | |||
500 | while (--i > 0) | 497 | while (--i > 0) |
501 | if (!(inw(dev->base_addr + EL3_STATUS) & 0x1000)) break; | 498 | if (!(inw(dev->base_addr + EL3_STATUS) & 0x1000)) break; |
502 | if (i == 0) | 499 | if (i == 0) |
503 | printk(KERN_NOTICE "%s: command 0x%04x did not complete!\n", dev->name, cmd); | 500 | netdev_notice(dev, "command 0x%04x did not complete!\n", cmd); |
504 | } | 501 | } |
505 | 502 | ||
506 | /* Read a word from the EEPROM using the regular EEPROM access register. | 503 | /* Read a word from the EEPROM using the regular EEPROM access register. |
@@ -687,7 +684,7 @@ static int el3_open(struct net_device *dev) | |||
687 | netif_start_queue(dev); | 684 | netif_start_queue(dev); |
688 | 685 | ||
689 | tc574_reset(dev); | 686 | tc574_reset(dev); |
690 | lp->media.function = &media_check; | 687 | lp->media.function = media_check; |
691 | lp->media.data = (unsigned long) dev; | 688 | lp->media.data = (unsigned long) dev; |
692 | lp->media.expires = jiffies + HZ; | 689 | lp->media.expires = jiffies + HZ; |
693 | add_timer(&lp->media); | 690 | add_timer(&lp->media); |
@@ -702,7 +699,7 @@ static void el3_tx_timeout(struct net_device *dev) | |||
702 | { | 699 | { |
703 | unsigned int ioaddr = dev->base_addr; | 700 | unsigned int ioaddr = dev->base_addr; |
704 | 701 | ||
705 | printk(KERN_NOTICE "%s: Transmit timed out!\n", dev->name); | 702 | netdev_notice(dev, "Transmit timed out!\n"); |
706 | dump_status(dev); | 703 | dump_status(dev); |
707 | dev->stats.tx_errors++; | 704 | dev->stats.tx_errors++; |
708 | dev->trans_start = jiffies; /* prevent tx timeout */ | 705 | dev->trans_start = jiffies; /* prevent tx timeout */ |
@@ -825,8 +822,8 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id) | |||
825 | EL3WINDOW(4); | 822 | EL3WINDOW(4); |
826 | fifo_diag = inw(ioaddr + Wn4_FIFODiag); | 823 | fifo_diag = inw(ioaddr + Wn4_FIFODiag); |
827 | EL3WINDOW(1); | 824 | EL3WINDOW(1); |
828 | printk(KERN_NOTICE "%s: adapter failure, FIFO diagnostic" | 825 | netdev_notice(dev, "adapter failure, FIFO diagnostic register %04x\n", |
829 | " register %04x.\n", dev->name, fifo_diag); | 826 | fifo_diag); |
830 | if (fifo_diag & 0x0400) { | 827 | if (fifo_diag & 0x0400) { |
831 | /* Tx overrun */ | 828 | /* Tx overrun */ |
832 | tc574_wait_for_completion(dev, TxReset); | 829 | tc574_wait_for_completion(dev, TxReset); |
@@ -880,7 +877,7 @@ static void media_check(unsigned long arg) | |||
880 | this, we can limp along even if the interrupt is blocked */ | 877 | this, we can limp along even if the interrupt is blocked */ |
881 | if ((inw(ioaddr + EL3_STATUS) & IntLatch) && (inb(ioaddr + Timer) == 0xff)) { | 878 | if ((inw(ioaddr + EL3_STATUS) & IntLatch) && (inb(ioaddr + Timer) == 0xff)) { |
882 | if (!lp->fast_poll) | 879 | if (!lp->fast_poll) |
883 | printk(KERN_INFO "%s: interrupt(s) dropped!\n", dev->name); | 880 | netdev_info(dev, "interrupt(s) dropped!\n"); |
884 | 881 | ||
885 | local_irq_save(flags); | 882 | local_irq_save(flags); |
886 | el3_interrupt(dev->irq, dev); | 883 | el3_interrupt(dev->irq, dev); |
@@ -903,23 +900,21 @@ static void media_check(unsigned long arg) | |||
903 | 900 | ||
904 | if (media != lp->media_status) { | 901 | if (media != lp->media_status) { |
905 | if ((media ^ lp->media_status) & 0x0004) | 902 | if ((media ^ lp->media_status) & 0x0004) |
906 | printk(KERN_INFO "%s: %s link beat\n", dev->name, | 903 | netdev_info(dev, "%s link beat\n", |
907 | (lp->media_status & 0x0004) ? "lost" : "found"); | 904 | (lp->media_status & 0x0004) ? "lost" : "found"); |
908 | if ((media ^ lp->media_status) & 0x0020) { | 905 | if ((media ^ lp->media_status) & 0x0020) { |
909 | lp->partner = 0; | 906 | lp->partner = 0; |
910 | if (lp->media_status & 0x0020) { | 907 | if (lp->media_status & 0x0020) { |
911 | printk(KERN_INFO "%s: autonegotiation restarted\n", | 908 | netdev_info(dev, "autonegotiation restarted\n"); |
912 | dev->name); | ||
913 | } else if (partner) { | 909 | } else if (partner) { |
914 | partner &= lp->advertising; | 910 | partner &= lp->advertising; |
915 | lp->partner = partner; | 911 | lp->partner = partner; |
916 | printk(KERN_INFO "%s: autonegotiation complete: " | 912 | netdev_info(dev, "autonegotiation complete: " |
917 | "%sbaseT-%cD selected\n", dev->name, | 913 | "%dbaseT-%cD selected\n", |
918 | ((partner & 0x0180) ? "100" : "10"), | 914 | (partner & 0x0180) ? 100 : 10, |
919 | ((partner & 0x0140) ? 'F' : 'H')); | 915 | (partner & 0x0140) ? 'F' : 'H'); |
920 | } else { | 916 | } else { |
921 | printk(KERN_INFO "%s: link partner did not autonegotiate\n", | 917 | netdev_info(dev, "link partner did not autonegotiate\n"); |
922 | dev->name); | ||
923 | } | 918 | } |
924 | 919 | ||
925 | EL3WINDOW(3); | 920 | EL3WINDOW(3); |
@@ -929,10 +924,9 @@ static void media_check(unsigned long arg) | |||
929 | 924 | ||
930 | } | 925 | } |
931 | if (media & 0x0010) | 926 | if (media & 0x0010) |
932 | printk(KERN_INFO "%s: remote fault detected\n", | 927 | netdev_info(dev, "remote fault detected\n"); |
933 | dev->name); | ||
934 | if (media & 0x0002) | 928 | if (media & 0x0002) |
935 | printk(KERN_INFO "%s: jabber detected\n", dev->name); | 929 | netdev_info(dev, "jabber detected\n"); |
936 | lp->media_status = media; | 930 | lp->media_status = media; |
937 | } | 931 | } |
938 | spin_unlock_irqrestore(&lp->window_lock, flags); | 932 | spin_unlock_irqrestore(&lp->window_lock, flags); |
@@ -1042,16 +1036,6 @@ static int el3_rx(struct net_device *dev, int worklimit) | |||
1042 | return worklimit; | 1036 | return worklimit; |
1043 | } | 1037 | } |
1044 | 1038 | ||
1045 | static void netdev_get_drvinfo(struct net_device *dev, | ||
1046 | struct ethtool_drvinfo *info) | ||
1047 | { | ||
1048 | strcpy(info->driver, "3c574_cs"); | ||
1049 | } | ||
1050 | |||
1051 | static const struct ethtool_ops netdev_ethtool_ops = { | ||
1052 | .get_drvinfo = netdev_get_drvinfo, | ||
1053 | }; | ||
1054 | |||
1055 | /* Provide ioctl() calls to examine the MII xcvr state. */ | 1039 | /* Provide ioctl() calls to examine the MII xcvr state. */ |
1056 | static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | 1040 | static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) |
1057 | { | 1041 | { |
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index a07e22295330..79b9ca0dbdb4 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c | |||
@@ -19,6 +19,8 @@ | |||
19 | 19 | ||
20 | ======================================================================*/ | 20 | ======================================================================*/ |
21 | 21 | ||
22 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
23 | |||
22 | #define DRV_NAME "3c589_cs" | 24 | #define DRV_NAME "3c589_cs" |
23 | #define DRV_VERSION "1.162-ac" | 25 | #define DRV_VERSION "1.162-ac" |
24 | 26 | ||
@@ -237,7 +239,7 @@ static int tc589_config(struct pcmcia_device *link) | |||
237 | __be16 *phys_addr; | 239 | __be16 *phys_addr; |
238 | int ret, i, j, multi = 0, fifo; | 240 | int ret, i, j, multi = 0, fifo; |
239 | unsigned int ioaddr; | 241 | unsigned int ioaddr; |
240 | char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; | 242 | static const char * const ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; |
241 | u8 *buf; | 243 | u8 *buf; |
242 | size_t len; | 244 | size_t len; |
243 | 245 | ||
@@ -246,8 +248,7 @@ static int tc589_config(struct pcmcia_device *link) | |||
246 | phys_addr = (__be16 *)dev->dev_addr; | 248 | phys_addr = (__be16 *)dev->dev_addr; |
247 | /* Is this a 3c562? */ | 249 | /* Is this a 3c562? */ |
248 | if (link->manf_id != MANFID_3COM) | 250 | if (link->manf_id != MANFID_3COM) |
249 | printk(KERN_INFO "3c589_cs: hmmm, is this really a " | 251 | dev_info(&link->dev, "hmmm, is this really a 3Com card??\n"); |
250 | "3Com card??\n"); | ||
251 | multi = (link->card_id == PRODID_3COM_3C562); | 252 | multi = (link->card_id == PRODID_3COM_3C562); |
252 | 253 | ||
253 | link->io_lines = 16; | 254 | link->io_lines = 16; |
@@ -288,8 +289,8 @@ static int tc589_config(struct pcmcia_device *link) | |||
288 | for (i = 0; i < 3; i++) | 289 | for (i = 0; i < 3; i++) |
289 | phys_addr[i] = htons(read_eeprom(ioaddr, i)); | 290 | phys_addr[i] = htons(read_eeprom(ioaddr, i)); |
290 | if (phys_addr[0] == htons(0x6060)) { | 291 | if (phys_addr[0] == htons(0x6060)) { |
291 | printk(KERN_ERR "3c589_cs: IO port conflict at 0x%03lx" | 292 | dev_err(&link->dev, "IO port conflict at 0x%03lx-0x%03lx\n", |
292 | "-0x%03lx\n", dev->base_addr, dev->base_addr+15); | 293 | dev->base_addr, dev->base_addr+15); |
293 | goto failed; | 294 | goto failed; |
294 | } | 295 | } |
295 | } | 296 | } |
@@ -303,12 +304,12 @@ static int tc589_config(struct pcmcia_device *link) | |||
303 | if ((if_port >= 0) && (if_port <= 3)) | 304 | if ((if_port >= 0) && (if_port <= 3)) |
304 | dev->if_port = if_port; | 305 | dev->if_port = if_port; |
305 | else | 306 | else |
306 | printk(KERN_ERR "3c589_cs: invalid if_port requested\n"); | 307 | dev_err(&link->dev, "invalid if_port requested\n"); |
307 | 308 | ||
308 | SET_NETDEV_DEV(dev, &link->dev); | 309 | SET_NETDEV_DEV(dev, &link->dev); |
309 | 310 | ||
310 | if (register_netdev(dev) != 0) { | 311 | if (register_netdev(dev) != 0) { |
311 | printk(KERN_ERR "3c589_cs: register_netdev() failed\n"); | 312 | dev_err(&link->dev, "register_netdev() failed\n"); |
312 | goto failed; | 313 | goto failed; |
313 | } | 314 | } |
314 | 315 | ||
@@ -502,7 +503,7 @@ static int el3_open(struct net_device *dev) | |||
502 | 503 | ||
503 | tc589_reset(dev); | 504 | tc589_reset(dev); |
504 | init_timer(&lp->media); | 505 | init_timer(&lp->media); |
505 | lp->media.function = &media_check; | 506 | lp->media.function = media_check; |
506 | lp->media.data = (unsigned long) dev; | 507 | lp->media.data = (unsigned long) dev; |
507 | lp->media.expires = jiffies + HZ; | 508 | lp->media.expires = jiffies + HZ; |
508 | add_timer(&lp->media); | 509 | add_timer(&lp->media); |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 9e8b28b271ae..d2e166e29dda 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -24,6 +24,8 @@ | |||
24 | 24 | ||
25 | ======================================================================*/ | 25 | ======================================================================*/ |
26 | 26 | ||
27 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
28 | |||
27 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
28 | #include <linux/module.h> | 30 | #include <linux/module.h> |
29 | #include <linux/init.h> | 31 | #include <linux/init.h> |
@@ -32,7 +34,6 @@ | |||
32 | #include <linux/timer.h> | 34 | #include <linux/timer.h> |
33 | #include <linux/delay.h> | 35 | #include <linux/delay.h> |
34 | #include <linux/spinlock.h> | 36 | #include <linux/spinlock.h> |
35 | #include <linux/ethtool.h> | ||
36 | #include <linux/netdevice.h> | 37 | #include <linux/netdevice.h> |
37 | #include <linux/etherdevice.h> | 38 | #include <linux/etherdevice.h> |
38 | #include <linux/crc32.h> | 39 | #include <linux/crc32.h> |
@@ -85,7 +86,6 @@ static netdev_tx_t axnet_start_xmit(struct sk_buff *skb, | |||
85 | static struct net_device_stats *get_stats(struct net_device *dev); | 86 | static struct net_device_stats *get_stats(struct net_device *dev); |
86 | static void set_multicast_list(struct net_device *dev); | 87 | static void set_multicast_list(struct net_device *dev); |
87 | static void axnet_tx_timeout(struct net_device *dev); | 88 | static void axnet_tx_timeout(struct net_device *dev); |
88 | static const struct ethtool_ops netdev_ethtool_ops; | ||
89 | static irqreturn_t ei_irq_wrapper(int irq, void *dev_id); | 89 | static irqreturn_t ei_irq_wrapper(int irq, void *dev_id); |
90 | static void ei_watchdog(u_long arg); | 90 | static void ei_watchdog(u_long arg); |
91 | static void axnet_reset_8390(struct net_device *dev); | 91 | static void axnet_reset_8390(struct net_device *dev); |
@@ -161,7 +161,6 @@ static int axnet_probe(struct pcmcia_device *link) | |||
161 | 161 | ||
162 | dev->netdev_ops = &axnet_netdev_ops; | 162 | dev->netdev_ops = &axnet_netdev_ops; |
163 | 163 | ||
164 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | ||
165 | dev->watchdog_timeo = TX_TIMEOUT; | 164 | dev->watchdog_timeo = TX_TIMEOUT; |
166 | 165 | ||
167 | return axnet_config(link); | 166 | return axnet_config(link); |
@@ -300,8 +299,8 @@ static int axnet_config(struct pcmcia_device *link) | |||
300 | dev->base_addr = link->resource[0]->start; | 299 | dev->base_addr = link->resource[0]->start; |
301 | 300 | ||
302 | if (!get_prom(link)) { | 301 | if (!get_prom(link)) { |
303 | printk(KERN_NOTICE "axnet_cs: this is not an AX88190 card!\n"); | 302 | pr_notice("this is not an AX88190 card!\n"); |
304 | printk(KERN_NOTICE "axnet_cs: use pcnet_cs instead.\n"); | 303 | pr_notice("use pcnet_cs instead.\n"); |
305 | goto failed; | 304 | goto failed; |
306 | } | 305 | } |
307 | 306 | ||
@@ -310,10 +309,10 @@ static int axnet_config(struct pcmcia_device *link) | |||
310 | ei_status.tx_start_page = AXNET_START_PG; | 309 | ei_status.tx_start_page = AXNET_START_PG; |
311 | ei_status.rx_start_page = AXNET_START_PG + TX_PAGES; | 310 | ei_status.rx_start_page = AXNET_START_PG + TX_PAGES; |
312 | ei_status.stop_page = AXNET_STOP_PG; | 311 | ei_status.stop_page = AXNET_STOP_PG; |
313 | ei_status.reset_8390 = &axnet_reset_8390; | 312 | ei_status.reset_8390 = axnet_reset_8390; |
314 | ei_status.get_8390_hdr = &get_8390_hdr; | 313 | ei_status.get_8390_hdr = get_8390_hdr; |
315 | ei_status.block_input = &block_input; | 314 | ei_status.block_input = block_input; |
316 | ei_status.block_output = &block_output; | 315 | ei_status.block_output = block_output; |
317 | 316 | ||
318 | if (inb(dev->base_addr + AXNET_TEST) != 0) | 317 | if (inb(dev->base_addr + AXNET_TEST) != 0) |
319 | info->flags |= IS_AX88790; | 318 | info->flags |= IS_AX88790; |
@@ -346,19 +345,18 @@ static int axnet_config(struct pcmcia_device *link) | |||
346 | SET_NETDEV_DEV(dev, &link->dev); | 345 | SET_NETDEV_DEV(dev, &link->dev); |
347 | 346 | ||
348 | if (register_netdev(dev) != 0) { | 347 | if (register_netdev(dev) != 0) { |
349 | printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n"); | 348 | pr_notice("register_netdev() failed\n"); |
350 | goto failed; | 349 | goto failed; |
351 | } | 350 | } |
352 | 351 | ||
353 | printk(KERN_INFO "%s: Asix AX88%d90: io %#3lx, irq %d, " | 352 | netdev_info(dev, "Asix AX88%d90: io %#3lx, irq %d, hw_addr %pM\n", |
354 | "hw_addr %pM\n", | 353 | ((info->flags & IS_AX88790) ? 7 : 1), |
355 | dev->name, ((info->flags & IS_AX88790) ? 7 : 1), | 354 | dev->base_addr, dev->irq, dev->dev_addr); |
356 | dev->base_addr, dev->irq, | ||
357 | dev->dev_addr); | ||
358 | if (info->phy_id != -1) { | 355 | if (info->phy_id != -1) { |
359 | dev_dbg(&link->dev, " MII transceiver at index %d, status %x.\n", info->phy_id, j); | 356 | netdev_dbg(dev, " MII transceiver at index %d, status %x\n", |
357 | info->phy_id, j); | ||
360 | } else { | 358 | } else { |
361 | printk(KERN_NOTICE " No MII transceivers found!\n"); | 359 | netdev_notice(dev, " No MII transceivers found!\n"); |
362 | } | 360 | } |
363 | return 0; | 361 | return 0; |
364 | 362 | ||
@@ -477,7 +475,7 @@ static int axnet_open(struct net_device *dev) | |||
477 | 475 | ||
478 | info->link_status = 0x00; | 476 | info->link_status = 0x00; |
479 | init_timer(&info->watchdog); | 477 | init_timer(&info->watchdog); |
480 | info->watchdog.function = &ei_watchdog; | 478 | info->watchdog.function = ei_watchdog; |
481 | info->watchdog.data = (u_long)dev; | 479 | info->watchdog.data = (u_long)dev; |
482 | info->watchdog.expires = jiffies + HZ; | 480 | info->watchdog.expires = jiffies + HZ; |
483 | add_timer(&info->watchdog); | 481 | add_timer(&info->watchdog); |
@@ -530,8 +528,7 @@ static void axnet_reset_8390(struct net_device *dev) | |||
530 | outb_p(ENISR_RESET, nic_base + EN0_ISR); /* Ack intr. */ | 528 | outb_p(ENISR_RESET, nic_base + EN0_ISR); /* Ack intr. */ |
531 | 529 | ||
532 | if (i == 100) | 530 | if (i == 100) |
533 | printk(KERN_ERR "%s: axnet_reset_8390() did not complete.\n", | 531 | netdev_err(dev, "axnet_reset_8390() did not complete\n"); |
534 | dev->name); | ||
535 | 532 | ||
536 | } /* axnet_reset_8390 */ | 533 | } /* axnet_reset_8390 */ |
537 | 534 | ||
@@ -558,7 +555,7 @@ static void ei_watchdog(u_long arg) | |||
558 | this, we can limp along even if the interrupt is blocked */ | 555 | this, we can limp along even if the interrupt is blocked */ |
559 | if (info->stale++ && (inb_p(nic_base + EN0_ISR) & ENISR_ALL)) { | 556 | if (info->stale++ && (inb_p(nic_base + EN0_ISR) & ENISR_ALL)) { |
560 | if (!info->fast_poll) | 557 | if (!info->fast_poll) |
561 | printk(KERN_INFO "%s: interrupt(s) dropped!\n", dev->name); | 558 | netdev_info(dev, "interrupt(s) dropped!\n"); |
562 | ei_irq_wrapper(dev->irq, dev); | 559 | ei_irq_wrapper(dev->irq, dev); |
563 | info->fast_poll = HZ; | 560 | info->fast_poll = HZ; |
564 | } | 561 | } |
@@ -573,7 +570,7 @@ static void ei_watchdog(u_long arg) | |||
573 | goto reschedule; | 570 | goto reschedule; |
574 | link = mdio_read(mii_addr, info->phy_id, 1); | 571 | link = mdio_read(mii_addr, info->phy_id, 1); |
575 | if (!link || (link == 0xffff)) { | 572 | if (!link || (link == 0xffff)) { |
576 | printk(KERN_INFO "%s: MII is missing!\n", dev->name); | 573 | netdev_info(dev, "MII is missing!\n"); |
577 | info->phy_id = -1; | 574 | info->phy_id = -1; |
578 | goto reschedule; | 575 | goto reschedule; |
579 | } | 576 | } |
@@ -581,18 +578,14 @@ static void ei_watchdog(u_long arg) | |||
581 | link &= 0x0004; | 578 | link &= 0x0004; |
582 | if (link != info->link_status) { | 579 | if (link != info->link_status) { |
583 | u_short p = mdio_read(mii_addr, info->phy_id, 5); | 580 | u_short p = mdio_read(mii_addr, info->phy_id, 5); |
584 | printk(KERN_INFO "%s: %s link beat\n", dev->name, | 581 | netdev_info(dev, "%s link beat\n", link ? "found" : "lost"); |
585 | (link) ? "found" : "lost"); | ||
586 | if (link) { | 582 | if (link) { |
587 | info->duplex_flag = (p & 0x0140) ? 0x80 : 0x00; | 583 | info->duplex_flag = (p & 0x0140) ? 0x80 : 0x00; |
588 | if (p) | 584 | if (p) |
589 | printk(KERN_INFO "%s: autonegotiation complete: " | 585 | netdev_info(dev, "autonegotiation complete: %dbaseT-%cD selected\n", |
590 | "%sbaseT-%cD selected\n", dev->name, | 586 | (p & 0x0180) ? 100 : 10, (p & 0x0140) ? 'F' : 'H'); |
591 | ((p & 0x0180) ? "100" : "10"), | ||
592 | ((p & 0x0140) ? 'F' : 'H')); | ||
593 | else | 587 | else |
594 | printk(KERN_INFO "%s: link partner did not autonegotiate\n", | 588 | netdev_info(dev, "link partner did not autonegotiate\n"); |
595 | dev->name); | ||
596 | AX88190_init(dev, 1); | 589 | AX88190_init(dev, 1); |
597 | } | 590 | } |
598 | info->link_status = link; | 591 | info->link_status = link; |
@@ -603,16 +596,6 @@ reschedule: | |||
603 | add_timer(&info->watchdog); | 596 | add_timer(&info->watchdog); |
604 | } | 597 | } |
605 | 598 | ||
606 | static void netdev_get_drvinfo(struct net_device *dev, | ||
607 | struct ethtool_drvinfo *info) | ||
608 | { | ||
609 | strcpy(info->driver, "axnet_cs"); | ||
610 | } | ||
611 | |||
612 | static const struct ethtool_ops netdev_ethtool_ops = { | ||
613 | .get_drvinfo = netdev_get_drvinfo, | ||
614 | }; | ||
615 | |||
616 | /*====================================================================*/ | 599 | /*====================================================================*/ |
617 | 600 | ||
618 | static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | 601 | static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) |
@@ -798,9 +781,6 @@ module_exit(exit_axnet_cs); | |||
798 | 781 | ||
799 | */ | 782 | */ |
800 | 783 | ||
801 | static const char version_8390[] = KERN_INFO \ | ||
802 | "8390.c:v1.10cvs 9/23/94 Donald Becker (becker@scyld.com)\n"; | ||
803 | |||
804 | #include <linux/bitops.h> | 784 | #include <linux/bitops.h> |
805 | #include <asm/irq.h> | 785 | #include <asm/irq.h> |
806 | #include <linux/fcntl.h> | 786 | #include <linux/fcntl.h> |
@@ -947,9 +927,11 @@ static void axnet_tx_timeout(struct net_device *dev) | |||
947 | isr = inb(e8390_base+EN0_ISR); | 927 | isr = inb(e8390_base+EN0_ISR); |
948 | spin_unlock_irqrestore(&ei_local->page_lock, flags); | 928 | spin_unlock_irqrestore(&ei_local->page_lock, flags); |
949 | 929 | ||
950 | printk(KERN_DEBUG "%s: Tx timed out, %s TSR=%#2x, ISR=%#2x, t=%d.\n", | 930 | netdev_printk(KERN_DEBUG, dev, |
951 | dev->name, (txsr & ENTSR_ABT) ? "excess collisions." : | 931 | "Tx timed out, %s TSR=%#2x, ISR=%#2x, t=%d.\n", |
952 | (isr) ? "lost interrupt?" : "cable problem?", txsr, isr, tickssofar); | 932 | (txsr & ENTSR_ABT) ? "excess collisions." : |
933 | (isr) ? "lost interrupt?" : "cable problem?", | ||
934 | txsr, isr, tickssofar); | ||
953 | 935 | ||
954 | if (!isr && !dev->stats.tx_packets) | 936 | if (!isr && !dev->stats.tx_packets) |
955 | { | 937 | { |
@@ -1019,22 +1001,28 @@ static netdev_tx_t axnet_start_xmit(struct sk_buff *skb, | |||
1019 | output_page = ei_local->tx_start_page; | 1001 | output_page = ei_local->tx_start_page; |
1020 | ei_local->tx1 = send_length; | 1002 | ei_local->tx1 = send_length; |
1021 | if (ei_debug && ei_local->tx2 > 0) | 1003 | if (ei_debug && ei_local->tx2 > 0) |
1022 | printk(KERN_DEBUG "%s: idle transmitter tx2=%d, lasttx=%d, txing=%d.\n", | 1004 | netdev_printk(KERN_DEBUG, dev, |
1023 | dev->name, ei_local->tx2, ei_local->lasttx, ei_local->txing); | 1005 | "idle transmitter tx2=%d, lasttx=%d, txing=%d\n", |
1006 | ei_local->tx2, ei_local->lasttx, | ||
1007 | ei_local->txing); | ||
1024 | } | 1008 | } |
1025 | else if (ei_local->tx2 == 0) | 1009 | else if (ei_local->tx2 == 0) |
1026 | { | 1010 | { |
1027 | output_page = ei_local->tx_start_page + TX_PAGES/2; | 1011 | output_page = ei_local->tx_start_page + TX_PAGES/2; |
1028 | ei_local->tx2 = send_length; | 1012 | ei_local->tx2 = send_length; |
1029 | if (ei_debug && ei_local->tx1 > 0) | 1013 | if (ei_debug && ei_local->tx1 > 0) |
1030 | printk(KERN_DEBUG "%s: idle transmitter, tx1=%d, lasttx=%d, txing=%d.\n", | 1014 | netdev_printk(KERN_DEBUG, dev, |
1031 | dev->name, ei_local->tx1, ei_local->lasttx, ei_local->txing); | 1015 | "idle transmitter, tx1=%d, lasttx=%d, txing=%d\n", |
1016 | ei_local->tx1, ei_local->lasttx, | ||
1017 | ei_local->txing); | ||
1032 | } | 1018 | } |
1033 | else | 1019 | else |
1034 | { /* We should never get here. */ | 1020 | { /* We should never get here. */ |
1035 | if (ei_debug) | 1021 | if (ei_debug) |
1036 | printk(KERN_DEBUG "%s: No Tx buffers free! tx1=%d tx2=%d last=%d\n", | 1022 | netdev_printk(KERN_DEBUG, dev, |
1037 | dev->name, ei_local->tx1, ei_local->tx2, ei_local->lasttx); | 1023 | "No Tx buffers free! tx1=%d tx2=%d last=%d\n", |
1024 | ei_local->tx1, ei_local->tx2, | ||
1025 | ei_local->lasttx); | ||
1038 | ei_local->irqlock = 0; | 1026 | ei_local->irqlock = 0; |
1039 | netif_stop_queue(dev); | 1027 | netif_stop_queue(dev); |
1040 | outb_p(ENISR_ALL, e8390_base + EN0_IMR); | 1028 | outb_p(ENISR_ALL, e8390_base + EN0_IMR); |
@@ -1122,23 +1110,26 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) | |||
1122 | 1110 | ||
1123 | spin_lock_irqsave(&ei_local->page_lock, flags); | 1111 | spin_lock_irqsave(&ei_local->page_lock, flags); |
1124 | 1112 | ||
1125 | if (ei_local->irqlock) | 1113 | if (ei_local->irqlock) { |
1126 | { | ||
1127 | #if 1 /* This might just be an interrupt for a PCI device sharing this line */ | 1114 | #if 1 /* This might just be an interrupt for a PCI device sharing this line */ |
1115 | const char *msg; | ||
1128 | /* The "irqlock" check is only for testing. */ | 1116 | /* The "irqlock" check is only for testing. */ |
1129 | printk(ei_local->irqlock | 1117 | if (ei_local->irqlock) |
1130 | ? "%s: Interrupted while interrupts are masked! isr=%#2x imr=%#2x.\n" | 1118 | msg = "Interrupted while interrupts are masked!"; |
1131 | : "%s: Reentering the interrupt handler! isr=%#2x imr=%#2x.\n", | 1119 | else |
1132 | dev->name, inb_p(e8390_base + EN0_ISR), | 1120 | msg = "Reentering the interrupt handler!"; |
1133 | inb_p(e8390_base + EN0_IMR)); | 1121 | netdev_info(dev, "%s, isr=%#2x imr=%#2x\n", |
1122 | msg, | ||
1123 | inb_p(e8390_base + EN0_ISR), | ||
1124 | inb_p(e8390_base + EN0_IMR)); | ||
1134 | #endif | 1125 | #endif |
1135 | spin_unlock_irqrestore(&ei_local->page_lock, flags); | 1126 | spin_unlock_irqrestore(&ei_local->page_lock, flags); |
1136 | return IRQ_NONE; | 1127 | return IRQ_NONE; |
1137 | } | 1128 | } |
1138 | 1129 | ||
1139 | if (ei_debug > 3) | 1130 | if (ei_debug > 3) |
1140 | printk(KERN_DEBUG "%s: interrupt(isr=%#2.2x).\n", dev->name, | 1131 | netdev_printk(KERN_DEBUG, dev, "interrupt(isr=%#2.2x)\n", |
1141 | inb_p(e8390_base + EN0_ISR)); | 1132 | inb_p(e8390_base + EN0_ISR)); |
1142 | 1133 | ||
1143 | outb_p(0x00, e8390_base + EN0_ISR); | 1134 | outb_p(0x00, e8390_base + EN0_ISR); |
1144 | ei_local->irqlock = 1; | 1135 | ei_local->irqlock = 1; |
@@ -1149,7 +1140,8 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) | |||
1149 | { | 1140 | { |
1150 | if (!netif_running(dev) || (interrupts == 0xff)) { | 1141 | if (!netif_running(dev) || (interrupts == 0xff)) { |
1151 | if (ei_debug > 1) | 1142 | if (ei_debug > 1) |
1152 | printk(KERN_WARNING "%s: interrupt from stopped card\n", dev->name); | 1143 | netdev_warn(dev, |
1144 | "interrupt from stopped card\n"); | ||
1153 | outb_p(interrupts, e8390_base + EN0_ISR); | 1145 | outb_p(interrupts, e8390_base + EN0_ISR); |
1154 | interrupts = 0; | 1146 | interrupts = 0; |
1155 | break; | 1147 | break; |
@@ -1192,11 +1184,12 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) | |||
1192 | { | 1184 | { |
1193 | /* 0xFF is valid for a card removal */ | 1185 | /* 0xFF is valid for a card removal */ |
1194 | if(interrupts!=0xFF) | 1186 | if(interrupts!=0xFF) |
1195 | printk(KERN_WARNING "%s: Too much work at interrupt, status %#2.2x\n", | 1187 | netdev_warn(dev, "Too much work at interrupt, status %#2.2x\n", |
1196 | dev->name, interrupts); | 1188 | interrupts); |
1197 | outb_p(ENISR_ALL, e8390_base + EN0_ISR); /* Ack. most intrs. */ | 1189 | outb_p(ENISR_ALL, e8390_base + EN0_ISR); /* Ack. most intrs. */ |
1198 | } else { | 1190 | } else { |
1199 | printk(KERN_WARNING "%s: unknown interrupt %#2x\n", dev->name, interrupts); | 1191 | netdev_warn(dev, "unknown interrupt %#2x\n", |
1192 | interrupts); | ||
1200 | outb_p(0xff, e8390_base + EN0_ISR); /* Ack. all intrs. */ | 1193 | outb_p(0xff, e8390_base + EN0_ISR); /* Ack. all intrs. */ |
1201 | } | 1194 | } |
1202 | } | 1195 | } |
@@ -1230,18 +1223,19 @@ static void ei_tx_err(struct net_device *dev) | |||
1230 | unsigned char tx_was_aborted = txsr & (ENTSR_ABT+ENTSR_FU); | 1223 | unsigned char tx_was_aborted = txsr & (ENTSR_ABT+ENTSR_FU); |
1231 | 1224 | ||
1232 | #ifdef VERBOSE_ERROR_DUMP | 1225 | #ifdef VERBOSE_ERROR_DUMP |
1233 | printk(KERN_DEBUG "%s: transmitter error (%#2x): ", dev->name, txsr); | 1226 | netdev_printk(KERN_DEBUG, dev, |
1227 | "transmitter error (%#2x):", txsr); | ||
1234 | if (txsr & ENTSR_ABT) | 1228 | if (txsr & ENTSR_ABT) |
1235 | printk("excess-collisions "); | 1229 | pr_cont(" excess-collisions"); |
1236 | if (txsr & ENTSR_ND) | 1230 | if (txsr & ENTSR_ND) |
1237 | printk("non-deferral "); | 1231 | pr_cont(" non-deferral"); |
1238 | if (txsr & ENTSR_CRS) | 1232 | if (txsr & ENTSR_CRS) |
1239 | printk("lost-carrier "); | 1233 | pr_cont(" lost-carrier"); |
1240 | if (txsr & ENTSR_FU) | 1234 | if (txsr & ENTSR_FU) |
1241 | printk("FIFO-underrun "); | 1235 | pr_cont(" FIFO-underrun"); |
1242 | if (txsr & ENTSR_CDH) | 1236 | if (txsr & ENTSR_CDH) |
1243 | printk("lost-heartbeat "); | 1237 | pr_cont(" lost-heartbeat"); |
1244 | printk("\n"); | 1238 | pr_cont("\n"); |
1245 | #endif | 1239 | #endif |
1246 | 1240 | ||
1247 | if (tx_was_aborted) | 1241 | if (tx_was_aborted) |
@@ -1278,8 +1272,9 @@ static void ei_tx_intr(struct net_device *dev) | |||
1278 | if (ei_local->tx1 < 0) | 1272 | if (ei_local->tx1 < 0) |
1279 | { | 1273 | { |
1280 | if (ei_local->lasttx != 1 && ei_local->lasttx != -1) | 1274 | if (ei_local->lasttx != 1 && ei_local->lasttx != -1) |
1281 | printk(KERN_ERR "%s: bogus last_tx_buffer %d, tx1=%d.\n", | 1275 | netdev_err(dev, "%s: bogus last_tx_buffer %d, tx1=%d\n", |
1282 | ei_local->name, ei_local->lasttx, ei_local->tx1); | 1276 | ei_local->name, ei_local->lasttx, |
1277 | ei_local->tx1); | ||
1283 | ei_local->tx1 = 0; | 1278 | ei_local->tx1 = 0; |
1284 | if (ei_local->tx2 > 0) | 1279 | if (ei_local->tx2 > 0) |
1285 | { | 1280 | { |
@@ -1294,8 +1289,9 @@ static void ei_tx_intr(struct net_device *dev) | |||
1294 | else if (ei_local->tx2 < 0) | 1289 | else if (ei_local->tx2 < 0) |
1295 | { | 1290 | { |
1296 | if (ei_local->lasttx != 2 && ei_local->lasttx != -2) | 1291 | if (ei_local->lasttx != 2 && ei_local->lasttx != -2) |
1297 | printk("%s: bogus last_tx_buffer %d, tx2=%d.\n", | 1292 | netdev_info(dev, "%s: bogus last_tx_buffer %d, tx2=%d\n", |
1298 | ei_local->name, ei_local->lasttx, ei_local->tx2); | 1293 | ei_local->name, ei_local->lasttx, |
1294 | ei_local->tx2); | ||
1299 | ei_local->tx2 = 0; | 1295 | ei_local->tx2 = 0; |
1300 | if (ei_local->tx1 > 0) | 1296 | if (ei_local->tx1 > 0) |
1301 | { | 1297 | { |
@@ -1308,8 +1304,9 @@ static void ei_tx_intr(struct net_device *dev) | |||
1308 | else | 1304 | else |
1309 | ei_local->lasttx = 10, ei_local->txing = 0; | 1305 | ei_local->lasttx = 10, ei_local->txing = 0; |
1310 | } | 1306 | } |
1311 | // else printk(KERN_WARNING "%s: unexpected TX-done interrupt, lasttx=%d.\n", | 1307 | // else |
1312 | // dev->name, ei_local->lasttx); | 1308 | // netdev_warn(dev, "unexpected TX-done interrupt, lasttx=%d\n", |
1309 | // ei_local->lasttx); | ||
1313 | 1310 | ||
1314 | /* Minimize Tx latency: update the statistics after we restart TXing. */ | 1311 | /* Minimize Tx latency: update the statistics after we restart TXing. */ |
1315 | if (status & ENTSR_COL) | 1312 | if (status & ENTSR_COL) |
@@ -1372,8 +1369,8 @@ static void ei_receive(struct net_device *dev) | |||
1372 | is that some clones crash in roughly the same way. | 1369 | is that some clones crash in roughly the same way. |
1373 | */ | 1370 | */ |
1374 | if (ei_debug > 0 && this_frame != ei_local->current_page && (this_frame!=0x0 || rxing_page!=0xFF)) | 1371 | if (ei_debug > 0 && this_frame != ei_local->current_page && (this_frame!=0x0 || rxing_page!=0xFF)) |
1375 | printk(KERN_ERR "%s: mismatched read page pointers %2x vs %2x.\n", | 1372 | netdev_err(dev, "mismatched read page pointers %2x vs %2x\n", |
1376 | dev->name, this_frame, ei_local->current_page); | 1373 | this_frame, ei_local->current_page); |
1377 | 1374 | ||
1378 | if (this_frame == rxing_page) /* Read all the frames? */ | 1375 | if (this_frame == rxing_page) /* Read all the frames? */ |
1379 | break; /* Done for now */ | 1376 | break; /* Done for now */ |
@@ -1389,9 +1386,10 @@ static void ei_receive(struct net_device *dev) | |||
1389 | if (pkt_len < 60 || pkt_len > 1518) | 1386 | if (pkt_len < 60 || pkt_len > 1518) |
1390 | { | 1387 | { |
1391 | if (ei_debug) | 1388 | if (ei_debug) |
1392 | printk(KERN_DEBUG "%s: bogus packet size: %d, status=%#2x nxpg=%#2x.\n", | 1389 | netdev_printk(KERN_DEBUG, dev, |
1393 | dev->name, rx_frame.count, rx_frame.status, | 1390 | "bogus packet size: %d, status=%#2x nxpg=%#2x\n", |
1394 | rx_frame.next); | 1391 | rx_frame.count, rx_frame.status, |
1392 | rx_frame.next); | ||
1395 | dev->stats.rx_errors++; | 1393 | dev->stats.rx_errors++; |
1396 | dev->stats.rx_length_errors++; | 1394 | dev->stats.rx_length_errors++; |
1397 | } | 1395 | } |
@@ -1403,8 +1401,9 @@ static void ei_receive(struct net_device *dev) | |||
1403 | if (skb == NULL) | 1401 | if (skb == NULL) |
1404 | { | 1402 | { |
1405 | if (ei_debug > 1) | 1403 | if (ei_debug > 1) |
1406 | printk(KERN_DEBUG "%s: Couldn't allocate a sk_buff of size %d.\n", | 1404 | netdev_printk(KERN_DEBUG, dev, |
1407 | dev->name, pkt_len); | 1405 | "Couldn't allocate a sk_buff of size %d\n", |
1406 | pkt_len); | ||
1408 | dev->stats.rx_dropped++; | 1407 | dev->stats.rx_dropped++; |
1409 | break; | 1408 | break; |
1410 | } | 1409 | } |
@@ -1424,9 +1423,10 @@ static void ei_receive(struct net_device *dev) | |||
1424 | else | 1423 | else |
1425 | { | 1424 | { |
1426 | if (ei_debug) | 1425 | if (ei_debug) |
1427 | printk(KERN_DEBUG "%s: bogus packet: status=%#2x nxpg=%#2x size=%d\n", | 1426 | netdev_printk(KERN_DEBUG, dev, |
1428 | dev->name, rx_frame.status, rx_frame.next, | 1427 | "bogus packet: status=%#2x nxpg=%#2x size=%d\n", |
1429 | rx_frame.count); | 1428 | rx_frame.status, rx_frame.next, |
1429 | rx_frame.count); | ||
1430 | dev->stats.rx_errors++; | 1430 | dev->stats.rx_errors++; |
1431 | /* NB: The NIC counts CRC, frame and missed errors. */ | 1431 | /* NB: The NIC counts CRC, frame and missed errors. */ |
1432 | if (pkt_stat & ENRSR_FO) | 1432 | if (pkt_stat & ENRSR_FO) |
@@ -1436,8 +1436,8 @@ static void ei_receive(struct net_device *dev) | |||
1436 | 1436 | ||
1437 | /* This _should_ never happen: it's here for avoiding bad clones. */ | 1437 | /* This _should_ never happen: it's here for avoiding bad clones. */ |
1438 | if (next_frame >= ei_local->stop_page) { | 1438 | if (next_frame >= ei_local->stop_page) { |
1439 | printk("%s: next frame inconsistency, %#2x\n", dev->name, | 1439 | netdev_info(dev, "next frame inconsistency, %#2x\n", |
1440 | next_frame); | 1440 | next_frame); |
1441 | next_frame = ei_local->rx_start_page; | 1441 | next_frame = ei_local->rx_start_page; |
1442 | } | 1442 | } |
1443 | ei_local->current_page = next_frame; | 1443 | ei_local->current_page = next_frame; |
@@ -1472,7 +1472,7 @@ static void ei_rx_overrun(struct net_device *dev) | |||
1472 | outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD); | 1472 | outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD); |
1473 | 1473 | ||
1474 | if (ei_debug > 1) | 1474 | if (ei_debug > 1) |
1475 | printk(KERN_DEBUG "%s: Receiver overrun.\n", dev->name); | 1475 | netdev_printk(KERN_DEBUG, dev, "Receiver overrun\n"); |
1476 | dev->stats.rx_over_errors++; | 1476 | dev->stats.rx_over_errors++; |
1477 | 1477 | ||
1478 | /* | 1478 | /* |
@@ -1669,7 +1669,7 @@ static void AX88190_init(struct net_device *dev, int startp) | |||
1669 | { | 1669 | { |
1670 | outb_p(dev->dev_addr[i], e8390_base + EN1_PHYS_SHIFT(i)); | 1670 | outb_p(dev->dev_addr[i], e8390_base + EN1_PHYS_SHIFT(i)); |
1671 | if(inb_p(e8390_base + EN1_PHYS_SHIFT(i))!=dev->dev_addr[i]) | 1671 | if(inb_p(e8390_base + EN1_PHYS_SHIFT(i))!=dev->dev_addr[i]) |
1672 | printk(KERN_ERR "Hw. address read/write mismap %d\n",i); | 1672 | netdev_err(dev, "Hw. address read/write mismap %d\n", i); |
1673 | } | 1673 | } |
1674 | 1674 | ||
1675 | outb_p(ei_local->rx_start_page, e8390_base + EN1_CURPAG); | 1675 | outb_p(ei_local->rx_start_page, e8390_base + EN1_CURPAG); |
@@ -1706,8 +1706,7 @@ static void NS8390_trigger_send(struct net_device *dev, unsigned int length, | |||
1706 | 1706 | ||
1707 | if (inb_p(e8390_base) & E8390_TRANS) | 1707 | if (inb_p(e8390_base) & E8390_TRANS) |
1708 | { | 1708 | { |
1709 | printk(KERN_WARNING "%s: trigger_send() called with the transmitter busy.\n", | 1709 | netdev_warn(dev, "trigger_send() called with the transmitter busy\n"); |
1710 | dev->name); | ||
1711 | return; | 1710 | return; |
1712 | } | 1711 | } |
1713 | outb_p(length & 0xff, e8390_base + EN0_TCNTLO); | 1712 | outb_p(length & 0xff, e8390_base + EN0_TCNTLO); |
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c index b706a7249477..27bfad76fc40 100644 --- a/drivers/net/pcmcia/com20020_cs.c +++ b/drivers/net/pcmcia/com20020_cs.c | |||
@@ -51,23 +51,23 @@ | |||
51 | 51 | ||
52 | #define VERSION "arcnet: COM20020 PCMCIA support loaded.\n" | 52 | #define VERSION "arcnet: COM20020 PCMCIA support loaded.\n" |
53 | 53 | ||
54 | #ifdef DEBUG | ||
55 | 54 | ||
56 | static void regdump(struct net_device *dev) | 55 | static void regdump(struct net_device *dev) |
57 | { | 56 | { |
57 | #ifdef DEBUG | ||
58 | int ioaddr = dev->base_addr; | 58 | int ioaddr = dev->base_addr; |
59 | int count; | 59 | int count; |
60 | 60 | ||
61 | printk("com20020 register dump:\n"); | 61 | netdev_dbg(dev, "register dump:\n"); |
62 | for (count = ioaddr; count < ioaddr + 16; count++) | 62 | for (count = ioaddr; count < ioaddr + 16; count++) |
63 | { | 63 | { |
64 | if (!(count % 16)) | 64 | if (!(count % 16)) |
65 | printk("\n%04X: ", count); | 65 | pr_cont("%04X:", count); |
66 | printk("%02X ", inb(count)); | 66 | pr_cont(" %02X", inb(count)); |
67 | } | 67 | } |
68 | printk("\n"); | 68 | pr_cont("\n"); |
69 | 69 | ||
70 | printk("buffer0 dump:\n"); | 70 | netdev_dbg(dev, "buffer0 dump:\n"); |
71 | /* set up the address register */ | 71 | /* set up the address register */ |
72 | count = 0; | 72 | count = 0; |
73 | outb((count >> 8) | RDDATAflag | AUTOINCflag, _ADDR_HI); | 73 | outb((count >> 8) | RDDATAflag | AUTOINCflag, _ADDR_HI); |
@@ -76,19 +76,15 @@ static void regdump(struct net_device *dev) | |||
76 | for (count = 0; count < 256+32; count++) | 76 | for (count = 0; count < 256+32; count++) |
77 | { | 77 | { |
78 | if (!(count % 16)) | 78 | if (!(count % 16)) |
79 | printk("\n%04X: ", count); | 79 | pr_cont("%04X:", count); |
80 | 80 | ||
81 | /* copy the data */ | 81 | /* copy the data */ |
82 | printk("%02X ", inb(_MEMDATA)); | 82 | pr_cont(" %02X", inb(_MEMDATA)); |
83 | } | 83 | } |
84 | printk("\n"); | 84 | pr_cont("\n"); |
85 | #endif | ||
85 | } | 86 | } |
86 | 87 | ||
87 | #else | ||
88 | |||
89 | static inline void regdump(struct net_device *dev) { } | ||
90 | |||
91 | #endif | ||
92 | 88 | ||
93 | 89 | ||
94 | /*====================================================================*/ | 90 | /*====================================================================*/ |
@@ -274,13 +270,13 @@ static int com20020_config(struct pcmcia_device *link) | |||
274 | i = com20020_found(dev, 0); /* calls register_netdev */ | 270 | i = com20020_found(dev, 0); /* calls register_netdev */ |
275 | 271 | ||
276 | if (i != 0) { | 272 | if (i != 0) { |
277 | dev_printk(KERN_NOTICE, &link->dev, | 273 | dev_notice(&link->dev, |
278 | "com20020_cs: com20020_found() failed\n"); | 274 | "com20020_found() failed\n"); |
279 | goto failed; | 275 | goto failed; |
280 | } | 276 | } |
281 | 277 | ||
282 | dev_dbg(&link->dev,KERN_INFO "%s: port %#3lx, irq %d\n", | 278 | netdev_dbg(dev, "port %#3lx, irq %d\n", |
283 | dev->name, dev->base_addr, dev->irq); | 279 | dev->base_addr, dev->irq); |
284 | return 0; | 280 | return 0; |
285 | 281 | ||
286 | failed: | 282 | failed: |
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 1c327598bbe8..9226cda4d054 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
@@ -28,6 +28,8 @@ | |||
28 | 28 | ||
29 | ======================================================================*/ | 29 | ======================================================================*/ |
30 | 30 | ||
31 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
32 | |||
31 | #define DRV_NAME "fmvj18x_cs" | 33 | #define DRV_NAME "fmvj18x_cs" |
32 | #define DRV_VERSION "2.9" | 34 | #define DRV_VERSION "2.9" |
33 | 35 | ||
@@ -289,7 +291,7 @@ static int mfc_try_io_port(struct pcmcia_device *link) | |||
289 | link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; | 291 | link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; |
290 | if (link->resource[1]->start == 0) { | 292 | if (link->resource[1]->start == 0) { |
291 | link->resource[1]->end = 0; | 293 | link->resource[1]->end = 0; |
292 | printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n"); | 294 | pr_notice("out of resource for serial\n"); |
293 | } | 295 | } |
294 | ret = pcmcia_request_io(link); | 296 | ret = pcmcia_request_io(link); |
295 | if (ret == 0) | 297 | if (ret == 0) |
@@ -497,7 +499,7 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
497 | case XXX10304: | 499 | case XXX10304: |
498 | /* Read MACID from Buggy CIS */ | 500 | /* Read MACID from Buggy CIS */ |
499 | if (fmvj18x_get_hwinfo(link, buggybuf) == -1) { | 501 | if (fmvj18x_get_hwinfo(link, buggybuf) == -1) { |
500 | printk(KERN_NOTICE "fmvj18x_cs: unable to read hardware net address.\n"); | 502 | pr_notice("unable to read hardware net address\n"); |
501 | goto failed; | 503 | goto failed; |
502 | } | 504 | } |
503 | for (i = 0 ; i < 6; i++) { | 505 | for (i = 0 ; i < 6; i++) { |
@@ -518,15 +520,14 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
518 | SET_NETDEV_DEV(dev, &link->dev); | 520 | SET_NETDEV_DEV(dev, &link->dev); |
519 | 521 | ||
520 | if (register_netdev(dev) != 0) { | 522 | if (register_netdev(dev) != 0) { |
521 | printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n"); | 523 | pr_notice("register_netdev() failed\n"); |
522 | goto failed; | 524 | goto failed; |
523 | } | 525 | } |
524 | 526 | ||
525 | /* print current configuration */ | 527 | /* print current configuration */ |
526 | printk(KERN_INFO "%s: %s, sram %s, port %#3lx, irq %d, " | 528 | netdev_info(dev, "%s, sram %s, port %#3lx, irq %d, hw_addr %pM\n", |
527 | "hw_addr %pM\n", | 529 | card_name, sram_config == 0 ? "4K TX*2" : "8K TX*2", |
528 | dev->name, card_name, sram_config == 0 ? "4K TX*2" : "8K TX*2", | 530 | dev->base_addr, dev->irq, dev->dev_addr); |
529 | dev->base_addr, dev->irq, dev->dev_addr); | ||
530 | 531 | ||
531 | return 0; | 532 | return 0; |
532 | 533 | ||
@@ -597,7 +598,7 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link) | |||
597 | lp->base = ioremap(link->resource[3]->start, | 598 | lp->base = ioremap(link->resource[3]->start, |
598 | resource_size(link->resource[3])); | 599 | resource_size(link->resource[3])); |
599 | if (lp->base == NULL) { | 600 | if (lp->base == NULL) { |
600 | printk(KERN_NOTICE "fmvj18x_cs: ioremap failed\n"); | 601 | netdev_notice(dev, "ioremap failed\n"); |
601 | return -1; | 602 | return -1; |
602 | } | 603 | } |
603 | 604 | ||
@@ -787,17 +788,16 @@ static void fjn_tx_timeout(struct net_device *dev) | |||
787 | struct local_info_t *lp = netdev_priv(dev); | 788 | struct local_info_t *lp = netdev_priv(dev); |
788 | unsigned int ioaddr = dev->base_addr; | 789 | unsigned int ioaddr = dev->base_addr; |
789 | 790 | ||
790 | printk(KERN_NOTICE "%s: transmit timed out with status %04x, %s?\n", | 791 | netdev_notice(dev, "transmit timed out with status %04x, %s?\n", |
791 | dev->name, htons(inw(ioaddr + TX_STATUS)), | 792 | htons(inw(ioaddr + TX_STATUS)), |
792 | inb(ioaddr + TX_STATUS) & F_TMT_RDY | 793 | inb(ioaddr + TX_STATUS) & F_TMT_RDY |
793 | ? "IRQ conflict" : "network cable problem"); | 794 | ? "IRQ conflict" : "network cable problem"); |
794 | printk(KERN_NOTICE "%s: timeout registers: %04x %04x %04x " | 795 | netdev_notice(dev, "timeout registers: %04x %04x %04x " |
795 | "%04x %04x %04x %04x %04x.\n", | 796 | "%04x %04x %04x %04x %04x.\n", |
796 | dev->name, htons(inw(ioaddr + 0)), | 797 | htons(inw(ioaddr + 0)), htons(inw(ioaddr + 2)), |
797 | htons(inw(ioaddr + 2)), htons(inw(ioaddr + 4)), | 798 | htons(inw(ioaddr + 4)), htons(inw(ioaddr + 6)), |
798 | htons(inw(ioaddr + 6)), htons(inw(ioaddr + 8)), | 799 | htons(inw(ioaddr + 8)), htons(inw(ioaddr + 10)), |
799 | htons(inw(ioaddr +10)), htons(inw(ioaddr +12)), | 800 | htons(inw(ioaddr + 12)), htons(inw(ioaddr + 14))); |
800 | htons(inw(ioaddr +14))); | ||
801 | dev->stats.tx_errors++; | 801 | dev->stats.tx_errors++; |
802 | /* ToDo: We should try to restart the adaptor... */ | 802 | /* ToDo: We should try to restart the adaptor... */ |
803 | local_irq_disable(); | 803 | local_irq_disable(); |
@@ -832,13 +832,13 @@ static netdev_tx_t fjn_start_xmit(struct sk_buff *skb, | |||
832 | unsigned char *buf = skb->data; | 832 | unsigned char *buf = skb->data; |
833 | 833 | ||
834 | if (length > ETH_FRAME_LEN) { | 834 | if (length > ETH_FRAME_LEN) { |
835 | printk(KERN_NOTICE "%s: Attempting to send a large packet" | 835 | netdev_notice(dev, "Attempting to send a large packet (%d bytes)\n", |
836 | " (%d bytes).\n", dev->name, length); | 836 | length); |
837 | return NETDEV_TX_BUSY; | 837 | return NETDEV_TX_BUSY; |
838 | } | 838 | } |
839 | 839 | ||
840 | pr_debug("%s: Transmitting a packet of length %lu.\n", | 840 | netdev_dbg(dev, "Transmitting a packet of length %lu\n", |
841 | dev->name, (unsigned long)skb->len); | 841 | (unsigned long)skb->len); |
842 | dev->stats.tx_bytes += skb->len; | 842 | dev->stats.tx_bytes += skb->len; |
843 | 843 | ||
844 | /* Disable both interrupts. */ | 844 | /* Disable both interrupts. */ |
@@ -891,7 +891,7 @@ static void fjn_reset(struct net_device *dev) | |||
891 | unsigned int ioaddr = dev->base_addr; | 891 | unsigned int ioaddr = dev->base_addr; |
892 | int i; | 892 | int i; |
893 | 893 | ||
894 | pr_debug("fjn_reset(%s) called.\n",dev->name); | 894 | netdev_dbg(dev, "fjn_reset() called\n"); |
895 | 895 | ||
896 | /* Reset controller */ | 896 | /* Reset controller */ |
897 | if( sram_config == 0 ) | 897 | if( sram_config == 0 ) |
@@ -975,8 +975,8 @@ static void fjn_rx(struct net_device *dev) | |||
975 | while ((inb(ioaddr + RX_MODE) & F_BUF_EMP) == 0) { | 975 | while ((inb(ioaddr + RX_MODE) & F_BUF_EMP) == 0) { |
976 | u_short status = inw(ioaddr + DATAPORT); | 976 | u_short status = inw(ioaddr + DATAPORT); |
977 | 977 | ||
978 | pr_debug("%s: Rxing packet mode %02x status %04x.\n", | 978 | netdev_dbg(dev, "Rxing packet mode %02x status %04x.\n", |
979 | dev->name, inb(ioaddr + RX_MODE), status); | 979 | inb(ioaddr + RX_MODE), status); |
980 | #ifndef final_version | 980 | #ifndef final_version |
981 | if (status == 0) { | 981 | if (status == 0) { |
982 | outb(F_SKP_PKT, ioaddr + RX_SKIP); | 982 | outb(F_SKP_PKT, ioaddr + RX_SKIP); |
@@ -995,16 +995,16 @@ static void fjn_rx(struct net_device *dev) | |||
995 | struct sk_buff *skb; | 995 | struct sk_buff *skb; |
996 | 996 | ||
997 | if (pkt_len > 1550) { | 997 | if (pkt_len > 1550) { |
998 | printk(KERN_NOTICE "%s: The FMV-18x claimed a very " | 998 | netdev_notice(dev, "The FMV-18x claimed a very large packet, size %d\n", |
999 | "large packet, size %d.\n", dev->name, pkt_len); | 999 | pkt_len); |
1000 | outb(F_SKP_PKT, ioaddr + RX_SKIP); | 1000 | outb(F_SKP_PKT, ioaddr + RX_SKIP); |
1001 | dev->stats.rx_errors++; | 1001 | dev->stats.rx_errors++; |
1002 | break; | 1002 | break; |
1003 | } | 1003 | } |
1004 | skb = dev_alloc_skb(pkt_len+2); | 1004 | skb = dev_alloc_skb(pkt_len+2); |
1005 | if (skb == NULL) { | 1005 | if (skb == NULL) { |
1006 | printk(KERN_NOTICE "%s: Memory squeeze, dropping " | 1006 | netdev_notice(dev, "Memory squeeze, dropping packet (len %d)\n", |
1007 | "packet (len %d).\n", dev->name, pkt_len); | 1007 | pkt_len); |
1008 | outb(F_SKP_PKT, ioaddr + RX_SKIP); | 1008 | outb(F_SKP_PKT, ioaddr + RX_SKIP); |
1009 | dev->stats.rx_dropped++; | 1009 | dev->stats.rx_dropped++; |
1010 | break; | 1010 | break; |
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index bf7dff96d881..15d57f5b6f29 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
@@ -45,6 +45,8 @@ | |||
45 | 45 | ||
46 | ======================================================================*/ | 46 | ======================================================================*/ |
47 | 47 | ||
48 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
49 | |||
48 | #include <linux/kernel.h> | 50 | #include <linux/kernel.h> |
49 | #include <linux/init.h> | 51 | #include <linux/init.h> |
50 | #include <linux/ptrace.h> | 52 | #include <linux/ptrace.h> |
@@ -52,7 +54,6 @@ | |||
52 | #include <linux/string.h> | 54 | #include <linux/string.h> |
53 | #include <linux/timer.h> | 55 | #include <linux/timer.h> |
54 | #include <linux/module.h> | 56 | #include <linux/module.h> |
55 | #include <linux/ethtool.h> | ||
56 | #include <linux/netdevice.h> | 57 | #include <linux/netdevice.h> |
57 | #include <linux/trdevice.h> | 58 | #include <linux/trdevice.h> |
58 | #include <linux/ibmtr.h> | 59 | #include <linux/ibmtr.h> |
@@ -105,16 +106,6 @@ typedef struct ibmtr_dev_t { | |||
105 | struct tok_info *ti; | 106 | struct tok_info *ti; |
106 | } ibmtr_dev_t; | 107 | } ibmtr_dev_t; |
107 | 108 | ||
108 | static void netdev_get_drvinfo(struct net_device *dev, | ||
109 | struct ethtool_drvinfo *info) | ||
110 | { | ||
111 | strcpy(info->driver, "ibmtr_cs"); | ||
112 | } | ||
113 | |||
114 | static const struct ethtool_ops netdev_ethtool_ops = { | ||
115 | .get_drvinfo = netdev_get_drvinfo, | ||
116 | }; | ||
117 | |||
118 | static irqreturn_t ibmtr_interrupt(int irq, void *dev_id) { | 109 | static irqreturn_t ibmtr_interrupt(int irq, void *dev_id) { |
119 | ibmtr_dev_t *info = dev_id; | 110 | ibmtr_dev_t *info = dev_id; |
120 | struct net_device *dev = info->dev; | 111 | struct net_device *dev = info->dev; |
@@ -148,8 +139,6 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link) | |||
148 | 139 | ||
149 | info->dev = dev; | 140 | info->dev = dev; |
150 | 141 | ||
151 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | ||
152 | |||
153 | return ibmtr_config(link); | 142 | return ibmtr_config(link); |
154 | } /* ibmtr_attach */ | 143 | } /* ibmtr_attach */ |
155 | 144 | ||
@@ -256,15 +245,14 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) | |||
256 | 245 | ||
257 | i = ibmtr_probe_card(dev); | 246 | i = ibmtr_probe_card(dev); |
258 | if (i != 0) { | 247 | if (i != 0) { |
259 | printk(KERN_NOTICE "ibmtr_cs: register_netdev() failed\n"); | 248 | pr_notice("register_netdev() failed\n"); |
260 | goto failed; | 249 | goto failed; |
261 | } | 250 | } |
262 | 251 | ||
263 | printk(KERN_INFO | 252 | netdev_info(dev, "port %#3lx, irq %d, mmio %#5lx, sram %#5lx, hwaddr=%pM\n", |
264 | "%s: port %#3lx, irq %d, mmio %#5lx, sram %#5lx, hwaddr=%pM\n", | 253 | dev->base_addr, dev->irq, |
265 | dev->name, dev->base_addr, dev->irq, | 254 | (u_long)ti->mmio, (u_long)(ti->sram_base << 12), |
266 | (u_long)ti->mmio, (u_long)(ti->sram_base << 12), | 255 | dev->dev_addr); |
267 | dev->dev_addr); | ||
268 | return 0; | 256 | return 0; |
269 | 257 | ||
270 | failed: | 258 | failed: |
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index 1eca4f5a6e78..0a2b0f9cdf33 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 | ||
@@ -502,7 +504,7 @@ static int mace_read(mace_private *lp, unsigned int ioaddr, int reg) | |||
502 | spin_unlock_irqrestore(&lp->bank_lock, flags); | 504 | spin_unlock_irqrestore(&lp->bank_lock, flags); |
503 | break; | 505 | break; |
504 | } | 506 | } |
505 | return (data & 0xFF); | 507 | return data & 0xFF; |
506 | } /* mace_read */ | 508 | } /* mace_read */ |
507 | 509 | ||
508 | /* ---------------------------------------------------------------------------- | 510 | /* ---------------------------------------------------------------------------- |
@@ -546,7 +548,7 @@ static int mace_init(mace_private *lp, unsigned int ioaddr, char *enet_addr) | |||
546 | /* Wait for reset bit to be cleared automatically after <= 200ns */; | 548 | /* Wait for reset bit to be cleared automatically after <= 200ns */; |
547 | if(++ct > 500) | 549 | if(++ct > 500) |
548 | { | 550 | { |
549 | printk(KERN_ERR "mace: reset failed, card removed ?\n"); | 551 | pr_err("reset failed, card removed?\n"); |
550 | return -1; | 552 | return -1; |
551 | } | 553 | } |
552 | udelay(1); | 554 | udelay(1); |
@@ -593,7 +595,7 @@ static int mace_init(mace_private *lp, unsigned int ioaddr, char *enet_addr) | |||
593 | { | 595 | { |
594 | if(++ ct > 500) | 596 | if(++ ct > 500) |
595 | { | 597 | { |
596 | printk(KERN_ERR "mace: ADDRCHG timeout, card removed ?\n"); | 598 | pr_err("ADDRCHG timeout, card removed?\n"); |
597 | return -1; | 599 | return -1; |
598 | } | 600 | } |
599 | } | 601 | } |
@@ -654,8 +656,8 @@ static int nmclan_config(struct pcmcia_device *link) | |||
654 | dev_dbg(&link->dev, "nmclan_cs configured: mace id=%x %x\n", | 656 | dev_dbg(&link->dev, "nmclan_cs configured: mace id=%x %x\n", |
655 | sig[0], sig[1]); | 657 | sig[0], sig[1]); |
656 | } else { | 658 | } else { |
657 | printk(KERN_NOTICE "nmclan_cs: mace id not found: %x %x should" | 659 | pr_notice("mace id not found: %x %x should be 0x40 0x?9\n", |
658 | " be 0x40 0x?9\n", sig[0], sig[1]); | 660 | sig[0], sig[1]); |
659 | return -ENODEV; | 661 | return -ENODEV; |
660 | } | 662 | } |
661 | } | 663 | } |
@@ -667,20 +669,18 @@ static int nmclan_config(struct pcmcia_device *link) | |||
667 | if (if_port <= 2) | 669 | if (if_port <= 2) |
668 | dev->if_port = if_port; | 670 | dev->if_port = if_port; |
669 | else | 671 | else |
670 | printk(KERN_NOTICE "nmclan_cs: invalid if_port requested\n"); | 672 | pr_notice("invalid if_port requested\n"); |
671 | 673 | ||
672 | SET_NETDEV_DEV(dev, &link->dev); | 674 | SET_NETDEV_DEV(dev, &link->dev); |
673 | 675 | ||
674 | i = register_netdev(dev); | 676 | i = register_netdev(dev); |
675 | if (i != 0) { | 677 | if (i != 0) { |
676 | printk(KERN_NOTICE "nmclan_cs: register_netdev() failed\n"); | 678 | pr_notice("register_netdev() failed\n"); |
677 | goto failed; | 679 | goto failed; |
678 | } | 680 | } |
679 | 681 | ||
680 | printk(KERN_INFO "%s: nmclan: port %#3lx, irq %d, %s port," | 682 | netdev_info(dev, "nmclan: port %#3lx, irq %d, %s port, hw_addr %pM\n", |
681 | " hw_addr %pM\n", | 683 | dev->base_addr, dev->irq, if_names[dev->if_port], dev->dev_addr); |
682 | dev->name, dev->base_addr, dev->irq, if_names[dev->if_port], | ||
683 | dev->dev_addr); | ||
684 | return 0; | 684 | return 0; |
685 | 685 | ||
686 | failed: | 686 | failed: |
@@ -768,8 +768,7 @@ static int mace_config(struct net_device *dev, struct ifmap *map) | |||
768 | if ((map->port != (u_char)(-1)) && (map->port != dev->if_port)) { | 768 | if ((map->port != (u_char)(-1)) && (map->port != dev->if_port)) { |
769 | if (map->port <= 2) { | 769 | if (map->port <= 2) { |
770 | dev->if_port = map->port; | 770 | dev->if_port = map->port; |
771 | printk(KERN_INFO "%s: switched to %s port\n", dev->name, | 771 | netdev_info(dev, "switched to %s port\n", if_names[dev->if_port]); |
772 | if_names[dev->if_port]); | ||
773 | } else | 772 | } else |
774 | return -EINVAL; | 773 | return -EINVAL; |
775 | } | 774 | } |
@@ -848,12 +847,12 @@ static void mace_tx_timeout(struct net_device *dev) | |||
848 | mace_private *lp = netdev_priv(dev); | 847 | mace_private *lp = netdev_priv(dev); |
849 | struct pcmcia_device *link = lp->p_dev; | 848 | struct pcmcia_device *link = lp->p_dev; |
850 | 849 | ||
851 | printk(KERN_NOTICE "%s: transmit timed out -- ", dev->name); | 850 | netdev_notice(dev, "transmit timed out -- "); |
852 | #if RESET_ON_TIMEOUT | 851 | #if RESET_ON_TIMEOUT |
853 | printk("resetting card\n"); | 852 | pr_cont("resetting card\n"); |
854 | pcmcia_reset_card(link->socket); | 853 | pcmcia_reset_card(link->socket); |
855 | #else /* #if RESET_ON_TIMEOUT */ | 854 | #else /* #if RESET_ON_TIMEOUT */ |
856 | printk("NOT resetting card\n"); | 855 | pr_cont("NOT resetting card\n"); |
857 | #endif /* #if RESET_ON_TIMEOUT */ | 856 | #endif /* #if RESET_ON_TIMEOUT */ |
858 | dev->trans_start = jiffies; /* prevent tx timeout */ | 857 | dev->trans_start = jiffies; /* prevent tx timeout */ |
859 | netif_wake_queue(dev); | 858 | netif_wake_queue(dev); |
@@ -935,22 +934,21 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id) | |||
935 | ioaddr = dev->base_addr; | 934 | ioaddr = dev->base_addr; |
936 | 935 | ||
937 | if (lp->tx_irq_disabled) { | 936 | if (lp->tx_irq_disabled) { |
938 | printk( | 937 | const char *msg; |
939 | (lp->tx_irq_disabled? | 938 | if (lp->tx_irq_disabled) |
940 | KERN_NOTICE "%s: Interrupt with tx_irq_disabled " | 939 | msg = "Interrupt with tx_irq_disabled"; |
941 | "[isr=%02X, imr=%02X]\n": | 940 | else |
942 | KERN_NOTICE "%s: Re-entering the interrupt handler " | 941 | msg = "Re-entering the interrupt handler"; |
943 | "[isr=%02X, imr=%02X]\n"), | 942 | netdev_notice(dev, "%s [isr=%02X, imr=%02X]\n", |
944 | dev->name, | 943 | msg, |
945 | inb(ioaddr + AM2150_MACE_BASE + MACE_IR), | 944 | inb(ioaddr + AM2150_MACE_BASE + MACE_IR), |
946 | inb(ioaddr + AM2150_MACE_BASE + MACE_IMR) | 945 | inb(ioaddr + AM2150_MACE_BASE + MACE_IMR)); |
947 | ); | ||
948 | /* WARNING: MACE_IR has been read! */ | 946 | /* WARNING: MACE_IR has been read! */ |
949 | return IRQ_NONE; | 947 | return IRQ_NONE; |
950 | } | 948 | } |
951 | 949 | ||
952 | if (!netif_device_present(dev)) { | 950 | if (!netif_device_present(dev)) { |
953 | pr_debug("%s: interrupt from dead card\n", dev->name); | 951 | netdev_dbg(dev, "interrupt from dead card\n"); |
954 | return IRQ_NONE; | 952 | return IRQ_NONE; |
955 | } | 953 | } |
956 | 954 | ||
@@ -1348,8 +1346,8 @@ static void BuildLAF(int *ladrf, int *adr) | |||
1348 | printk(KERN_DEBUG " adr =%pM\n", adr); | 1346 | printk(KERN_DEBUG " adr =%pM\n", adr); |
1349 | printk(KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63] =", hashcode); | 1347 | printk(KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63] =", hashcode); |
1350 | for (i = 0; i < 8; i++) | 1348 | for (i = 0; i < 8; i++) |
1351 | printk(KERN_CONT " %02X", ladrf[i]); | 1349 | pr_cont(" %02X", ladrf[i]); |
1352 | printk(KERN_CONT "\n"); | 1350 | pr_cont("\n"); |
1353 | #endif | 1351 | #endif |
1354 | } /* BuildLAF */ | 1352 | } /* BuildLAF */ |
1355 | 1353 | ||
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index 5d7d1d3088ae..03096c80103d 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -28,6 +28,8 @@ | |||
28 | 28 | ||
29 | ======================================================================*/ | 29 | ======================================================================*/ |
30 | 30 | ||
31 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
32 | |||
31 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
32 | #include <linux/module.h> | 34 | #include <linux/module.h> |
33 | #include <linux/init.h> | 35 | #include <linux/init.h> |
@@ -35,7 +37,6 @@ | |||
35 | #include <linux/string.h> | 37 | #include <linux/string.h> |
36 | #include <linux/timer.h> | 38 | #include <linux/timer.h> |
37 | #include <linux/delay.h> | 39 | #include <linux/delay.h> |
38 | #include <linux/ethtool.h> | ||
39 | #include <linux/netdevice.h> | 40 | #include <linux/netdevice.h> |
40 | #include <linux/log2.h> | 41 | #include <linux/log2.h> |
41 | #include <linux/etherdevice.h> | 42 | #include <linux/etherdevice.h> |
@@ -99,7 +100,6 @@ static void pcnet_release(struct pcmcia_device *link); | |||
99 | static int pcnet_open(struct net_device *dev); | 100 | static int pcnet_open(struct net_device *dev); |
100 | static int pcnet_close(struct net_device *dev); | 101 | static int pcnet_close(struct net_device *dev); |
101 | static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 102 | static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
102 | static const struct ethtool_ops netdev_ethtool_ops; | ||
103 | static irqreturn_t ei_irq_wrapper(int irq, void *dev_id); | 103 | static irqreturn_t ei_irq_wrapper(int irq, void *dev_id); |
104 | static void ei_watchdog(u_long arg); | 104 | static void ei_watchdog(u_long arg); |
105 | static void pcnet_reset_8390(struct net_device *dev); | 105 | static void pcnet_reset_8390(struct net_device *dev); |
@@ -415,8 +415,6 @@ static hw_info_t *get_ax88190(struct pcmcia_device *link) | |||
415 | dev->dev_addr[i] = j & 0xff; | 415 | dev->dev_addr[i] = j & 0xff; |
416 | dev->dev_addr[i+1] = j >> 8; | 416 | dev->dev_addr[i+1] = j >> 8; |
417 | } | 417 | } |
418 | printk(KERN_NOTICE "pcnet_cs: this is an AX88190 card!\n"); | ||
419 | printk(KERN_NOTICE "pcnet_cs: use axnet_cs instead.\n"); | ||
420 | return NULL; | 418 | return NULL; |
421 | } | 419 | } |
422 | 420 | ||
@@ -604,9 +602,7 @@ static int pcnet_config(struct pcmcia_device *link) | |||
604 | 602 | ||
605 | ei_status.name = "NE2000"; | 603 | ei_status.name = "NE2000"; |
606 | ei_status.word16 = 1; | 604 | ei_status.word16 = 1; |
607 | ei_status.reset_8390 = &pcnet_reset_8390; | 605 | ei_status.reset_8390 = pcnet_reset_8390; |
608 | |||
609 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | ||
610 | 606 | ||
611 | if (info->flags & (IS_DL10019|IS_DL10022)) | 607 | if (info->flags & (IS_DL10019|IS_DL10022)) |
612 | mii_phy_probe(dev); | 608 | mii_phy_probe(dev); |
@@ -614,25 +610,25 @@ static int pcnet_config(struct pcmcia_device *link) | |||
614 | SET_NETDEV_DEV(dev, &link->dev); | 610 | SET_NETDEV_DEV(dev, &link->dev); |
615 | 611 | ||
616 | if (register_netdev(dev) != 0) { | 612 | if (register_netdev(dev) != 0) { |
617 | printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n"); | 613 | pr_notice("register_netdev() failed\n"); |
618 | goto failed; | 614 | goto failed; |
619 | } | 615 | } |
620 | 616 | ||
621 | if (info->flags & (IS_DL10019|IS_DL10022)) { | 617 | if (info->flags & (IS_DL10019|IS_DL10022)) { |
622 | u_char id = inb(dev->base_addr + 0x1a); | 618 | u_char id = inb(dev->base_addr + 0x1a); |
623 | printk(KERN_INFO "%s: NE2000 (DL100%d rev %02x): ", | 619 | netdev_info(dev, "NE2000 (DL100%d rev %02x): ", |
624 | dev->name, ((info->flags & IS_DL10022) ? 22 : 19), id); | 620 | (info->flags & IS_DL10022) ? 22 : 19, id); |
625 | if (info->pna_phy) | 621 | if (info->pna_phy) |
626 | printk("PNA, "); | 622 | pr_cont("PNA, "); |
627 | } else { | 623 | } else { |
628 | printk(KERN_INFO "%s: NE2000 Compatible: ", dev->name); | 624 | netdev_info(dev, "NE2000 Compatible: "); |
629 | } | 625 | } |
630 | printk("io %#3lx, irq %d,", dev->base_addr, dev->irq); | 626 | pr_cont("io %#3lx, irq %d,", dev->base_addr, dev->irq); |
631 | if (info->flags & USE_SHMEM) | 627 | if (info->flags & USE_SHMEM) |
632 | printk (" mem %#5lx,", dev->mem_start); | 628 | pr_cont(" mem %#5lx,", dev->mem_start); |
633 | if (info->flags & HAS_MISC_REG) | 629 | if (info->flags & HAS_MISC_REG) |
634 | printk(" %s xcvr,", if_names[dev->if_port]); | 630 | pr_cont(" %s xcvr,", if_names[dev->if_port]); |
635 | printk(" hw_addr %pM\n", dev->dev_addr); | 631 | pr_cont(" hw_addr %pM\n", dev->dev_addr); |
636 | return 0; | 632 | return 0; |
637 | 633 | ||
638 | failed: | 634 | failed: |
@@ -889,7 +885,7 @@ static void mii_phy_probe(struct net_device *dev) | |||
889 | phyid = tmp << 16; | 885 | phyid = tmp << 16; |
890 | phyid |= mdio_read(mii_addr, i, MII_PHYID_REG2); | 886 | phyid |= mdio_read(mii_addr, i, MII_PHYID_REG2); |
891 | phyid &= MII_PHYID_REV_MASK; | 887 | phyid &= MII_PHYID_REV_MASK; |
892 | pr_debug("%s: MII at %d is 0x%08x\n", dev->name, i, phyid); | 888 | netdev_dbg(dev, "MII at %d is 0x%08x\n", i, phyid); |
893 | if (phyid == AM79C9XX_HOME_PHY) { | 889 | if (phyid == AM79C9XX_HOME_PHY) { |
894 | info->pna_phy = i; | 890 | info->pna_phy = i; |
895 | } else if (phyid != AM79C9XX_ETH_PHY) { | 891 | } else if (phyid != AM79C9XX_ETH_PHY) { |
@@ -922,7 +918,7 @@ static int pcnet_open(struct net_device *dev) | |||
922 | info->phy_id = info->eth_phy; | 918 | info->phy_id = info->eth_phy; |
923 | info->link_status = 0x00; | 919 | info->link_status = 0x00; |
924 | init_timer(&info->watchdog); | 920 | init_timer(&info->watchdog); |
925 | info->watchdog.function = &ei_watchdog; | 921 | info->watchdog.function = ei_watchdog; |
926 | info->watchdog.data = (u_long)dev; | 922 | info->watchdog.data = (u_long)dev; |
927 | info->watchdog.expires = jiffies + HZ; | 923 | info->watchdog.expires = jiffies + HZ; |
928 | add_timer(&info->watchdog); | 924 | add_timer(&info->watchdog); |
@@ -975,8 +971,8 @@ static void pcnet_reset_8390(struct net_device *dev) | |||
975 | outb_p(ENISR_RESET, nic_base + EN0_ISR); /* Ack intr. */ | 971 | outb_p(ENISR_RESET, nic_base + EN0_ISR); /* Ack intr. */ |
976 | 972 | ||
977 | if (i == 100) | 973 | if (i == 100) |
978 | printk(KERN_ERR "%s: pcnet_reset_8390() did not complete.\n", | 974 | netdev_err(dev, "pcnet_reset_8390() did not complete.\n"); |
979 | dev->name); | 975 | |
980 | set_misc_reg(dev); | 976 | set_misc_reg(dev); |
981 | 977 | ||
982 | } /* pcnet_reset_8390 */ | 978 | } /* pcnet_reset_8390 */ |
@@ -992,8 +988,7 @@ static int set_config(struct net_device *dev, struct ifmap *map) | |||
992 | else if ((map->port < 1) || (map->port > 2)) | 988 | else if ((map->port < 1) || (map->port > 2)) |
993 | return -EINVAL; | 989 | return -EINVAL; |
994 | dev->if_port = map->port; | 990 | dev->if_port = map->port; |
995 | printk(KERN_INFO "%s: switched to %s port\n", | 991 | netdev_info(dev, "switched to %s port\n", if_names[dev->if_port]); |
996 | dev->name, if_names[dev->if_port]); | ||
997 | NS8390_init(dev, 1); | 992 | NS8390_init(dev, 1); |
998 | } | 993 | } |
999 | return 0; | 994 | return 0; |
@@ -1028,7 +1023,7 @@ static void ei_watchdog(u_long arg) | |||
1028 | this, we can limp along even if the interrupt is blocked */ | 1023 | this, we can limp along even if the interrupt is blocked */ |
1029 | if (info->stale++ && (inb_p(nic_base + EN0_ISR) & ENISR_ALL)) { | 1024 | if (info->stale++ && (inb_p(nic_base + EN0_ISR) & ENISR_ALL)) { |
1030 | if (!info->fast_poll) | 1025 | if (!info->fast_poll) |
1031 | printk(KERN_INFO "%s: interrupt(s) dropped!\n", dev->name); | 1026 | netdev_info(dev, "interrupt(s) dropped!\n"); |
1032 | ei_irq_wrapper(dev->irq, dev); | 1027 | ei_irq_wrapper(dev->irq, dev); |
1033 | info->fast_poll = HZ; | 1028 | info->fast_poll = HZ; |
1034 | } | 1029 | } |
@@ -1048,7 +1043,7 @@ static void ei_watchdog(u_long arg) | |||
1048 | if (info->eth_phy) { | 1043 | if (info->eth_phy) { |
1049 | info->phy_id = info->eth_phy = 0; | 1044 | info->phy_id = info->eth_phy = 0; |
1050 | } else { | 1045 | } else { |
1051 | printk(KERN_INFO "%s: MII is missing!\n", dev->name); | 1046 | netdev_info(dev, "MII is missing!\n"); |
1052 | info->flags &= ~HAS_MII; | 1047 | info->flags &= ~HAS_MII; |
1053 | } | 1048 | } |
1054 | goto reschedule; | 1049 | goto reschedule; |
@@ -1057,8 +1052,7 @@ static void ei_watchdog(u_long arg) | |||
1057 | link &= 0x0004; | 1052 | link &= 0x0004; |
1058 | if (link != info->link_status) { | 1053 | if (link != info->link_status) { |
1059 | u_short p = mdio_read(mii_addr, info->phy_id, 5); | 1054 | u_short p = mdio_read(mii_addr, info->phy_id, 5); |
1060 | printk(KERN_INFO "%s: %s link beat\n", dev->name, | 1055 | netdev_info(dev, "%s link beat\n", link ? "found" : "lost"); |
1061 | (link) ? "found" : "lost"); | ||
1062 | if (link && (info->flags & IS_DL10022)) { | 1056 | if (link && (info->flags & IS_DL10022)) { |
1063 | /* Disable collision detection on full duplex links */ | 1057 | /* Disable collision detection on full duplex links */ |
1064 | outb((p & 0x0140) ? 4 : 0, nic_base + DLINK_DIAG); | 1058 | outb((p & 0x0140) ? 4 : 0, nic_base + DLINK_DIAG); |
@@ -1069,13 +1063,12 @@ static void ei_watchdog(u_long arg) | |||
1069 | if (link) { | 1063 | if (link) { |
1070 | if (info->phy_id == info->eth_phy) { | 1064 | if (info->phy_id == info->eth_phy) { |
1071 | if (p) | 1065 | if (p) |
1072 | printk(KERN_INFO "%s: autonegotiation complete: " | 1066 | netdev_info(dev, "autonegotiation complete: " |
1073 | "%sbaseT-%cD selected\n", dev->name, | 1067 | "%sbaseT-%cD selected\n", |
1074 | ((p & 0x0180) ? "100" : "10"), | 1068 | ((p & 0x0180) ? "100" : "10"), |
1075 | ((p & 0x0140) ? 'F' : 'H')); | 1069 | ((p & 0x0140) ? 'F' : 'H')); |
1076 | else | 1070 | else |
1077 | printk(KERN_INFO "%s: link partner did not " | 1071 | netdev_info(dev, "link partner did not autonegotiate\n"); |
1078 | "autonegotiate\n", dev->name); | ||
1079 | } | 1072 | } |
1080 | NS8390_init(dev, 1); | 1073 | NS8390_init(dev, 1); |
1081 | } | 1074 | } |
@@ -1088,7 +1081,7 @@ static void ei_watchdog(u_long arg) | |||
1088 | /* isolate this MII and try flipping to the other one */ | 1081 | /* isolate this MII and try flipping to the other one */ |
1089 | mdio_write(mii_addr, info->phy_id, 0, 0x0400); | 1082 | mdio_write(mii_addr, info->phy_id, 0, 0x0400); |
1090 | info->phy_id ^= info->pna_phy ^ info->eth_phy; | 1083 | info->phy_id ^= info->pna_phy ^ info->eth_phy; |
1091 | printk(KERN_INFO "%s: switched to %s transceiver\n", dev->name, | 1084 | netdev_info(dev, "switched to %s transceiver\n", |
1092 | (info->phy_id == info->eth_phy) ? "ethernet" : "PNA"); | 1085 | (info->phy_id == info->eth_phy) ? "ethernet" : "PNA"); |
1093 | mdio_write(mii_addr, info->phy_id, 0, | 1086 | mdio_write(mii_addr, info->phy_id, 0, |
1094 | (info->phy_id == info->eth_phy) ? 0x1000 : 0); | 1087 | (info->phy_id == info->eth_phy) ? 0x1000 : 0); |
@@ -1104,18 +1097,6 @@ reschedule: | |||
1104 | 1097 | ||
1105 | /*====================================================================*/ | 1098 | /*====================================================================*/ |
1106 | 1099 | ||
1107 | static void netdev_get_drvinfo(struct net_device *dev, | ||
1108 | struct ethtool_drvinfo *info) | ||
1109 | { | ||
1110 | strcpy(info->driver, "pcnet_cs"); | ||
1111 | } | ||
1112 | |||
1113 | static const struct ethtool_ops netdev_ethtool_ops = { | ||
1114 | .get_drvinfo = netdev_get_drvinfo, | ||
1115 | }; | ||
1116 | |||
1117 | /*====================================================================*/ | ||
1118 | |||
1119 | 1100 | ||
1120 | static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | 1101 | static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) |
1121 | { | 1102 | { |
@@ -1148,9 +1129,9 @@ static void dma_get_8390_hdr(struct net_device *dev, | |||
1148 | unsigned int nic_base = dev->base_addr; | 1129 | unsigned int nic_base = dev->base_addr; |
1149 | 1130 | ||
1150 | if (ei_status.dmaing) { | 1131 | if (ei_status.dmaing) { |
1151 | printk(KERN_NOTICE "%s: DMAing conflict in dma_block_input." | 1132 | netdev_notice(dev, "DMAing conflict in dma_block_input." |
1152 | "[DMAstat:%1x][irqlock:%1x]\n", | 1133 | "[DMAstat:%1x][irqlock:%1x]\n", |
1153 | dev->name, ei_status.dmaing, ei_status.irqlock); | 1134 | ei_status.dmaing, ei_status.irqlock); |
1154 | return; | 1135 | return; |
1155 | } | 1136 | } |
1156 | 1137 | ||
@@ -1181,11 +1162,11 @@ static void dma_block_input(struct net_device *dev, int count, | |||
1181 | char *buf = skb->data; | 1162 | char *buf = skb->data; |
1182 | 1163 | ||
1183 | if ((ei_debug > 4) && (count != 4)) | 1164 | if ((ei_debug > 4) && (count != 4)) |
1184 | pr_debug("%s: [bi=%d]\n", dev->name, count+4); | 1165 | netdev_dbg(dev, "[bi=%d]\n", count+4); |
1185 | if (ei_status.dmaing) { | 1166 | if (ei_status.dmaing) { |
1186 | printk(KERN_NOTICE "%s: DMAing conflict in dma_block_input." | 1167 | netdev_notice(dev, "DMAing conflict in dma_block_input." |
1187 | "[DMAstat:%1x][irqlock:%1x]\n", | 1168 | "[DMAstat:%1x][irqlock:%1x]\n", |
1188 | dev->name, ei_status.dmaing, ei_status.irqlock); | 1169 | ei_status.dmaing, ei_status.irqlock); |
1189 | return; | 1170 | return; |
1190 | } | 1171 | } |
1191 | ei_status.dmaing |= 0x01; | 1172 | ei_status.dmaing |= 0x01; |
@@ -1215,9 +1196,9 @@ static void dma_block_input(struct net_device *dev, int count, | |||
1215 | break; | 1196 | break; |
1216 | } while (--tries > 0); | 1197 | } while (--tries > 0); |
1217 | if (tries <= 0) | 1198 | if (tries <= 0) |
1218 | printk(KERN_NOTICE "%s: RX transfer address mismatch," | 1199 | netdev_notice(dev, "RX transfer address mismatch," |
1219 | "%#4.4x (expected) vs. %#4.4x (actual).\n", | 1200 | "%#4.4x (expected) vs. %#4.4x (actual).\n", |
1220 | dev->name, ring_offset + xfer_count, addr); | 1201 | ring_offset + xfer_count, addr); |
1221 | } | 1202 | } |
1222 | #endif | 1203 | #endif |
1223 | outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */ | 1204 | outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */ |
@@ -1238,7 +1219,7 @@ static void dma_block_output(struct net_device *dev, int count, | |||
1238 | 1219 | ||
1239 | #ifdef PCMCIA_DEBUG | 1220 | #ifdef PCMCIA_DEBUG |
1240 | if (ei_debug > 4) | 1221 | if (ei_debug > 4) |
1241 | printk(KERN_DEBUG "%s: [bo=%d]\n", dev->name, count); | 1222 | netdev_dbg(dev, "[bo=%d]\n", count); |
1242 | #endif | 1223 | #endif |
1243 | 1224 | ||
1244 | /* Round the count up for word writes. Do we need to do this? | 1225 | /* Round the count up for word writes. Do we need to do this? |
@@ -1247,9 +1228,9 @@ static void dma_block_output(struct net_device *dev, int count, | |||
1247 | if (count & 0x01) | 1228 | if (count & 0x01) |
1248 | count++; | 1229 | count++; |
1249 | if (ei_status.dmaing) { | 1230 | if (ei_status.dmaing) { |
1250 | printk(KERN_NOTICE "%s: DMAing conflict in dma_block_output." | 1231 | netdev_notice(dev, "DMAing conflict in dma_block_output." |
1251 | "[DMAstat:%1x][irqlock:%1x]\n", | 1232 | "[DMAstat:%1x][irqlock:%1x]\n", |
1252 | dev->name, ei_status.dmaing, ei_status.irqlock); | 1233 | ei_status.dmaing, ei_status.irqlock); |
1253 | return; | 1234 | return; |
1254 | } | 1235 | } |
1255 | ei_status.dmaing |= 0x01; | 1236 | ei_status.dmaing |= 0x01; |
@@ -1286,9 +1267,9 @@ static void dma_block_output(struct net_device *dev, int count, | |||
1286 | break; | 1267 | break; |
1287 | } while (--tries > 0); | 1268 | } while (--tries > 0); |
1288 | if (tries <= 0) { | 1269 | if (tries <= 0) { |
1289 | printk(KERN_NOTICE "%s: Tx packet transfer address mismatch," | 1270 | netdev_notice(dev, "Tx packet transfer address mismatch," |
1290 | "%#4.4x (expected) vs. %#4.4x (actual).\n", | 1271 | "%#4.4x (expected) vs. %#4.4x (actual).\n", |
1291 | dev->name, (start_page << 8) + count, addr); | 1272 | (start_page << 8) + count, addr); |
1292 | if (retries++ == 0) | 1273 | if (retries++ == 0) |
1293 | goto retry; | 1274 | goto retry; |
1294 | } | 1275 | } |
@@ -1297,8 +1278,7 @@ static void dma_block_output(struct net_device *dev, int count, | |||
1297 | 1278 | ||
1298 | while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0) | 1279 | while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0) |
1299 | if (time_after(jiffies, dma_start + PCNET_RDC_TIMEOUT)) { | 1280 | if (time_after(jiffies, dma_start + PCNET_RDC_TIMEOUT)) { |
1300 | printk(KERN_NOTICE "%s: timeout waiting for Tx RDC.\n", | 1281 | netdev_notice(dev, "timeout waiting for Tx RDC.\n"); |
1301 | dev->name); | ||
1302 | pcnet_reset_8390(dev); | 1282 | pcnet_reset_8390(dev); |
1303 | NS8390_init(dev, 1); | 1283 | NS8390_init(dev, 1); |
1304 | break; | 1284 | break; |
@@ -1322,9 +1302,9 @@ static int setup_dma_config(struct pcmcia_device *link, int start_pg, | |||
1322 | ei_status.stop_page = stop_pg; | 1302 | ei_status.stop_page = stop_pg; |
1323 | 1303 | ||
1324 | /* set up block i/o functions */ | 1304 | /* set up block i/o functions */ |
1325 | ei_status.get_8390_hdr = &dma_get_8390_hdr; | 1305 | ei_status.get_8390_hdr = dma_get_8390_hdr; |
1326 | ei_status.block_input = &dma_block_input; | 1306 | ei_status.block_input = dma_block_input; |
1327 | ei_status.block_output = &dma_block_output; | 1307 | ei_status.block_output = dma_block_output; |
1328 | 1308 | ||
1329 | return 0; | 1309 | return 0; |
1330 | } | 1310 | } |
@@ -1470,9 +1450,9 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg, | |||
1470 | (resource_size(link->resource[3]) - offset) >> 8); | 1450 | (resource_size(link->resource[3]) - offset) >> 8); |
1471 | 1451 | ||
1472 | /* set up block i/o functions */ | 1452 | /* set up block i/o functions */ |
1473 | ei_status.get_8390_hdr = &shmem_get_8390_hdr; | 1453 | ei_status.get_8390_hdr = shmem_get_8390_hdr; |
1474 | ei_status.block_input = &shmem_block_input; | 1454 | ei_status.block_input = shmem_block_input; |
1475 | ei_status.block_output = &shmem_block_output; | 1455 | ei_status.block_output = shmem_block_output; |
1476 | 1456 | ||
1477 | info->flags |= USE_SHMEM; | 1457 | info->flags |= USE_SHMEM; |
1478 | return 0; | 1458 | return 0; |
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index 0af2fc8ec164..8a9ff5318923 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -25,6 +25,8 @@ | |||
25 | 25 | ||
26 | ======================================================================*/ | 26 | ======================================================================*/ |
27 | 27 | ||
28 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
29 | |||
28 | #include <linux/module.h> | 30 | #include <linux/module.h> |
29 | #include <linux/kernel.h> | 31 | #include <linux/kernel.h> |
30 | #include <linux/init.h> | 32 | #include <linux/init.h> |
@@ -293,7 +295,7 @@ static const struct net_device_ops smc_netdev_ops = { | |||
293 | .ndo_tx_timeout = smc_tx_timeout, | 295 | .ndo_tx_timeout = smc_tx_timeout, |
294 | .ndo_set_config = s9k_config, | 296 | .ndo_set_config = s9k_config, |
295 | .ndo_set_multicast_list = set_rx_mode, | 297 | .ndo_set_multicast_list = set_rx_mode, |
296 | .ndo_do_ioctl = &smc_ioctl, | 298 | .ndo_do_ioctl = smc_ioctl, |
297 | .ndo_change_mtu = eth_change_mtu, | 299 | .ndo_change_mtu = eth_change_mtu, |
298 | .ndo_set_mac_address = eth_mac_addr, | 300 | .ndo_set_mac_address = eth_mac_addr, |
299 | .ndo_validate_addr = eth_validate_addr, | 301 | .ndo_validate_addr = eth_validate_addr, |
@@ -788,11 +790,11 @@ static int check_sig(struct pcmcia_device *link) | |||
788 | ((s >> 8) != (s & 0xff))) { | 790 | ((s >> 8) != (s & 0xff))) { |
789 | SMC_SELECT_BANK(3); | 791 | SMC_SELECT_BANK(3); |
790 | s = inw(ioaddr + REVISION); | 792 | s = inw(ioaddr + REVISION); |
791 | return (s & 0xff); | 793 | return s & 0xff; |
792 | } | 794 | } |
793 | 795 | ||
794 | if (width) { | 796 | if (width) { |
795 | printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n"); | 797 | pr_info("using 8-bit IO window\n"); |
796 | 798 | ||
797 | smc91c92_suspend(link); | 799 | smc91c92_suspend(link); |
798 | pcmcia_fixup_iowidth(link); | 800 | pcmcia_fixup_iowidth(link); |
@@ -845,7 +847,7 @@ static int smc91c92_config(struct pcmcia_device *link) | |||
845 | if ((if_port >= 0) && (if_port <= 2)) | 847 | if ((if_port >= 0) && (if_port <= 2)) |
846 | dev->if_port = if_port; | 848 | dev->if_port = if_port; |
847 | else | 849 | else |
848 | printk(KERN_NOTICE "smc91c92_cs: invalid if_port requested\n"); | 850 | dev_notice(&link->dev, "invalid if_port requested\n"); |
849 | 851 | ||
850 | switch (smc->manfid) { | 852 | switch (smc->manfid) { |
851 | case MANFID_OSITECH: | 853 | case MANFID_OSITECH: |
@@ -863,7 +865,7 @@ static int smc91c92_config(struct pcmcia_device *link) | |||
863 | } | 865 | } |
864 | 866 | ||
865 | if (i != 0) { | 867 | if (i != 0) { |
866 | printk(KERN_NOTICE "smc91c92_cs: Unable to find hardware address.\n"); | 868 | dev_notice(&link->dev, "Unable to find hardware address.\n"); |
867 | goto config_failed; | 869 | goto config_failed; |
868 | } | 870 | } |
869 | 871 | ||
@@ -916,30 +918,28 @@ static int smc91c92_config(struct pcmcia_device *link) | |||
916 | SET_NETDEV_DEV(dev, &link->dev); | 918 | SET_NETDEV_DEV(dev, &link->dev); |
917 | 919 | ||
918 | if (register_netdev(dev) != 0) { | 920 | if (register_netdev(dev) != 0) { |
919 | printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n"); | 921 | dev_err(&link->dev, "register_netdev() failed\n"); |
920 | goto config_undo; | 922 | goto config_undo; |
921 | } | 923 | } |
922 | 924 | ||
923 | printk(KERN_INFO "%s: smc91c%s rev %d: io %#3lx, irq %d, " | 925 | netdev_info(dev, "smc91c%s rev %d: io %#3lx, irq %d, hw_addr %pM\n", |
924 | "hw_addr %pM\n", | 926 | name, (rev & 0x0f), dev->base_addr, dev->irq, dev->dev_addr); |
925 | dev->name, name, (rev & 0x0f), dev->base_addr, dev->irq, | ||
926 | dev->dev_addr); | ||
927 | 927 | ||
928 | if (rev > 0) { | 928 | if (rev > 0) { |
929 | if (mir & 0x3ff) | 929 | if (mir & 0x3ff) |
930 | printk(KERN_INFO " %lu byte", mir); | 930 | netdev_info(dev, " %lu byte", mir); |
931 | else | 931 | else |
932 | printk(KERN_INFO " %lu kb", mir>>10); | 932 | netdev_info(dev, " %lu kb", mir>>10); |
933 | printk(" buffer, %s xcvr\n", (smc->cfg & CFG_MII_SELECT) ? | 933 | pr_cont(" buffer, %s xcvr\n", |
934 | "MII" : if_names[dev->if_port]); | 934 | (smc->cfg & CFG_MII_SELECT) ? "MII" : if_names[dev->if_port]); |
935 | } | 935 | } |
936 | 936 | ||
937 | if (smc->cfg & CFG_MII_SELECT) { | 937 | if (smc->cfg & CFG_MII_SELECT) { |
938 | if (smc->mii_if.phy_id != -1) { | 938 | if (smc->mii_if.phy_id != -1) { |
939 | dev_dbg(&link->dev, " MII transceiver at index %d, status %x.\n", | 939 | netdev_dbg(dev, " MII transceiver at index %d, status %x\n", |
940 | smc->mii_if.phy_id, j); | 940 | smc->mii_if.phy_id, j); |
941 | } else { | 941 | } else { |
942 | printk(KERN_NOTICE " No MII transceivers found!\n"); | 942 | netdev_notice(dev, " No MII transceivers found!\n"); |
943 | } | 943 | } |
944 | } | 944 | } |
945 | return 0; | 945 | return 0; |
@@ -1037,10 +1037,10 @@ static void smc_dump(struct net_device *dev) | |||
1037 | save = inw(ioaddr + BANK_SELECT); | 1037 | save = inw(ioaddr + BANK_SELECT); |
1038 | for (w = 0; w < 4; w++) { | 1038 | for (w = 0; w < 4; w++) { |
1039 | SMC_SELECT_BANK(w); | 1039 | SMC_SELECT_BANK(w); |
1040 | printk(KERN_DEBUG "bank %d: ", w); | 1040 | netdev_printk(KERN_DEBUG, dev, "bank %d: ", w); |
1041 | for (i = 0; i < 14; i += 2) | 1041 | for (i = 0; i < 14; i += 2) |
1042 | printk(" %04x", inw(ioaddr + i)); | 1042 | pr_cont(" %04x", inw(ioaddr + i)); |
1043 | printk("\n"); | 1043 | pr_cont("\n"); |
1044 | } | 1044 | } |
1045 | outw(save, ioaddr + BANK_SELECT); | 1045 | outw(save, ioaddr + BANK_SELECT); |
1046 | } | 1046 | } |
@@ -1062,7 +1062,7 @@ static int smc_open(struct net_device *dev) | |||
1062 | return -ENODEV; | 1062 | return -ENODEV; |
1063 | /* Physical device present signature. */ | 1063 | /* Physical device present signature. */ |
1064 | if (check_sig(link) < 0) { | 1064 | if (check_sig(link) < 0) { |
1065 | printk("smc91c92_cs: Yikes! Bad chip signature!\n"); | 1065 | netdev_info(dev, "Yikes! Bad chip signature!\n"); |
1066 | return -ENODEV; | 1066 | return -ENODEV; |
1067 | } | 1067 | } |
1068 | link->open++; | 1068 | link->open++; |
@@ -1073,7 +1073,7 @@ static int smc_open(struct net_device *dev) | |||
1073 | 1073 | ||
1074 | smc_reset(dev); | 1074 | smc_reset(dev); |
1075 | init_timer(&smc->media); | 1075 | init_timer(&smc->media); |
1076 | smc->media.function = &media_check; | 1076 | smc->media.function = media_check; |
1077 | smc->media.data = (u_long) dev; | 1077 | smc->media.data = (u_long) dev; |
1078 | smc->media.expires = jiffies + HZ; | 1078 | smc->media.expires = jiffies + HZ; |
1079 | add_timer(&smc->media); | 1079 | add_timer(&smc->media); |
@@ -1128,7 +1128,7 @@ static void smc_hardware_send_packet(struct net_device * dev) | |||
1128 | u_char packet_no; | 1128 | u_char packet_no; |
1129 | 1129 | ||
1130 | if (!skb) { | 1130 | if (!skb) { |
1131 | printk(KERN_ERR "%s: In XMIT with no packet to send.\n", dev->name); | 1131 | netdev_err(dev, "In XMIT with no packet to send\n"); |
1132 | return; | 1132 | return; |
1133 | } | 1133 | } |
1134 | 1134 | ||
@@ -1136,8 +1136,8 @@ static void smc_hardware_send_packet(struct net_device * dev) | |||
1136 | packet_no = inw(ioaddr + PNR_ARR) >> 8; | 1136 | packet_no = inw(ioaddr + PNR_ARR) >> 8; |
1137 | if (packet_no & 0x80) { | 1137 | if (packet_no & 0x80) { |
1138 | /* If not, there is a hardware problem! Likely an ejected card. */ | 1138 | /* If not, there is a hardware problem! Likely an ejected card. */ |
1139 | printk(KERN_WARNING "%s: 91c92 hardware Tx buffer allocation" | 1139 | netdev_warn(dev, "hardware Tx buffer allocation failed, status %#2.2x\n", |
1140 | " failed, status %#2.2x.\n", dev->name, packet_no); | 1140 | packet_no); |
1141 | dev_kfree_skb_irq(skb); | 1141 | dev_kfree_skb_irq(skb); |
1142 | smc->saved_skb = NULL; | 1142 | smc->saved_skb = NULL; |
1143 | netif_start_queue(dev); | 1143 | netif_start_queue(dev); |
@@ -1156,8 +1156,7 @@ static void smc_hardware_send_packet(struct net_device * dev) | |||
1156 | u_char *buf = skb->data; | 1156 | u_char *buf = skb->data; |
1157 | u_int length = skb->len; /* The chip will pad to ethernet min. */ | 1157 | u_int length = skb->len; /* The chip will pad to ethernet min. */ |
1158 | 1158 | ||
1159 | pr_debug("%s: Trying to xmit packet of length %d.\n", | 1159 | netdev_dbg(dev, "Trying to xmit packet of length %d\n", length); |
1160 | dev->name, length); | ||
1161 | 1160 | ||
1162 | /* send the packet length: +6 for status word, length, and ctl */ | 1161 | /* send the packet length: +6 for status word, length, and ctl */ |
1163 | outw(0, ioaddr + DATA_1); | 1162 | outw(0, ioaddr + DATA_1); |
@@ -1189,9 +1188,8 @@ static void smc_tx_timeout(struct net_device *dev) | |||
1189 | struct smc_private *smc = netdev_priv(dev); | 1188 | struct smc_private *smc = netdev_priv(dev); |
1190 | unsigned int ioaddr = dev->base_addr; | 1189 | unsigned int ioaddr = dev->base_addr; |
1191 | 1190 | ||
1192 | printk(KERN_NOTICE "%s: SMC91c92 transmit timed out, " | 1191 | netdev_notice(dev, "transmit timed out, Tx_status %2.2x status %4.4x.\n", |
1193 | "Tx_status %2.2x status %4.4x.\n", | 1192 | inw(ioaddr)&0xff, inw(ioaddr + 2)); |
1194 | dev->name, inw(ioaddr)&0xff, inw(ioaddr + 2)); | ||
1195 | dev->stats.tx_errors++; | 1193 | dev->stats.tx_errors++; |
1196 | smc_reset(dev); | 1194 | smc_reset(dev); |
1197 | dev->trans_start = jiffies; /* prevent tx timeout */ | 1195 | dev->trans_start = jiffies; /* prevent tx timeout */ |
@@ -1210,14 +1208,14 @@ static netdev_tx_t smc_start_xmit(struct sk_buff *skb, | |||
1210 | 1208 | ||
1211 | netif_stop_queue(dev); | 1209 | netif_stop_queue(dev); |
1212 | 1210 | ||
1213 | pr_debug("%s: smc_start_xmit(length = %d) called," | 1211 | netdev_dbg(dev, "smc_start_xmit(length = %d) called, status %04x\n", |
1214 | " status %4.4x.\n", dev->name, skb->len, inw(ioaddr + 2)); | 1212 | skb->len, inw(ioaddr + 2)); |
1215 | 1213 | ||
1216 | if (smc->saved_skb) { | 1214 | if (smc->saved_skb) { |
1217 | /* THIS SHOULD NEVER HAPPEN. */ | 1215 | /* THIS SHOULD NEVER HAPPEN. */ |
1218 | dev->stats.tx_aborted_errors++; | 1216 | dev->stats.tx_aborted_errors++; |
1219 | printk(KERN_DEBUG "%s: Internal error -- sent packet while busy.\n", | 1217 | netdev_printk(KERN_DEBUG, dev, |
1220 | dev->name); | 1218 | "Internal error -- sent packet while busy\n"); |
1221 | return NETDEV_TX_BUSY; | 1219 | return NETDEV_TX_BUSY; |
1222 | } | 1220 | } |
1223 | smc->saved_skb = skb; | 1221 | smc->saved_skb = skb; |
@@ -1225,7 +1223,7 @@ static netdev_tx_t smc_start_xmit(struct sk_buff *skb, | |||
1225 | num_pages = skb->len >> 8; | 1223 | num_pages = skb->len >> 8; |
1226 | 1224 | ||
1227 | if (num_pages > 7) { | 1225 | if (num_pages > 7) { |
1228 | printk(KERN_ERR "%s: Far too big packet error.\n", dev->name); | 1226 | netdev_err(dev, "Far too big packet error: %d pages\n", num_pages); |
1229 | dev_kfree_skb (skb); | 1227 | dev_kfree_skb (skb); |
1230 | smc->saved_skb = NULL; | 1228 | smc->saved_skb = NULL; |
1231 | dev->stats.tx_dropped++; | 1229 | dev->stats.tx_dropped++; |
@@ -1295,8 +1293,7 @@ static void smc_tx_err(struct net_device * dev) | |||
1295 | } | 1293 | } |
1296 | 1294 | ||
1297 | if (tx_status & TS_SUCCESS) { | 1295 | if (tx_status & TS_SUCCESS) { |
1298 | printk(KERN_NOTICE "%s: Successful packet caused error " | 1296 | netdev_notice(dev, "Successful packet caused error interrupt?\n"); |
1299 | "interrupt?\n", dev->name); | ||
1300 | } | 1297 | } |
1301 | /* re-enable transmit */ | 1298 | /* re-enable transmit */ |
1302 | SMC_SELECT_BANK(0); | 1299 | SMC_SELECT_BANK(0); |
@@ -1486,8 +1483,7 @@ static void smc_rx(struct net_device *dev) | |||
1486 | /* Assertion: we are in Window 2. */ | 1483 | /* Assertion: we are in Window 2. */ |
1487 | 1484 | ||
1488 | if (inw(ioaddr + FIFO_PORTS) & FP_RXEMPTY) { | 1485 | if (inw(ioaddr + FIFO_PORTS) & FP_RXEMPTY) { |
1489 | printk(KERN_ERR "%s: smc_rx() with nothing on Rx FIFO.\n", | 1486 | netdev_err(dev, "smc_rx() with nothing on Rx FIFO\n"); |
1490 | dev->name); | ||
1491 | return; | 1487 | return; |
1492 | } | 1488 | } |
1493 | 1489 | ||
@@ -1602,8 +1598,7 @@ static int s9k_config(struct net_device *dev, struct ifmap *map) | |||
1602 | else if (map->port > 2) | 1598 | else if (map->port > 2) |
1603 | return -EINVAL; | 1599 | return -EINVAL; |
1604 | dev->if_port = map->port; | 1600 | dev->if_port = map->port; |
1605 | printk(KERN_INFO "%s: switched to %s port\n", | 1601 | netdev_info(dev, "switched to %s port\n", if_names[dev->if_port]); |
1606 | dev->name, if_names[dev->if_port]); | ||
1607 | smc_reset(dev); | 1602 | smc_reset(dev); |
1608 | } | 1603 | } |
1609 | return 0; | 1604 | return 0; |
@@ -1754,7 +1749,7 @@ static void media_check(u_long arg) | |||
1754 | this, we can limp along even if the interrupt is blocked */ | 1749 | this, we can limp along even if the interrupt is blocked */ |
1755 | if (smc->watchdog++ && ((i>>8) & i)) { | 1750 | if (smc->watchdog++ && ((i>>8) & i)) { |
1756 | if (!smc->fast_poll) | 1751 | if (!smc->fast_poll) |
1757 | printk(KERN_INFO "%s: interrupt(s) dropped!\n", dev->name); | 1752 | netdev_info(dev, "interrupt(s) dropped!\n"); |
1758 | local_irq_save(flags); | 1753 | local_irq_save(flags); |
1759 | smc_interrupt(dev->irq, dev); | 1754 | smc_interrupt(dev->irq, dev); |
1760 | local_irq_restore(flags); | 1755 | local_irq_restore(flags); |
@@ -1778,7 +1773,7 @@ static void media_check(u_long arg) | |||
1778 | SMC_SELECT_BANK(3); | 1773 | SMC_SELECT_BANK(3); |
1779 | link = mdio_read(dev, smc->mii_if.phy_id, 1); | 1774 | link = mdio_read(dev, smc->mii_if.phy_id, 1); |
1780 | if (!link || (link == 0xffff)) { | 1775 | if (!link || (link == 0xffff)) { |
1781 | printk(KERN_INFO "%s: MII is missing!\n", dev->name); | 1776 | netdev_info(dev, "MII is missing!\n"); |
1782 | smc->mii_if.phy_id = -1; | 1777 | smc->mii_if.phy_id = -1; |
1783 | goto reschedule; | 1778 | goto reschedule; |
1784 | } | 1779 | } |
@@ -1786,15 +1781,13 @@ static void media_check(u_long arg) | |||
1786 | link &= 0x0004; | 1781 | link &= 0x0004; |
1787 | if (link != smc->link_status) { | 1782 | if (link != smc->link_status) { |
1788 | u_short p = mdio_read(dev, smc->mii_if.phy_id, 5); | 1783 | u_short p = mdio_read(dev, smc->mii_if.phy_id, 5); |
1789 | printk(KERN_INFO "%s: %s link beat\n", dev->name, | 1784 | netdev_info(dev, "%s link beat\n", link ? "found" : "lost"); |
1790 | (link) ? "found" : "lost"); | ||
1791 | smc->duplex = (((p & 0x0100) || ((p & 0x1c0) == 0x40)) | 1785 | smc->duplex = (((p & 0x0100) || ((p & 0x1c0) == 0x40)) |
1792 | ? TCR_FDUPLX : 0); | 1786 | ? TCR_FDUPLX : 0); |
1793 | if (link) { | 1787 | if (link) { |
1794 | printk(KERN_INFO "%s: autonegotiation complete: " | 1788 | netdev_info(dev, "autonegotiation complete: " |
1795 | "%sbaseT-%cD selected\n", dev->name, | 1789 | "%dbaseT-%cD selected\n", |
1796 | ((p & 0x0180) ? "100" : "10"), | 1790 | (p & 0x0180) ? 100 : 10, smc->duplex ? 'F' : 'H'); |
1797 | (smc->duplex ? 'F' : 'H')); | ||
1798 | } | 1791 | } |
1799 | SMC_SELECT_BANK(0); | 1792 | SMC_SELECT_BANK(0); |
1800 | outw(inw(ioaddr + TCR) | smc->duplex, ioaddr + TCR); | 1793 | outw(inw(ioaddr + TCR) | smc->duplex, ioaddr + TCR); |
@@ -1813,25 +1806,23 @@ static void media_check(u_long arg) | |||
1813 | if (media != smc->media_status) { | 1806 | if (media != smc->media_status) { |
1814 | if ((media & smc->media_status & 1) && | 1807 | if ((media & smc->media_status & 1) && |
1815 | ((smc->media_status ^ media) & EPH_LINK_OK)) | 1808 | ((smc->media_status ^ media) & EPH_LINK_OK)) |
1816 | printk(KERN_INFO "%s: %s link beat\n", dev->name, | 1809 | netdev_info(dev, "%s link beat\n", |
1817 | (smc->media_status & EPH_LINK_OK ? "lost" : "found")); | 1810 | smc->media_status & EPH_LINK_OK ? "lost" : "found"); |
1818 | else if ((media & smc->media_status & 2) && | 1811 | else if ((media & smc->media_status & 2) && |
1819 | ((smc->media_status ^ media) & EPH_16COL)) | 1812 | ((smc->media_status ^ media) & EPH_16COL)) |
1820 | printk(KERN_INFO "%s: coax cable %s\n", dev->name, | 1813 | netdev_info(dev, "coax cable %s\n", |
1821 | (media & EPH_16COL ? "problem" : "ok")); | 1814 | media & EPH_16COL ? "problem" : "ok"); |
1822 | if (dev->if_port == 0) { | 1815 | if (dev->if_port == 0) { |
1823 | if (media & 1) { | 1816 | if (media & 1) { |
1824 | if (media & EPH_LINK_OK) | 1817 | if (media & EPH_LINK_OK) |
1825 | printk(KERN_INFO "%s: flipped to 10baseT\n", | 1818 | netdev_info(dev, "flipped to 10baseT\n"); |
1826 | dev->name); | ||
1827 | else | 1819 | else |
1828 | smc_set_xcvr(dev, 2); | 1820 | smc_set_xcvr(dev, 2); |
1829 | } else { | 1821 | } else { |
1830 | if (media & EPH_16COL) | 1822 | if (media & EPH_16COL) |
1831 | smc_set_xcvr(dev, 1); | 1823 | smc_set_xcvr(dev, 1); |
1832 | else | 1824 | else |
1833 | printk(KERN_INFO "%s: flipped to 10base2\n", | 1825 | netdev_info(dev, "flipped to 10base2\n"); |
1834 | dev->name); | ||
1835 | } | 1826 | } |
1836 | } | 1827 | } |
1837 | smc->media_status = media; | 1828 | smc->media_status = media; |
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index 1fece617c069..a46b7fd6c0f5 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
@@ -63,6 +63,8 @@ | |||
63 | * OF THE POSSIBILITY OF SUCH DAMAGE. | 63 | * OF THE POSSIBILITY OF SUCH DAMAGE. |
64 | */ | 64 | */ |
65 | 65 | ||
66 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
67 | |||
66 | #include <linux/module.h> | 68 | #include <linux/module.h> |
67 | #include <linux/kernel.h> | 69 | #include <linux/kernel.h> |
68 | #include <linux/init.h> | 70 | #include <linux/init.h> |
@@ -209,13 +211,6 @@ enum xirc_cmd { /* Commands */ | |||
209 | 211 | ||
210 | static const char *if_names[] = { "Auto", "10BaseT", "10Base2", "AUI", "100BaseT" }; | 212 | static const char *if_names[] = { "Auto", "10BaseT", "10Base2", "AUI", "100BaseT" }; |
211 | 213 | ||
212 | |||
213 | #define KDBG_XIRC KERN_DEBUG "xirc2ps_cs: " | ||
214 | #define KERR_XIRC KERN_ERR "xirc2ps_cs: " | ||
215 | #define KWRN_XIRC KERN_WARNING "xirc2ps_cs: " | ||
216 | #define KNOT_XIRC KERN_NOTICE "xirc2ps_cs: " | ||
217 | #define KINF_XIRC KERN_INFO "xirc2ps_cs: " | ||
218 | |||
219 | /* card types */ | 214 | /* card types */ |
220 | #define XIR_UNKNOWN 0 /* unknown: not supported */ | 215 | #define XIR_UNKNOWN 0 /* unknown: not supported */ |
221 | #define XIR_CE 1 /* (prodid 1) different hardware: not supported */ | 216 | #define XIR_CE 1 /* (prodid 1) different hardware: not supported */ |
@@ -327,26 +322,26 @@ PrintRegisters(struct net_device *dev) | |||
327 | if (pc_debug > 1) { | 322 | if (pc_debug > 1) { |
328 | int i, page; | 323 | int i, page; |
329 | 324 | ||
330 | printk(KDBG_XIRC "Register common: "); | 325 | printk(KERN_DEBUG pr_fmt("Register common: ")); |
331 | for (i = 0; i < 8; i++) | 326 | for (i = 0; i < 8; i++) |
332 | printk(" %2.2x", GetByte(i)); | 327 | pr_cont(" %2.2x", GetByte(i)); |
333 | printk("\n"); | 328 | pr_cont("\n"); |
334 | for (page = 0; page <= 8; page++) { | 329 | for (page = 0; page <= 8; page++) { |
335 | printk(KDBG_XIRC "Register page %2x: ", page); | 330 | printk(KERN_DEBUG pr_fmt("Register page %2x: "), page); |
336 | SelectPage(page); | 331 | SelectPage(page); |
337 | for (i = 8; i < 16; i++) | 332 | for (i = 8; i < 16; i++) |
338 | printk(" %2.2x", GetByte(i)); | 333 | pr_cont(" %2.2x", GetByte(i)); |
339 | printk("\n"); | 334 | pr_cont("\n"); |
340 | } | 335 | } |
341 | for (page=0x40 ; page <= 0x5f; page++) { | 336 | for (page=0x40 ; page <= 0x5f; page++) { |
342 | if (page == 0x43 || (page >= 0x46 && page <= 0x4f) || | 337 | if (page == 0x43 || (page >= 0x46 && page <= 0x4f) || |
343 | (page >= 0x51 && page <=0x5e)) | 338 | (page >= 0x51 && page <=0x5e)) |
344 | continue; | 339 | continue; |
345 | printk(KDBG_XIRC "Register page %2x: ", page); | 340 | printk(KERN_DEBUG pr_fmt("Register page %2x: "), page); |
346 | SelectPage(page); | 341 | SelectPage(page); |
347 | for (i = 8; i < 16; i++) | 342 | for (i = 8; i < 16; i++) |
348 | printk(" %2.2x", GetByte(i)); | 343 | pr_cont(" %2.2x", GetByte(i)); |
349 | printk("\n"); | 344 | pr_cont("\n"); |
350 | } | 345 | } |
351 | } | 346 | } |
352 | } | 347 | } |
@@ -566,11 +561,11 @@ set_card_type(struct pcmcia_device *link) | |||
566 | local->modem = 0; | 561 | local->modem = 0; |
567 | local->card_type = XIR_UNKNOWN; | 562 | local->card_type = XIR_UNKNOWN; |
568 | if (!(prodid & 0x40)) { | 563 | if (!(prodid & 0x40)) { |
569 | printk(KNOT_XIRC "Ooops: Not a creditcard\n"); | 564 | pr_notice("Oops: Not a creditcard\n"); |
570 | return 0; | 565 | return 0; |
571 | } | 566 | } |
572 | if (!(mediaid & 0x01)) { | 567 | if (!(mediaid & 0x01)) { |
573 | printk(KNOT_XIRC "Not an Ethernet card\n"); | 568 | pr_notice("Not an Ethernet card\n"); |
574 | return 0; | 569 | return 0; |
575 | } | 570 | } |
576 | if (mediaid & 0x10) { | 571 | if (mediaid & 0x10) { |
@@ -601,12 +596,11 @@ set_card_type(struct pcmcia_device *link) | |||
601 | } | 596 | } |
602 | } | 597 | } |
603 | if (local->card_type == XIR_CE || local->card_type == XIR_CEM) { | 598 | if (local->card_type == XIR_CE || local->card_type == XIR_CEM) { |
604 | printk(KNOT_XIRC "Sorry, this is an old CE card\n"); | 599 | pr_notice("Sorry, this is an old CE card\n"); |
605 | return 0; | 600 | return 0; |
606 | } | 601 | } |
607 | if (local->card_type == XIR_UNKNOWN) | 602 | if (local->card_type == XIR_UNKNOWN) |
608 | printk(KNOT_XIRC "unknown card (mediaid=%02x prodid=%02x)\n", | 603 | pr_notice("unknown card (mediaid=%02x prodid=%02x)\n", mediaid, prodid); |
609 | mediaid, prodid); | ||
610 | 604 | ||
611 | return 1; | 605 | return 1; |
612 | } | 606 | } |
@@ -710,7 +704,7 @@ xirc2ps_config(struct pcmcia_device * link) | |||
710 | 704 | ||
711 | /* Is this a valid card */ | 705 | /* Is this a valid card */ |
712 | if (link->has_manf_id == 0) { | 706 | if (link->has_manf_id == 0) { |
713 | printk(KNOT_XIRC "manfid not found in CIS\n"); | 707 | pr_notice("manfid not found in CIS\n"); |
714 | goto failure; | 708 | goto failure; |
715 | } | 709 | } |
716 | 710 | ||
@@ -732,14 +726,14 @@ xirc2ps_config(struct pcmcia_device * link) | |||
732 | local->manf_str = "Toshiba"; | 726 | local->manf_str = "Toshiba"; |
733 | break; | 727 | break; |
734 | default: | 728 | default: |
735 | printk(KNOT_XIRC "Unknown Card Manufacturer ID: 0x%04x\n", | 729 | pr_notice("Unknown Card Manufacturer ID: 0x%04x\n", |
736 | (unsigned)link->manf_id); | 730 | (unsigned)link->manf_id); |
737 | goto failure; | 731 | goto failure; |
738 | } | 732 | } |
739 | dev_dbg(&link->dev, "found %s card\n", local->manf_str); | 733 | dev_dbg(&link->dev, "found %s card\n", local->manf_str); |
740 | 734 | ||
741 | if (!set_card_type(link)) { | 735 | if (!set_card_type(link)) { |
742 | printk(KNOT_XIRC "this card is not supported\n"); | 736 | pr_notice("this card is not supported\n"); |
743 | goto failure; | 737 | goto failure; |
744 | } | 738 | } |
745 | 739 | ||
@@ -765,7 +759,7 @@ xirc2ps_config(struct pcmcia_device * link) | |||
765 | err = pcmcia_loop_tuple(link, CISTPL_FUNCE, pcmcia_get_mac_ce, dev); | 759 | err = pcmcia_loop_tuple(link, CISTPL_FUNCE, pcmcia_get_mac_ce, dev); |
766 | 760 | ||
767 | if (err) { | 761 | if (err) { |
768 | printk(KNOT_XIRC "node-id not found in CIS\n"); | 762 | pr_notice("node-id not found in CIS\n"); |
769 | goto failure; | 763 | goto failure; |
770 | } | 764 | } |
771 | 765 | ||
@@ -792,7 +786,7 @@ xirc2ps_config(struct pcmcia_device * link) | |||
792 | * try to configure as Ethernet only. | 786 | * try to configure as Ethernet only. |
793 | * .... */ | 787 | * .... */ |
794 | } | 788 | } |
795 | printk(KNOT_XIRC "no ports available\n"); | 789 | pr_notice("no ports available\n"); |
796 | } else { | 790 | } else { |
797 | link->io_lines = 10; | 791 | link->io_lines = 10; |
798 | link->resource[0]->end = 16; | 792 | link->resource[0]->end = 16; |
@@ -865,24 +859,24 @@ xirc2ps_config(struct pcmcia_device * link) | |||
865 | #if 0 | 859 | #if 0 |
866 | { | 860 | { |
867 | u_char tmp; | 861 | u_char tmp; |
868 | printk(KERN_INFO "ECOR:"); | 862 | pr_info("ECOR:"); |
869 | for (i=0; i < 7; i++) { | 863 | for (i=0; i < 7; i++) { |
870 | tmp = readb(local->dingo_ccr + i*2); | 864 | tmp = readb(local->dingo_ccr + i*2); |
871 | printk(" %02x", tmp); | 865 | pr_cont(" %02x", tmp); |
872 | } | 866 | } |
873 | printk("\n"); | 867 | pr_cont("\n"); |
874 | printk(KERN_INFO "DCOR:"); | 868 | pr_info("DCOR:"); |
875 | for (i=0; i < 4; i++) { | 869 | for (i=0; i < 4; i++) { |
876 | tmp = readb(local->dingo_ccr + 0x20 + i*2); | 870 | tmp = readb(local->dingo_ccr + 0x20 + i*2); |
877 | printk(" %02x", tmp); | 871 | pr_cont(" %02x", tmp); |
878 | } | 872 | } |
879 | printk("\n"); | 873 | pr_cont("\n"); |
880 | printk(KERN_INFO "SCOR:"); | 874 | pr_info("SCOR:"); |
881 | for (i=0; i < 10; i++) { | 875 | for (i=0; i < 10; i++) { |
882 | tmp = readb(local->dingo_ccr + 0x40 + i*2); | 876 | tmp = readb(local->dingo_ccr + 0x40 + i*2); |
883 | printk(" %02x", tmp); | 877 | pr_cont(" %02x", tmp); |
884 | } | 878 | } |
885 | printk("\n"); | 879 | pr_cont("\n"); |
886 | } | 880 | } |
887 | #endif | 881 | #endif |
888 | 882 | ||
@@ -901,7 +895,7 @@ xirc2ps_config(struct pcmcia_device * link) | |||
901 | (local->mohawk && if_port==4)) | 895 | (local->mohawk && if_port==4)) |
902 | dev->if_port = if_port; | 896 | dev->if_port = if_port; |
903 | else | 897 | else |
904 | printk(KNOT_XIRC "invalid if_port requested\n"); | 898 | pr_notice("invalid if_port requested\n"); |
905 | 899 | ||
906 | /* we can now register the device with the net subsystem */ | 900 | /* we can now register the device with the net subsystem */ |
907 | dev->irq = link->irq; | 901 | dev->irq = link->irq; |
@@ -913,14 +907,14 @@ xirc2ps_config(struct pcmcia_device * link) | |||
913 | SET_NETDEV_DEV(dev, &link->dev); | 907 | SET_NETDEV_DEV(dev, &link->dev); |
914 | 908 | ||
915 | if ((err=register_netdev(dev))) { | 909 | if ((err=register_netdev(dev))) { |
916 | printk(KNOT_XIRC "register_netdev() failed\n"); | 910 | pr_notice("register_netdev() failed\n"); |
917 | goto config_error; | 911 | goto config_error; |
918 | } | 912 | } |
919 | 913 | ||
920 | /* give some infos about the hardware */ | 914 | /* give some infos about the hardware */ |
921 | printk(KERN_INFO "%s: %s: port %#3lx, irq %d, hwaddr %pM\n", | 915 | netdev_info(dev, "%s: port %#3lx, irq %d, hwaddr %pM\n", |
922 | dev->name, local->manf_str,(u_long)dev->base_addr, (int)dev->irq, | 916 | local->manf_str, (u_long)dev->base_addr, (int)dev->irq, |
923 | dev->dev_addr); | 917 | dev->dev_addr); |
924 | 918 | ||
925 | return 0; | 919 | return 0; |
926 | 920 | ||
@@ -1047,8 +1041,7 @@ xirc2ps_interrupt(int irq, void *dev_id) | |||
1047 | 1041 | ||
1048 | skb = dev_alloc_skb(pktlen+3); /* 1 extra so we can use insw */ | 1042 | skb = dev_alloc_skb(pktlen+3); /* 1 extra so we can use insw */ |
1049 | if (!skb) { | 1043 | if (!skb) { |
1050 | printk(KNOT_XIRC "low memory, packet dropped (size=%u)\n", | 1044 | pr_notice("low memory, packet dropped (size=%u)\n", pktlen); |
1051 | pktlen); | ||
1052 | dev->stats.rx_dropped++; | 1045 | dev->stats.rx_dropped++; |
1053 | } else { /* okay get the packet */ | 1046 | } else { /* okay get the packet */ |
1054 | skb_reserve(skb, 2); | 1047 | skb_reserve(skb, 2); |
@@ -1217,7 +1210,7 @@ xirc_tx_timeout(struct net_device *dev) | |||
1217 | { | 1210 | { |
1218 | local_info_t *lp = netdev_priv(dev); | 1211 | local_info_t *lp = netdev_priv(dev); |
1219 | dev->stats.tx_errors++; | 1212 | dev->stats.tx_errors++; |
1220 | printk(KERN_NOTICE "%s: transmit timed out\n", dev->name); | 1213 | netdev_notice(dev, "transmit timed out\n"); |
1221 | schedule_work(&lp->tx_timeout_task); | 1214 | schedule_work(&lp->tx_timeout_task); |
1222 | } | 1215 | } |
1223 | 1216 | ||
@@ -1384,8 +1377,7 @@ do_config(struct net_device *dev, struct ifmap *map) | |||
1384 | local->probe_port = 0; | 1377 | local->probe_port = 0; |
1385 | dev->if_port = map->port; | 1378 | dev->if_port = map->port; |
1386 | } | 1379 | } |
1387 | printk(KERN_INFO "%s: switching to %s port\n", | 1380 | netdev_info(dev, "switching to %s port\n", if_names[dev->if_port]); |
1388 | dev->name, if_names[dev->if_port]); | ||
1389 | do_reset(dev,1); /* not the fine way :-) */ | 1381 | do_reset(dev,1); /* not the fine way :-) */ |
1390 | } | 1382 | } |
1391 | return 0; | 1383 | return 0; |
@@ -1525,7 +1517,7 @@ do_reset(struct net_device *dev, int full) | |||
1525 | { | 1517 | { |
1526 | SelectPage(0); | 1518 | SelectPage(0); |
1527 | value = GetByte(XIRCREG_ESR); /* read the ESR */ | 1519 | value = GetByte(XIRCREG_ESR); /* read the ESR */ |
1528 | printk(KERN_DEBUG "%s: ESR is: %#02x\n", dev->name, value); | 1520 | pr_debug("%s: ESR is: %#02x\n", dev->name, value); |
1529 | } | 1521 | } |
1530 | #endif | 1522 | #endif |
1531 | 1523 | ||
@@ -1575,13 +1567,12 @@ do_reset(struct net_device *dev, int full) | |||
1575 | 1567 | ||
1576 | if (full && local->mohawk && init_mii(dev)) { | 1568 | if (full && local->mohawk && init_mii(dev)) { |
1577 | if (dev->if_port == 4 || local->dingo || local->new_mii) { | 1569 | if (dev->if_port == 4 || local->dingo || local->new_mii) { |
1578 | printk(KERN_INFO "%s: MII selected\n", dev->name); | 1570 | netdev_info(dev, "MII selected\n"); |
1579 | SelectPage(2); | 1571 | SelectPage(2); |
1580 | PutByte(XIRCREG2_MSR, GetByte(XIRCREG2_MSR) | 0x08); | 1572 | PutByte(XIRCREG2_MSR, GetByte(XIRCREG2_MSR) | 0x08); |
1581 | msleep(20); | 1573 | msleep(20); |
1582 | } else { | 1574 | } else { |
1583 | printk(KERN_INFO "%s: MII detected; using 10mbs\n", | 1575 | netdev_info(dev, "MII detected; using 10mbs\n"); |
1584 | dev->name); | ||
1585 | SelectPage(0x42); | 1576 | SelectPage(0x42); |
1586 | if (dev->if_port == 2) /* enable 10Base2 */ | 1577 | if (dev->if_port == 2) /* enable 10Base2 */ |
1587 | PutByte(XIRCREG42_SWC1, 0xC0); | 1578 | PutByte(XIRCREG42_SWC1, 0xC0); |
@@ -1626,8 +1617,8 @@ do_reset(struct net_device *dev, int full) | |||
1626 | } | 1617 | } |
1627 | 1618 | ||
1628 | if (full) | 1619 | if (full) |
1629 | printk(KERN_INFO "%s: media %s, silicon revision %d\n", | 1620 | netdev_info(dev, "media %s, silicon revision %d\n", |
1630 | dev->name, if_names[dev->if_port], local->silicon); | 1621 | if_names[dev->if_port], local->silicon); |
1631 | /* We should switch back to page 0 to avoid a bug in revision 0 | 1622 | /* We should switch back to page 0 to avoid a bug in revision 0 |
1632 | * where regs with offset below 8 can't be read after an access | 1623 | * where regs with offset below 8 can't be read after an access |
1633 | * to the MAC registers */ | 1624 | * to the MAC registers */ |
@@ -1669,8 +1660,7 @@ init_mii(struct net_device *dev) | |||
1669 | control = mii_rd(ioaddr, 0, 0); | 1660 | control = mii_rd(ioaddr, 0, 0); |
1670 | 1661 | ||
1671 | if (control & 0x0400) { | 1662 | if (control & 0x0400) { |
1672 | printk(KERN_NOTICE "%s can't take PHY out of isolation mode\n", | 1663 | netdev_notice(dev, "can't take PHY out of isolation mode\n"); |
1673 | dev->name); | ||
1674 | local->probe_port = 0; | 1664 | local->probe_port = 0; |
1675 | return 0; | 1665 | return 0; |
1676 | } | 1666 | } |
@@ -1688,8 +1678,7 @@ init_mii(struct net_device *dev) | |||
1688 | } | 1678 | } |
1689 | 1679 | ||
1690 | if (!(status & 0x0020)) { | 1680 | if (!(status & 0x0020)) { |
1691 | printk(KERN_INFO "%s: autonegotiation failed;" | 1681 | netdev_info(dev, "autonegotiation failed; using 10mbs\n"); |
1692 | " using 10mbs\n", dev->name); | ||
1693 | if (!local->new_mii) { | 1682 | if (!local->new_mii) { |
1694 | control = 0x0000; | 1683 | control = 0x0000; |
1695 | mii_wr(ioaddr, 0, 0, control, 16); | 1684 | mii_wr(ioaddr, 0, 0, control, 16); |
@@ -1699,8 +1688,7 @@ init_mii(struct net_device *dev) | |||
1699 | } | 1688 | } |
1700 | } else { | 1689 | } else { |
1701 | linkpartner = mii_rd(ioaddr, 0, 5); | 1690 | linkpartner = mii_rd(ioaddr, 0, 5); |
1702 | printk(KERN_INFO "%s: MII link partner: %04x\n", | 1691 | netdev_info(dev, "MII link partner: %04x\n", linkpartner); |
1703 | dev->name, linkpartner); | ||
1704 | if (linkpartner & 0x0080) { | 1692 | if (linkpartner & 0x0080) { |
1705 | dev->if_port = 4; | 1693 | dev->if_port = 4; |
1706 | } else | 1694 | } else |