aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/pcmcia')
-rw-r--r--drivers/net/pcmcia/3c574_cs.c88
-rw-r--r--drivers/net/pcmcia/3c589_cs.c17
-rw-r--r--drivers/net/pcmcia/axnet_cs.c187
-rw-r--r--drivers/net/pcmcia/com20020_cs.c32
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c60
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c26
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c56
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c106
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c105
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c104
10 files changed, 353 insertions, 428 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index c683f77c6f4..042f6777e6b 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
@@ -238,7 +239,6 @@ static int el3_rx(struct net_device *dev, int worklimit);
238static int el3_close(struct net_device *dev); 239static int el3_close(struct net_device *dev);
239static void el3_tx_timeout(struct net_device *dev); 240static void el3_tx_timeout(struct net_device *dev);
240static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 241static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
241static const struct ethtool_ops netdev_ethtool_ops;
242static void set_rx_mode(struct net_device *dev); 242static void set_rx_mode(struct net_device *dev);
243static void set_multicast_list(struct net_device *dev); 243static void set_multicast_list(struct net_device *dev);
244 244
@@ -285,7 +285,6 @@ static int tc574_probe(struct pcmcia_device *link)
285 link->conf.ConfigIndex = 1; 285 link->conf.ConfigIndex = 1;
286 286
287 dev->netdev_ops = &el3_netdev_ops; 287 dev->netdev_ops = &el3_netdev_ops;
288 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
289 dev->watchdog_timeo = TX_TIMEOUT; 288 dev->watchdog_timeo = TX_TIMEOUT;
290 289
291 return tc574_config(link); 290 return tc574_config(link);
@@ -376,8 +375,8 @@ static int tc574_config(struct pcmcia_device *link)
376 for (i = 0; i < 3; i++) 375 for (i = 0; i < 3; i++)
377 phys_addr[i] = htons(read_eeprom(ioaddr, i + 10)); 376 phys_addr[i] = htons(read_eeprom(ioaddr, i + 10));
378 if (phys_addr[0] == htons(0x6060)) { 377 if (phys_addr[0] == htons(0x6060)) {
379 printk(KERN_NOTICE "3c574_cs: IO port conflict at 0x%03lx" 378 pr_notice("IO port conflict at 0x%03lx-0x%03lx\n",
380 "-0x%03lx\n", dev->base_addr, dev->base_addr+15); 379 dev->base_addr, dev->base_addr+15);
381 goto failed; 380 goto failed;
382 } 381 }
383 } 382 }
@@ -391,7 +390,7 @@ static int tc574_config(struct pcmcia_device *link)
391 outw(2<<11, ioaddr + RunnerRdCtrl); 390 outw(2<<11, ioaddr + RunnerRdCtrl);
392 mcr = inb(ioaddr + 2); 391 mcr = inb(ioaddr + 2);
393 outw(0<<11, ioaddr + RunnerRdCtrl); 392 outw(0<<11, ioaddr + RunnerRdCtrl);
394 printk(KERN_INFO " ASIC rev %d,", mcr>>3); 393 pr_info(" ASIC rev %d,", mcr>>3);
395 EL3WINDOW(3); 394 EL3WINDOW(3);
396 config = inl(ioaddr + Wn3_Config); 395 config = inl(ioaddr + Wn3_Config);
397 lp->default_media = (config & Xcvr) >> Xcvr_shift; 396 lp->default_media = (config & Xcvr) >> Xcvr_shift;
@@ -428,7 +427,7 @@ static int tc574_config(struct pcmcia_device *link)
428 } 427 }
429 } 428 }
430 if (phy > 32) { 429 if (phy > 32) {
431 printk(KERN_NOTICE " No MII transceivers found!\n"); 430 pr_notice(" No MII transceivers found!\n");
432 goto failed; 431 goto failed;
433 } 432 }
434 i = mdio_read(ioaddr, lp->phys, 16) | 0x40; 433 i = mdio_read(ioaddr, lp->phys, 16) | 0x40;
@@ -444,18 +443,16 @@ static int tc574_config(struct pcmcia_device *link)
444 SET_NETDEV_DEV(dev, &link->dev); 443 SET_NETDEV_DEV(dev, &link->dev);
445 444
446 if (register_netdev(dev) != 0) { 445 if (register_netdev(dev) != 0) {
447 printk(KERN_NOTICE "3c574_cs: register_netdev() failed\n"); 446 pr_notice("register_netdev() failed\n");
448 goto failed; 447 goto failed;
449 } 448 }
450 449
451 printk(KERN_INFO "%s: %s at io %#3lx, irq %d, " 450 netdev_info(dev, "%s at io %#3lx, irq %d, hw_addr %pM\n",
452 "hw_addr %pM.\n", 451 cardname, dev->base_addr, dev->irq, dev->dev_addr);
453 dev->name, cardname, dev->base_addr, dev->irq, 452 netdev_info(dev, " %dK FIFO split %s Rx:Tx, %sMII interface.\n",
454 dev->dev_addr); 453 8 << config & Ram_size,
455 printk(" %dK FIFO split %s Rx:Tx, %sMII interface.\n", 454 ram_split[(config & Ram_split) >> Ram_split_shift],
456 8 << config & Ram_size, 455 config & Autoselect ? "autoselect " : "");
457 ram_split[(config & Ram_split) >> Ram_split_shift],
458 config & Autoselect ? "autoselect " : "");
459 456
460 return 0; 457 return 0;
461 458
@@ -502,14 +499,14 @@ static void dump_status(struct net_device *dev)
502{ 499{
503 unsigned int ioaddr = dev->base_addr; 500 unsigned int ioaddr = dev->base_addr;
504 EL3WINDOW(1); 501 EL3WINDOW(1);
505 printk(KERN_INFO " irq status %04x, rx status %04x, tx status " 502 netdev_info(dev, " irq status %04x, rx status %04x, tx status %02x, tx free %04x\n",
506 "%02x, tx free %04x\n", inw(ioaddr+EL3_STATUS), 503 inw(ioaddr+EL3_STATUS),
507 inw(ioaddr+RxStatus), inb(ioaddr+TxStatus), 504 inw(ioaddr+RxStatus), inb(ioaddr+TxStatus),
508 inw(ioaddr+TxFree)); 505 inw(ioaddr+TxFree));
509 EL3WINDOW(4); 506 EL3WINDOW(4);
510 printk(KERN_INFO " diagnostics: fifo %04x net %04x ethernet %04x" 507 netdev_info(dev, " diagnostics: fifo %04x net %04x ethernet %04x media %04x\n",
511 " media %04x\n", inw(ioaddr+0x04), inw(ioaddr+0x06), 508 inw(ioaddr+0x04), inw(ioaddr+0x06),
512 inw(ioaddr+0x08), inw(ioaddr+0x0a)); 509 inw(ioaddr+0x08), inw(ioaddr+0x0a));
513 EL3WINDOW(1); 510 EL3WINDOW(1);
514} 511}
515 512
@@ -523,7 +520,7 @@ static void tc574_wait_for_completion(struct net_device *dev, int cmd)
523 while (--i > 0) 520 while (--i > 0)
524 if (!(inw(dev->base_addr + EL3_STATUS) & 0x1000)) break; 521 if (!(inw(dev->base_addr + EL3_STATUS) & 0x1000)) break;
525 if (i == 0) 522 if (i == 0)
526 printk(KERN_NOTICE "%s: command 0x%04x did not complete!\n", dev->name, cmd); 523 netdev_notice(dev, "command 0x%04x did not complete!\n", cmd);
527} 524}
528 525
529/* Read a word from the EEPROM using the regular EEPROM access register. 526/* Read a word from the EEPROM using the regular EEPROM access register.
@@ -710,7 +707,7 @@ static int el3_open(struct net_device *dev)
710 netif_start_queue(dev); 707 netif_start_queue(dev);
711 708
712 tc574_reset(dev); 709 tc574_reset(dev);
713 lp->media.function = &media_check; 710 lp->media.function = media_check;
714 lp->media.data = (unsigned long) dev; 711 lp->media.data = (unsigned long) dev;
715 lp->media.expires = jiffies + HZ; 712 lp->media.expires = jiffies + HZ;
716 add_timer(&lp->media); 713 add_timer(&lp->media);
@@ -725,7 +722,7 @@ static void el3_tx_timeout(struct net_device *dev)
725{ 722{
726 unsigned int ioaddr = dev->base_addr; 723 unsigned int ioaddr = dev->base_addr;
727 724
728 printk(KERN_NOTICE "%s: Transmit timed out!\n", dev->name); 725 netdev_notice(dev, "Transmit timed out!\n");
729 dump_status(dev); 726 dump_status(dev);
730 dev->stats.tx_errors++; 727 dev->stats.tx_errors++;
731 dev->trans_start = jiffies; /* prevent tx timeout */ 728 dev->trans_start = jiffies; /* prevent tx timeout */
@@ -848,8 +845,8 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
848 EL3WINDOW(4); 845 EL3WINDOW(4);
849 fifo_diag = inw(ioaddr + Wn4_FIFODiag); 846 fifo_diag = inw(ioaddr + Wn4_FIFODiag);
850 EL3WINDOW(1); 847 EL3WINDOW(1);
851 printk(KERN_NOTICE "%s: adapter failure, FIFO diagnostic" 848 netdev_notice(dev, "adapter failure, FIFO diagnostic register %04x\n",
852 " register %04x.\n", dev->name, fifo_diag); 849 fifo_diag);
853 if (fifo_diag & 0x0400) { 850 if (fifo_diag & 0x0400) {
854 /* Tx overrun */ 851 /* Tx overrun */
855 tc574_wait_for_completion(dev, TxReset); 852 tc574_wait_for_completion(dev, TxReset);
@@ -903,7 +900,7 @@ static void media_check(unsigned long arg)
903 this, we can limp along even if the interrupt is blocked */ 900 this, we can limp along even if the interrupt is blocked */
904 if ((inw(ioaddr + EL3_STATUS) & IntLatch) && (inb(ioaddr + Timer) == 0xff)) { 901 if ((inw(ioaddr + EL3_STATUS) & IntLatch) && (inb(ioaddr + Timer) == 0xff)) {
905 if (!lp->fast_poll) 902 if (!lp->fast_poll)
906 printk(KERN_INFO "%s: interrupt(s) dropped!\n", dev->name); 903 netdev_info(dev, "interrupt(s) dropped!\n");
907 904
908 local_irq_save(flags); 905 local_irq_save(flags);
909 el3_interrupt(dev->irq, dev); 906 el3_interrupt(dev->irq, dev);
@@ -926,23 +923,21 @@ static void media_check(unsigned long arg)
926 923
927 if (media != lp->media_status) { 924 if (media != lp->media_status) {
928 if ((media ^ lp->media_status) & 0x0004) 925 if ((media ^ lp->media_status) & 0x0004)
929 printk(KERN_INFO "%s: %s link beat\n", dev->name, 926 netdev_info(dev, "%s link beat\n",
930 (lp->media_status & 0x0004) ? "lost" : "found"); 927 (lp->media_status & 0x0004) ? "lost" : "found");
931 if ((media ^ lp->media_status) & 0x0020) { 928 if ((media ^ lp->media_status) & 0x0020) {
932 lp->partner = 0; 929 lp->partner = 0;
933 if (lp->media_status & 0x0020) { 930 if (lp->media_status & 0x0020) {
934 printk(KERN_INFO "%s: autonegotiation restarted\n", 931 netdev_info(dev, "autonegotiation restarted\n");
935 dev->name);
936 } else if (partner) { 932 } else if (partner) {
937 partner &= lp->advertising; 933 partner &= lp->advertising;
938 lp->partner = partner; 934 lp->partner = partner;
939 printk(KERN_INFO "%s: autonegotiation complete: " 935 netdev_info(dev, "autonegotiation complete: "
940 "%sbaseT-%cD selected\n", dev->name, 936 "%dbaseT-%cD selected\n",
941 ((partner & 0x0180) ? "100" : "10"), 937 (partner & 0x0180) ? 100 : 10,
942 ((partner & 0x0140) ? 'F' : 'H')); 938 (partner & 0x0140) ? 'F' : 'H');
943 } else { 939 } else {
944 printk(KERN_INFO "%s: link partner did not autonegotiate\n", 940 netdev_info(dev, "link partner did not autonegotiate\n");
945 dev->name);
946 } 941 }
947 942
948 EL3WINDOW(3); 943 EL3WINDOW(3);
@@ -952,10 +947,9 @@ static void media_check(unsigned long arg)
952 947
953 } 948 }
954 if (media & 0x0010) 949 if (media & 0x0010)
955 printk(KERN_INFO "%s: remote fault detected\n", 950 netdev_info(dev, "remote fault detected\n");
956 dev->name);
957 if (media & 0x0002) 951 if (media & 0x0002)
958 printk(KERN_INFO "%s: jabber detected\n", dev->name); 952 netdev_info(dev, "jabber detected\n");
959 lp->media_status = media; 953 lp->media_status = media;
960 } 954 }
961 spin_unlock_irqrestore(&lp->window_lock, flags); 955 spin_unlock_irqrestore(&lp->window_lock, flags);
@@ -1065,16 +1059,6 @@ static int el3_rx(struct net_device *dev, int worklimit)
1065 return worklimit; 1059 return worklimit;
1066} 1060}
1067 1061
1068static void netdev_get_drvinfo(struct net_device *dev,
1069 struct ethtool_drvinfo *info)
1070{
1071 strcpy(info->driver, "3c574_cs");
1072}
1073
1074static const struct ethtool_ops netdev_ethtool_ops = {
1075 .get_drvinfo = netdev_get_drvinfo,
1076};
1077
1078/* Provide ioctl() calls to examine the MII xcvr state. */ 1062/* Provide ioctl() calls to examine the MII xcvr state. */
1079static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 1063static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1080{ 1064{
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 61f9cf2100f..35562a39577 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
@@ -264,7 +266,7 @@ static int tc589_config(struct pcmcia_device *link)
264 __be16 *phys_addr; 266 __be16 *phys_addr;
265 int ret, i, j, multi = 0, fifo; 267 int ret, i, j, multi = 0, fifo;
266 unsigned int ioaddr; 268 unsigned int ioaddr;
267 char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; 269 static const char * const ram_split[] = {"5:3", "3:1", "1:1", "3:5"};
268 u8 *buf; 270 u8 *buf;
269 size_t len; 271 size_t len;
270 272
@@ -273,8 +275,7 @@ static int tc589_config(struct pcmcia_device *link)
273 phys_addr = (__be16 *)dev->dev_addr; 275 phys_addr = (__be16 *)dev->dev_addr;
274 /* Is this a 3c562? */ 276 /* Is this a 3c562? */
275 if (link->manf_id != MANFID_3COM) 277 if (link->manf_id != MANFID_3COM)
276 printk(KERN_INFO "3c589_cs: hmmm, is this really a " 278 dev_info(&link->dev, "hmmm, is this really a 3Com card??\n");
277 "3Com card??\n");
278 multi = (link->card_id == PRODID_3COM_3C562); 279 multi = (link->card_id == PRODID_3COM_3C562);
279 280
280 link->io_lines = 16; 281 link->io_lines = 16;
@@ -315,8 +316,8 @@ static int tc589_config(struct pcmcia_device *link)
315 for (i = 0; i < 3; i++) 316 for (i = 0; i < 3; i++)
316 phys_addr[i] = htons(read_eeprom(ioaddr, i)); 317 phys_addr[i] = htons(read_eeprom(ioaddr, i));
317 if (phys_addr[0] == htons(0x6060)) { 318 if (phys_addr[0] == htons(0x6060)) {
318 printk(KERN_ERR "3c589_cs: IO port conflict at 0x%03lx" 319 dev_err(&link->dev, "IO port conflict at 0x%03lx-0x%03lx\n",
319 "-0x%03lx\n", dev->base_addr, dev->base_addr+15); 320 dev->base_addr, dev->base_addr+15);
320 goto failed; 321 goto failed;
321 } 322 }
322 } 323 }
@@ -330,12 +331,12 @@ static int tc589_config(struct pcmcia_device *link)
330 if ((if_port >= 0) && (if_port <= 3)) 331 if ((if_port >= 0) && (if_port <= 3))
331 dev->if_port = if_port; 332 dev->if_port = if_port;
332 else 333 else
333 printk(KERN_ERR "3c589_cs: invalid if_port requested\n"); 334 dev_err(&link->dev, "invalid if_port requested\n");
334 335
335 SET_NETDEV_DEV(dev, &link->dev); 336 SET_NETDEV_DEV(dev, &link->dev);
336 337
337 if (register_netdev(dev) != 0) { 338 if (register_netdev(dev) != 0) {
338 printk(KERN_ERR "3c589_cs: register_netdev() failed\n"); 339 dev_err(&link->dev, "register_netdev() failed\n");
339 goto failed; 340 goto failed;
340 } 341 }
341 342
@@ -537,7 +538,7 @@ static int el3_open(struct net_device *dev)
537 538
538 tc589_reset(dev); 539 tc589_reset(dev);
539 init_timer(&lp->media); 540 init_timer(&lp->media);
540 lp->media.function = &media_check; 541 lp->media.function = media_check;
541 lp->media.data = (unsigned long) dev; 542 lp->media.data = (unsigned long) dev;
542 lp->media.expires = jiffies + HZ; 543 lp->media.expires = jiffies + HZ;
543 add_timer(&lp->media); 544 add_timer(&lp->media);
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 5f05ffb240c..3f61fde70d7 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>
@@ -86,7 +87,6 @@ static netdev_tx_t axnet_start_xmit(struct sk_buff *skb,
86static struct net_device_stats *get_stats(struct net_device *dev); 87static struct net_device_stats *get_stats(struct net_device *dev);
87static void set_multicast_list(struct net_device *dev); 88static void set_multicast_list(struct net_device *dev);
88static void axnet_tx_timeout(struct net_device *dev); 89static void axnet_tx_timeout(struct net_device *dev);
89static const struct ethtool_ops netdev_ethtool_ops;
90static irqreturn_t ei_irq_wrapper(int irq, void *dev_id); 90static irqreturn_t ei_irq_wrapper(int irq, void *dev_id);
91static void ei_watchdog(u_long arg); 91static void ei_watchdog(u_long arg);
92static void axnet_reset_8390(struct net_device *dev); 92static void axnet_reset_8390(struct net_device *dev);
@@ -171,7 +171,6 @@ static int axnet_probe(struct pcmcia_device *link)
171 171
172 dev->netdev_ops = &axnet_netdev_ops; 172 dev->netdev_ops = &axnet_netdev_ops;
173 173
174 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
175 dev->watchdog_timeo = TX_TIMEOUT; 174 dev->watchdog_timeo = TX_TIMEOUT;
176 175
177 return axnet_config(link); 176 return axnet_config(link);
@@ -347,8 +346,8 @@ static int axnet_config(struct pcmcia_device *link)
347 dev->base_addr = link->resource[0]->start; 346 dev->base_addr = link->resource[0]->start;
348 347
349 if (!get_prom(link)) { 348 if (!get_prom(link)) {
350 printk(KERN_NOTICE "axnet_cs: this is not an AX88190 card!\n"); 349 pr_notice("this is not an AX88190 card!\n");
351 printk(KERN_NOTICE "axnet_cs: use pcnet_cs instead.\n"); 350 pr_notice("use pcnet_cs instead.\n");
352 goto failed; 351 goto failed;
353 } 352 }
354 353
@@ -357,10 +356,10 @@ static int axnet_config(struct pcmcia_device *link)
357 ei_status.tx_start_page = AXNET_START_PG; 356 ei_status.tx_start_page = AXNET_START_PG;
358 ei_status.rx_start_page = AXNET_START_PG + TX_PAGES; 357 ei_status.rx_start_page = AXNET_START_PG + TX_PAGES;
359 ei_status.stop_page = AXNET_STOP_PG; 358 ei_status.stop_page = AXNET_STOP_PG;
360 ei_status.reset_8390 = &axnet_reset_8390; 359 ei_status.reset_8390 = axnet_reset_8390;
361 ei_status.get_8390_hdr = &get_8390_hdr; 360 ei_status.get_8390_hdr = get_8390_hdr;
362 ei_status.block_input = &block_input; 361 ei_status.block_input = block_input;
363 ei_status.block_output = &block_output; 362 ei_status.block_output = block_output;
364 363
365 if (inb(dev->base_addr + AXNET_TEST) != 0) 364 if (inb(dev->base_addr + AXNET_TEST) != 0)
366 info->flags |= IS_AX88790; 365 info->flags |= IS_AX88790;
@@ -393,19 +392,18 @@ static int axnet_config(struct pcmcia_device *link)
393 SET_NETDEV_DEV(dev, &link->dev); 392 SET_NETDEV_DEV(dev, &link->dev);
394 393
395 if (register_netdev(dev) != 0) { 394 if (register_netdev(dev) != 0) {
396 printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n"); 395 pr_notice("register_netdev() failed\n");
397 goto failed; 396 goto failed;
398 } 397 }
399 398
400 printk(KERN_INFO "%s: Asix AX88%d90: io %#3lx, irq %d, " 399 netdev_info(dev, "Asix AX88%d90: io %#3lx, irq %d, hw_addr %pM\n",
401 "hw_addr %pM\n", 400 ((info->flags & IS_AX88790) ? 7 : 1),
402 dev->name, ((info->flags & IS_AX88790) ? 7 : 1), 401 dev->base_addr, dev->irq, dev->dev_addr);
403 dev->base_addr, dev->irq,
404 dev->dev_addr);
405 if (info->phy_id != -1) { 402 if (info->phy_id != -1) {
406 dev_dbg(&link->dev, " MII transceiver at index %d, status %x.\n", info->phy_id, j); 403 netdev_dbg(dev, " MII transceiver at index %d, status %x\n",
404 info->phy_id, j);
407 } else { 405 } else {
408 printk(KERN_NOTICE " No MII transceivers found!\n"); 406 netdev_notice(dev, " No MII transceivers found!\n");
409 } 407 }
410 return 0; 408 return 0;
411 409
@@ -532,7 +530,7 @@ static int axnet_open(struct net_device *dev)
532 530
533 info->link_status = 0x00; 531 info->link_status = 0x00;
534 init_timer(&info->watchdog); 532 init_timer(&info->watchdog);
535 info->watchdog.function = &ei_watchdog; 533 info->watchdog.function = ei_watchdog;
536 info->watchdog.data = (u_long)dev; 534 info->watchdog.data = (u_long)dev;
537 info->watchdog.expires = jiffies + HZ; 535 info->watchdog.expires = jiffies + HZ;
538 add_timer(&info->watchdog); 536 add_timer(&info->watchdog);
@@ -585,8 +583,7 @@ static void axnet_reset_8390(struct net_device *dev)
585 outb_p(ENISR_RESET, nic_base + EN0_ISR); /* Ack intr. */ 583 outb_p(ENISR_RESET, nic_base + EN0_ISR); /* Ack intr. */
586 584
587 if (i == 100) 585 if (i == 100)
588 printk(KERN_ERR "%s: axnet_reset_8390() did not complete.\n", 586 netdev_err(dev, "axnet_reset_8390() did not complete\n");
589 dev->name);
590 587
591} /* axnet_reset_8390 */ 588} /* axnet_reset_8390 */
592 589
@@ -613,7 +610,7 @@ static void ei_watchdog(u_long arg)
613 this, we can limp along even if the interrupt is blocked */ 610 this, we can limp along even if the interrupt is blocked */
614 if (info->stale++ && (inb_p(nic_base + EN0_ISR) & ENISR_ALL)) { 611 if (info->stale++ && (inb_p(nic_base + EN0_ISR) & ENISR_ALL)) {
615 if (!info->fast_poll) 612 if (!info->fast_poll)
616 printk(KERN_INFO "%s: interrupt(s) dropped!\n", dev->name); 613 netdev_info(dev, "interrupt(s) dropped!\n");
617 ei_irq_wrapper(dev->irq, dev); 614 ei_irq_wrapper(dev->irq, dev);
618 info->fast_poll = HZ; 615 info->fast_poll = HZ;
619 } 616 }
@@ -628,7 +625,7 @@ static void ei_watchdog(u_long arg)
628 goto reschedule; 625 goto reschedule;
629 link = mdio_read(mii_addr, info->phy_id, 1); 626 link = mdio_read(mii_addr, info->phy_id, 1);
630 if (!link || (link == 0xffff)) { 627 if (!link || (link == 0xffff)) {
631 printk(KERN_INFO "%s: MII is missing!\n", dev->name); 628 netdev_info(dev, "MII is missing!\n");
632 info->phy_id = -1; 629 info->phy_id = -1;
633 goto reschedule; 630 goto reschedule;
634 } 631 }
@@ -636,18 +633,14 @@ static void ei_watchdog(u_long arg)
636 link &= 0x0004; 633 link &= 0x0004;
637 if (link != info->link_status) { 634 if (link != info->link_status) {
638 u_short p = mdio_read(mii_addr, info->phy_id, 5); 635 u_short p = mdio_read(mii_addr, info->phy_id, 5);
639 printk(KERN_INFO "%s: %s link beat\n", dev->name, 636 netdev_info(dev, "%s link beat\n", link ? "found" : "lost");
640 (link) ? "found" : "lost");
641 if (link) { 637 if (link) {
642 info->duplex_flag = (p & 0x0140) ? 0x80 : 0x00; 638 info->duplex_flag = (p & 0x0140) ? 0x80 : 0x00;
643 if (p) 639 if (p)
644 printk(KERN_INFO "%s: autonegotiation complete: " 640 netdev_info(dev, "autonegotiation complete: %dbaseT-%cD selected\n",
645 "%sbaseT-%cD selected\n", dev->name, 641 (p & 0x0180) ? 100 : 10, (p & 0x0140) ? 'F' : 'H');
646 ((p & 0x0180) ? "100" : "10"),
647 ((p & 0x0140) ? 'F' : 'H'));
648 else 642 else
649 printk(KERN_INFO "%s: link partner did not autonegotiate\n", 643 netdev_info(dev, "link partner did not autonegotiate\n");
650 dev->name);
651 AX88190_init(dev, 1); 644 AX88190_init(dev, 1);
652 } 645 }
653 info->link_status = link; 646 info->link_status = link;
@@ -658,16 +651,6 @@ reschedule:
658 add_timer(&info->watchdog); 651 add_timer(&info->watchdog);
659} 652}
660 653
661static void netdev_get_drvinfo(struct net_device *dev,
662 struct ethtool_drvinfo *info)
663{
664 strcpy(info->driver, "axnet_cs");
665}
666
667static const struct ethtool_ops netdev_ethtool_ops = {
668 .get_drvinfo = netdev_get_drvinfo,
669};
670
671/*====================================================================*/ 654/*====================================================================*/
672 655
673static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 656static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
@@ -855,9 +838,6 @@ module_exit(exit_axnet_cs);
855 838
856 */ 839 */
857 840
858static const char version_8390[] = KERN_INFO \
859 "8390.c:v1.10cvs 9/23/94 Donald Becker (becker@scyld.com)\n";
860
861#include <linux/bitops.h> 841#include <linux/bitops.h>
862#include <asm/irq.h> 842#include <asm/irq.h>
863#include <linux/fcntl.h> 843#include <linux/fcntl.h>
@@ -1004,9 +984,11 @@ static void axnet_tx_timeout(struct net_device *dev)
1004 isr = inb(e8390_base+EN0_ISR); 984 isr = inb(e8390_base+EN0_ISR);
1005 spin_unlock_irqrestore(&ei_local->page_lock, flags); 985 spin_unlock_irqrestore(&ei_local->page_lock, flags);
1006 986
1007 printk(KERN_DEBUG "%s: Tx timed out, %s TSR=%#2x, ISR=%#2x, t=%d.\n", 987 netdev_printk(KERN_DEBUG, dev,
1008 dev->name, (txsr & ENTSR_ABT) ? "excess collisions." : 988 "Tx timed out, %s TSR=%#2x, ISR=%#2x, t=%d.\n",
1009 (isr) ? "lost interrupt?" : "cable problem?", txsr, isr, tickssofar); 989 (txsr & ENTSR_ABT) ? "excess collisions." :
990 (isr) ? "lost interrupt?" : "cable problem?",
991 txsr, isr, tickssofar);
1010 992
1011 if (!isr && !dev->stats.tx_packets) 993 if (!isr && !dev->stats.tx_packets)
1012 { 994 {
@@ -1076,22 +1058,28 @@ static netdev_tx_t axnet_start_xmit(struct sk_buff *skb,
1076 output_page = ei_local->tx_start_page; 1058 output_page = ei_local->tx_start_page;
1077 ei_local->tx1 = send_length; 1059 ei_local->tx1 = send_length;
1078 if (ei_debug && ei_local->tx2 > 0) 1060 if (ei_debug && ei_local->tx2 > 0)
1079 printk(KERN_DEBUG "%s: idle transmitter tx2=%d, lasttx=%d, txing=%d.\n", 1061 netdev_printk(KERN_DEBUG, dev,
1080 dev->name, ei_local->tx2, ei_local->lasttx, ei_local->txing); 1062 "idle transmitter tx2=%d, lasttx=%d, txing=%d\n",
1063 ei_local->tx2, ei_local->lasttx,
1064 ei_local->txing);
1081 } 1065 }
1082 else if (ei_local->tx2 == 0) 1066 else if (ei_local->tx2 == 0)
1083 { 1067 {
1084 output_page = ei_local->tx_start_page + TX_PAGES/2; 1068 output_page = ei_local->tx_start_page + TX_PAGES/2;
1085 ei_local->tx2 = send_length; 1069 ei_local->tx2 = send_length;
1086 if (ei_debug && ei_local->tx1 > 0) 1070 if (ei_debug && ei_local->tx1 > 0)
1087 printk(KERN_DEBUG "%s: idle transmitter, tx1=%d, lasttx=%d, txing=%d.\n", 1071 netdev_printk(KERN_DEBUG, dev,
1088 dev->name, ei_local->tx1, ei_local->lasttx, ei_local->txing); 1072 "idle transmitter, tx1=%d, lasttx=%d, txing=%d\n",
1073 ei_local->tx1, ei_local->lasttx,
1074 ei_local->txing);
1089 } 1075 }
1090 else 1076 else
1091 { /* We should never get here. */ 1077 { /* We should never get here. */
1092 if (ei_debug) 1078 if (ei_debug)
1093 printk(KERN_DEBUG "%s: No Tx buffers free! tx1=%d tx2=%d last=%d\n", 1079 netdev_printk(KERN_DEBUG, dev,
1094 dev->name, ei_local->tx1, ei_local->tx2, ei_local->lasttx); 1080 "No Tx buffers free! tx1=%d tx2=%d last=%d\n",
1081 ei_local->tx1, ei_local->tx2,
1082 ei_local->lasttx);
1095 ei_local->irqlock = 0; 1083 ei_local->irqlock = 0;
1096 netif_stop_queue(dev); 1084 netif_stop_queue(dev);
1097 outb_p(ENISR_ALL, e8390_base + EN0_IMR); 1085 outb_p(ENISR_ALL, e8390_base + EN0_IMR);
@@ -1179,23 +1167,26 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
1179 1167
1180 spin_lock_irqsave(&ei_local->page_lock, flags); 1168 spin_lock_irqsave(&ei_local->page_lock, flags);
1181 1169
1182 if (ei_local->irqlock) 1170 if (ei_local->irqlock) {
1183 {
1184#if 1 /* This might just be an interrupt for a PCI device sharing this line */ 1171#if 1 /* This might just be an interrupt for a PCI device sharing this line */
1172 const char *msg;
1185 /* The "irqlock" check is only for testing. */ 1173 /* The "irqlock" check is only for testing. */
1186 printk(ei_local->irqlock 1174 if (ei_local->irqlock)
1187 ? "%s: Interrupted while interrupts are masked! isr=%#2x imr=%#2x.\n" 1175 msg = "Interrupted while interrupts are masked!";
1188 : "%s: Reentering the interrupt handler! isr=%#2x imr=%#2x.\n", 1176 else
1189 dev->name, inb_p(e8390_base + EN0_ISR), 1177 msg = "Reentering the interrupt handler!";
1190 inb_p(e8390_base + EN0_IMR)); 1178 netdev_info(dev, "%s, isr=%#2x imr=%#2x\n",
1179 msg,
1180 inb_p(e8390_base + EN0_ISR),
1181 inb_p(e8390_base + EN0_IMR));
1191#endif 1182#endif
1192 spin_unlock_irqrestore(&ei_local->page_lock, flags); 1183 spin_unlock_irqrestore(&ei_local->page_lock, flags);
1193 return IRQ_NONE; 1184 return IRQ_NONE;
1194 } 1185 }
1195 1186
1196 if (ei_debug > 3) 1187 if (ei_debug > 3)
1197 printk(KERN_DEBUG "%s: interrupt(isr=%#2.2x).\n", dev->name, 1188 netdev_printk(KERN_DEBUG, dev, "interrupt(isr=%#2.2x)\n",
1198 inb_p(e8390_base + EN0_ISR)); 1189 inb_p(e8390_base + EN0_ISR));
1199 1190
1200 outb_p(0x00, e8390_base + EN0_ISR); 1191 outb_p(0x00, e8390_base + EN0_ISR);
1201 ei_local->irqlock = 1; 1192 ei_local->irqlock = 1;
@@ -1206,7 +1197,8 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
1206 { 1197 {
1207 if (!netif_running(dev) || (interrupts == 0xff)) { 1198 if (!netif_running(dev) || (interrupts == 0xff)) {
1208 if (ei_debug > 1) 1199 if (ei_debug > 1)
1209 printk(KERN_WARNING "%s: interrupt from stopped card\n", dev->name); 1200 netdev_warn(dev,
1201 "interrupt from stopped card\n");
1210 outb_p(interrupts, e8390_base + EN0_ISR); 1202 outb_p(interrupts, e8390_base + EN0_ISR);
1211 interrupts = 0; 1203 interrupts = 0;
1212 break; 1204 break;
@@ -1249,11 +1241,12 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
1249 { 1241 {
1250 /* 0xFF is valid for a card removal */ 1242 /* 0xFF is valid for a card removal */
1251 if(interrupts!=0xFF) 1243 if(interrupts!=0xFF)
1252 printk(KERN_WARNING "%s: Too much work at interrupt, status %#2.2x\n", 1244 netdev_warn(dev, "Too much work at interrupt, status %#2.2x\n",
1253 dev->name, interrupts); 1245 interrupts);
1254 outb_p(ENISR_ALL, e8390_base + EN0_ISR); /* Ack. most intrs. */ 1246 outb_p(ENISR_ALL, e8390_base + EN0_ISR); /* Ack. most intrs. */
1255 } else { 1247 } else {
1256 printk(KERN_WARNING "%s: unknown interrupt %#2x\n", dev->name, interrupts); 1248 netdev_warn(dev, "unknown interrupt %#2x\n",
1249 interrupts);
1257 outb_p(0xff, e8390_base + EN0_ISR); /* Ack. all intrs. */ 1250 outb_p(0xff, e8390_base + EN0_ISR); /* Ack. all intrs. */
1258 } 1251 }
1259 } 1252 }
@@ -1287,18 +1280,19 @@ static void ei_tx_err(struct net_device *dev)
1287 unsigned char tx_was_aborted = txsr & (ENTSR_ABT+ENTSR_FU); 1280 unsigned char tx_was_aborted = txsr & (ENTSR_ABT+ENTSR_FU);
1288 1281
1289#ifdef VERBOSE_ERROR_DUMP 1282#ifdef VERBOSE_ERROR_DUMP
1290 printk(KERN_DEBUG "%s: transmitter error (%#2x): ", dev->name, txsr); 1283 netdev_printk(KERN_DEBUG, dev,
1284 "transmitter error (%#2x):", txsr);
1291 if (txsr & ENTSR_ABT) 1285 if (txsr & ENTSR_ABT)
1292 printk("excess-collisions "); 1286 pr_cont(" excess-collisions");
1293 if (txsr & ENTSR_ND) 1287 if (txsr & ENTSR_ND)
1294 printk("non-deferral "); 1288 pr_cont(" non-deferral");
1295 if (txsr & ENTSR_CRS) 1289 if (txsr & ENTSR_CRS)
1296 printk("lost-carrier "); 1290 pr_cont(" lost-carrier");
1297 if (txsr & ENTSR_FU) 1291 if (txsr & ENTSR_FU)
1298 printk("FIFO-underrun "); 1292 pr_cont(" FIFO-underrun");
1299 if (txsr & ENTSR_CDH) 1293 if (txsr & ENTSR_CDH)
1300 printk("lost-heartbeat "); 1294 pr_cont(" lost-heartbeat");
1301 printk("\n"); 1295 pr_cont("\n");
1302#endif 1296#endif
1303 1297
1304 if (tx_was_aborted) 1298 if (tx_was_aborted)
@@ -1335,8 +1329,9 @@ static void ei_tx_intr(struct net_device *dev)
1335 if (ei_local->tx1 < 0) 1329 if (ei_local->tx1 < 0)
1336 { 1330 {
1337 if (ei_local->lasttx != 1 && ei_local->lasttx != -1) 1331 if (ei_local->lasttx != 1 && ei_local->lasttx != -1)
1338 printk(KERN_ERR "%s: bogus last_tx_buffer %d, tx1=%d.\n", 1332 netdev_err(dev, "%s: bogus last_tx_buffer %d, tx1=%d\n",
1339 ei_local->name, ei_local->lasttx, ei_local->tx1); 1333 ei_local->name, ei_local->lasttx,
1334 ei_local->tx1);
1340 ei_local->tx1 = 0; 1335 ei_local->tx1 = 0;
1341 if (ei_local->tx2 > 0) 1336 if (ei_local->tx2 > 0)
1342 { 1337 {
@@ -1351,8 +1346,9 @@ static void ei_tx_intr(struct net_device *dev)
1351 else if (ei_local->tx2 < 0) 1346 else if (ei_local->tx2 < 0)
1352 { 1347 {
1353 if (ei_local->lasttx != 2 && ei_local->lasttx != -2) 1348 if (ei_local->lasttx != 2 && ei_local->lasttx != -2)
1354 printk("%s: bogus last_tx_buffer %d, tx2=%d.\n", 1349 netdev_info(dev, "%s: bogus last_tx_buffer %d, tx2=%d\n",
1355 ei_local->name, ei_local->lasttx, ei_local->tx2); 1350 ei_local->name, ei_local->lasttx,
1351 ei_local->tx2);
1356 ei_local->tx2 = 0; 1352 ei_local->tx2 = 0;
1357 if (ei_local->tx1 > 0) 1353 if (ei_local->tx1 > 0)
1358 { 1354 {
@@ -1365,8 +1361,9 @@ static void ei_tx_intr(struct net_device *dev)
1365 else 1361 else
1366 ei_local->lasttx = 10, ei_local->txing = 0; 1362 ei_local->lasttx = 10, ei_local->txing = 0;
1367 } 1363 }
1368// else printk(KERN_WARNING "%s: unexpected TX-done interrupt, lasttx=%d.\n", 1364// else
1369// dev->name, ei_local->lasttx); 1365// netdev_warn(dev, "unexpected TX-done interrupt, lasttx=%d\n",
1366// ei_local->lasttx);
1370 1367
1371 /* Minimize Tx latency: update the statistics after we restart TXing. */ 1368 /* Minimize Tx latency: update the statistics after we restart TXing. */
1372 if (status & ENTSR_COL) 1369 if (status & ENTSR_COL)
@@ -1429,8 +1426,8 @@ static void ei_receive(struct net_device *dev)
1429 is that some clones crash in roughly the same way. 1426 is that some clones crash in roughly the same way.
1430 */ 1427 */
1431 if (ei_debug > 0 && this_frame != ei_local->current_page && (this_frame!=0x0 || rxing_page!=0xFF)) 1428 if (ei_debug > 0 && this_frame != ei_local->current_page && (this_frame!=0x0 || rxing_page!=0xFF))
1432 printk(KERN_ERR "%s: mismatched read page pointers %2x vs %2x.\n", 1429 netdev_err(dev, "mismatched read page pointers %2x vs %2x\n",
1433 dev->name, this_frame, ei_local->current_page); 1430 this_frame, ei_local->current_page);
1434 1431
1435 if (this_frame == rxing_page) /* Read all the frames? */ 1432 if (this_frame == rxing_page) /* Read all the frames? */
1436 break; /* Done for now */ 1433 break; /* Done for now */
@@ -1446,9 +1443,10 @@ static void ei_receive(struct net_device *dev)
1446 if (pkt_len < 60 || pkt_len > 1518) 1443 if (pkt_len < 60 || pkt_len > 1518)
1447 { 1444 {
1448 if (ei_debug) 1445 if (ei_debug)
1449 printk(KERN_DEBUG "%s: bogus packet size: %d, status=%#2x nxpg=%#2x.\n", 1446 netdev_printk(KERN_DEBUG, dev,
1450 dev->name, rx_frame.count, rx_frame.status, 1447 "bogus packet size: %d, status=%#2x nxpg=%#2x\n",
1451 rx_frame.next); 1448 rx_frame.count, rx_frame.status,
1449 rx_frame.next);
1452 dev->stats.rx_errors++; 1450 dev->stats.rx_errors++;
1453 dev->stats.rx_length_errors++; 1451 dev->stats.rx_length_errors++;
1454 } 1452 }
@@ -1460,8 +1458,9 @@ static void ei_receive(struct net_device *dev)
1460 if (skb == NULL) 1458 if (skb == NULL)
1461 { 1459 {
1462 if (ei_debug > 1) 1460 if (ei_debug > 1)
1463 printk(KERN_DEBUG "%s: Couldn't allocate a sk_buff of size %d.\n", 1461 netdev_printk(KERN_DEBUG, dev,
1464 dev->name, pkt_len); 1462 "Couldn't allocate a sk_buff of size %d\n",
1463 pkt_len);
1465 dev->stats.rx_dropped++; 1464 dev->stats.rx_dropped++;
1466 break; 1465 break;
1467 } 1466 }
@@ -1481,9 +1480,10 @@ static void ei_receive(struct net_device *dev)
1481 else 1480 else
1482 { 1481 {
1483 if (ei_debug) 1482 if (ei_debug)
1484 printk(KERN_DEBUG "%s: bogus packet: status=%#2x nxpg=%#2x size=%d\n", 1483 netdev_printk(KERN_DEBUG, dev,
1485 dev->name, rx_frame.status, rx_frame.next, 1484 "bogus packet: status=%#2x nxpg=%#2x size=%d\n",
1486 rx_frame.count); 1485 rx_frame.status, rx_frame.next,
1486 rx_frame.count);
1487 dev->stats.rx_errors++; 1487 dev->stats.rx_errors++;
1488 /* NB: The NIC counts CRC, frame and missed errors. */ 1488 /* NB: The NIC counts CRC, frame and missed errors. */
1489 if (pkt_stat & ENRSR_FO) 1489 if (pkt_stat & ENRSR_FO)
@@ -1493,8 +1493,8 @@ static void ei_receive(struct net_device *dev)
1493 1493
1494 /* This _should_ never happen: it's here for avoiding bad clones. */ 1494 /* This _should_ never happen: it's here for avoiding bad clones. */
1495 if (next_frame >= ei_local->stop_page) { 1495 if (next_frame >= ei_local->stop_page) {
1496 printk("%s: next frame inconsistency, %#2x\n", dev->name, 1496 netdev_info(dev, "next frame inconsistency, %#2x\n",
1497 next_frame); 1497 next_frame);
1498 next_frame = ei_local->rx_start_page; 1498 next_frame = ei_local->rx_start_page;
1499 } 1499 }
1500 ei_local->current_page = next_frame; 1500 ei_local->current_page = next_frame;
@@ -1529,7 +1529,7 @@ static void ei_rx_overrun(struct net_device *dev)
1529 outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD); 1529 outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD);
1530 1530
1531 if (ei_debug > 1) 1531 if (ei_debug > 1)
1532 printk(KERN_DEBUG "%s: Receiver overrun.\n", dev->name); 1532 netdev_printk(KERN_DEBUG, dev, "Receiver overrun\n");
1533 dev->stats.rx_over_errors++; 1533 dev->stats.rx_over_errors++;
1534 1534
1535 /* 1535 /*
@@ -1726,7 +1726,7 @@ static void AX88190_init(struct net_device *dev, int startp)
1726 { 1726 {
1727 outb_p(dev->dev_addr[i], e8390_base + EN1_PHYS_SHIFT(i)); 1727 outb_p(dev->dev_addr[i], e8390_base + EN1_PHYS_SHIFT(i));
1728 if(inb_p(e8390_base + EN1_PHYS_SHIFT(i))!=dev->dev_addr[i]) 1728 if(inb_p(e8390_base + EN1_PHYS_SHIFT(i))!=dev->dev_addr[i])
1729 printk(KERN_ERR "Hw. address read/write mismap %d\n",i); 1729 netdev_err(dev, "Hw. address read/write mismap %d\n", i);
1730 } 1730 }
1731 1731
1732 outb_p(ei_local->rx_start_page, e8390_base + EN1_CURPAG); 1732 outb_p(ei_local->rx_start_page, e8390_base + EN1_CURPAG);
@@ -1763,8 +1763,7 @@ static void NS8390_trigger_send(struct net_device *dev, unsigned int length,
1763 1763
1764 if (inb_p(e8390_base) & E8390_TRANS) 1764 if (inb_p(e8390_base) & E8390_TRANS)
1765 { 1765 {
1766 printk(KERN_WARNING "%s: trigger_send() called with the transmitter busy.\n", 1766 netdev_warn(dev, "trigger_send() called with the transmitter busy\n");
1767 dev->name);
1768 return; 1767 return;
1769 } 1768 }
1770 outb_p(length & 0xff, e8390_base + EN0_TCNTLO); 1769 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 3c400cfa82a..f065c35cd4b 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -52,23 +52,23 @@
52 52
53#define VERSION "arcnet: COM20020 PCMCIA support loaded.\n" 53#define VERSION "arcnet: COM20020 PCMCIA support loaded.\n"
54 54
55#ifdef DEBUG
56 55
57static void regdump(struct net_device *dev) 56static void regdump(struct net_device *dev)
58{ 57{
58#ifdef DEBUG
59 int ioaddr = dev->base_addr; 59 int ioaddr = dev->base_addr;
60 int count; 60 int count;
61 61
62 printk("com20020 register dump:\n"); 62 netdev_dbg(dev, "register dump:\n");
63 for (count = ioaddr; count < ioaddr + 16; count++) 63 for (count = ioaddr; count < ioaddr + 16; count++)
64 { 64 {
65 if (!(count % 16)) 65 if (!(count % 16))
66 printk("\n%04X: ", count); 66 pr_cont("%04X:", count);
67 printk("%02X ", inb(count)); 67 pr_cont(" %02X", inb(count));
68 } 68 }
69 printk("\n"); 69 pr_cont("\n");
70 70
71 printk("buffer0 dump:\n"); 71 netdev_dbg(dev, "buffer0 dump:\n");
72 /* set up the address register */ 72 /* set up the address register */
73 count = 0; 73 count = 0;
74 outb((count >> 8) | RDDATAflag | AUTOINCflag, _ADDR_HI); 74 outb((count >> 8) | RDDATAflag | AUTOINCflag, _ADDR_HI);
@@ -77,19 +77,15 @@ static void regdump(struct net_device *dev)
77 for (count = 0; count < 256+32; count++) 77 for (count = 0; count < 256+32; count++)
78 { 78 {
79 if (!(count % 16)) 79 if (!(count % 16))
80 printk("\n%04X: ", count); 80 pr_cont("%04X:", count);
81 81
82 /* copy the data */ 82 /* copy the data */
83 printk("%02X ", inb(_MEMDATA)); 83 pr_cont(" %02X", inb(_MEMDATA));
84 } 84 }
85 printk("\n"); 85 pr_cont("\n");
86#endif
86} 87}
87 88
88#else
89
90static inline void regdump(struct net_device *dev) { }
91
92#endif
93 89
94 90
95/*====================================================================*/ 91/*====================================================================*/
@@ -301,13 +297,13 @@ static int com20020_config(struct pcmcia_device *link)
301 i = com20020_found(dev, 0); /* calls register_netdev */ 297 i = com20020_found(dev, 0); /* calls register_netdev */
302 298
303 if (i != 0) { 299 if (i != 0) {
304 dev_printk(KERN_NOTICE, &link->dev, 300 dev_notice(&link->dev,
305 "com20020_cs: com20020_found() failed\n"); 301 "com20020_found() failed\n");
306 goto failed; 302 goto failed;
307 } 303 }
308 304
309 dev_dbg(&link->dev,KERN_INFO "%s: port %#3lx, irq %d\n", 305 netdev_dbg(dev, "port %#3lx, irq %d\n",
310 dev->name, dev->base_addr, dev->irq); 306 dev->base_addr, dev->irq);
311 return 0; 307 return 0;
312 308
313failed: 309failed:
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 98fffb03ecd..8f26d548d1b 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
@@ -291,7 +293,7 @@ static int mfc_try_io_port(struct pcmcia_device *link)
291 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; 293 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
292 if (link->resource[1]->start == 0) { 294 if (link->resource[1]->start == 0) {
293 link->resource[1]->end = 0; 295 link->resource[1]->end = 0;
294 printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n"); 296 pr_notice("out of resource for serial\n");
295 } 297 }
296 ret = pcmcia_request_io(link); 298 ret = pcmcia_request_io(link);
297 if (ret == 0) 299 if (ret == 0)
@@ -503,7 +505,7 @@ static int fmvj18x_config(struct pcmcia_device *link)
503 case XXX10304: 505 case XXX10304:
504 /* Read MACID from Buggy CIS */ 506 /* Read MACID from Buggy CIS */
505 if (fmvj18x_get_hwinfo(link, buggybuf) == -1) { 507 if (fmvj18x_get_hwinfo(link, buggybuf) == -1) {
506 printk(KERN_NOTICE "fmvj18x_cs: unable to read hardware net address.\n"); 508 pr_notice("unable to read hardware net address\n");
507 goto failed; 509 goto failed;
508 } 510 }
509 for (i = 0 ; i < 6; i++) { 511 for (i = 0 ; i < 6; i++) {
@@ -524,15 +526,14 @@ static int fmvj18x_config(struct pcmcia_device *link)
524 SET_NETDEV_DEV(dev, &link->dev); 526 SET_NETDEV_DEV(dev, &link->dev);
525 527
526 if (register_netdev(dev) != 0) { 528 if (register_netdev(dev) != 0) {
527 printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n"); 529 pr_notice("register_netdev() failed\n");
528 goto failed; 530 goto failed;
529 } 531 }
530 532
531 /* print current configuration */ 533 /* print current configuration */
532 printk(KERN_INFO "%s: %s, sram %s, port %#3lx, irq %d, " 534 netdev_info(dev, "%s, sram %s, port %#3lx, irq %d, hw_addr %pM\n",
533 "hw_addr %pM\n", 535 card_name, sram_config == 0 ? "4K TX*2" : "8K TX*2",
534 dev->name, card_name, sram_config == 0 ? "4K TX*2" : "8K TX*2", 536 dev->base_addr, dev->irq, dev->dev_addr);
535 dev->base_addr, dev->irq, dev->dev_addr);
536 537
537 return 0; 538 return 0;
538 539
@@ -606,7 +607,7 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link)
606 607
607 lp->base = ioremap(req.Base, req.Size); 608 lp->base = ioremap(req.Base, req.Size);
608 if (lp->base == NULL) { 609 if (lp->base == NULL) {
609 printk(KERN_NOTICE "fmvj18x_cs: ioremap failed\n"); 610 netdev_notice(dev, "ioremap failed\n");
610 return -1; 611 return -1;
611 } 612 }
612 613
@@ -800,17 +801,16 @@ static void fjn_tx_timeout(struct net_device *dev)
800 struct local_info_t *lp = netdev_priv(dev); 801 struct local_info_t *lp = netdev_priv(dev);
801 unsigned int ioaddr = dev->base_addr; 802 unsigned int ioaddr = dev->base_addr;
802 803
803 printk(KERN_NOTICE "%s: transmit timed out with status %04x, %s?\n", 804 netdev_notice(dev, "transmit timed out with status %04x, %s?\n",
804 dev->name, htons(inw(ioaddr + TX_STATUS)), 805 htons(inw(ioaddr + TX_STATUS)),
805 inb(ioaddr + TX_STATUS) & F_TMT_RDY 806 inb(ioaddr + TX_STATUS) & F_TMT_RDY
806 ? "IRQ conflict" : "network cable problem"); 807 ? "IRQ conflict" : "network cable problem");
807 printk(KERN_NOTICE "%s: timeout registers: %04x %04x %04x " 808 netdev_notice(dev, "timeout registers: %04x %04x %04x "
808 "%04x %04x %04x %04x %04x.\n", 809 "%04x %04x %04x %04x %04x.\n",
809 dev->name, htons(inw(ioaddr + 0)), 810 htons(inw(ioaddr + 0)), htons(inw(ioaddr + 2)),
810 htons(inw(ioaddr + 2)), htons(inw(ioaddr + 4)), 811 htons(inw(ioaddr + 4)), htons(inw(ioaddr + 6)),
811 htons(inw(ioaddr + 6)), htons(inw(ioaddr + 8)), 812 htons(inw(ioaddr + 8)), htons(inw(ioaddr + 10)),
812 htons(inw(ioaddr +10)), htons(inw(ioaddr +12)), 813 htons(inw(ioaddr + 12)), htons(inw(ioaddr + 14)));
813 htons(inw(ioaddr +14)));
814 dev->stats.tx_errors++; 814 dev->stats.tx_errors++;
815 /* ToDo: We should try to restart the adaptor... */ 815 /* ToDo: We should try to restart the adaptor... */
816 local_irq_disable(); 816 local_irq_disable();
@@ -845,13 +845,13 @@ static netdev_tx_t fjn_start_xmit(struct sk_buff *skb,
845 unsigned char *buf = skb->data; 845 unsigned char *buf = skb->data;
846 846
847 if (length > ETH_FRAME_LEN) { 847 if (length > ETH_FRAME_LEN) {
848 printk(KERN_NOTICE "%s: Attempting to send a large packet" 848 netdev_notice(dev, "Attempting to send a large packet (%d bytes)\n",
849 " (%d bytes).\n", dev->name, length); 849 length);
850 return NETDEV_TX_BUSY; 850 return NETDEV_TX_BUSY;
851 } 851 }
852 852
853 pr_debug("%s: Transmitting a packet of length %lu.\n", 853 netdev_dbg(dev, "Transmitting a packet of length %lu\n",
854 dev->name, (unsigned long)skb->len); 854 (unsigned long)skb->len);
855 dev->stats.tx_bytes += skb->len; 855 dev->stats.tx_bytes += skb->len;
856 856
857 /* Disable both interrupts. */ 857 /* Disable both interrupts. */
@@ -904,7 +904,7 @@ static void fjn_reset(struct net_device *dev)
904 unsigned int ioaddr = dev->base_addr; 904 unsigned int ioaddr = dev->base_addr;
905 int i; 905 int i;
906 906
907 pr_debug("fjn_reset(%s) called.\n",dev->name); 907 netdev_dbg(dev, "fjn_reset() called\n");
908 908
909 /* Reset controller */ 909 /* Reset controller */
910 if( sram_config == 0 ) 910 if( sram_config == 0 )
@@ -988,8 +988,8 @@ static void fjn_rx(struct net_device *dev)
988 while ((inb(ioaddr + RX_MODE) & F_BUF_EMP) == 0) { 988 while ((inb(ioaddr + RX_MODE) & F_BUF_EMP) == 0) {
989 u_short status = inw(ioaddr + DATAPORT); 989 u_short status = inw(ioaddr + DATAPORT);
990 990
991 pr_debug("%s: Rxing packet mode %02x status %04x.\n", 991 netdev_dbg(dev, "Rxing packet mode %02x status %04x.\n",
992 dev->name, inb(ioaddr + RX_MODE), status); 992 inb(ioaddr + RX_MODE), status);
993#ifndef final_version 993#ifndef final_version
994 if (status == 0) { 994 if (status == 0) {
995 outb(F_SKP_PKT, ioaddr + RX_SKIP); 995 outb(F_SKP_PKT, ioaddr + RX_SKIP);
@@ -1008,16 +1008,16 @@ static void fjn_rx(struct net_device *dev)
1008 struct sk_buff *skb; 1008 struct sk_buff *skb;
1009 1009
1010 if (pkt_len > 1550) { 1010 if (pkt_len > 1550) {
1011 printk(KERN_NOTICE "%s: The FMV-18x claimed a very " 1011 netdev_notice(dev, "The FMV-18x claimed a very large packet, size %d\n",
1012 "large packet, size %d.\n", dev->name, pkt_len); 1012 pkt_len);
1013 outb(F_SKP_PKT, ioaddr + RX_SKIP); 1013 outb(F_SKP_PKT, ioaddr + RX_SKIP);
1014 dev->stats.rx_errors++; 1014 dev->stats.rx_errors++;
1015 break; 1015 break;
1016 } 1016 }
1017 skb = dev_alloc_skb(pkt_len+2); 1017 skb = dev_alloc_skb(pkt_len+2);
1018 if (skb == NULL) { 1018 if (skb == NULL) {
1019 printk(KERN_NOTICE "%s: Memory squeeze, dropping " 1019 netdev_notice(dev, "Memory squeeze, dropping packet (len %d)\n",
1020 "packet (len %d).\n", dev->name, pkt_len); 1020 pkt_len);
1021 outb(F_SKP_PKT, ioaddr + RX_SKIP); 1021 outb(F_SKP_PKT, ioaddr + RX_SKIP);
1022 dev->stats.rx_dropped++; 1022 dev->stats.rx_dropped++;
1023 break; 1023 break;
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index b0d06a3d962..dc85282193b 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>
@@ -107,16 +108,6 @@ typedef struct ibmtr_dev_t {
107 struct tok_info *ti; 108 struct tok_info *ti;
108} ibmtr_dev_t; 109} ibmtr_dev_t;
109 110
110static void netdev_get_drvinfo(struct net_device *dev,
111 struct ethtool_drvinfo *info)
112{
113 strcpy(info->driver, "ibmtr_cs");
114}
115
116static const struct ethtool_ops netdev_ethtool_ops = {
117 .get_drvinfo = netdev_get_drvinfo,
118};
119
120static irqreturn_t ibmtr_interrupt(int irq, void *dev_id) { 111static irqreturn_t ibmtr_interrupt(int irq, void *dev_id) {
121 ibmtr_dev_t *info = dev_id; 112 ibmtr_dev_t *info = dev_id;
122 struct net_device *dev = info->dev; 113 struct net_device *dev = info->dev;
@@ -159,8 +150,6 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link)
159 150
160 info->dev = dev; 151 info->dev = dev;
161 152
162 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
163
164 return ibmtr_config(link); 153 return ibmtr_config(link);
165} /* ibmtr_attach */ 154} /* ibmtr_attach */
166 155
@@ -285,15 +274,14 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
285 274
286 i = ibmtr_probe_card(dev); 275 i = ibmtr_probe_card(dev);
287 if (i != 0) { 276 if (i != 0) {
288 printk(KERN_NOTICE "ibmtr_cs: register_netdev() failed\n"); 277 pr_notice("register_netdev() failed\n");
289 goto failed; 278 goto failed;
290 } 279 }
291 280
292 printk(KERN_INFO 281 netdev_info(dev, "port %#3lx, irq %d, mmio %#5lx, sram %#5lx, hwaddr=%pM\n",
293 "%s: port %#3lx, irq %d, mmio %#5lx, sram %#5lx, hwaddr=%pM\n", 282 dev->base_addr, dev->irq,
294 dev->name, dev->base_addr, dev->irq, 283 (u_long)ti->mmio, (u_long)(ti->sram_base << 12),
295 (u_long)ti->mmio, (u_long)(ti->sram_base << 12), 284 dev->dev_addr);
296 dev->dev_addr);
297 return 0; 285 return 0;
298 286
299failed: 287failed:
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index 68f2deeb3ad..c1d8ce9e4a6 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -111,6 +111,8 @@ Log: nmclan_cs.c,v
111 111
112---------------------------------------------------------------------------- */ 112---------------------------------------------------------------------------- */
113 113
114#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
115
114#define DRV_NAME "nmclan_cs" 116#define DRV_NAME "nmclan_cs"
115#define DRV_VERSION "0.16" 117#define DRV_VERSION "0.16"
116 118
@@ -519,7 +521,7 @@ static int mace_read(mace_private *lp, unsigned int ioaddr, int reg)
519 spin_unlock_irqrestore(&lp->bank_lock, flags); 521 spin_unlock_irqrestore(&lp->bank_lock, flags);
520 break; 522 break;
521 } 523 }
522 return (data & 0xFF); 524 return data & 0xFF;
523} /* mace_read */ 525} /* mace_read */
524 526
525/* ---------------------------------------------------------------------------- 527/* ----------------------------------------------------------------------------
@@ -563,7 +565,7 @@ static int mace_init(mace_private *lp, unsigned int ioaddr, char *enet_addr)
563 /* Wait for reset bit to be cleared automatically after <= 200ns */; 565 /* Wait for reset bit to be cleared automatically after <= 200ns */;
564 if(++ct > 500) 566 if(++ct > 500)
565 { 567 {
566 printk(KERN_ERR "mace: reset failed, card removed ?\n"); 568 pr_err("reset failed, card removed?\n");
567 return -1; 569 return -1;
568 } 570 }
569 udelay(1); 571 udelay(1);
@@ -610,7 +612,7 @@ static int mace_init(mace_private *lp, unsigned int ioaddr, char *enet_addr)
610 { 612 {
611 if(++ ct > 500) 613 if(++ ct > 500)
612 { 614 {
613 printk(KERN_ERR "mace: ADDRCHG timeout, card removed ?\n"); 615 pr_err("ADDRCHG timeout, card removed?\n");
614 return -1; 616 return -1;
615 } 617 }
616 } 618 }
@@ -678,8 +680,8 @@ static int nmclan_config(struct pcmcia_device *link)
678 dev_dbg(&link->dev, "nmclan_cs configured: mace id=%x %x\n", 680 dev_dbg(&link->dev, "nmclan_cs configured: mace id=%x %x\n",
679 sig[0], sig[1]); 681 sig[0], sig[1]);
680 } else { 682 } else {
681 printk(KERN_NOTICE "nmclan_cs: mace id not found: %x %x should" 683 pr_notice("mace id not found: %x %x should be 0x40 0x?9\n",
682 " be 0x40 0x?9\n", sig[0], sig[1]); 684 sig[0], sig[1]);
683 return -ENODEV; 685 return -ENODEV;
684 } 686 }
685 } 687 }
@@ -691,20 +693,18 @@ static int nmclan_config(struct pcmcia_device *link)
691 if (if_port <= 2) 693 if (if_port <= 2)
692 dev->if_port = if_port; 694 dev->if_port = if_port;
693 else 695 else
694 printk(KERN_NOTICE "nmclan_cs: invalid if_port requested\n"); 696 pr_notice("invalid if_port requested\n");
695 697
696 SET_NETDEV_DEV(dev, &link->dev); 698 SET_NETDEV_DEV(dev, &link->dev);
697 699
698 i = register_netdev(dev); 700 i = register_netdev(dev);
699 if (i != 0) { 701 if (i != 0) {
700 printk(KERN_NOTICE "nmclan_cs: register_netdev() failed\n"); 702 pr_notice("register_netdev() failed\n");
701 goto failed; 703 goto failed;
702 } 704 }
703 705
704 printk(KERN_INFO "%s: nmclan: port %#3lx, irq %d, %s port," 706 netdev_info(dev, "nmclan: port %#3lx, irq %d, %s port, hw_addr %pM\n",
705 " hw_addr %pM\n", 707 dev->base_addr, dev->irq, if_names[dev->if_port], dev->dev_addr);
706 dev->name, dev->base_addr, dev->irq, if_names[dev->if_port],
707 dev->dev_addr);
708 return 0; 708 return 0;
709 709
710failed: 710failed:
@@ -798,8 +798,7 @@ static int mace_config(struct net_device *dev, struct ifmap *map)
798 if ((map->port != (u_char)(-1)) && (map->port != dev->if_port)) { 798 if ((map->port != (u_char)(-1)) && (map->port != dev->if_port)) {
799 if (map->port <= 2) { 799 if (map->port <= 2) {
800 dev->if_port = map->port; 800 dev->if_port = map->port;
801 printk(KERN_INFO "%s: switched to %s port\n", dev->name, 801 netdev_info(dev, "switched to %s port\n", if_names[dev->if_port]);
802 if_names[dev->if_port]);
803 } else 802 } else
804 return -EINVAL; 803 return -EINVAL;
805 } 804 }
@@ -878,12 +877,12 @@ static void mace_tx_timeout(struct net_device *dev)
878 mace_private *lp = netdev_priv(dev); 877 mace_private *lp = netdev_priv(dev);
879 struct pcmcia_device *link = lp->p_dev; 878 struct pcmcia_device *link = lp->p_dev;
880 879
881 printk(KERN_NOTICE "%s: transmit timed out -- ", dev->name); 880 netdev_notice(dev, "transmit timed out -- ");
882#if RESET_ON_TIMEOUT 881#if RESET_ON_TIMEOUT
883 printk("resetting card\n"); 882 pr_cont("resetting card\n");
884 pcmcia_reset_card(link->socket); 883 pcmcia_reset_card(link->socket);
885#else /* #if RESET_ON_TIMEOUT */ 884#else /* #if RESET_ON_TIMEOUT */
886 printk("NOT resetting card\n"); 885 pr_cont("NOT resetting card\n");
887#endif /* #if RESET_ON_TIMEOUT */ 886#endif /* #if RESET_ON_TIMEOUT */
888 dev->trans_start = jiffies; /* prevent tx timeout */ 887 dev->trans_start = jiffies; /* prevent tx timeout */
889 netif_wake_queue(dev); 888 netif_wake_queue(dev);
@@ -965,22 +964,21 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id)
965 ioaddr = dev->base_addr; 964 ioaddr = dev->base_addr;
966 965
967 if (lp->tx_irq_disabled) { 966 if (lp->tx_irq_disabled) {
968 printk( 967 const char *msg;
969 (lp->tx_irq_disabled? 968 if (lp->tx_irq_disabled)
970 KERN_NOTICE "%s: Interrupt with tx_irq_disabled " 969 msg = "Interrupt with tx_irq_disabled";
971 "[isr=%02X, imr=%02X]\n": 970 else
972 KERN_NOTICE "%s: Re-entering the interrupt handler " 971 msg = "Re-entering the interrupt handler";
973 "[isr=%02X, imr=%02X]\n"), 972 netdev_notice(dev, "%s [isr=%02X, imr=%02X]\n",
974 dev->name, 973 msg,
975 inb(ioaddr + AM2150_MACE_BASE + MACE_IR), 974 inb(ioaddr + AM2150_MACE_BASE + MACE_IR),
976 inb(ioaddr + AM2150_MACE_BASE + MACE_IMR) 975 inb(ioaddr + AM2150_MACE_BASE + MACE_IMR));
977 );
978 /* WARNING: MACE_IR has been read! */ 976 /* WARNING: MACE_IR has been read! */
979 return IRQ_NONE; 977 return IRQ_NONE;
980 } 978 }
981 979
982 if (!netif_device_present(dev)) { 980 if (!netif_device_present(dev)) {
983 pr_debug("%s: interrupt from dead card\n", dev->name); 981 netdev_dbg(dev, "interrupt from dead card\n");
984 return IRQ_NONE; 982 return IRQ_NONE;
985 } 983 }
986 984
@@ -1378,8 +1376,8 @@ static void BuildLAF(int *ladrf, int *adr)
1378 printk(KERN_DEBUG " adr =%pM\n", adr); 1376 printk(KERN_DEBUG " adr =%pM\n", adr);
1379 printk(KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63] =", hashcode); 1377 printk(KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63] =", hashcode);
1380 for (i = 0; i < 8; i++) 1378 for (i = 0; i < 8; i++)
1381 printk(KERN_CONT " %02X", ladrf[i]); 1379 pr_cont(" %02X", ladrf[i]);
1382 printk(KERN_CONT "\n"); 1380 pr_cont("\n");
1383#endif 1381#endif
1384} /* BuildLAF */ 1382} /* BuildLAF */
1385 1383
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index f9b509a6b09..c94311aed1a 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>
@@ -100,7 +101,6 @@ static void pcnet_release(struct pcmcia_device *link);
100static int pcnet_open(struct net_device *dev); 101static int pcnet_open(struct net_device *dev);
101static int pcnet_close(struct net_device *dev); 102static int pcnet_close(struct net_device *dev);
102static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 103static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
103static const struct ethtool_ops netdev_ethtool_ops;
104static irqreturn_t ei_irq_wrapper(int irq, void *dev_id); 104static irqreturn_t ei_irq_wrapper(int irq, void *dev_id);
105static void ei_watchdog(u_long arg); 105static void ei_watchdog(u_long arg);
106static void pcnet_reset_8390(struct net_device *dev); 106static void pcnet_reset_8390(struct net_device *dev);
@@ -434,8 +434,6 @@ static hw_info_t *get_ax88190(struct pcmcia_device *link)
434 dev->dev_addr[i] = j & 0xff; 434 dev->dev_addr[i] = j & 0xff;
435 dev->dev_addr[i+1] = j >> 8; 435 dev->dev_addr[i+1] = j >> 8;
436 } 436 }
437 printk(KERN_NOTICE "pcnet_cs: this is an AX88190 card!\n");
438 printk(KERN_NOTICE "pcnet_cs: use axnet_cs instead.\n");
439 return NULL; 437 return NULL;
440} 438}
441 439
@@ -653,9 +651,7 @@ static int pcnet_config(struct pcmcia_device *link)
653 651
654 ei_status.name = "NE2000"; 652 ei_status.name = "NE2000";
655 ei_status.word16 = 1; 653 ei_status.word16 = 1;
656 ei_status.reset_8390 = &pcnet_reset_8390; 654 ei_status.reset_8390 = pcnet_reset_8390;
657
658 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
659 655
660 if (info->flags & (IS_DL10019|IS_DL10022)) 656 if (info->flags & (IS_DL10019|IS_DL10022))
661 mii_phy_probe(dev); 657 mii_phy_probe(dev);
@@ -663,25 +659,25 @@ static int pcnet_config(struct pcmcia_device *link)
663 SET_NETDEV_DEV(dev, &link->dev); 659 SET_NETDEV_DEV(dev, &link->dev);
664 660
665 if (register_netdev(dev) != 0) { 661 if (register_netdev(dev) != 0) {
666 printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n"); 662 pr_notice("register_netdev() failed\n");
667 goto failed; 663 goto failed;
668 } 664 }
669 665
670 if (info->flags & (IS_DL10019|IS_DL10022)) { 666 if (info->flags & (IS_DL10019|IS_DL10022)) {
671 u_char id = inb(dev->base_addr + 0x1a); 667 u_char id = inb(dev->base_addr + 0x1a);
672 printk(KERN_INFO "%s: NE2000 (DL100%d rev %02x): ", 668 netdev_info(dev, "NE2000 (DL100%d rev %02x): ",
673 dev->name, ((info->flags & IS_DL10022) ? 22 : 19), id); 669 (info->flags & IS_DL10022) ? 22 : 19, id);
674 if (info->pna_phy) 670 if (info->pna_phy)
675 printk("PNA, "); 671 pr_cont("PNA, ");
676 } else { 672 } else {
677 printk(KERN_INFO "%s: NE2000 Compatible: ", dev->name); 673 netdev_info(dev, "NE2000 Compatible: ");
678 } 674 }
679 printk("io %#3lx, irq %d,", dev->base_addr, dev->irq); 675 pr_cont("io %#3lx, irq %d,", dev->base_addr, dev->irq);
680 if (info->flags & USE_SHMEM) 676 if (info->flags & USE_SHMEM)
681 printk (" mem %#5lx,", dev->mem_start); 677 pr_cont(" mem %#5lx,", dev->mem_start);
682 if (info->flags & HAS_MISC_REG) 678 if (info->flags & HAS_MISC_REG)
683 printk(" %s xcvr,", if_names[dev->if_port]); 679 pr_cont(" %s xcvr,", if_names[dev->if_port]);
684 printk(" hw_addr %pM\n", dev->dev_addr); 680 pr_cont(" hw_addr %pM\n", dev->dev_addr);
685 return 0; 681 return 0;
686 682
687failed: 683failed:
@@ -955,7 +951,7 @@ static void mii_phy_probe(struct net_device *dev)
955 phyid = tmp << 16; 951 phyid = tmp << 16;
956 phyid |= mdio_read(mii_addr, i, MII_PHYID_REG2); 952 phyid |= mdio_read(mii_addr, i, MII_PHYID_REG2);
957 phyid &= MII_PHYID_REV_MASK; 953 phyid &= MII_PHYID_REV_MASK;
958 pr_debug("%s: MII at %d is 0x%08x\n", dev->name, i, phyid); 954 netdev_dbg(dev, "MII at %d is 0x%08x\n", i, phyid);
959 if (phyid == AM79C9XX_HOME_PHY) { 955 if (phyid == AM79C9XX_HOME_PHY) {
960 info->pna_phy = i; 956 info->pna_phy = i;
961 } else if (phyid != AM79C9XX_ETH_PHY) { 957 } else if (phyid != AM79C9XX_ETH_PHY) {
@@ -988,7 +984,7 @@ static int pcnet_open(struct net_device *dev)
988 info->phy_id = info->eth_phy; 984 info->phy_id = info->eth_phy;
989 info->link_status = 0x00; 985 info->link_status = 0x00;
990 init_timer(&info->watchdog); 986 init_timer(&info->watchdog);
991 info->watchdog.function = &ei_watchdog; 987 info->watchdog.function = ei_watchdog;
992 info->watchdog.data = (u_long)dev; 988 info->watchdog.data = (u_long)dev;
993 info->watchdog.expires = jiffies + HZ; 989 info->watchdog.expires = jiffies + HZ;
994 add_timer(&info->watchdog); 990 add_timer(&info->watchdog);
@@ -1041,8 +1037,8 @@ static void pcnet_reset_8390(struct net_device *dev)
1041 outb_p(ENISR_RESET, nic_base + EN0_ISR); /* Ack intr. */ 1037 outb_p(ENISR_RESET, nic_base + EN0_ISR); /* Ack intr. */
1042 1038
1043 if (i == 100) 1039 if (i == 100)
1044 printk(KERN_ERR "%s: pcnet_reset_8390() did not complete.\n", 1040 netdev_err(dev, "pcnet_reset_8390() did not complete.\n");
1045 dev->name); 1041
1046 set_misc_reg(dev); 1042 set_misc_reg(dev);
1047 1043
1048} /* pcnet_reset_8390 */ 1044} /* pcnet_reset_8390 */
@@ -1058,8 +1054,7 @@ static int set_config(struct net_device *dev, struct ifmap *map)
1058 else if ((map->port < 1) || (map->port > 2)) 1054 else if ((map->port < 1) || (map->port > 2))
1059 return -EINVAL; 1055 return -EINVAL;
1060 dev->if_port = map->port; 1056 dev->if_port = map->port;
1061 printk(KERN_INFO "%s: switched to %s port\n", 1057 netdev_info(dev, "switched to %s port\n", if_names[dev->if_port]);
1062 dev->name, if_names[dev->if_port]);
1063 NS8390_init(dev, 1); 1058 NS8390_init(dev, 1);
1064 } 1059 }
1065 return 0; 1060 return 0;
@@ -1094,7 +1089,7 @@ static void ei_watchdog(u_long arg)
1094 this, we can limp along even if the interrupt is blocked */ 1089 this, we can limp along even if the interrupt is blocked */
1095 if (info->stale++ && (inb_p(nic_base + EN0_ISR) & ENISR_ALL)) { 1090 if (info->stale++ && (inb_p(nic_base + EN0_ISR) & ENISR_ALL)) {
1096 if (!info->fast_poll) 1091 if (!info->fast_poll)
1097 printk(KERN_INFO "%s: interrupt(s) dropped!\n", dev->name); 1092 netdev_info(dev, "interrupt(s) dropped!\n");
1098 ei_irq_wrapper(dev->irq, dev); 1093 ei_irq_wrapper(dev->irq, dev);
1099 info->fast_poll = HZ; 1094 info->fast_poll = HZ;
1100 } 1095 }
@@ -1114,7 +1109,7 @@ static void ei_watchdog(u_long arg)
1114 if (info->eth_phy) { 1109 if (info->eth_phy) {
1115 info->phy_id = info->eth_phy = 0; 1110 info->phy_id = info->eth_phy = 0;
1116 } else { 1111 } else {
1117 printk(KERN_INFO "%s: MII is missing!\n", dev->name); 1112 netdev_info(dev, "MII is missing!\n");
1118 info->flags &= ~HAS_MII; 1113 info->flags &= ~HAS_MII;
1119 } 1114 }
1120 goto reschedule; 1115 goto reschedule;
@@ -1123,8 +1118,7 @@ static void ei_watchdog(u_long arg)
1123 link &= 0x0004; 1118 link &= 0x0004;
1124 if (link != info->link_status) { 1119 if (link != info->link_status) {
1125 u_short p = mdio_read(mii_addr, info->phy_id, 5); 1120 u_short p = mdio_read(mii_addr, info->phy_id, 5);
1126 printk(KERN_INFO "%s: %s link beat\n", dev->name, 1121 netdev_info(dev, "%s link beat\n", link ? "found" : "lost");
1127 (link) ? "found" : "lost");
1128 if (link && (info->flags & IS_DL10022)) { 1122 if (link && (info->flags & IS_DL10022)) {
1129 /* Disable collision detection on full duplex links */ 1123 /* Disable collision detection on full duplex links */
1130 outb((p & 0x0140) ? 4 : 0, nic_base + DLINK_DIAG); 1124 outb((p & 0x0140) ? 4 : 0, nic_base + DLINK_DIAG);
@@ -1135,13 +1129,12 @@ static void ei_watchdog(u_long arg)
1135 if (link) { 1129 if (link) {
1136 if (info->phy_id == info->eth_phy) { 1130 if (info->phy_id == info->eth_phy) {
1137 if (p) 1131 if (p)
1138 printk(KERN_INFO "%s: autonegotiation complete: " 1132 netdev_info(dev, "autonegotiation complete: "
1139 "%sbaseT-%cD selected\n", dev->name, 1133 "%sbaseT-%cD selected\n",
1140 ((p & 0x0180) ? "100" : "10"), 1134 ((p & 0x0180) ? "100" : "10"),
1141 ((p & 0x0140) ? 'F' : 'H')); 1135 ((p & 0x0140) ? 'F' : 'H'));
1142 else 1136 else
1143 printk(KERN_INFO "%s: link partner did not " 1137 netdev_info(dev, "link partner did not autonegotiate\n");
1144 "autonegotiate\n", dev->name);
1145 } 1138 }
1146 NS8390_init(dev, 1); 1139 NS8390_init(dev, 1);
1147 } 1140 }
@@ -1154,7 +1147,7 @@ static void ei_watchdog(u_long arg)
1154 /* isolate this MII and try flipping to the other one */ 1147 /* isolate this MII and try flipping to the other one */
1155 mdio_write(mii_addr, info->phy_id, 0, 0x0400); 1148 mdio_write(mii_addr, info->phy_id, 0, 0x0400);
1156 info->phy_id ^= info->pna_phy ^ info->eth_phy; 1149 info->phy_id ^= info->pna_phy ^ info->eth_phy;
1157 printk(KERN_INFO "%s: switched to %s transceiver\n", dev->name, 1150 netdev_info(dev, "switched to %s transceiver\n",
1158 (info->phy_id == info->eth_phy) ? "ethernet" : "PNA"); 1151 (info->phy_id == info->eth_phy) ? "ethernet" : "PNA");
1159 mdio_write(mii_addr, info->phy_id, 0, 1152 mdio_write(mii_addr, info->phy_id, 0,
1160 (info->phy_id == info->eth_phy) ? 0x1000 : 0); 1153 (info->phy_id == info->eth_phy) ? 0x1000 : 0);
@@ -1170,18 +1163,6 @@ reschedule:
1170 1163
1171/*====================================================================*/ 1164/*====================================================================*/
1172 1165
1173static void netdev_get_drvinfo(struct net_device *dev,
1174 struct ethtool_drvinfo *info)
1175{
1176 strcpy(info->driver, "pcnet_cs");
1177}
1178
1179static const struct ethtool_ops netdev_ethtool_ops = {
1180 .get_drvinfo = netdev_get_drvinfo,
1181};
1182
1183/*====================================================================*/
1184
1185 1166
1186static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 1167static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1187{ 1168{
@@ -1214,9 +1195,9 @@ static void dma_get_8390_hdr(struct net_device *dev,
1214 unsigned int nic_base = dev->base_addr; 1195 unsigned int nic_base = dev->base_addr;
1215 1196
1216 if (ei_status.dmaing) { 1197 if (ei_status.dmaing) {
1217 printk(KERN_NOTICE "%s: DMAing conflict in dma_block_input." 1198 netdev_notice(dev, "DMAing conflict in dma_block_input."
1218 "[DMAstat:%1x][irqlock:%1x]\n", 1199 "[DMAstat:%1x][irqlock:%1x]\n",
1219 dev->name, ei_status.dmaing, ei_status.irqlock); 1200 ei_status.dmaing, ei_status.irqlock);
1220 return; 1201 return;
1221 } 1202 }
1222 1203
@@ -1247,11 +1228,11 @@ static void dma_block_input(struct net_device *dev, int count,
1247 char *buf = skb->data; 1228 char *buf = skb->data;
1248 1229
1249 if ((ei_debug > 4) && (count != 4)) 1230 if ((ei_debug > 4) && (count != 4))
1250 pr_debug("%s: [bi=%d]\n", dev->name, count+4); 1231 netdev_dbg(dev, "[bi=%d]\n", count+4);
1251 if (ei_status.dmaing) { 1232 if (ei_status.dmaing) {
1252 printk(KERN_NOTICE "%s: DMAing conflict in dma_block_input." 1233 netdev_notice(dev, "DMAing conflict in dma_block_input."
1253 "[DMAstat:%1x][irqlock:%1x]\n", 1234 "[DMAstat:%1x][irqlock:%1x]\n",
1254 dev->name, ei_status.dmaing, ei_status.irqlock); 1235 ei_status.dmaing, ei_status.irqlock);
1255 return; 1236 return;
1256 } 1237 }
1257 ei_status.dmaing |= 0x01; 1238 ei_status.dmaing |= 0x01;
@@ -1281,9 +1262,9 @@ static void dma_block_input(struct net_device *dev, int count,
1281 break; 1262 break;
1282 } while (--tries > 0); 1263 } while (--tries > 0);
1283 if (tries <= 0) 1264 if (tries <= 0)
1284 printk(KERN_NOTICE "%s: RX transfer address mismatch," 1265 netdev_notice(dev, "RX transfer address mismatch,"
1285 "%#4.4x (expected) vs. %#4.4x (actual).\n", 1266 "%#4.4x (expected) vs. %#4.4x (actual).\n",
1286 dev->name, ring_offset + xfer_count, addr); 1267 ring_offset + xfer_count, addr);
1287 } 1268 }
1288#endif 1269#endif
1289 outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */ 1270 outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
@@ -1304,7 +1285,7 @@ static void dma_block_output(struct net_device *dev, int count,
1304 1285
1305#ifdef PCMCIA_DEBUG 1286#ifdef PCMCIA_DEBUG
1306 if (ei_debug > 4) 1287 if (ei_debug > 4)
1307 printk(KERN_DEBUG "%s: [bo=%d]\n", dev->name, count); 1288 netdev_dbg(dev, "[bo=%d]\n", count);
1308#endif 1289#endif
1309 1290
1310 /* Round the count up for word writes. Do we need to do this? 1291 /* Round the count up for word writes. Do we need to do this?
@@ -1313,9 +1294,9 @@ static void dma_block_output(struct net_device *dev, int count,
1313 if (count & 0x01) 1294 if (count & 0x01)
1314 count++; 1295 count++;
1315 if (ei_status.dmaing) { 1296 if (ei_status.dmaing) {
1316 printk(KERN_NOTICE "%s: DMAing conflict in dma_block_output." 1297 netdev_notice(dev, "DMAing conflict in dma_block_output."
1317 "[DMAstat:%1x][irqlock:%1x]\n", 1298 "[DMAstat:%1x][irqlock:%1x]\n",
1318 dev->name, ei_status.dmaing, ei_status.irqlock); 1299 ei_status.dmaing, ei_status.irqlock);
1319 return; 1300 return;
1320 } 1301 }
1321 ei_status.dmaing |= 0x01; 1302 ei_status.dmaing |= 0x01;
@@ -1352,9 +1333,9 @@ static void dma_block_output(struct net_device *dev, int count,
1352 break; 1333 break;
1353 } while (--tries > 0); 1334 } while (--tries > 0);
1354 if (tries <= 0) { 1335 if (tries <= 0) {
1355 printk(KERN_NOTICE "%s: Tx packet transfer address mismatch," 1336 netdev_notice(dev, "Tx packet transfer address mismatch,"
1356 "%#4.4x (expected) vs. %#4.4x (actual).\n", 1337 "%#4.4x (expected) vs. %#4.4x (actual).\n",
1357 dev->name, (start_page << 8) + count, addr); 1338 (start_page << 8) + count, addr);
1358 if (retries++ == 0) 1339 if (retries++ == 0)
1359 goto retry; 1340 goto retry;
1360 } 1341 }
@@ -1363,8 +1344,7 @@ static void dma_block_output(struct net_device *dev, int count,
1363 1344
1364 while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0) 1345 while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0)
1365 if (time_after(jiffies, dma_start + PCNET_RDC_TIMEOUT)) { 1346 if (time_after(jiffies, dma_start + PCNET_RDC_TIMEOUT)) {
1366 printk(KERN_NOTICE "%s: timeout waiting for Tx RDC.\n", 1347 netdev_notice(dev, "timeout waiting for Tx RDC.\n");
1367 dev->name);
1368 pcnet_reset_8390(dev); 1348 pcnet_reset_8390(dev);
1369 NS8390_init(dev, 1); 1349 NS8390_init(dev, 1);
1370 break; 1350 break;
@@ -1388,9 +1368,9 @@ static int setup_dma_config(struct pcmcia_device *link, int start_pg,
1388 ei_status.stop_page = stop_pg; 1368 ei_status.stop_page = stop_pg;
1389 1369
1390 /* set up block i/o functions */ 1370 /* set up block i/o functions */
1391 ei_status.get_8390_hdr = &dma_get_8390_hdr; 1371 ei_status.get_8390_hdr = dma_get_8390_hdr;
1392 ei_status.block_input = &dma_block_input; 1372 ei_status.block_input = dma_block_input;
1393 ei_status.block_output = &dma_block_output; 1373 ei_status.block_output = dma_block_output;
1394 1374
1395 return 0; 1375 return 0;
1396} 1376}
@@ -1536,9 +1516,9 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
1536 ei_status.stop_page = start_pg + ((req.Size - offset) >> 8); 1516 ei_status.stop_page = start_pg + ((req.Size - offset) >> 8);
1537 1517
1538 /* set up block i/o functions */ 1518 /* set up block i/o functions */
1539 ei_status.get_8390_hdr = &shmem_get_8390_hdr; 1519 ei_status.get_8390_hdr = shmem_get_8390_hdr;
1540 ei_status.block_input = &shmem_block_input; 1520 ei_status.block_input = shmem_block_input;
1541 ei_status.block_output = &shmem_block_output; 1521 ei_status.block_output = shmem_block_output;
1542 1522
1543 info->flags |= USE_SHMEM; 1523 info->flags |= USE_SHMEM;
1544 return 0; 1524 return 0;
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 377367d03b4..7204a4b5529 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>
@@ -294,7 +296,7 @@ static const struct net_device_ops smc_netdev_ops = {
294 .ndo_tx_timeout = smc_tx_timeout, 296 .ndo_tx_timeout = smc_tx_timeout,
295 .ndo_set_config = s9k_config, 297 .ndo_set_config = s9k_config,
296 .ndo_set_multicast_list = set_rx_mode, 298 .ndo_set_multicast_list = set_rx_mode,
297 .ndo_do_ioctl = &smc_ioctl, 299 .ndo_do_ioctl = smc_ioctl,
298 .ndo_change_mtu = eth_change_mtu, 300 .ndo_change_mtu = eth_change_mtu,
299 .ndo_set_mac_address = eth_mac_addr, 301 .ndo_set_mac_address = eth_mac_addr,
300 .ndo_validate_addr = eth_validate_addr, 302 .ndo_validate_addr = eth_validate_addr,
@@ -813,14 +815,14 @@ static int check_sig(struct pcmcia_device *link)
813 ((s >> 8) != (s & 0xff))) { 815 ((s >> 8) != (s & 0xff))) {
814 SMC_SELECT_BANK(3); 816 SMC_SELECT_BANK(3);
815 s = inw(ioaddr + REVISION); 817 s = inw(ioaddr + REVISION);
816 return (s & 0xff); 818 return s & 0xff;
817 } 819 }
818 820
819 if (width) { 821 if (width) {
820 modconf_t mod = { 822 modconf_t mod = {
821 .Attributes = CONF_IO_CHANGE_WIDTH, 823 .Attributes = CONF_IO_CHANGE_WIDTH,
822 }; 824 };
823 printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n"); 825 pr_info("using 8-bit IO window\n");
824 826
825 smc91c92_suspend(link); 827 smc91c92_suspend(link);
826 pcmcia_modify_configuration(link, &mod); 828 pcmcia_modify_configuration(link, &mod);
@@ -881,7 +883,7 @@ static int smc91c92_config(struct pcmcia_device *link)
881 if ((if_port >= 0) && (if_port <= 2)) 883 if ((if_port >= 0) && (if_port <= 2))
882 dev->if_port = if_port; 884 dev->if_port = if_port;
883 else 885 else
884 printk(KERN_NOTICE "smc91c92_cs: invalid if_port requested\n"); 886 dev_notice(&link->dev, "invalid if_port requested\n");
885 887
886 switch (smc->manfid) { 888 switch (smc->manfid) {
887 case MANFID_OSITECH: 889 case MANFID_OSITECH:
@@ -899,7 +901,7 @@ static int smc91c92_config(struct pcmcia_device *link)
899 } 901 }
900 902
901 if (i != 0) { 903 if (i != 0) {
902 printk(KERN_NOTICE "smc91c92_cs: Unable to find hardware address.\n"); 904 dev_notice(&link->dev, "Unable to find hardware address.\n");
903 goto config_failed; 905 goto config_failed;
904 } 906 }
905 907
@@ -952,30 +954,28 @@ static int smc91c92_config(struct pcmcia_device *link)
952 SET_NETDEV_DEV(dev, &link->dev); 954 SET_NETDEV_DEV(dev, &link->dev);
953 955
954 if (register_netdev(dev) != 0) { 956 if (register_netdev(dev) != 0) {
955 printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n"); 957 dev_err(&link->dev, "register_netdev() failed\n");
956 goto config_undo; 958 goto config_undo;
957 } 959 }
958 960
959 printk(KERN_INFO "%s: smc91c%s rev %d: io %#3lx, irq %d, " 961 netdev_info(dev, "smc91c%s rev %d: io %#3lx, irq %d, hw_addr %pM\n",
960 "hw_addr %pM\n", 962 name, (rev & 0x0f), dev->base_addr, dev->irq, dev->dev_addr);
961 dev->name, name, (rev & 0x0f), dev->base_addr, dev->irq,
962 dev->dev_addr);
963 963
964 if (rev > 0) { 964 if (rev > 0) {
965 if (mir & 0x3ff) 965 if (mir & 0x3ff)
966 printk(KERN_INFO " %lu byte", mir); 966 netdev_info(dev, " %lu byte", mir);
967 else 967 else
968 printk(KERN_INFO " %lu kb", mir>>10); 968 netdev_info(dev, " %lu kb", mir>>10);
969 printk(" buffer, %s xcvr\n", (smc->cfg & CFG_MII_SELECT) ? 969 pr_cont(" buffer, %s xcvr\n",
970 "MII" : if_names[dev->if_port]); 970 (smc->cfg & CFG_MII_SELECT) ? "MII" : if_names[dev->if_port]);
971 } 971 }
972 972
973 if (smc->cfg & CFG_MII_SELECT) { 973 if (smc->cfg & CFG_MII_SELECT) {
974 if (smc->mii_if.phy_id != -1) { 974 if (smc->mii_if.phy_id != -1) {
975 dev_dbg(&link->dev, " MII transceiver at index %d, status %x.\n", 975 netdev_dbg(dev, " MII transceiver at index %d, status %x\n",
976 smc->mii_if.phy_id, j); 976 smc->mii_if.phy_id, j);
977 } else { 977 } else {
978 printk(KERN_NOTICE " No MII transceivers found!\n"); 978 netdev_notice(dev, " No MII transceivers found!\n");
979 } 979 }
980 } 980 }
981 return 0; 981 return 0;
@@ -1081,10 +1081,10 @@ static void smc_dump(struct net_device *dev)
1081 save = inw(ioaddr + BANK_SELECT); 1081 save = inw(ioaddr + BANK_SELECT);
1082 for (w = 0; w < 4; w++) { 1082 for (w = 0; w < 4; w++) {
1083 SMC_SELECT_BANK(w); 1083 SMC_SELECT_BANK(w);
1084 printk(KERN_DEBUG "bank %d: ", w); 1084 netdev_printk(KERN_DEBUG, dev, "bank %d: ", w);
1085 for (i = 0; i < 14; i += 2) 1085 for (i = 0; i < 14; i += 2)
1086 printk(" %04x", inw(ioaddr + i)); 1086 pr_cont(" %04x", inw(ioaddr + i));
1087 printk("\n"); 1087 pr_cont("\n");
1088 } 1088 }
1089 outw(save, ioaddr + BANK_SELECT); 1089 outw(save, ioaddr + BANK_SELECT);
1090} 1090}
@@ -1106,7 +1106,7 @@ static int smc_open(struct net_device *dev)
1106 return -ENODEV; 1106 return -ENODEV;
1107 /* Physical device present signature. */ 1107 /* Physical device present signature. */
1108 if (check_sig(link) < 0) { 1108 if (check_sig(link) < 0) {
1109 printk("smc91c92_cs: Yikes! Bad chip signature!\n"); 1109 netdev_info(dev, "Yikes! Bad chip signature!\n");
1110 return -ENODEV; 1110 return -ENODEV;
1111 } 1111 }
1112 link->open++; 1112 link->open++;
@@ -1117,7 +1117,7 @@ static int smc_open(struct net_device *dev)
1117 1117
1118 smc_reset(dev); 1118 smc_reset(dev);
1119 init_timer(&smc->media); 1119 init_timer(&smc->media);
1120 smc->media.function = &media_check; 1120 smc->media.function = media_check;
1121 smc->media.data = (u_long) dev; 1121 smc->media.data = (u_long) dev;
1122 smc->media.expires = jiffies + HZ; 1122 smc->media.expires = jiffies + HZ;
1123 add_timer(&smc->media); 1123 add_timer(&smc->media);
@@ -1172,7 +1172,7 @@ static void smc_hardware_send_packet(struct net_device * dev)
1172 u_char packet_no; 1172 u_char packet_no;
1173 1173
1174 if (!skb) { 1174 if (!skb) {
1175 printk(KERN_ERR "%s: In XMIT with no packet to send.\n", dev->name); 1175 netdev_err(dev, "In XMIT with no packet to send\n");
1176 return; 1176 return;
1177 } 1177 }
1178 1178
@@ -1180,8 +1180,8 @@ static void smc_hardware_send_packet(struct net_device * dev)
1180 packet_no = inw(ioaddr + PNR_ARR) >> 8; 1180 packet_no = inw(ioaddr + PNR_ARR) >> 8;
1181 if (packet_no & 0x80) { 1181 if (packet_no & 0x80) {
1182 /* If not, there is a hardware problem! Likely an ejected card. */ 1182 /* If not, there is a hardware problem! Likely an ejected card. */
1183 printk(KERN_WARNING "%s: 91c92 hardware Tx buffer allocation" 1183 netdev_warn(dev, "hardware Tx buffer allocation failed, status %#2.2x\n",
1184 " failed, status %#2.2x.\n", dev->name, packet_no); 1184 packet_no);
1185 dev_kfree_skb_irq(skb); 1185 dev_kfree_skb_irq(skb);
1186 smc->saved_skb = NULL; 1186 smc->saved_skb = NULL;
1187 netif_start_queue(dev); 1187 netif_start_queue(dev);
@@ -1200,8 +1200,7 @@ static void smc_hardware_send_packet(struct net_device * dev)
1200 u_char *buf = skb->data; 1200 u_char *buf = skb->data;
1201 u_int length = skb->len; /* The chip will pad to ethernet min. */ 1201 u_int length = skb->len; /* The chip will pad to ethernet min. */
1202 1202
1203 pr_debug("%s: Trying to xmit packet of length %d.\n", 1203 netdev_dbg(dev, "Trying to xmit packet of length %d\n", length);
1204 dev->name, length);
1205 1204
1206 /* send the packet length: +6 for status word, length, and ctl */ 1205 /* send the packet length: +6 for status word, length, and ctl */
1207 outw(0, ioaddr + DATA_1); 1206 outw(0, ioaddr + DATA_1);
@@ -1233,9 +1232,8 @@ static void smc_tx_timeout(struct net_device *dev)
1233 struct smc_private *smc = netdev_priv(dev); 1232 struct smc_private *smc = netdev_priv(dev);
1234 unsigned int ioaddr = dev->base_addr; 1233 unsigned int ioaddr = dev->base_addr;
1235 1234
1236 printk(KERN_NOTICE "%s: SMC91c92 transmit timed out, " 1235 netdev_notice(dev, "transmit timed out, Tx_status %2.2x status %4.4x.\n",
1237 "Tx_status %2.2x status %4.4x.\n", 1236 inw(ioaddr)&0xff, inw(ioaddr + 2));
1238 dev->name, inw(ioaddr)&0xff, inw(ioaddr + 2));
1239 dev->stats.tx_errors++; 1237 dev->stats.tx_errors++;
1240 smc_reset(dev); 1238 smc_reset(dev);
1241 dev->trans_start = jiffies; /* prevent tx timeout */ 1239 dev->trans_start = jiffies; /* prevent tx timeout */
@@ -1254,14 +1252,14 @@ static netdev_tx_t smc_start_xmit(struct sk_buff *skb,
1254 1252
1255 netif_stop_queue(dev); 1253 netif_stop_queue(dev);
1256 1254
1257 pr_debug("%s: smc_start_xmit(length = %d) called," 1255 netdev_dbg(dev, "smc_start_xmit(length = %d) called, status %04x\n",
1258 " status %4.4x.\n", dev->name, skb->len, inw(ioaddr + 2)); 1256 skb->len, inw(ioaddr + 2));
1259 1257
1260 if (smc->saved_skb) { 1258 if (smc->saved_skb) {
1261 /* THIS SHOULD NEVER HAPPEN. */ 1259 /* THIS SHOULD NEVER HAPPEN. */
1262 dev->stats.tx_aborted_errors++; 1260 dev->stats.tx_aborted_errors++;
1263 printk(KERN_DEBUG "%s: Internal error -- sent packet while busy.\n", 1261 netdev_printk(KERN_DEBUG, dev,
1264 dev->name); 1262 "Internal error -- sent packet while busy\n");
1265 return NETDEV_TX_BUSY; 1263 return NETDEV_TX_BUSY;
1266 } 1264 }
1267 smc->saved_skb = skb; 1265 smc->saved_skb = skb;
@@ -1269,7 +1267,7 @@ static netdev_tx_t smc_start_xmit(struct sk_buff *skb,
1269 num_pages = skb->len >> 8; 1267 num_pages = skb->len >> 8;
1270 1268
1271 if (num_pages > 7) { 1269 if (num_pages > 7) {
1272 printk(KERN_ERR "%s: Far too big packet error.\n", dev->name); 1270 netdev_err(dev, "Far too big packet error: %d pages\n", num_pages);
1273 dev_kfree_skb (skb); 1271 dev_kfree_skb (skb);
1274 smc->saved_skb = NULL; 1272 smc->saved_skb = NULL;
1275 dev->stats.tx_dropped++; 1273 dev->stats.tx_dropped++;
@@ -1339,8 +1337,7 @@ static void smc_tx_err(struct net_device * dev)
1339 } 1337 }
1340 1338
1341 if (tx_status & TS_SUCCESS) { 1339 if (tx_status & TS_SUCCESS) {
1342 printk(KERN_NOTICE "%s: Successful packet caused error " 1340 netdev_notice(dev, "Successful packet caused error interrupt?\n");
1343 "interrupt?\n", dev->name);
1344 } 1341 }
1345 /* re-enable transmit */ 1342 /* re-enable transmit */
1346 SMC_SELECT_BANK(0); 1343 SMC_SELECT_BANK(0);
@@ -1530,8 +1527,7 @@ static void smc_rx(struct net_device *dev)
1530 /* Assertion: we are in Window 2. */ 1527 /* Assertion: we are in Window 2. */
1531 1528
1532 if (inw(ioaddr + FIFO_PORTS) & FP_RXEMPTY) { 1529 if (inw(ioaddr + FIFO_PORTS) & FP_RXEMPTY) {
1533 printk(KERN_ERR "%s: smc_rx() with nothing on Rx FIFO.\n", 1530 netdev_err(dev, "smc_rx() with nothing on Rx FIFO\n");
1534 dev->name);
1535 return; 1531 return;
1536 } 1532 }
1537 1533
@@ -1646,8 +1642,7 @@ static int s9k_config(struct net_device *dev, struct ifmap *map)
1646 else if (map->port > 2) 1642 else if (map->port > 2)
1647 return -EINVAL; 1643 return -EINVAL;
1648 dev->if_port = map->port; 1644 dev->if_port = map->port;
1649 printk(KERN_INFO "%s: switched to %s port\n", 1645 netdev_info(dev, "switched to %s port\n", if_names[dev->if_port]);
1650 dev->name, if_names[dev->if_port]);
1651 smc_reset(dev); 1646 smc_reset(dev);
1652 } 1647 }
1653 return 0; 1648 return 0;
@@ -1798,7 +1793,7 @@ static void media_check(u_long arg)
1798 this, we can limp along even if the interrupt is blocked */ 1793 this, we can limp along even if the interrupt is blocked */
1799 if (smc->watchdog++ && ((i>>8) & i)) { 1794 if (smc->watchdog++ && ((i>>8) & i)) {
1800 if (!smc->fast_poll) 1795 if (!smc->fast_poll)
1801 printk(KERN_INFO "%s: interrupt(s) dropped!\n", dev->name); 1796 netdev_info(dev, "interrupt(s) dropped!\n");
1802 local_irq_save(flags); 1797 local_irq_save(flags);
1803 smc_interrupt(dev->irq, dev); 1798 smc_interrupt(dev->irq, dev);
1804 local_irq_restore(flags); 1799 local_irq_restore(flags);
@@ -1822,7 +1817,7 @@ static void media_check(u_long arg)
1822 SMC_SELECT_BANK(3); 1817 SMC_SELECT_BANK(3);
1823 link = mdio_read(dev, smc->mii_if.phy_id, 1); 1818 link = mdio_read(dev, smc->mii_if.phy_id, 1);
1824 if (!link || (link == 0xffff)) { 1819 if (!link || (link == 0xffff)) {
1825 printk(KERN_INFO "%s: MII is missing!\n", dev->name); 1820 netdev_info(dev, "MII is missing!\n");
1826 smc->mii_if.phy_id = -1; 1821 smc->mii_if.phy_id = -1;
1827 goto reschedule; 1822 goto reschedule;
1828 } 1823 }
@@ -1830,15 +1825,13 @@ static void media_check(u_long arg)
1830 link &= 0x0004; 1825 link &= 0x0004;
1831 if (link != smc->link_status) { 1826 if (link != smc->link_status) {
1832 u_short p = mdio_read(dev, smc->mii_if.phy_id, 5); 1827 u_short p = mdio_read(dev, smc->mii_if.phy_id, 5);
1833 printk(KERN_INFO "%s: %s link beat\n", dev->name, 1828 netdev_info(dev, "%s link beat\n", link ? "found" : "lost");
1834 (link) ? "found" : "lost");
1835 smc->duplex = (((p & 0x0100) || ((p & 0x1c0) == 0x40)) 1829 smc->duplex = (((p & 0x0100) || ((p & 0x1c0) == 0x40))
1836 ? TCR_FDUPLX : 0); 1830 ? TCR_FDUPLX : 0);
1837 if (link) { 1831 if (link) {
1838 printk(KERN_INFO "%s: autonegotiation complete: " 1832 netdev_info(dev, "autonegotiation complete: "
1839 "%sbaseT-%cD selected\n", dev->name, 1833 "%dbaseT-%cD selected\n",
1840 ((p & 0x0180) ? "100" : "10"), 1834 (p & 0x0180) ? 100 : 10, smc->duplex ? 'F' : 'H');
1841 (smc->duplex ? 'F' : 'H'));
1842 } 1835 }
1843 SMC_SELECT_BANK(0); 1836 SMC_SELECT_BANK(0);
1844 outw(inw(ioaddr + TCR) | smc->duplex, ioaddr + TCR); 1837 outw(inw(ioaddr + TCR) | smc->duplex, ioaddr + TCR);
@@ -1857,25 +1850,23 @@ static void media_check(u_long arg)
1857 if (media != smc->media_status) { 1850 if (media != smc->media_status) {
1858 if ((media & smc->media_status & 1) && 1851 if ((media & smc->media_status & 1) &&
1859 ((smc->media_status ^ media) & EPH_LINK_OK)) 1852 ((smc->media_status ^ media) & EPH_LINK_OK))
1860 printk(KERN_INFO "%s: %s link beat\n", dev->name, 1853 netdev_info(dev, "%s link beat\n",
1861 (smc->media_status & EPH_LINK_OK ? "lost" : "found")); 1854 smc->media_status & EPH_LINK_OK ? "lost" : "found");
1862 else if ((media & smc->media_status & 2) && 1855 else if ((media & smc->media_status & 2) &&
1863 ((smc->media_status ^ media) & EPH_16COL)) 1856 ((smc->media_status ^ media) & EPH_16COL))
1864 printk(KERN_INFO "%s: coax cable %s\n", dev->name, 1857 netdev_info(dev, "coax cable %s\n",
1865 (media & EPH_16COL ? "problem" : "ok")); 1858 media & EPH_16COL ? "problem" : "ok");
1866 if (dev->if_port == 0) { 1859 if (dev->if_port == 0) {
1867 if (media & 1) { 1860 if (media & 1) {
1868 if (media & EPH_LINK_OK) 1861 if (media & EPH_LINK_OK)
1869 printk(KERN_INFO "%s: flipped to 10baseT\n", 1862 netdev_info(dev, "flipped to 10baseT\n");
1870 dev->name);
1871 else 1863 else
1872 smc_set_xcvr(dev, 2); 1864 smc_set_xcvr(dev, 2);
1873 } else { 1865 } else {
1874 if (media & EPH_16COL) 1866 if (media & EPH_16COL)
1875 smc_set_xcvr(dev, 1); 1867 smc_set_xcvr(dev, 1);
1876 else 1868 else
1877 printk(KERN_INFO "%s: flipped to 10base2\n", 1869 netdev_info(dev, "flipped to 10base2\n");
1878 dev->name);
1879 } 1870 }
1880 } 1871 }
1881 smc->media_status = media; 1872 smc->media_status = media;
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index f5819526b5e..d858b5e4c4a 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>
@@ -210,13 +212,6 @@ enum xirc_cmd { /* Commands */
210 212
211static const char *if_names[] = { "Auto", "10BaseT", "10Base2", "AUI", "100BaseT" }; 213static const char *if_names[] = { "Auto", "10BaseT", "10Base2", "AUI", "100BaseT" };
212 214
213
214#define KDBG_XIRC KERN_DEBUG "xirc2ps_cs: "
215#define KERR_XIRC KERN_ERR "xirc2ps_cs: "
216#define KWRN_XIRC KERN_WARNING "xirc2ps_cs: "
217#define KNOT_XIRC KERN_NOTICE "xirc2ps_cs: "
218#define KINF_XIRC KERN_INFO "xirc2ps_cs: "
219
220/* card types */ 215/* card types */
221#define XIR_UNKNOWN 0 /* unknown: not supported */ 216#define XIR_UNKNOWN 0 /* unknown: not supported */
222#define XIR_CE 1 /* (prodid 1) different hardware: not supported */ 217#define XIR_CE 1 /* (prodid 1) different hardware: not supported */
@@ -350,26 +345,26 @@ PrintRegisters(struct net_device *dev)
350 if (pc_debug > 1) { 345 if (pc_debug > 1) {
351 int i, page; 346 int i, page;
352 347
353 printk(KDBG_XIRC "Register common: "); 348 printk(KERN_DEBUG pr_fmt("Register common: "));
354 for (i = 0; i < 8; i++) 349 for (i = 0; i < 8; i++)
355 printk(" %2.2x", GetByte(i)); 350 pr_cont(" %2.2x", GetByte(i));
356 printk("\n"); 351 pr_cont("\n");
357 for (page = 0; page <= 8; page++) { 352 for (page = 0; page <= 8; page++) {
358 printk(KDBG_XIRC "Register page %2x: ", page); 353 printk(KERN_DEBUG pr_fmt("Register page %2x: "), page);
359 SelectPage(page); 354 SelectPage(page);
360 for (i = 8; i < 16; i++) 355 for (i = 8; i < 16; i++)
361 printk(" %2.2x", GetByte(i)); 356 pr_cont(" %2.2x", GetByte(i));
362 printk("\n"); 357 pr_cont("\n");
363 } 358 }
364 for (page=0x40 ; page <= 0x5f; page++) { 359 for (page=0x40 ; page <= 0x5f; page++) {
365 if (page == 0x43 || (page >= 0x46 && page <= 0x4f) || 360 if (page == 0x43 || (page >= 0x46 && page <= 0x4f) ||
366 (page >= 0x51 && page <=0x5e)) 361 (page >= 0x51 && page <=0x5e))
367 continue; 362 continue;
368 printk(KDBG_XIRC "Register page %2x: ", page); 363 printk(KERN_DEBUG pr_fmt("Register page %2x: "), page);
369 SelectPage(page); 364 SelectPage(page);
370 for (i = 8; i < 16; i++) 365 for (i = 8; i < 16; i++)
371 printk(" %2.2x", GetByte(i)); 366 pr_cont(" %2.2x", GetByte(i));
372 printk("\n"); 367 pr_cont("\n");
373 } 368 }
374 } 369 }
375} 370}
@@ -608,11 +603,11 @@ set_card_type(struct pcmcia_device *link)
608 local->modem = 0; 603 local->modem = 0;
609 local->card_type = XIR_UNKNOWN; 604 local->card_type = XIR_UNKNOWN;
610 if (!(prodid & 0x40)) { 605 if (!(prodid & 0x40)) {
611 printk(KNOT_XIRC "Ooops: Not a creditcard\n"); 606 pr_notice("Oops: Not a creditcard\n");
612 return 0; 607 return 0;
613 } 608 }
614 if (!(mediaid & 0x01)) { 609 if (!(mediaid & 0x01)) {
615 printk(KNOT_XIRC "Not an Ethernet card\n"); 610 pr_notice("Not an Ethernet card\n");
616 return 0; 611 return 0;
617 } 612 }
618 if (mediaid & 0x10) { 613 if (mediaid & 0x10) {
@@ -643,12 +638,11 @@ set_card_type(struct pcmcia_device *link)
643 } 638 }
644 } 639 }
645 if (local->card_type == XIR_CE || local->card_type == XIR_CEM) { 640 if (local->card_type == XIR_CE || local->card_type == XIR_CEM) {
646 printk(KNOT_XIRC "Sorry, this is an old CE card\n"); 641 pr_notice("Sorry, this is an old CE card\n");
647 return 0; 642 return 0;
648 } 643 }
649 if (local->card_type == XIR_UNKNOWN) 644 if (local->card_type == XIR_UNKNOWN)
650 printk(KNOT_XIRC "unknown card (mediaid=%02x prodid=%02x)\n", 645 pr_notice("unknown card (mediaid=%02x prodid=%02x)\n", mediaid, prodid);
651 mediaid, prodid);
652 646
653 return 1; 647 return 1;
654} 648}
@@ -748,7 +742,7 @@ xirc2ps_config(struct pcmcia_device * link)
748 742
749 /* Is this a valid card */ 743 /* Is this a valid card */
750 if (link->has_manf_id == 0) { 744 if (link->has_manf_id == 0) {
751 printk(KNOT_XIRC "manfid not found in CIS\n"); 745 pr_notice("manfid not found in CIS\n");
752 goto failure; 746 goto failure;
753 } 747 }
754 748
@@ -770,14 +764,14 @@ xirc2ps_config(struct pcmcia_device * link)
770 local->manf_str = "Toshiba"; 764 local->manf_str = "Toshiba";
771 break; 765 break;
772 default: 766 default:
773 printk(KNOT_XIRC "Unknown Card Manufacturer ID: 0x%04x\n", 767 pr_notice("Unknown Card Manufacturer ID: 0x%04x\n",
774 (unsigned)link->manf_id); 768 (unsigned)link->manf_id);
775 goto failure; 769 goto failure;
776 } 770 }
777 dev_dbg(&link->dev, "found %s card\n", local->manf_str); 771 dev_dbg(&link->dev, "found %s card\n", local->manf_str);
778 772
779 if (!set_card_type(link)) { 773 if (!set_card_type(link)) {
780 printk(KNOT_XIRC "this card is not supported\n"); 774 pr_notice("this card is not supported\n");
781 goto failure; 775 goto failure;
782 } 776 }
783 777
@@ -803,7 +797,7 @@ xirc2ps_config(struct pcmcia_device * link)
803 err = pcmcia_loop_tuple(link, CISTPL_FUNCE, pcmcia_get_mac_ce, dev); 797 err = pcmcia_loop_tuple(link, CISTPL_FUNCE, pcmcia_get_mac_ce, dev);
804 798
805 if (err) { 799 if (err) {
806 printk(KNOT_XIRC "node-id not found in CIS\n"); 800 pr_notice("node-id not found in CIS\n");
807 goto failure; 801 goto failure;
808 } 802 }
809 803
@@ -838,7 +832,7 @@ xirc2ps_config(struct pcmcia_device * link)
838 * try to configure as Ethernet only. 832 * try to configure as Ethernet only.
839 * .... */ 833 * .... */
840 } 834 }
841 printk(KNOT_XIRC "no ports available\n"); 835 pr_notice("no ports available\n");
842 } else { 836 } else {
843 link->resource[0]->end = 16; 837 link->resource[0]->end = 16;
844 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { 838 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {
@@ -911,24 +905,24 @@ xirc2ps_config(struct pcmcia_device * link)
911 #if 0 905 #if 0
912 { 906 {
913 u_char tmp; 907 u_char tmp;
914 printk(KERN_INFO "ECOR:"); 908 pr_info("ECOR:");
915 for (i=0; i < 7; i++) { 909 for (i=0; i < 7; i++) {
916 tmp = readb(local->dingo_ccr + i*2); 910 tmp = readb(local->dingo_ccr + i*2);
917 printk(" %02x", tmp); 911 pr_cont(" %02x", tmp);
918 } 912 }
919 printk("\n"); 913 pr_cont("\n");
920 printk(KERN_INFO "DCOR:"); 914 pr_info("DCOR:");
921 for (i=0; i < 4; i++) { 915 for (i=0; i < 4; i++) {
922 tmp = readb(local->dingo_ccr + 0x20 + i*2); 916 tmp = readb(local->dingo_ccr + 0x20 + i*2);
923 printk(" %02x", tmp); 917 pr_cont(" %02x", tmp);
924 } 918 }
925 printk("\n"); 919 pr_cont("\n");
926 printk(KERN_INFO "SCOR:"); 920 pr_info("SCOR:");
927 for (i=0; i < 10; i++) { 921 for (i=0; i < 10; i++) {
928 tmp = readb(local->dingo_ccr + 0x40 + i*2); 922 tmp = readb(local->dingo_ccr + 0x40 + i*2);
929 printk(" %02x", tmp); 923 pr_cont(" %02x", tmp);
930 } 924 }
931 printk("\n"); 925 pr_cont("\n");
932 } 926 }
933 #endif 927 #endif
934 928
@@ -947,7 +941,7 @@ xirc2ps_config(struct pcmcia_device * link)
947 (local->mohawk && if_port==4)) 941 (local->mohawk && if_port==4))
948 dev->if_port = if_port; 942 dev->if_port = if_port;
949 else 943 else
950 printk(KNOT_XIRC "invalid if_port requested\n"); 944 pr_notice("invalid if_port requested\n");
951 945
952 /* we can now register the device with the net subsystem */ 946 /* we can now register the device with the net subsystem */
953 dev->irq = link->irq; 947 dev->irq = link->irq;
@@ -959,14 +953,14 @@ xirc2ps_config(struct pcmcia_device * link)
959 SET_NETDEV_DEV(dev, &link->dev); 953 SET_NETDEV_DEV(dev, &link->dev);
960 954
961 if ((err=register_netdev(dev))) { 955 if ((err=register_netdev(dev))) {
962 printk(KNOT_XIRC "register_netdev() failed\n"); 956 pr_notice("register_netdev() failed\n");
963 goto config_error; 957 goto config_error;
964 } 958 }
965 959
966 /* give some infos about the hardware */ 960 /* give some infos about the hardware */
967 printk(KERN_INFO "%s: %s: port %#3lx, irq %d, hwaddr %pM\n", 961 netdev_info(dev, "%s: port %#3lx, irq %d, hwaddr %pM\n",
968 dev->name, local->manf_str,(u_long)dev->base_addr, (int)dev->irq, 962 local->manf_str, (u_long)dev->base_addr, (int)dev->irq,
969 dev->dev_addr); 963 dev->dev_addr);
970 964
971 return 0; 965 return 0;
972 966
@@ -1098,8 +1092,7 @@ xirc2ps_interrupt(int irq, void *dev_id)
1098 1092
1099 skb = dev_alloc_skb(pktlen+3); /* 1 extra so we can use insw */ 1093 skb = dev_alloc_skb(pktlen+3); /* 1 extra so we can use insw */
1100 if (!skb) { 1094 if (!skb) {
1101 printk(KNOT_XIRC "low memory, packet dropped (size=%u)\n", 1095 pr_notice("low memory, packet dropped (size=%u)\n", pktlen);
1102 pktlen);
1103 dev->stats.rx_dropped++; 1096 dev->stats.rx_dropped++;
1104 } else { /* okay get the packet */ 1097 } else { /* okay get the packet */
1105 skb_reserve(skb, 2); 1098 skb_reserve(skb, 2);
@@ -1268,7 +1261,7 @@ xirc_tx_timeout(struct net_device *dev)
1268{ 1261{
1269 local_info_t *lp = netdev_priv(dev); 1262 local_info_t *lp = netdev_priv(dev);
1270 dev->stats.tx_errors++; 1263 dev->stats.tx_errors++;
1271 printk(KERN_NOTICE "%s: transmit timed out\n", dev->name); 1264 netdev_notice(dev, "transmit timed out\n");
1272 schedule_work(&lp->tx_timeout_task); 1265 schedule_work(&lp->tx_timeout_task);
1273} 1266}
1274 1267
@@ -1435,8 +1428,7 @@ do_config(struct net_device *dev, struct ifmap *map)
1435 local->probe_port = 0; 1428 local->probe_port = 0;
1436 dev->if_port = map->port; 1429 dev->if_port = map->port;
1437 } 1430 }
1438 printk(KERN_INFO "%s: switching to %s port\n", 1431 netdev_info(dev, "switching to %s port\n", if_names[dev->if_port]);
1439 dev->name, if_names[dev->if_port]);
1440 do_reset(dev,1); /* not the fine way :-) */ 1432 do_reset(dev,1); /* not the fine way :-) */
1441 } 1433 }
1442 return 0; 1434 return 0;
@@ -1576,7 +1568,7 @@ do_reset(struct net_device *dev, int full)
1576 { 1568 {
1577 SelectPage(0); 1569 SelectPage(0);
1578 value = GetByte(XIRCREG_ESR); /* read the ESR */ 1570 value = GetByte(XIRCREG_ESR); /* read the ESR */
1579 printk(KERN_DEBUG "%s: ESR is: %#02x\n", dev->name, value); 1571 pr_debug("%s: ESR is: %#02x\n", dev->name, value);
1580 } 1572 }
1581 #endif 1573 #endif
1582 1574
@@ -1626,13 +1618,12 @@ do_reset(struct net_device *dev, int full)
1626 1618
1627 if (full && local->mohawk && init_mii(dev)) { 1619 if (full && local->mohawk && init_mii(dev)) {
1628 if (dev->if_port == 4 || local->dingo || local->new_mii) { 1620 if (dev->if_port == 4 || local->dingo || local->new_mii) {
1629 printk(KERN_INFO "%s: MII selected\n", dev->name); 1621 netdev_info(dev, "MII selected\n");
1630 SelectPage(2); 1622 SelectPage(2);
1631 PutByte(XIRCREG2_MSR, GetByte(XIRCREG2_MSR) | 0x08); 1623 PutByte(XIRCREG2_MSR, GetByte(XIRCREG2_MSR) | 0x08);
1632 msleep(20); 1624 msleep(20);
1633 } else { 1625 } else {
1634 printk(KERN_INFO "%s: MII detected; using 10mbs\n", 1626 netdev_info(dev, "MII detected; using 10mbs\n");
1635 dev->name);
1636 SelectPage(0x42); 1627 SelectPage(0x42);
1637 if (dev->if_port == 2) /* enable 10Base2 */ 1628 if (dev->if_port == 2) /* enable 10Base2 */
1638 PutByte(XIRCREG42_SWC1, 0xC0); 1629 PutByte(XIRCREG42_SWC1, 0xC0);
@@ -1677,8 +1668,8 @@ do_reset(struct net_device *dev, int full)
1677 } 1668 }
1678 1669
1679 if (full) 1670 if (full)
1680 printk(KERN_INFO "%s: media %s, silicon revision %d\n", 1671 netdev_info(dev, "media %s, silicon revision %d\n",
1681 dev->name, if_names[dev->if_port], local->silicon); 1672 if_names[dev->if_port], local->silicon);
1682 /* We should switch back to page 0 to avoid a bug in revision 0 1673 /* We should switch back to page 0 to avoid a bug in revision 0
1683 * where regs with offset below 8 can't be read after an access 1674 * where regs with offset below 8 can't be read after an access
1684 * to the MAC registers */ 1675 * to the MAC registers */
@@ -1720,8 +1711,7 @@ init_mii(struct net_device *dev)
1720 control = mii_rd(ioaddr, 0, 0); 1711 control = mii_rd(ioaddr, 0, 0);
1721 1712
1722 if (control & 0x0400) { 1713 if (control & 0x0400) {
1723 printk(KERN_NOTICE "%s can't take PHY out of isolation mode\n", 1714 netdev_notice(dev, "can't take PHY out of isolation mode\n");
1724 dev->name);
1725 local->probe_port = 0; 1715 local->probe_port = 0;
1726 return 0; 1716 return 0;
1727 } 1717 }
@@ -1739,8 +1729,7 @@ init_mii(struct net_device *dev)
1739 } 1729 }
1740 1730
1741 if (!(status & 0x0020)) { 1731 if (!(status & 0x0020)) {
1742 printk(KERN_INFO "%s: autonegotiation failed;" 1732 netdev_info(dev, "autonegotiation failed; using 10mbs\n");
1743 " using 10mbs\n", dev->name);
1744 if (!local->new_mii) { 1733 if (!local->new_mii) {
1745 control = 0x0000; 1734 control = 0x0000;
1746 mii_wr(ioaddr, 0, 0, control, 16); 1735 mii_wr(ioaddr, 0, 0, control, 16);
@@ -1750,8 +1739,7 @@ init_mii(struct net_device *dev)
1750 } 1739 }
1751 } else { 1740 } else {
1752 linkpartner = mii_rd(ioaddr, 0, 5); 1741 linkpartner = mii_rd(ioaddr, 0, 5);
1753 printk(KERN_INFO "%s: MII link partner: %04x\n", 1742 netdev_info(dev, "MII link partner: %04x\n", linkpartner);
1754 dev->name, linkpartner);
1755 if (linkpartner & 0x0080) { 1743 if (linkpartner & 0x0080) {
1756 dev->if_port = 4; 1744 dev->if_port = 4;
1757 } else 1745 } else