aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-12-11 17:20:31 -0500
committerDavid S. Miller <davem@davemloft.net>2013-12-11 17:20:31 -0500
commit9508fdde4d53f0d9e583e841ed08796d2f310be1 (patch)
tree7f8e6d1ee20d74baa55d354e1e218feac10b1d5e /drivers/net
parent99023e90fe5c147ea0665bda86764ea44f08a622 (diff)
Revert "8390 : Replace ei_debug with msg_enable/NETIF_MSG_* feature"
This reverts commit 99023e90fe5c147ea0665bda86764ea44f08a622. Accidently checked this into 'net' instead of 'net-next'. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/8390/8390.h7
-rw-r--r--drivers/net/ethernet/8390/apne.c62
-rw-r--r--drivers/net/ethernet/8390/ax88796.c22
-rw-r--r--drivers/net/ethernet/8390/axnet_cs.c119
-rw-r--r--drivers/net/ethernet/8390/etherh.c51
-rw-r--r--drivers/net/ethernet/8390/hydra.c11
-rw-r--r--drivers/net/ethernet/8390/lib8390.c77
-rw-r--r--drivers/net/ethernet/8390/mac8390.c19
-rw-r--r--drivers/net/ethernet/8390/mcf8390.c8
-rw-r--r--drivers/net/ethernet/8390/ne.c96
-rw-r--r--drivers/net/ethernet/8390/ne2k-pci.c54
-rw-r--r--drivers/net/ethernet/8390/pcnet_cs.c62
-rw-r--r--drivers/net/ethernet/8390/smc-ultra.c48
-rw-r--r--drivers/net/ethernet/8390/stnic.c28
-rw-r--r--drivers/net/ethernet/8390/wd.c42
-rw-r--r--drivers/net/ethernet/8390/zorro8390.c22
16 files changed, 302 insertions, 426 deletions
diff --git a/drivers/net/ethernet/8390/8390.h b/drivers/net/ethernet/8390/8390.h
index 3e2f2c2e7b58..2923c51bb351 100644
--- a/drivers/net/ethernet/8390/8390.h
+++ b/drivers/net/ethernet/8390/8390.h
@@ -21,6 +21,12 @@ struct e8390_pkt_hdr {
21 unsigned short count; /* header + packet length in bytes */ 21 unsigned short count; /* header + packet length in bytes */
22}; 22};
23 23
24#ifdef notdef
25extern int ei_debug;
26#else
27#define ei_debug 1
28#endif
29
24#ifdef CONFIG_NET_POLL_CONTROLLER 30#ifdef CONFIG_NET_POLL_CONTROLLER
25void ei_poll(struct net_device *dev); 31void ei_poll(struct net_device *dev);
26void eip_poll(struct net_device *dev); 32void eip_poll(struct net_device *dev);
@@ -93,7 +99,6 @@ struct ei_device {
93 u32 *reg_offset; /* Register mapping table */ 99 u32 *reg_offset; /* Register mapping table */
94 spinlock_t page_lock; /* Page register locks */ 100 spinlock_t page_lock; /* Page register locks */
95 unsigned long priv; /* Private field to store bus IDs etc. */ 101 unsigned long priv; /* Private field to store bus IDs etc. */
96 u32 msg_enable; /* debug message level */
97#ifdef AX88796_PLATFORM 102#ifdef AX88796_PLATFORM
98 unsigned char rxcr_base; /* default value for RXCR */ 103 unsigned char rxcr_base; /* default value for RXCR */
99#endif 104#endif
diff --git a/drivers/net/ethernet/8390/apne.c b/drivers/net/ethernet/8390/apne.c
index 811fa5d5c697..912ed7a5f33a 100644
--- a/drivers/net/ethernet/8390/apne.c
+++ b/drivers/net/ethernet/8390/apne.c
@@ -116,15 +116,9 @@ static const char version[] =
116 116
117static int apne_owned; /* signal if card already owned */ 117static int apne_owned; /* signal if card already owned */
118 118
119static u32 apne_msg_enable;
120module_param_named(msg_enable, apne_msg_enable, uint, (S_IRUSR|S_IRGRP|S_IROTH));
121MODULE_PARM_DESC(msg_enable, "Debug message level (see linux/netdevice.h for bitmap)");
122
123struct net_device * __init apne_probe(int unit) 119struct net_device * __init apne_probe(int unit)
124{ 120{
125 struct net_device *dev; 121 struct net_device *dev;
126 struct ei_device *ei_local;
127
128#ifndef MANUAL_CONFIG 122#ifndef MANUAL_CONFIG
129 char tuple[8]; 123 char tuple[8];
130#endif 124#endif
@@ -139,11 +133,11 @@ struct net_device * __init apne_probe(int unit)
139 if ( !(AMIGAHW_PRESENT(PCMCIA)) ) 133 if ( !(AMIGAHW_PRESENT(PCMCIA)) )
140 return ERR_PTR(-ENODEV); 134 return ERR_PTR(-ENODEV);
141 135
142 pr_info("Looking for PCMCIA ethernet card : "); 136 printk("Looking for PCMCIA ethernet card : ");
143 137
144 /* check if a card is inserted */ 138 /* check if a card is inserted */
145 if (!(PCMCIA_INSERTED)) { 139 if (!(PCMCIA_INSERTED)) {
146 pr_cont("NO PCMCIA card inserted\n"); 140 printk("NO PCMCIA card inserted\n");
147 return ERR_PTR(-ENODEV); 141 return ERR_PTR(-ENODEV);
148 } 142 }
149 143
@@ -154,8 +148,6 @@ struct net_device * __init apne_probe(int unit)
154 sprintf(dev->name, "eth%d", unit); 148 sprintf(dev->name, "eth%d", unit);
155 netdev_boot_setup_check(dev); 149 netdev_boot_setup_check(dev);
156 } 150 }
157 ei_local = netdev_priv(dev);
158 ei_local->msg_enable = apne_msg_enable;
159 151
160 /* disable pcmcia irq for readtuple */ 152 /* disable pcmcia irq for readtuple */
161 pcmcia_disable_irq(); 153 pcmcia_disable_irq();
@@ -163,14 +155,14 @@ struct net_device * __init apne_probe(int unit)
163#ifndef MANUAL_CONFIG 155#ifndef MANUAL_CONFIG
164 if ((pcmcia_copy_tuple(CISTPL_FUNCID, tuple, 8) < 3) || 156 if ((pcmcia_copy_tuple(CISTPL_FUNCID, tuple, 8) < 3) ||
165 (tuple[2] != CISTPL_FUNCID_NETWORK)) { 157 (tuple[2] != CISTPL_FUNCID_NETWORK)) {
166 pr_cont("not an ethernet card\n"); 158 printk("not an ethernet card\n");
167 /* XXX: shouldn't we re-enable irq here? */ 159 /* XXX: shouldn't we re-enable irq here? */
168 free_netdev(dev); 160 free_netdev(dev);
169 return ERR_PTR(-ENODEV); 161 return ERR_PTR(-ENODEV);
170 } 162 }
171#endif 163#endif
172 164
173 pr_cont("ethernet PCMCIA card inserted\n"); 165 printk("ethernet PCMCIA card inserted\n");
174 166
175 if (!init_pcmcia()) { 167 if (!init_pcmcia()) {
176 /* XXX: shouldn't we re-enable irq here? */ 168 /* XXX: shouldn't we re-enable irq here? */
@@ -212,12 +204,11 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
212 int neX000, ctron; 204 int neX000, ctron;
213#endif 205#endif
214 static unsigned version_printed; 206 static unsigned version_printed;
215 struct ei_device *ei_local = netdev_priv(dev);
216 207
217 if ((apne_msg_enable & NETIF_MSG_DRV) && (version_printed++ == 0)) 208 if (ei_debug && version_printed++ == 0)
218 netdev_info(dev, version); 209 printk(version);
219 210
220 netdev_info(dev, "PCMCIA NE*000 ethercard probe"); 211 printk("PCMCIA NE*000 ethercard probe");
221 212
222 /* Reset card. Who knows what dain-bramaged state it was left in. */ 213 /* Reset card. Who knows what dain-bramaged state it was left in. */
223 { unsigned long reset_start_time = jiffies; 214 { unsigned long reset_start_time = jiffies;
@@ -226,7 +217,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
226 217
227 while ((inb(ioaddr + NE_EN0_ISR) & ENISR_RESET) == 0) 218 while ((inb(ioaddr + NE_EN0_ISR) & ENISR_RESET) == 0)
228 if (time_after(jiffies, reset_start_time + 2*HZ/100)) { 219 if (time_after(jiffies, reset_start_time + 2*HZ/100)) {
229 pr_cont(" not found (no reset ack).\n"); 220 printk(" not found (no reset ack).\n");
230 return -ENODEV; 221 return -ENODEV;
231 } 222 }
232 223
@@ -297,7 +288,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
297 start_page = 0x01; 288 start_page = 0x01;
298 stop_page = (wordlength == 2) ? 0x40 : 0x20; 289 stop_page = (wordlength == 2) ? 0x40 : 0x20;
299 } else { 290 } else {
300 pr_cont(" not found.\n"); 291 printk(" not found.\n");
301 return -ENXIO; 292 return -ENXIO;
302 293
303 } 294 }
@@ -329,9 +320,9 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
329 for (i = 0; i < ETH_ALEN; i++) 320 for (i = 0; i < ETH_ALEN; i++)
330 dev->dev_addr[i] = SA_prom[i]; 321 dev->dev_addr[i] = SA_prom[i];
331 322
332 pr_cont(" %pM\n", dev->dev_addr); 323 printk(" %pM\n", dev->dev_addr);
333 324
334 netdev_info(dev, "%s found.\n", name); 325 printk("%s: %s found.\n", dev->name, name);
335 326
336 ei_status.name = name; 327 ei_status.name = name;
337 ei_status.tx_start_page = start_page; 328 ei_status.tx_start_page = start_page;
@@ -361,11 +352,10 @@ static void
361apne_reset_8390(struct net_device *dev) 352apne_reset_8390(struct net_device *dev)
362{ 353{
363 unsigned long reset_start_time = jiffies; 354 unsigned long reset_start_time = jiffies;
364 struct ei_device *ei_local = netdev_priv(dev);
365 355
366 init_pcmcia(); 356 init_pcmcia();
367 357
368 netif_dbg(ei_local, hw, dev, "resetting the 8390 t=%ld...\n", jiffies); 358 if (ei_debug > 1) printk("resetting the 8390 t=%ld...", jiffies);
369 359
370 outb(inb(NE_BASE + NE_RESET), NE_BASE + NE_RESET); 360 outb(inb(NE_BASE + NE_RESET), NE_BASE + NE_RESET);
371 361
@@ -375,8 +365,8 @@ apne_reset_8390(struct net_device *dev)
375 /* This check _should_not_ be necessary, omit eventually. */ 365 /* This check _should_not_ be necessary, omit eventually. */
376 while ((inb(NE_BASE+NE_EN0_ISR) & ENISR_RESET) == 0) 366 while ((inb(NE_BASE+NE_EN0_ISR) & ENISR_RESET) == 0)
377 if (time_after(jiffies, reset_start_time + 2*HZ/100)) { 367 if (time_after(jiffies, reset_start_time + 2*HZ/100)) {
378 netdev_err(dev, "ne_reset_8390() did not complete.\n"); 368 printk("%s: ne_reset_8390() did not complete.\n", dev->name);
379 break; 369 break;
380 } 370 }
381 outb(ENISR_RESET, NE_BASE + NE_EN0_ISR); /* Ack intr. */ 371 outb(ENISR_RESET, NE_BASE + NE_EN0_ISR); /* Ack intr. */
382} 372}
@@ -396,9 +386,9 @@ apne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_pa
396 386
397 /* This *shouldn't* happen. If it does, it's the last thing you'll see */ 387 /* This *shouldn't* happen. If it does, it's the last thing you'll see */
398 if (ei_status.dmaing) { 388 if (ei_status.dmaing) {
399 netdev_err(dev, "DMAing conflict in ne_get_8390_hdr " 389 printk("%s: DMAing conflict in ne_get_8390_hdr "
400 "[DMAstat:%d][irqlock:%d][intr:%d].\n", 390 "[DMAstat:%d][irqlock:%d][intr:%d].\n",
401 ei_status.dmaing, ei_status.irqlock, dev->irq); 391 dev->name, ei_status.dmaing, ei_status.irqlock, dev->irq);
402 return; 392 return;
403 } 393 }
404 394
@@ -443,9 +433,9 @@ apne_block_input(struct net_device *dev, int count, struct sk_buff *skb, int rin
443 433
444 /* This *shouldn't* happen. If it does, it's the last thing you'll see */ 434 /* This *shouldn't* happen. If it does, it's the last thing you'll see */
445 if (ei_status.dmaing) { 435 if (ei_status.dmaing) {
446 netdev_err(dev, "DMAing conflict in ne_block_input " 436 printk("%s: DMAing conflict in ne_block_input "
447 "[DMAstat:%d][irqlock:%d][intr:%d].\n", 437 "[DMAstat:%d][irqlock:%d][intr:%d].\n",
448 ei_status.dmaing, ei_status.irqlock, dev->irq); 438 dev->name, ei_status.dmaing, ei_status.irqlock, dev->irq);
449 return; 439 return;
450 } 440 }
451 ei_status.dmaing |= 0x01; 441 ei_status.dmaing |= 0x01;
@@ -491,9 +481,9 @@ apne_block_output(struct net_device *dev, int count,
491 481
492 /* This *shouldn't* happen. If it does, it's the last thing you'll see */ 482 /* This *shouldn't* happen. If it does, it's the last thing you'll see */
493 if (ei_status.dmaing) { 483 if (ei_status.dmaing) {
494 netdev_err(dev, "DMAing conflict in ne_block_output." 484 printk("%s: DMAing conflict in ne_block_output."
495 "[DMAstat:%d][irqlock:%d][intr:%d]\n", 485 "[DMAstat:%d][irqlock:%d][intr:%d]\n",
496 ei_status.dmaing, ei_status.irqlock, dev->irq); 486 dev->name, ei_status.dmaing, ei_status.irqlock, dev->irq);
497 return; 487 return;
498 } 488 }
499 ei_status.dmaing |= 0x01; 489 ei_status.dmaing |= 0x01;
@@ -523,7 +513,7 @@ apne_block_output(struct net_device *dev, int count,
523 513
524 while ((inb(NE_BASE + NE_EN0_ISR) & ENISR_RDC) == 0) 514 while ((inb(NE_BASE + NE_EN0_ISR) & ENISR_RDC) == 0)
525 if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */ 515 if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */
526 netdev_warn(dev, "timeout waiting for Tx RDC.\n"); 516 printk("%s: timeout waiting for Tx RDC.\n", dev->name);
527 apne_reset_8390(dev); 517 apne_reset_8390(dev);
528 NS8390_init(dev,1); 518 NS8390_init(dev,1);
529 break; 519 break;
@@ -546,8 +536,8 @@ static irqreturn_t apne_interrupt(int irq, void *dev_id)
546 pcmcia_ack_int(pcmcia_intreq); 536 pcmcia_ack_int(pcmcia_intreq);
547 return IRQ_NONE; 537 return IRQ_NONE;
548 } 538 }
549 if (apne_msg_enable & NETIF_MSG_INTR) 539 if (ei_debug > 3)
550 pr_debug("pcmcia intreq = %x\n", pcmcia_intreq); 540 printk("pcmcia intreq = %x\n", pcmcia_intreq);
551 pcmcia_disable_irq(); /* to get rid of the sti() within ei_interrupt */ 541 pcmcia_disable_irq(); /* to get rid of the sti() within ei_interrupt */
552 ei_interrupt(irq, dev_id); 542 ei_interrupt(irq, dev_id);
553 pcmcia_ack_int(pcmcia_get_intreq()); 543 pcmcia_ack_int(pcmcia_get_intreq());
diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c
index 8ed5b34d7553..36fa577970bb 100644
--- a/drivers/net/ethernet/8390/ax88796.c
+++ b/drivers/net/ethernet/8390/ax88796.c
@@ -78,8 +78,6 @@ static unsigned char version[] = "ax88796.c: Copyright 2005,2007 Simtec Electron
78 78
79#define AX_GPOC_PPDSET BIT(6) 79#define AX_GPOC_PPDSET BIT(6)
80 80
81static u32 ax_msg_enable;
82
83/* device private data */ 81/* device private data */
84 82
85struct ax_device { 83struct ax_device {
@@ -149,7 +147,8 @@ static void ax_reset_8390(struct net_device *dev)
149 unsigned long reset_start_time = jiffies; 147 unsigned long reset_start_time = jiffies;
150 void __iomem *addr = (void __iomem *)dev->base_addr; 148 void __iomem *addr = (void __iomem *)dev->base_addr;
151 149
152 netif_dbg(ei_local, hw, dev, "resetting the 8390 t=%ld...\n", jiffies); 150 if (ei_debug > 1)
151 netdev_dbg(dev, "resetting the 8390 t=%ld\n", jiffies);
153 152
154 ei_outb(ei_inb(addr + NE_RESET), addr + NE_RESET); 153 ei_outb(ei_inb(addr + NE_RESET), addr + NE_RESET);
155 154
@@ -497,28 +496,12 @@ static int ax_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
497 return phy_ethtool_sset(phy_dev, cmd); 496 return phy_ethtool_sset(phy_dev, cmd);
498} 497}
499 498
500static u32 ax_get_msglevel(struct net_device *dev)
501{
502 struct ei_device *ei_local = netdev_priv(dev);
503
504 return ei_local->msg_enable;
505}
506
507static void ax_set_msglevel(struct net_device *dev, u32 v)
508{
509 struct ei_device *ei_local = netdev_priv(dev);
510
511 ei_local->msg_enable = v;
512}
513
514static const struct ethtool_ops ax_ethtool_ops = { 499static const struct ethtool_ops ax_ethtool_ops = {
515 .get_drvinfo = ax_get_drvinfo, 500 .get_drvinfo = ax_get_drvinfo,
516 .get_settings = ax_get_settings, 501 .get_settings = ax_get_settings,
517 .set_settings = ax_set_settings, 502 .set_settings = ax_set_settings,
518 .get_link = ethtool_op_get_link, 503 .get_link = ethtool_op_get_link,
519 .get_ts_info = ethtool_op_get_ts_info, 504 .get_ts_info = ethtool_op_get_ts_info,
520 .get_msglevel = ax_get_msglevel,
521 .set_msglevel = ax_set_msglevel,
522}; 505};
523 506
524#ifdef CONFIG_AX88796_93CX6 507#ifdef CONFIG_AX88796_93CX6
@@ -780,7 +763,6 @@ static int ax_init_dev(struct net_device *dev)
780 ei_local->block_output = &ax_block_output; 763 ei_local->block_output = &ax_block_output;
781 ei_local->get_8390_hdr = &ax_get_8390_hdr; 764 ei_local->get_8390_hdr = &ax_get_8390_hdr;
782 ei_local->priv = 0; 765 ei_local->priv = 0;
783 ei_local->msg_enable = ax_msg_enable;
784 766
785 dev->netdev_ops = &ax_netdev_ops; 767 dev->netdev_ops = &ax_netdev_ops;
786 dev->ethtool_ops = &ax_ethtool_ops; 768 dev->ethtool_ops = &ax_ethtool_ops;
diff --git a/drivers/net/ethernet/8390/axnet_cs.c b/drivers/net/ethernet/8390/axnet_cs.c
index 5698a4c85d8e..d801c1410fb0 100644
--- a/drivers/net/ethernet/8390/axnet_cs.c
+++ b/drivers/net/ethernet/8390/axnet_cs.c
@@ -105,7 +105,6 @@ static void AX88190_init(struct net_device *dev, int startp);
105static int ax_open(struct net_device *dev); 105static int ax_open(struct net_device *dev);
106static int ax_close(struct net_device *dev); 106static int ax_close(struct net_device *dev);
107static irqreturn_t ax_interrupt(int irq, void *dev_id); 107static irqreturn_t ax_interrupt(int irq, void *dev_id);
108static u32 axnet_msg_enable;
109 108
110/*====================================================================*/ 109/*====================================================================*/
111 110
@@ -153,7 +152,6 @@ static int axnet_probe(struct pcmcia_device *link)
153 return -ENOMEM; 152 return -ENOMEM;
154 153
155 ei_local = netdev_priv(dev); 154 ei_local = netdev_priv(dev);
156 ei_local->msg_enable = axnet_msg_enable;
157 spin_lock_init(&ei_local->page_lock); 155 spin_lock_init(&ei_local->page_lock);
158 156
159 info = PRIV(dev); 157 info = PRIV(dev);
@@ -652,12 +650,11 @@ static void block_input(struct net_device *dev, int count,
652 struct sk_buff *skb, int ring_offset) 650 struct sk_buff *skb, int ring_offset)
653{ 651{
654 unsigned int nic_base = dev->base_addr; 652 unsigned int nic_base = dev->base_addr;
655 struct ei_device *ei_local = netdev_priv(dev);
656 int xfer_count = count; 653 int xfer_count = count;
657 char *buf = skb->data; 654 char *buf = skb->data;
658 655
659 if ((netif_msg_rx_status(ei_local)) && (count != 4)) 656 if ((ei_debug > 4) && (count != 4))
660 netdev_dbg(dev, "[bi=%d]\n", count+4); 657 pr_debug("%s: [bi=%d]\n", dev->name, count+4);
661 outb_p(ring_offset & 0xff, nic_base + EN0_RSARLO); 658 outb_p(ring_offset & 0xff, nic_base + EN0_RSARLO);
662 outb_p(ring_offset >> 8, nic_base + EN0_RSARHI); 659 outb_p(ring_offset >> 8, nic_base + EN0_RSARHI);
663 outb_p(E8390_RREAD+E8390_START, nic_base + AXNET_CMD); 660 outb_p(E8390_RREAD+E8390_START, nic_base + AXNET_CMD);
@@ -813,6 +810,11 @@ module_pcmcia_driver(axnet_cs_driver);
813#define ei_block_input (ei_local->block_input) 810#define ei_block_input (ei_local->block_input)
814#define ei_get_8390_hdr (ei_local->get_8390_hdr) 811#define ei_get_8390_hdr (ei_local->get_8390_hdr)
815 812
813/* use 0 for production, 1 for verification, >2 for debug */
814#ifndef ei_debug
815int ei_debug = 1;
816#endif
817
816/* Index to functions. */ 818/* Index to functions. */
817static void ei_tx_intr(struct net_device *dev); 819static void ei_tx_intr(struct net_device *dev);
818static void ei_tx_err(struct net_device *dev); 820static void ei_tx_err(struct net_device *dev);
@@ -923,10 +925,11 @@ static void axnet_tx_timeout(struct net_device *dev)
923 isr = inb(e8390_base+EN0_ISR); 925 isr = inb(e8390_base+EN0_ISR);
924 spin_unlock_irqrestore(&ei_local->page_lock, flags); 926 spin_unlock_irqrestore(&ei_local->page_lock, flags);
925 927
926 netdev_dbg(dev, "Tx timed out, %s TSR=%#2x, ISR=%#2x, t=%d.\n", 928 netdev_printk(KERN_DEBUG, dev,
927 (txsr & ENTSR_ABT) ? "excess collisions." : 929 "Tx timed out, %s TSR=%#2x, ISR=%#2x, t=%d.\n",
928 (isr) ? "lost interrupt?" : "cable problem?", 930 (txsr & ENTSR_ABT) ? "excess collisions." :
929 txsr, isr, tickssofar); 931 (isr) ? "lost interrupt?" : "cable problem?",
932 txsr, isr, tickssofar);
930 933
931 if (!isr && !dev->stats.tx_packets) 934 if (!isr && !dev->stats.tx_packets)
932 { 935 {
@@ -995,30 +998,29 @@ static netdev_tx_t axnet_start_xmit(struct sk_buff *skb,
995 { 998 {
996 output_page = ei_local->tx_start_page; 999 output_page = ei_local->tx_start_page;
997 ei_local->tx1 = send_length; 1000 ei_local->tx1 = send_length;
998 if ((netif_msg_tx_queued(ei_local)) && 1001 if (ei_debug && ei_local->tx2 > 0)
999 ei_local->tx2 > 0) 1002 netdev_printk(KERN_DEBUG, dev,
1000 netdev_dbg(dev, 1003 "idle transmitter tx2=%d, lasttx=%d, txing=%d\n",
1001 "idle transmitter tx2=%d, lasttx=%d, txing=%d\n", 1004 ei_local->tx2, ei_local->lasttx,
1002 ei_local->tx2, ei_local->lasttx, 1005 ei_local->txing);
1003 ei_local->txing);
1004 } 1006 }
1005 else if (ei_local->tx2 == 0) 1007 else if (ei_local->tx2 == 0)
1006 { 1008 {
1007 output_page = ei_local->tx_start_page + TX_PAGES/2; 1009 output_page = ei_local->tx_start_page + TX_PAGES/2;
1008 ei_local->tx2 = send_length; 1010 ei_local->tx2 = send_length;
1009 if ((netif_msg_tx_queued(ei_local)) && 1011 if (ei_debug && ei_local->tx1 > 0)
1010 ei_local->tx1 > 0) 1012 netdev_printk(KERN_DEBUG, dev,
1011 netdev_dbg(dev, 1013 "idle transmitter, tx1=%d, lasttx=%d, txing=%d\n",
1012 "idle transmitter, tx1=%d, lasttx=%d, txing=%d\n", 1014 ei_local->tx1, ei_local->lasttx,
1013 ei_local->tx1, ei_local->lasttx, 1015 ei_local->txing);
1014 ei_local->txing);
1015 } 1016 }
1016 else 1017 else
1017 { /* We should never get here. */ 1018 { /* We should never get here. */
1018 netif_dbg(ei_local, tx_err, dev, 1019 if (ei_debug)
1019 "No Tx buffers free! tx1=%d tx2=%d last=%d\n", 1020 netdev_printk(KERN_DEBUG, dev,
1020 ei_local->tx1, ei_local->tx2, 1021 "No Tx buffers free! tx1=%d tx2=%d last=%d\n",
1021 ei_local->lasttx); 1022 ei_local->tx1, ei_local->tx2,
1023 ei_local->lasttx);
1022 ei_local->irqlock = 0; 1024 ei_local->irqlock = 0;
1023 netif_stop_queue(dev); 1025 netif_stop_queue(dev);
1024 outb_p(ENISR_ALL, e8390_base + EN0_IMR); 1026 outb_p(ENISR_ALL, e8390_base + EN0_IMR);
@@ -1122,9 +1124,10 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
1122 spin_unlock_irqrestore(&ei_local->page_lock, flags); 1124 spin_unlock_irqrestore(&ei_local->page_lock, flags);
1123 return IRQ_NONE; 1125 return IRQ_NONE;
1124 } 1126 }
1125 1127
1126 netif_dbg(ei_local, intr, dev, "interrupt(isr=%#2.2x)\n", 1128 if (ei_debug > 3)
1127 inb_p(e8390_base + EN0_ISR)); 1129 netdev_printk(KERN_DEBUG, dev, "interrupt(isr=%#2.2x)\n",
1130 inb_p(e8390_base + EN0_ISR));
1128 1131
1129 outb_p(0x00, e8390_base + EN0_ISR); 1132 outb_p(0x00, e8390_base + EN0_ISR);
1130 ei_local->irqlock = 1; 1133 ei_local->irqlock = 1;
@@ -1134,8 +1137,9 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
1134 ++nr_serviced < MAX_SERVICE) 1137 ++nr_serviced < MAX_SERVICE)
1135 { 1138 {
1136 if (!netif_running(dev) || (interrupts == 0xff)) { 1139 if (!netif_running(dev) || (interrupts == 0xff)) {
1137 netif_warn(ei_local, intr, dev, 1140 if (ei_debug > 1)
1138 "interrupt from stopped card\n"); 1141 netdev_warn(dev,
1142 "interrupt from stopped card\n");
1139 outb_p(interrupts, e8390_base + EN0_ISR); 1143 outb_p(interrupts, e8390_base + EN0_ISR);
1140 interrupts = 0; 1144 interrupts = 0;
1141 break; 1145 break;
@@ -1171,15 +1175,14 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
1171 } 1175 }
1172 } 1176 }
1173 1177
1174 if (interrupts && (netif_msg_intr(ei_local))) 1178 if (interrupts && ei_debug > 3)
1175 { 1179 {
1176 handled = 1; 1180 handled = 1;
1177 if (nr_serviced >= MAX_SERVICE) 1181 if (nr_serviced >= MAX_SERVICE)
1178 { 1182 {
1179 /* 0xFF is valid for a card removal */ 1183 /* 0xFF is valid for a card removal */
1180 if (interrupts != 0xFF) 1184 if(interrupts!=0xFF)
1181 netdev_warn(dev, 1185 netdev_warn(dev, "Too much work at interrupt, status %#2.2x\n",
1182 "Too much work at interrupt, status %#2.2x\n",
1183 interrupts); 1186 interrupts);
1184 outb_p(ENISR_ALL, e8390_base + EN0_ISR); /* Ack. most intrs. */ 1187 outb_p(ENISR_ALL, e8390_base + EN0_ISR); /* Ack. most intrs. */
1185 } else { 1188 } else {
@@ -1218,7 +1221,8 @@ static void ei_tx_err(struct net_device *dev)
1218 unsigned char tx_was_aborted = txsr & (ENTSR_ABT+ENTSR_FU); 1221 unsigned char tx_was_aborted = txsr & (ENTSR_ABT+ENTSR_FU);
1219 1222
1220#ifdef VERBOSE_ERROR_DUMP 1223#ifdef VERBOSE_ERROR_DUMP
1221 netdev_dbg(dev, "transmitter error (%#2x):", txsr); 1224 netdev_printk(KERN_DEBUG, dev,
1225 "transmitter error (%#2x):", txsr);
1222 if (txsr & ENTSR_ABT) 1226 if (txsr & ENTSR_ABT)
1223 pr_cont(" excess-collisions"); 1227 pr_cont(" excess-collisions");
1224 if (txsr & ENTSR_ND) 1228 if (txsr & ENTSR_ND)
@@ -1283,9 +1287,9 @@ static void ei_tx_intr(struct net_device *dev)
1283 else if (ei_local->tx2 < 0) 1287 else if (ei_local->tx2 < 0)
1284 { 1288 {
1285 if (ei_local->lasttx != 2 && ei_local->lasttx != -2) 1289 if (ei_local->lasttx != 2 && ei_local->lasttx != -2)
1286 netdev_err(dev, "%s: bogus last_tx_buffer %d, tx2=%d\n", 1290 netdev_info(dev, "%s: bogus last_tx_buffer %d, tx2=%d\n",
1287 ei_local->name, ei_local->lasttx, 1291 ei_local->name, ei_local->lasttx,
1288 ei_local->tx2); 1292 ei_local->tx2);
1289 ei_local->tx2 = 0; 1293 ei_local->tx2 = 0;
1290 if (ei_local->tx1 > 0) 1294 if (ei_local->tx1 > 0)
1291 { 1295 {
@@ -1362,11 +1366,9 @@ static void ei_receive(struct net_device *dev)
1362 Keep quiet if it looks like a card removal. One problem here 1366 Keep quiet if it looks like a card removal. One problem here
1363 is that some clones crash in roughly the same way. 1367 is that some clones crash in roughly the same way.
1364 */ 1368 */
1365 if ((netif_msg_rx_err(ei_local)) && 1369 if (ei_debug > 0 && this_frame != ei_local->current_page && (this_frame!=0x0 || rxing_page!=0xFF))
1366 this_frame != ei_local->current_page && 1370 netdev_err(dev, "mismatched read page pointers %2x vs %2x\n",
1367 (this_frame != 0x0 || rxing_page != 0xFF)) 1371 this_frame, ei_local->current_page);
1368 netdev_err(dev, "mismatched read page pointers %2x vs %2x\n",
1369 this_frame, ei_local->current_page);
1370 1372
1371 if (this_frame == rxing_page) /* Read all the frames? */ 1373 if (this_frame == rxing_page) /* Read all the frames? */
1372 break; /* Done for now */ 1374 break; /* Done for now */
@@ -1381,10 +1383,11 @@ static void ei_receive(struct net_device *dev)
1381 1383
1382 if (pkt_len < 60 || pkt_len > 1518) 1384 if (pkt_len < 60 || pkt_len > 1518)
1383 { 1385 {
1384 netif_err(ei_local, rx_err, dev, 1386 if (ei_debug)
1385 "bogus packet size: %d, status=%#2x nxpg=%#2x\n", 1387 netdev_printk(KERN_DEBUG, dev,
1386 rx_frame.count, rx_frame.status, 1388 "bogus packet size: %d, status=%#2x nxpg=%#2x\n",
1387 rx_frame.next); 1389 rx_frame.count, rx_frame.status,
1390 rx_frame.next);
1388 dev->stats.rx_errors++; 1391 dev->stats.rx_errors++;
1389 dev->stats.rx_length_errors++; 1392 dev->stats.rx_length_errors++;
1390 } 1393 }
@@ -1395,9 +1398,10 @@ static void ei_receive(struct net_device *dev)
1395 skb = netdev_alloc_skb(dev, pkt_len + 2); 1398 skb = netdev_alloc_skb(dev, pkt_len + 2);
1396 if (skb == NULL) 1399 if (skb == NULL)
1397 { 1400 {
1398 netif_err(ei_local, rx_err, dev, 1401 if (ei_debug > 1)
1399 "Couldn't allocate a sk_buff of size %d\n", 1402 netdev_printk(KERN_DEBUG, dev,
1400 pkt_len); 1403 "Couldn't allocate a sk_buff of size %d\n",
1404 pkt_len);
1401 dev->stats.rx_dropped++; 1405 dev->stats.rx_dropped++;
1402 break; 1406 break;
1403 } 1407 }
@@ -1416,10 +1420,11 @@ static void ei_receive(struct net_device *dev)
1416 } 1420 }
1417 else 1421 else
1418 { 1422 {
1419 netif_err(ei_local, rx_err, dev, 1423 if (ei_debug)
1420 "bogus packet: status=%#2x nxpg=%#2x size=%d\n", 1424 netdev_printk(KERN_DEBUG, dev,
1421 rx_frame.status, rx_frame.next, 1425 "bogus packet: status=%#2x nxpg=%#2x size=%d\n",
1422 rx_frame.count); 1426 rx_frame.status, rx_frame.next,
1427 rx_frame.count);
1423 dev->stats.rx_errors++; 1428 dev->stats.rx_errors++;
1424 /* NB: The NIC counts CRC, frame and missed errors. */ 1429 /* NB: The NIC counts CRC, frame and missed errors. */
1425 if (pkt_stat & ENRSR_FO) 1430 if (pkt_stat & ENRSR_FO)
@@ -1456,7 +1461,6 @@ static void ei_rx_overrun(struct net_device *dev)
1456 axnet_dev_t *info = PRIV(dev); 1461 axnet_dev_t *info = PRIV(dev);
1457 long e8390_base = dev->base_addr; 1462 long e8390_base = dev->base_addr;
1458 unsigned char was_txing, must_resend = 0; 1463 unsigned char was_txing, must_resend = 0;
1459 struct ei_device *ei_local = netdev_priv(dev);
1460 1464
1461 /* 1465 /*
1462 * Record whether a Tx was in progress and then issue the 1466 * Record whether a Tx was in progress and then issue the
@@ -1464,8 +1468,9 @@ static void ei_rx_overrun(struct net_device *dev)
1464 */ 1468 */
1465 was_txing = inb_p(e8390_base+E8390_CMD) & E8390_TRANS; 1469 was_txing = inb_p(e8390_base+E8390_CMD) & E8390_TRANS;
1466 outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD); 1470 outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD);
1467 1471
1468 netif_dbg(ei_local, rx_err, dev, "Receiver overrun\n"); 1472 if (ei_debug > 1)
1473 netdev_printk(KERN_DEBUG, dev, "Receiver overrun\n");
1469 dev->stats.rx_over_errors++; 1474 dev->stats.rx_over_errors++;
1470 1475
1471 /* 1476 /*
diff --git a/drivers/net/ethernet/8390/etherh.c b/drivers/net/ethernet/8390/etherh.c
index b15e482a7c63..78c6fb4b1143 100644
--- a/drivers/net/ethernet/8390/etherh.c
+++ b/drivers/net/ethernet/8390/etherh.c
@@ -56,6 +56,9 @@
56#define ei_inb_p(_p) readb((void __iomem *)_p) 56#define ei_inb_p(_p) readb((void __iomem *)_p)
57#define ei_outb_p(_v,_p) writeb(_v,(void __iomem *)_p) 57#define ei_outb_p(_v,_p) writeb(_v,(void __iomem *)_p)
58 58
59#define NET_DEBUG 0
60#define DEBUG_INIT 2
61
59#define DRV_NAME "etherh" 62#define DRV_NAME "etherh"
60#define DRV_VERSION "1.11" 63#define DRV_VERSION "1.11"
61 64
@@ -64,7 +67,7 @@ static char version[] __initdata =
64 67
65#include "lib8390.c" 68#include "lib8390.c"
66 69
67static u32 etherh_msg_enable; 70static unsigned int net_debug = NET_DEBUG;
68 71
69struct etherh_priv { 72struct etherh_priv {
70 void __iomem *ioc_fast; 73 void __iomem *ioc_fast;
@@ -314,9 +317,9 @@ etherh_block_output (struct net_device *dev, int count, const unsigned char *buf
314 void __iomem *dma_base, *addr; 317 void __iomem *dma_base, *addr;
315 318
316 if (ei_local->dmaing) { 319 if (ei_local->dmaing) {
317 netdev_err(dev, "DMAing conflict in etherh_block_input: " 320 printk(KERN_ERR "%s: DMAing conflict in etherh_block_input: "
318 " DMAstat %d irqlock %d\n", 321 " DMAstat %d irqlock %d\n", dev->name,
319 ei_local->dmaing, ei_local->irqlock); 322 ei_local->dmaing, ei_local->irqlock);
320 return; 323 return;
321 } 324 }
322 325
@@ -358,7 +361,8 @@ etherh_block_output (struct net_device *dev, int count, const unsigned char *buf
358 361
359 while ((readb (addr + EN0_ISR) & ENISR_RDC) == 0) 362 while ((readb (addr + EN0_ISR) & ENISR_RDC) == 0)
360 if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */ 363 if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */
361 netdev_warn(dev, "timeout waiting for TX RDC\n"); 364 printk(KERN_ERR "%s: timeout waiting for TX RDC\n",
365 dev->name);
362 etherh_reset (dev); 366 etherh_reset (dev);
363 __NS8390_init (dev, 1); 367 __NS8390_init (dev, 1);
364 break; 368 break;
@@ -379,9 +383,9 @@ etherh_block_input (struct net_device *dev, int count, struct sk_buff *skb, int
379 void __iomem *dma_base, *addr; 383 void __iomem *dma_base, *addr;
380 384
381 if (ei_local->dmaing) { 385 if (ei_local->dmaing) {
382 netdev_err(dev, "DMAing conflict in etherh_block_input: " 386 printk(KERN_ERR "%s: DMAing conflict in etherh_block_input: "
383 " DMAstat %d irqlock %d\n", 387 " DMAstat %d irqlock %d\n", dev->name,
384 ei_local->dmaing, ei_local->irqlock); 388 ei_local->dmaing, ei_local->irqlock);
385 return; 389 return;
386 } 390 }
387 391
@@ -419,9 +423,9 @@ etherh_get_header (struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_p
419 void __iomem *dma_base, *addr; 423 void __iomem *dma_base, *addr;
420 424
421 if (ei_local->dmaing) { 425 if (ei_local->dmaing) {
422 netdev_err(dev, "DMAing conflict in etherh_get_header: " 426 printk(KERN_ERR "%s: DMAing conflict in etherh_get_header: "
423 " DMAstat %d irqlock %d\n", 427 " DMAstat %d irqlock %d\n", dev->name,
424 ei_local->dmaing, ei_local->irqlock); 428 ei_local->dmaing, ei_local->irqlock);
425 return; 429 return;
426 } 430 }
427 431
@@ -509,8 +513,8 @@ static void __init etherh_banner(void)
509{ 513{
510 static int version_printed; 514 static int version_printed;
511 515
512 if ((etherh_msg_enable & NETIF_MSG_DRV) && (version_printed++ == 0)) 516 if (net_debug && version_printed++ == 0)
513 pr_info("%s", version); 517 printk(KERN_INFO "%s", version);
514} 518}
515 519
516/* 520/*
@@ -621,27 +625,11 @@ static int etherh_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
621 return 0; 625 return 0;
622} 626}
623 627
624static u32 etherh_get_msglevel(struct net_device *dev)
625{
626 struct ei_device *ei_local = netdev_priv(dev);
627
628 return ei_local->msg_enable;
629}
630
631static void etherh_set_msglevel(struct net_device *dev, u32 v)
632{
633 struct ei_device *ei_local = netdev_priv(dev);
634
635 ei_local->msg_enable = v;
636}
637
638static const struct ethtool_ops etherh_ethtool_ops = { 628static const struct ethtool_ops etherh_ethtool_ops = {
639 .get_settings = etherh_get_settings, 629 .get_settings = etherh_get_settings,
640 .set_settings = etherh_set_settings, 630 .set_settings = etherh_set_settings,
641 .get_drvinfo = etherh_get_drvinfo, 631 .get_drvinfo = etherh_get_drvinfo,
642 .get_ts_info = ethtool_op_get_ts_info, 632 .get_ts_info = ethtool_op_get_ts_info,
643 .get_msglevel = etherh_get_msglevel,
644 .set_msglevel = etherh_set_msglevel,
645}; 633};
646 634
647static const struct net_device_ops etherh_netdev_ops = { 635static const struct net_device_ops etherh_netdev_ops = {
@@ -758,7 +746,6 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
758 ei_local->block_output = etherh_block_output; 746 ei_local->block_output = etherh_block_output;
759 ei_local->get_8390_hdr = etherh_get_header; 747 ei_local->get_8390_hdr = etherh_get_header;
760 ei_local->interface_num = 0; 748 ei_local->interface_num = 0;
761 ei_local->msg_enable = etherh_msg_enable;
762 749
763 etherh_reset(dev); 750 etherh_reset(dev);
764 __NS8390_init(dev, 0); 751 __NS8390_init(dev, 0);
@@ -767,8 +754,8 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
767 if (ret) 754 if (ret)
768 goto free; 755 goto free;
769 756
770 netdev_info(dev, "%s in slot %d, %pM\n", 757 printk(KERN_INFO "%s: %s in slot %d, %pM\n",
771 data->name, ec->slot_no, dev->dev_addr); 758 dev->name, data->name, ec->slot_no, dev->dev_addr);
772 759
773 ecard_set_drvdata(ec, dev); 760 ecard_set_drvdata(ec, dev);
774 761
diff --git a/drivers/net/ethernet/8390/hydra.c b/drivers/net/ethernet/8390/hydra.c
index d8b86c83dd15..fb3dd4399cf3 100644
--- a/drivers/net/ethernet/8390/hydra.c
+++ b/drivers/net/ethernet/8390/hydra.c
@@ -66,7 +66,6 @@ static void hydra_block_input(struct net_device *dev, int count,
66static void hydra_block_output(struct net_device *dev, int count, 66static void hydra_block_output(struct net_device *dev, int count,
67 const unsigned char *buf, int start_page); 67 const unsigned char *buf, int start_page);
68static void hydra_remove_one(struct zorro_dev *z); 68static void hydra_remove_one(struct zorro_dev *z);
69static u32 hydra_msg_enable;
70 69
71static struct zorro_device_id hydra_zorro_tbl[] = { 70static struct zorro_device_id hydra_zorro_tbl[] = {
72 { ZORRO_PROD_HYDRA_SYSTEMS_AMIGANET }, 71 { ZORRO_PROD_HYDRA_SYSTEMS_AMIGANET },
@@ -120,7 +119,6 @@ static int hydra_init(struct zorro_dev *z)
120 int start_page, stop_page; 119 int start_page, stop_page;
121 int j; 120 int j;
122 int err; 121 int err;
123 struct ei_device *ei_local;
124 122
125 static u32 hydra_offsets[16] = { 123 static u32 hydra_offsets[16] = {
126 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 124 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e,
@@ -139,8 +137,6 @@ static int hydra_init(struct zorro_dev *z)
139 start_page = NESM_START_PG; 137 start_page = NESM_START_PG;
140 stop_page = NESM_STOP_PG; 138 stop_page = NESM_STOP_PG;
141 139
142 ei_local = netdev_priv(dev);
143 ei_local->msg_enable = hydra_msg_enable;
144 dev->base_addr = ioaddr; 140 dev->base_addr = ioaddr;
145 dev->irq = IRQ_AMIGA_PORTS; 141 dev->irq = IRQ_AMIGA_PORTS;
146 142
@@ -191,16 +187,15 @@ static int hydra_open(struct net_device *dev)
191 187
192static int hydra_close(struct net_device *dev) 188static int hydra_close(struct net_device *dev)
193{ 189{
194 struct ei_device *ei_local = netdev_priv(dev); 190 if (ei_debug > 1)
195 191 printk(KERN_DEBUG "%s: Shutting down ethercard.\n", dev->name);
196 netif_dbg(ei_local, ifdown, dev, "Shutting down ethercard.\n");
197 __ei_close(dev); 192 __ei_close(dev);
198 return 0; 193 return 0;
199} 194}
200 195
201static void hydra_reset_8390(struct net_device *dev) 196static void hydra_reset_8390(struct net_device *dev)
202{ 197{
203 netdev_info(dev, "Hydra hw reset not there\n"); 198 printk(KERN_INFO "Hydra hw reset not there\n");
204} 199}
205 200
206static void hydra_get_8390_hdr(struct net_device *dev, 201static void hydra_get_8390_hdr(struct net_device *dev,
diff --git a/drivers/net/ethernet/8390/lib8390.c b/drivers/net/ethernet/8390/lib8390.c
index d2cd80444ade..b329f5c0d62b 100644
--- a/drivers/net/ethernet/8390/lib8390.c
+++ b/drivers/net/ethernet/8390/lib8390.c
@@ -99,6 +99,11 @@
99#define ei_block_input (ei_local->block_input) 99#define ei_block_input (ei_local->block_input)
100#define ei_get_8390_hdr (ei_local->get_8390_hdr) 100#define ei_get_8390_hdr (ei_local->get_8390_hdr)
101 101
102/* use 0 for production, 1 for verification, >2 for debug */
103#ifndef ei_debug
104int ei_debug = 1;
105#endif
106
102/* Index to functions. */ 107/* Index to functions. */
103static void ei_tx_intr(struct net_device *dev); 108static void ei_tx_intr(struct net_device *dev);
104static void ei_tx_err(struct net_device *dev); 109static void ei_tx_err(struct net_device *dev);
@@ -111,11 +116,6 @@ static void NS8390_trigger_send(struct net_device *dev, unsigned int length,
111static void do_set_multicast_list(struct net_device *dev); 116static void do_set_multicast_list(struct net_device *dev);
112static void __NS8390_init(struct net_device *dev, int startp); 117static void __NS8390_init(struct net_device *dev, int startp);
113 118
114static unsigned version_printed;
115static u32 msg_enable;
116module_param(msg_enable, uint, (S_IRUSR|S_IRGRP|S_IROTH));
117MODULE_PARM_DESC(msg_enable, "Debug message level (see linux/netdevice.h for bitmap)");
118
119/* 119/*
120 * SMP and the 8390 setup. 120 * SMP and the 8390 setup.
121 * 121 *
@@ -345,23 +345,19 @@ static netdev_tx_t __ei_start_xmit(struct sk_buff *skb,
345 if (ei_local->tx1 == 0) { 345 if (ei_local->tx1 == 0) {
346 output_page = ei_local->tx_start_page; 346 output_page = ei_local->tx_start_page;
347 ei_local->tx1 = send_length; 347 ei_local->tx1 = send_length;
348 if ((netif_msg_tx_queued(ei_local)) && 348 if (ei_debug && ei_local->tx2 > 0)
349 ei_local->tx2 > 0) 349 netdev_dbg(dev, "idle transmitter tx2=%d, lasttx=%d, txing=%d\n",
350 netdev_dbg(dev,
351 "idle transmitter tx2=%d, lasttx=%d, txing=%d\n",
352 ei_local->tx2, ei_local->lasttx, ei_local->txing); 350 ei_local->tx2, ei_local->lasttx, ei_local->txing);
353 } else if (ei_local->tx2 == 0) { 351 } else if (ei_local->tx2 == 0) {
354 output_page = ei_local->tx_start_page + TX_PAGES/2; 352 output_page = ei_local->tx_start_page + TX_PAGES/2;
355 ei_local->tx2 = send_length; 353 ei_local->tx2 = send_length;
356 if ((netif_msg_tx_queued(ei_local)) && 354 if (ei_debug && ei_local->tx1 > 0)
357 ei_local->tx1 > 0) 355 netdev_dbg(dev, "idle transmitter, tx1=%d, lasttx=%d, txing=%d\n",
358 netdev_dbg(dev,
359 "idle transmitter, tx1=%d, lasttx=%d, txing=%d\n",
360 ei_local->tx1, ei_local->lasttx, ei_local->txing); 356 ei_local->tx1, ei_local->lasttx, ei_local->txing);
361 } else { /* We should never get here. */ 357 } else { /* We should never get here. */
362 netif_dbg(ei_local, tx_err, dev, 358 if (ei_debug)
363 "No Tx buffers free! tx1=%d tx2=%d last=%d\n", 359 netdev_dbg(dev, "No Tx buffers free! tx1=%d tx2=%d last=%d\n",
364 ei_local->tx1, ei_local->tx2, ei_local->lasttx); 360 ei_local->tx1, ei_local->tx2, ei_local->lasttx);
365 ei_local->irqlock = 0; 361 ei_local->irqlock = 0;
366 netif_stop_queue(dev); 362 netif_stop_queue(dev);
367 ei_outb_p(ENISR_ALL, e8390_base + EN0_IMR); 363 ei_outb_p(ENISR_ALL, e8390_base + EN0_IMR);
@@ -392,7 +388,7 @@ static netdev_tx_t __ei_start_xmit(struct sk_buff *skb,
392 } else 388 } else
393 ei_local->txqueue++; 389 ei_local->txqueue++;
394 390
395 if (ei_local->tx1 && ei_local->tx2) 391 if (ei_local->tx1 && ei_local->tx2)
396 netif_stop_queue(dev); 392 netif_stop_queue(dev);
397 else 393 else
398 netif_start_queue(dev); 394 netif_start_queue(dev);
@@ -449,8 +445,9 @@ static irqreturn_t __ei_interrupt(int irq, void *dev_id)
449 445
450 /* Change to page 0 and read the intr status reg. */ 446 /* Change to page 0 and read the intr status reg. */
451 ei_outb_p(E8390_NODMA+E8390_PAGE0, e8390_base + E8390_CMD); 447 ei_outb_p(E8390_NODMA+E8390_PAGE0, e8390_base + E8390_CMD);
452 netif_dbg(ei_local, intr, dev, "interrupt(isr=%#2.2x)\n", 448 if (ei_debug > 3)
453 ei_inb_p(e8390_base + EN0_ISR)); 449 netdev_dbg(dev, "interrupt(isr=%#2.2x)\n",
450 ei_inb_p(e8390_base + EN0_ISR));
454 451
455 /* !!Assumption!! -- we stay in page 0. Don't break this. */ 452 /* !!Assumption!! -- we stay in page 0. Don't break this. */
456 while ((interrupts = ei_inb_p(e8390_base + EN0_ISR)) != 0 && 453 while ((interrupts = ei_inb_p(e8390_base + EN0_ISR)) != 0 &&
@@ -488,7 +485,7 @@ static irqreturn_t __ei_interrupt(int irq, void *dev_id)
488 ei_outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, e8390_base + E8390_CMD); 485 ei_outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, e8390_base + E8390_CMD);
489 } 486 }
490 487
491 if (interrupts && (netif_msg_intr(ei_local))) { 488 if (interrupts && ei_debug) {
492 ei_outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, e8390_base + E8390_CMD); 489 ei_outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, e8390_base + E8390_CMD);
493 if (nr_serviced >= MAX_SERVICE) { 490 if (nr_serviced >= MAX_SERVICE) {
494 /* 0xFF is valid for a card removal */ 491 /* 0xFF is valid for a card removal */
@@ -679,11 +676,10 @@ static void ei_receive(struct net_device *dev)
679 Keep quiet if it looks like a card removal. One problem here 676 Keep quiet if it looks like a card removal. One problem here
680 is that some clones crash in roughly the same way. 677 is that some clones crash in roughly the same way.
681 */ 678 */
682 if ((netif_msg_rx_status(ei_local)) && 679 if (ei_debug > 0 &&
683 this_frame != ei_local->current_page && 680 this_frame != ei_local->current_page &&
684 (this_frame != 0x0 || rxing_page != 0xFF)) 681 (this_frame != 0x0 || rxing_page != 0xFF))
685 netdev_err(dev, 682 netdev_err(dev, "mismatched read page pointers %2x vs %2x\n",
686 "mismatched read page pointers %2x vs %2x\n",
687 this_frame, ei_local->current_page); 683 this_frame, ei_local->current_page);
688 684
689 if (this_frame == rxing_page) /* Read all the frames? */ 685 if (this_frame == rxing_page) /* Read all the frames? */
@@ -711,10 +707,10 @@ static void ei_receive(struct net_device *dev)
711 } 707 }
712 708
713 if (pkt_len < 60 || pkt_len > 1518) { 709 if (pkt_len < 60 || pkt_len > 1518) {
714 netif_dbg(ei_local, rx_status, dev, 710 if (ei_debug)
715 "bogus packet size: %d, status=%#2x nxpg=%#2x\n", 711 netdev_dbg(dev, "bogus packet size: %d, status=%#2x nxpg=%#2x\n",
716 rx_frame.count, rx_frame.status, 712 rx_frame.count, rx_frame.status,
717 rx_frame.next); 713 rx_frame.next);
718 dev->stats.rx_errors++; 714 dev->stats.rx_errors++;
719 dev->stats.rx_length_errors++; 715 dev->stats.rx_length_errors++;
720 } else if ((pkt_stat & 0x0F) == ENRSR_RXOK) { 716 } else if ((pkt_stat & 0x0F) == ENRSR_RXOK) {
@@ -722,9 +718,9 @@ static void ei_receive(struct net_device *dev)
722 718
723 skb = netdev_alloc_skb(dev, pkt_len + 2); 719 skb = netdev_alloc_skb(dev, pkt_len + 2);
724 if (skb == NULL) { 720 if (skb == NULL) {
725 netif_err(ei_local, rx_err, dev, 721 if (ei_debug > 1)
726 "Couldn't allocate a sk_buff of size %d\n", 722 netdev_dbg(dev, "Couldn't allocate a sk_buff of size %d\n",
727 pkt_len); 723 pkt_len);
728 dev->stats.rx_dropped++; 724 dev->stats.rx_dropped++;
729 break; 725 break;
730 } else { 726 } else {
@@ -740,10 +736,10 @@ static void ei_receive(struct net_device *dev)
740 dev->stats.multicast++; 736 dev->stats.multicast++;
741 } 737 }
742 } else { 738 } else {
743 netif_err(ei_local, rx_err, dev, 739 if (ei_debug)
744 "bogus packet: status=%#2x nxpg=%#2x size=%d\n", 740 netdev_dbg(dev, "bogus packet: status=%#2x nxpg=%#2x size=%d\n",
745 rx_frame.status, rx_frame.next, 741 rx_frame.status, rx_frame.next,
746 rx_frame.count); 742 rx_frame.count);
747 dev->stats.rx_errors++; 743 dev->stats.rx_errors++;
748 /* NB: The NIC counts CRC, frame and missed errors. */ 744 /* NB: The NIC counts CRC, frame and missed errors. */
749 if (pkt_stat & ENRSR_FO) 745 if (pkt_stat & ENRSR_FO)
@@ -793,7 +789,8 @@ static void ei_rx_overrun(struct net_device *dev)
793 was_txing = ei_inb_p(e8390_base+E8390_CMD) & E8390_TRANS; 789 was_txing = ei_inb_p(e8390_base+E8390_CMD) & E8390_TRANS;
794 ei_outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD); 790 ei_outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD);
795 791
796 netif_dbg(ei_local, rx_err, dev, "Receiver overrun\n"); 792 if (ei_debug > 1)
793 netdev_dbg(dev, "Receiver overrun\n");
797 dev->stats.rx_over_errors++; 794 dev->stats.rx_over_errors++;
798 795
799 /* 796 /*
@@ -968,9 +965,8 @@ static void __ei_set_multicast_list(struct net_device *dev)
968static void ethdev_setup(struct net_device *dev) 965static void ethdev_setup(struct net_device *dev)
969{ 966{
970 struct ei_device *ei_local = netdev_priv(dev); 967 struct ei_device *ei_local = netdev_priv(dev);
971 968 if (ei_debug > 1)
972 if ((msg_enable & NETIF_MSG_DRV) && (version_printed++ == 0)) 969 printk(version);
973 pr_info("%s", version);
974 970
975 ether_setup(dev); 971 ether_setup(dev);
976 972
@@ -1039,10 +1035,9 @@ static void __NS8390_init(struct net_device *dev, int startp)
1039 ei_outb_p(E8390_NODMA + E8390_PAGE1 + E8390_STOP, e8390_base+E8390_CMD); /* 0x61 */ 1035 ei_outb_p(E8390_NODMA + E8390_PAGE1 + E8390_STOP, e8390_base+E8390_CMD); /* 0x61 */
1040 for (i = 0; i < 6; i++) { 1036 for (i = 0; i < 6; i++) {
1041 ei_outb_p(dev->dev_addr[i], e8390_base + EN1_PHYS_SHIFT(i)); 1037 ei_outb_p(dev->dev_addr[i], e8390_base + EN1_PHYS_SHIFT(i));
1042 if ((netif_msg_probe(ei_local)) && 1038 if (ei_debug > 1 &&
1043 ei_inb_p(e8390_base + EN1_PHYS_SHIFT(i)) != dev->dev_addr[i]) 1039 ei_inb_p(e8390_base + EN1_PHYS_SHIFT(i)) != dev->dev_addr[i])
1044 netdev_err(dev, 1040 netdev_err(dev, "Hw. address read/write mismap %d\n", i);
1045 "Hw. address read/write mismap %d\n", i);
1046 } 1041 }
1047 1042
1048 ei_outb_p(ei_local->rx_start_page, e8390_base + EN1_CURPAG); 1043 ei_outb_p(ei_local->rx_start_page, e8390_base + EN1_CURPAG);
diff --git a/drivers/net/ethernet/8390/mac8390.c b/drivers/net/ethernet/8390/mac8390.c
index 90e825e8abfe..88ccc8b14f0a 100644
--- a/drivers/net/ethernet/8390/mac8390.c
+++ b/drivers/net/ethernet/8390/mac8390.c
@@ -167,7 +167,6 @@ static void slow_sane_block_output(struct net_device *dev, int count,
167 const unsigned char *buf, int start_page); 167 const unsigned char *buf, int start_page);
168static void word_memcpy_tocard(unsigned long tp, const void *fp, int count); 168static void word_memcpy_tocard(unsigned long tp, const void *fp, int count);
169static void word_memcpy_fromcard(void *tp, unsigned long fp, int count); 169static void word_memcpy_fromcard(void *tp, unsigned long fp, int count);
170static u32 mac8390_msg_enable;
171 170
172static enum mac8390_type __init mac8390_ident(struct nubus_dev *dev) 171static enum mac8390_type __init mac8390_ident(struct nubus_dev *dev)
173{ 172{
@@ -403,7 +402,6 @@ struct net_device * __init mac8390_probe(int unit)
403 struct net_device *dev; 402 struct net_device *dev;
404 struct nubus_dev *ndev = NULL; 403 struct nubus_dev *ndev = NULL;
405 int err = -ENODEV; 404 int err = -ENODEV;
406 struct ei_device *ei_local;
407 405
408 static unsigned int slots; 406 static unsigned int slots;
409 407
@@ -442,10 +440,6 @@ struct net_device * __init mac8390_probe(int unit)
442 440
443 if (!ndev) 441 if (!ndev)
444 goto out; 442 goto out;
445
446 ei_local = netdev_priv(dev);
447 ei_local->msg_enable = mac8390_msg_enable;
448
449 err = register_netdev(dev); 443 err = register_netdev(dev);
450 if (err) 444 if (err)
451 goto out; 445 goto out;
@@ -666,22 +660,19 @@ static int mac8390_close(struct net_device *dev)
666 660
667static void mac8390_no_reset(struct net_device *dev) 661static void mac8390_no_reset(struct net_device *dev)
668{ 662{
669 struct ei_device *ei_local = netdev_priv(dev);
670
671 ei_status.txing = 0; 663 ei_status.txing = 0;
672 netif_info(ei_local, hw, dev, "reset not supported\n"); 664 if (ei_debug > 1)
665 pr_info("reset not supported\n");
673} 666}
674 667
675static void interlan_reset(struct net_device *dev) 668static void interlan_reset(struct net_device *dev)
676{ 669{
677 unsigned char *target = nubus_slot_addr(IRQ2SLOT(dev->irq)); 670 unsigned char *target = nubus_slot_addr(IRQ2SLOT(dev->irq));
678 struct ei_device *ei_local = netdev_priv(dev); 671 if (ei_debug > 1)
679 672 pr_info("Need to reset the NS8390 t=%lu...", jiffies);
680 netif_info(ei_local, hw, dev, "Need to reset the NS8390 t=%lu...",
681 jiffies);
682 ei_status.txing = 0; 673 ei_status.txing = 0;
683 target[0xC0000] = 0; 674 target[0xC0000] = 0;
684 if (netif_msg_hw(ei_local)) 675 if (ei_debug > 1)
685 pr_cont("reset complete\n"); 676 pr_cont("reset complete\n");
686} 677}
687 678
diff --git a/drivers/net/ethernet/8390/mcf8390.c b/drivers/net/ethernet/8390/mcf8390.c
index df0ffca91c1c..230efd6fa5d5 100644
--- a/drivers/net/ethernet/8390/mcf8390.c
+++ b/drivers/net/ethernet/8390/mcf8390.c
@@ -39,7 +39,6 @@ static const char version[] =
39 39
40#define NESM_START_PG 0x40 /* First page of TX buffer */ 40#define NESM_START_PG 0x40 /* First page of TX buffer */
41#define NESM_STOP_PG 0x80 /* Last page +1 of RX ring */ 41#define NESM_STOP_PG 0x80 /* Last page +1 of RX ring */
42static u32 mcf8390_msg_enable;
43 42
44#ifdef NE2000_ODDOFFSET 43#ifdef NE2000_ODDOFFSET
45/* 44/*
@@ -154,9 +153,9 @@ static void mcf8390_reset_8390(struct net_device *dev)
154{ 153{
155 unsigned long reset_start_time = jiffies; 154 unsigned long reset_start_time = jiffies;
156 u32 addr = dev->base_addr; 155 u32 addr = dev->base_addr;
157 struct ei_device *ei_local = netdev_priv(dev);
158 156
159 netif_dbg(ei_local, hw, dev, "resetting the 8390 t=%ld...\n", jiffies); 157 if (ei_debug > 1)
158 netdev_dbg(dev, "resetting the 8390 t=%ld...\n", jiffies);
160 159
161 ei_outb(ei_inb(addr + NE_RESET), addr + NE_RESET); 160 ei_outb(ei_inb(addr + NE_RESET), addr + NE_RESET);
162 161
@@ -289,7 +288,7 @@ static void mcf8390_block_output(struct net_device *dev, int count,
289 dma_start = jiffies; 288 dma_start = jiffies;
290 while ((ei_inb(addr + NE_EN0_ISR) & ENISR_RDC) == 0) { 289 while ((ei_inb(addr + NE_EN0_ISR) & ENISR_RDC) == 0) {
291 if (time_after(jiffies, dma_start + 2 * HZ / 100)) { /* 20ms */ 290 if (time_after(jiffies, dma_start + 2 * HZ / 100)) { /* 20ms */
292 netdev_warn(dev, "timeout waiting for Tx RDC\n"); 291 netdev_err(dev, "timeout waiting for Tx RDC\n");
293 mcf8390_reset_8390(dev); 292 mcf8390_reset_8390(dev);
294 __NS8390_init(dev, 1); 293 __NS8390_init(dev, 1);
295 break; 294 break;
@@ -438,7 +437,6 @@ static int mcf8390_probe(struct platform_device *pdev)
438 SET_NETDEV_DEV(dev, &pdev->dev); 437 SET_NETDEV_DEV(dev, &pdev->dev);
439 platform_set_drvdata(pdev, dev); 438 platform_set_drvdata(pdev, dev);
440 ei_local = netdev_priv(dev); 439 ei_local = netdev_priv(dev);
441 ei_local->msg_enable = mcf8390_msg_enable;
442 440
443 dev->irq = irq->start; 441 dev->irq = irq->start;
444 dev->base_addr = mem->start; 442 dev->base_addr = mem->start;
diff --git a/drivers/net/ethernet/8390/ne.c b/drivers/net/ethernet/8390/ne.c
index 58eaa8f34942..b2e840513735 100644
--- a/drivers/net/ethernet/8390/ne.c
+++ b/drivers/net/ethernet/8390/ne.c
@@ -71,17 +71,14 @@ static struct platform_device *pdev_ne[MAX_NE_CARDS];
71static int io[MAX_NE_CARDS]; 71static int io[MAX_NE_CARDS];
72static int irq[MAX_NE_CARDS]; 72static int irq[MAX_NE_CARDS];
73static int bad[MAX_NE_CARDS]; 73static int bad[MAX_NE_CARDS];
74static u32 ne_msg_enable;
75 74
76#ifdef MODULE 75#ifdef MODULE
77module_param_array(io, int, NULL, 0); 76module_param_array(io, int, NULL, 0);
78module_param_array(irq, int, NULL, 0); 77module_param_array(irq, int, NULL, 0);
79module_param_array(bad, int, NULL, 0); 78module_param_array(bad, int, NULL, 0);
80module_param_named(msg_enable, ne_msg_enable, uint, (S_IRUSR|S_IRGRP|S_IROTH));
81MODULE_PARM_DESC(io, "I/O base address(es),required"); 79MODULE_PARM_DESC(io, "I/O base address(es),required");
82MODULE_PARM_DESC(irq, "IRQ number(s)"); 80MODULE_PARM_DESC(irq, "IRQ number(s)");
83MODULE_PARM_DESC(bad, "Accept card(s) with bad signatures"); 81MODULE_PARM_DESC(bad, "Accept card(s) with bad signatures");
84MODULE_PARM_DESC(msg_enable, "Debug message level (see linux/netdevice.h for bitmap)");
85MODULE_DESCRIPTION("NE1000/NE2000 ISA/PnP Ethernet driver"); 82MODULE_DESCRIPTION("NE1000/NE2000 ISA/PnP Ethernet driver");
86MODULE_LICENSE("GPL"); 83MODULE_LICENSE("GPL");
87#endif /* MODULE */ 84#endif /* MODULE */
@@ -217,8 +214,8 @@ static int __init do_ne_probe(struct net_device *dev)
217 if (base_addr > 0x1ff) { /* Check a single specified location. */ 214 if (base_addr > 0x1ff) { /* Check a single specified location. */
218 int ret = ne_probe1(dev, base_addr); 215 int ret = ne_probe1(dev, base_addr);
219 if (ret) 216 if (ret)
220 netdev_warn(dev, "ne.c: No NE*000 card found at " 217 printk(KERN_WARNING "ne.c: No NE*000 card found at "
221 "i/o = %#lx\n", base_addr); 218 "i/o = %#lx\n", base_addr);
222 return ret; 219 return ret;
223 } 220 }
224 else if (base_addr != 0) /* Don't probe at all. */ 221 else if (base_addr != 0) /* Don't probe at all. */
@@ -267,14 +264,11 @@ static int __init ne_probe_isapnp(struct net_device *dev)
267 /* found it */ 264 /* found it */
268 dev->base_addr = pnp_port_start(idev, 0); 265 dev->base_addr = pnp_port_start(idev, 0);
269 dev->irq = pnp_irq(idev, 0); 266 dev->irq = pnp_irq(idev, 0);
270 netdev_info(dev, 267 printk(KERN_INFO "ne.c: ISAPnP reports %s at i/o %#lx, irq %d.\n",
271 "ne.c: ISAPnP reports %s at i/o %#lx, irq %d.\n", 268 (char *) isapnp_clone_list[i].driver_data,
272 (char *) isapnp_clone_list[i].driver_data, 269 dev->base_addr, dev->irq);
273 dev->base_addr, dev->irq);
274 if (ne_probe1(dev, dev->base_addr) != 0) { /* Shouldn't happen. */ 270 if (ne_probe1(dev, dev->base_addr) != 0) { /* Shouldn't happen. */
275 netdev_err(dev, 271 printk(KERN_ERR "ne.c: Probe of ISAPnP card at %#lx failed.\n", dev->base_addr);
276 "ne.c: Probe of ISAPnP card at %#lx failed.\n",
277 dev->base_addr);
278 pnp_device_detach(idev); 272 pnp_device_detach(idev);
279 return -ENXIO; 273 return -ENXIO;
280 } 274 }
@@ -299,7 +293,6 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
299 int neX000, ctron, copam, bad_card; 293 int neX000, ctron, copam, bad_card;
300 int reg0, ret; 294 int reg0, ret;
301 static unsigned version_printed; 295 static unsigned version_printed;
302 struct ei_device *ei_local = netdev_priv(dev);
303 296
304 if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME)) 297 if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME))
305 return -EBUSY; 298 return -EBUSY;
@@ -326,10 +319,10 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
326 } 319 }
327 } 320 }
328 321
329 if ((ne_msg_enable & NETIF_MSG_DRV) && (version_printed++ == 0)) 322 if (ei_debug && version_printed++ == 0)
330 netdev_info(dev, "%s%s", version1, version2); 323 printk(KERN_INFO "%s%s", version1, version2);
331 324
332 netdev_info(dev, "NE*000 ethercard probe at %#3lx:", ioaddr); 325 printk(KERN_INFO "NE*000 ethercard probe at %#3lx:", ioaddr);
333 326
334 /* A user with a poor card that fails to ack the reset, or that 327 /* A user with a poor card that fails to ack the reset, or that
335 does not have a valid 0x57,0x57 signature can still use this 328 does not have a valid 0x57,0x57 signature can still use this
@@ -350,10 +343,10 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
350 while ((inb_p(ioaddr + EN0_ISR) & ENISR_RESET) == 0) 343 while ((inb_p(ioaddr + EN0_ISR) & ENISR_RESET) == 0)
351 if (time_after(jiffies, reset_start_time + 2*HZ/100)) { 344 if (time_after(jiffies, reset_start_time + 2*HZ/100)) {
352 if (bad_card) { 345 if (bad_card) {
353 pr_cont(" (warning: no reset ack)"); 346 printk(" (warning: no reset ack)");
354 break; 347 break;
355 } else { 348 } else {
356 pr_cont(" not found (no reset ack).\n"); 349 printk(" not found (no reset ack).\n");
357 ret = -ENODEV; 350 ret = -ENODEV;
358 goto err_out; 351 goto err_out;
359 } 352 }
@@ -461,13 +454,13 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
461 } 454 }
462 if (bad_clone_list[i].name8 == NULL) 455 if (bad_clone_list[i].name8 == NULL)
463 { 456 {
464 pr_cont(" not found (invalid signature %2.2x %2.2x).\n", 457 printk(" not found (invalid signature %2.2x %2.2x).\n",
465 SA_prom[14], SA_prom[15]); 458 SA_prom[14], SA_prom[15]);
466 ret = -ENXIO; 459 ret = -ENXIO;
467 goto err_out; 460 goto err_out;
468 } 461 }
469#else 462#else
470 pr_cont(" not found.\n"); 463 printk(" not found.\n");
471 ret = -ENXIO; 464 ret = -ENXIO;
472 goto err_out; 465 goto err_out;
473#endif 466#endif
@@ -483,15 +476,15 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
483 mdelay(10); /* wait 10ms for interrupt to propagate */ 476 mdelay(10); /* wait 10ms for interrupt to propagate */
484 outb_p(0x00, ioaddr + EN0_IMR); /* Mask it again. */ 477 outb_p(0x00, ioaddr + EN0_IMR); /* Mask it again. */
485 dev->irq = probe_irq_off(cookie); 478 dev->irq = probe_irq_off(cookie);
486 if (netif_msg_probe(ei_local)) 479 if (ei_debug > 2)
487 pr_cont(" autoirq is %d", dev->irq); 480 printk(" autoirq is %d\n", dev->irq);
488 } else if (dev->irq == 2) 481 } else if (dev->irq == 2)
489 /* Fixup for users that don't know that IRQ 2 is really IRQ 9, 482 /* Fixup for users that don't know that IRQ 2 is really IRQ 9,
490 or don't know which one to set. */ 483 or don't know which one to set. */
491 dev->irq = 9; 484 dev->irq = 9;
492 485
493 if (! dev->irq) { 486 if (! dev->irq) {
494 pr_cont(" failed to detect IRQ line.\n"); 487 printk(" failed to detect IRQ line.\n");
495 ret = -EAGAIN; 488 ret = -EAGAIN;
496 goto err_out; 489 goto err_out;
497 } 490 }
@@ -500,7 +493,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
500 share and the board will usually be enabled. */ 493 share and the board will usually be enabled. */
501 ret = request_irq(dev->irq, eip_interrupt, 0, name, dev); 494 ret = request_irq(dev->irq, eip_interrupt, 0, name, dev);
502 if (ret) { 495 if (ret) {
503 pr_cont(" unable to get IRQ %d (errno=%d).\n", dev->irq, ret); 496 printk (" unable to get IRQ %d (errno=%d).\n", dev->irq, ret);
504 goto err_out; 497 goto err_out;
505 } 498 }
506 499
@@ -519,7 +512,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
519 } 512 }
520#endif 513#endif
521 514
522 pr_cont("%pM\n", dev->dev_addr); 515 printk("%pM\n", dev->dev_addr);
523 516
524 ei_status.name = name; 517 ei_status.name = name;
525 ei_status.tx_start_page = start_page; 518 ei_status.tx_start_page = start_page;
@@ -543,12 +536,11 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
543 dev->netdev_ops = &eip_netdev_ops; 536 dev->netdev_ops = &eip_netdev_ops;
544 NS8390p_init(dev, 0); 537 NS8390p_init(dev, 0);
545 538
546 ei_local->msg_enable = ne_msg_enable;
547 ret = register_netdev(dev); 539 ret = register_netdev(dev);
548 if (ret) 540 if (ret)
549 goto out_irq; 541 goto out_irq;
550 netdev_info(dev, "%s found at %#lx, using IRQ %d.\n", 542 printk(KERN_INFO "%s: %s found at %#lx, using IRQ %d.\n",
551 name, ioaddr, dev->irq); 543 dev->name, name, ioaddr, dev->irq);
552 return 0; 544 return 0;
553 545
554out_irq: 546out_irq:
@@ -564,9 +556,9 @@ err_out:
564static void ne_reset_8390(struct net_device *dev) 556static void ne_reset_8390(struct net_device *dev)
565{ 557{
566 unsigned long reset_start_time = jiffies; 558 unsigned long reset_start_time = jiffies;
567 struct ei_device *ei_local = netdev_priv(dev);
568 559
569 netif_dbg(ei_local, hw, dev, "resetting the 8390 t=%ld...\n", jiffies); 560 if (ei_debug > 1)
561 printk(KERN_DEBUG "resetting the 8390 t=%ld...", jiffies);
570 562
571 /* DON'T change these to inb_p/outb_p or reset will fail on clones. */ 563 /* DON'T change these to inb_p/outb_p or reset will fail on clones. */
572 outb(inb(NE_BASE + NE_RESET), NE_BASE + NE_RESET); 564 outb(inb(NE_BASE + NE_RESET), NE_BASE + NE_RESET);
@@ -577,7 +569,7 @@ static void ne_reset_8390(struct net_device *dev)
577 /* This check _should_not_ be necessary, omit eventually. */ 569 /* This check _should_not_ be necessary, omit eventually. */
578 while ((inb_p(NE_BASE+EN0_ISR) & ENISR_RESET) == 0) 570 while ((inb_p(NE_BASE+EN0_ISR) & ENISR_RESET) == 0)
579 if (time_after(jiffies, reset_start_time + 2*HZ/100)) { 571 if (time_after(jiffies, reset_start_time + 2*HZ/100)) {
580 netdev_err(dev, "ne_reset_8390() did not complete.\n"); 572 printk(KERN_WARNING "%s: ne_reset_8390() did not complete.\n", dev->name);
581 break; 573 break;
582 } 574 }
583 outb_p(ENISR_RESET, NE_BASE + EN0_ISR); /* Ack intr. */ 575 outb_p(ENISR_RESET, NE_BASE + EN0_ISR); /* Ack intr. */
@@ -595,9 +587,9 @@ static void ne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, i
595 587
596 if (ei_status.dmaing) 588 if (ei_status.dmaing)
597 { 589 {
598 netdev_err(dev, "DMAing conflict in ne_get_8390_hdr " 590 printk(KERN_EMERG "%s: DMAing conflict in ne_get_8390_hdr "
599 "[DMAstat:%d][irqlock:%d].\n", 591 "[DMAstat:%d][irqlock:%d].\n",
600 ei_status.dmaing, ei_status.irqlock); 592 dev->name, ei_status.dmaing, ei_status.irqlock);
601 return; 593 return;
602 } 594 }
603 595
@@ -629,7 +621,6 @@ static void ne_block_input(struct net_device *dev, int count, struct sk_buff *sk
629{ 621{
630#ifdef NE_SANITY_CHECK 622#ifdef NE_SANITY_CHECK
631 int xfer_count = count; 623 int xfer_count = count;
632 struct ei_device *ei_local = netdev_priv(dev);
633#endif 624#endif
634 int nic_base = dev->base_addr; 625 int nic_base = dev->base_addr;
635 char *buf = skb->data; 626 char *buf = skb->data;
@@ -637,9 +628,9 @@ static void ne_block_input(struct net_device *dev, int count, struct sk_buff *sk
637 /* This *shouldn't* happen. If it does, it's the last thing you'll see */ 628 /* This *shouldn't* happen. If it does, it's the last thing you'll see */
638 if (ei_status.dmaing) 629 if (ei_status.dmaing)
639 { 630 {
640 netdev_err(dev, "DMAing conflict in ne_block_input " 631 printk(KERN_EMERG "%s: DMAing conflict in ne_block_input "
641 "[DMAstat:%d][irqlock:%d].\n", 632 "[DMAstat:%d][irqlock:%d].\n",
642 ei_status.dmaing, ei_status.irqlock); 633 dev->name, ei_status.dmaing, ei_status.irqlock);
643 return; 634 return;
644 } 635 }
645 ei_status.dmaing |= 0x01; 636 ei_status.dmaing |= 0x01;
@@ -669,7 +660,7 @@ static void ne_block_input(struct net_device *dev, int count, struct sk_buff *sk
669 this message you either 1) have a slightly incompatible clone 660 this message you either 1) have a slightly incompatible clone
670 or 2) have noise/speed problems with your bus. */ 661 or 2) have noise/speed problems with your bus. */
671 662
672 if (netif_msg_rx_status(ei_local)) 663 if (ei_debug > 1)
673 { 664 {
674 /* DMA termination address check... */ 665 /* DMA termination address check... */
675 int addr, tries = 20; 666 int addr, tries = 20;
@@ -683,9 +674,9 @@ static void ne_block_input(struct net_device *dev, int count, struct sk_buff *sk
683 break; 674 break;
684 } while (--tries > 0); 675 } while (--tries > 0);
685 if (tries <= 0) 676 if (tries <= 0)
686 netdev_warn(dev, "RX transfer address mismatch," 677 printk(KERN_WARNING "%s: RX transfer address mismatch,"
687 "%#4.4x (expected) vs. %#4.4x (actual).\n", 678 "%#4.4x (expected) vs. %#4.4x (actual).\n",
688 ring_offset + xfer_count, addr); 679 dev->name, ring_offset + xfer_count, addr);
689 } 680 }
690#endif 681#endif
691 outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */ 682 outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
@@ -699,7 +690,6 @@ static void ne_block_output(struct net_device *dev, int count,
699 unsigned long dma_start; 690 unsigned long dma_start;
700#ifdef NE_SANITY_CHECK 691#ifdef NE_SANITY_CHECK
701 int retries = 0; 692 int retries = 0;
702 struct ei_device *ei_local = netdev_priv(dev);
703#endif 693#endif
704 694
705 /* Round the count up for word writes. Do we need to do this? 695 /* Round the count up for word writes. Do we need to do this?
@@ -712,9 +702,9 @@ static void ne_block_output(struct net_device *dev, int count,
712 /* This *shouldn't* happen. If it does, it's the last thing you'll see */ 702 /* This *shouldn't* happen. If it does, it's the last thing you'll see */
713 if (ei_status.dmaing) 703 if (ei_status.dmaing)
714 { 704 {
715 netdev_err(dev, "DMAing conflict in ne_block_output." 705 printk(KERN_EMERG "%s: DMAing conflict in ne_block_output."
716 "[DMAstat:%d][irqlock:%d]\n", 706 "[DMAstat:%d][irqlock:%d]\n",
717 ei_status.dmaing, ei_status.irqlock); 707 dev->name, ei_status.dmaing, ei_status.irqlock);
718 return; 708 return;
719 } 709 }
720 ei_status.dmaing |= 0x01; 710 ei_status.dmaing |= 0x01;
@@ -761,7 +751,7 @@ retry:
761 /* This was for the ALPHA version only, but enough people have 751 /* This was for the ALPHA version only, but enough people have
762 been encountering problems so it is still here. */ 752 been encountering problems so it is still here. */
763 753
764 if (netif_msg_tx_queued(ei_local)) 754 if (ei_debug > 1)
765 { 755 {
766 /* DMA termination address check... */ 756 /* DMA termination address check... */
767 int addr, tries = 20; 757 int addr, tries = 20;
@@ -775,9 +765,9 @@ retry:
775 765
776 if (tries <= 0) 766 if (tries <= 0)
777 { 767 {
778 netdev_warn(dev, "Tx packet transfer address mismatch," 768 printk(KERN_WARNING "%s: Tx packet transfer address mismatch,"
779 "%#4.4x (expected) vs. %#4.4x (actual).\n", 769 "%#4.4x (expected) vs. %#4.4x (actual).\n",
780 (start_page << 8) + count, addr); 770 dev->name, (start_page << 8) + count, addr);
781 if (retries++ == 0) 771 if (retries++ == 0)
782 goto retry; 772 goto retry;
783 } 773 }
@@ -786,7 +776,7 @@ retry:
786 776
787 while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0) 777 while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0)
788 if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */ 778 if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */
789 netdev_warn(dev, "timeout waiting for Tx RDC.\n"); 779 printk(KERN_WARNING "%s: timeout waiting for Tx RDC.\n", dev->name);
790 ne_reset_8390(dev); 780 ne_reset_8390(dev);
791 NS8390p_init(dev, 1); 781 NS8390p_init(dev, 1);
792 break; 782 break;
@@ -946,8 +936,8 @@ int __init init_module(void)
946 retval = platform_driver_probe(&ne_driver, ne_drv_probe); 936 retval = platform_driver_probe(&ne_driver, ne_drv_probe);
947 if (retval) { 937 if (retval) {
948 if (io[0] == 0) 938 if (io[0] == 0)
949 pr_notice("ne.c: You must supply \"io=0xNNN\"" 939 printk(KERN_NOTICE "ne.c: You must supply \"io=0xNNN\""
950 " value(s) for ISA cards.\n"); 940 " value(s) for ISA cards.\n");
951 ne_loop_rm_unreg(1); 941 ne_loop_rm_unreg(1);
952 return retval; 942 return retval;
953 } 943 }
diff --git a/drivers/net/ethernet/8390/ne2k-pci.c b/drivers/net/ethernet/8390/ne2k-pci.c
index f395c967262e..fc14a85e4d5f 100644
--- a/drivers/net/ethernet/8390/ne2k-pci.c
+++ b/drivers/net/ethernet/8390/ne2k-pci.c
@@ -33,6 +33,8 @@
33/* The user-configurable values. 33/* The user-configurable values.
34 These may be modified when a driver module is loaded.*/ 34 These may be modified when a driver module is loaded.*/
35 35
36static int debug = 1; /* 1 normal messages, 0 quiet .. 7 verbose. */
37
36#define MAX_UNITS 8 /* More are supported, limit only on options */ 38#define MAX_UNITS 8 /* More are supported, limit only on options */
37/* Used to pass the full-duplex flag, etc. */ 39/* Used to pass the full-duplex flag, etc. */
38static int full_duplex[MAX_UNITS]; 40static int full_duplex[MAX_UNITS];
@@ -58,8 +60,6 @@ static int options[MAX_UNITS];
58 60
59#include "8390.h" 61#include "8390.h"
60 62
61static u32 ne2k_msg_enable;
62
63/* These identify the driver base version and may not be removed. */ 63/* These identify the driver base version and may not be removed. */
64static const char version[] = 64static const char version[] =
65 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE 65 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE
@@ -76,10 +76,10 @@ MODULE_AUTHOR("Donald Becker / Paul Gortmaker");
76MODULE_DESCRIPTION("PCI NE2000 clone driver"); 76MODULE_DESCRIPTION("PCI NE2000 clone driver");
77MODULE_LICENSE("GPL"); 77MODULE_LICENSE("GPL");
78 78
79module_param_named(msg_enable, ne2k_msg_enable, uint, (S_IRUSR|S_IRGRP|S_IROTH)); 79module_param(debug, int, 0);
80module_param_array(options, int, NULL, 0); 80module_param_array(options, int, NULL, 0);
81module_param_array(full_duplex, int, NULL, 0); 81module_param_array(full_duplex, int, NULL, 0);
82MODULE_PARM_DESC(msg_enable, "Debug message level (see linux/netdevice.h for bitmap)"); 82MODULE_PARM_DESC(debug, "debug level (1-2)");
83MODULE_PARM_DESC(options, "Bit 5: full duplex"); 83MODULE_PARM_DESC(options, "Bit 5: full duplex");
84MODULE_PARM_DESC(full_duplex, "full duplex setting(s) (1)"); 84MODULE_PARM_DESC(full_duplex, "full duplex setting(s) (1)");
85 85
@@ -226,7 +226,6 @@ static int ne2k_pci_init_one(struct pci_dev *pdev,
226 static unsigned int fnd_cnt; 226 static unsigned int fnd_cnt;
227 long ioaddr; 227 long ioaddr;
228 int flags = pci_clone_list[chip_idx].flags; 228 int flags = pci_clone_list[chip_idx].flags;
229 struct ei_device *ei_local;
230 229
231/* when built into the kernel, we only print version if device is found */ 230/* when built into the kernel, we only print version if device is found */
232#ifndef MODULE 231#ifndef MODULE
@@ -281,8 +280,6 @@ static int ne2k_pci_init_one(struct pci_dev *pdev,
281 goto err_out_free_res; 280 goto err_out_free_res;
282 } 281 }
283 dev->netdev_ops = &ne2k_netdev_ops; 282 dev->netdev_ops = &ne2k_netdev_ops;
284 ei_local = netdev_priv(dev);
285 ei_local->msg_enable = ne2k_msg_enable;
286 283
287 SET_NETDEV_DEV(dev, &pdev->dev); 284 SET_NETDEV_DEV(dev, &pdev->dev);
288 285
@@ -382,9 +379,9 @@ static int ne2k_pci_init_one(struct pci_dev *pdev,
382 if (i) 379 if (i)
383 goto err_out_free_netdev; 380 goto err_out_free_netdev;
384 381
385 netdev_info(dev, "%s found at %#lx, IRQ %d, %pM.\n", 382 printk("%s: %s found at %#lx, IRQ %d, %pM.\n",
386 pci_clone_list[chip_idx].name, ioaddr, dev->irq, 383 dev->name, pci_clone_list[chip_idx].name, ioaddr, dev->irq,
387 dev->dev_addr); 384 dev->dev_addr);
388 385
389 return 0; 386 return 0;
390 387
@@ -453,10 +450,9 @@ static int ne2k_pci_close(struct net_device *dev)
453static void ne2k_pci_reset_8390(struct net_device *dev) 450static void ne2k_pci_reset_8390(struct net_device *dev)
454{ 451{
455 unsigned long reset_start_time = jiffies; 452 unsigned long reset_start_time = jiffies;
456 struct ei_device *ei_local = netdev_priv(dev);
457 453
458 netif_dbg(ei_local, hw, dev, "resetting the 8390 t=%ld...\n", 454 if (debug > 1) printk("%s: Resetting the 8390 t=%ld...",
459 jiffies); 455 dev->name, jiffies);
460 456
461 outb(inb(NE_BASE + NE_RESET), NE_BASE + NE_RESET); 457 outb(inb(NE_BASE + NE_RESET), NE_BASE + NE_RESET);
462 458
@@ -466,7 +462,7 @@ static void ne2k_pci_reset_8390(struct net_device *dev)
466 /* This check _should_not_ be necessary, omit eventually. */ 462 /* This check _should_not_ be necessary, omit eventually. */
467 while ((inb(NE_BASE+EN0_ISR) & ENISR_RESET) == 0) 463 while ((inb(NE_BASE+EN0_ISR) & ENISR_RESET) == 0)
468 if (jiffies - reset_start_time > 2) { 464 if (jiffies - reset_start_time > 2) {
469 netdev_err(dev, "ne2k_pci_reset_8390() did not complete.\n"); 465 printk("%s: ne2k_pci_reset_8390() did not complete.\n", dev->name);
470 break; 466 break;
471 } 467 }
472 outb(ENISR_RESET, NE_BASE + EN0_ISR); /* Ack intr. */ 468 outb(ENISR_RESET, NE_BASE + EN0_ISR); /* Ack intr. */
@@ -483,9 +479,9 @@ static void ne2k_pci_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *
483 479
484 /* This *shouldn't* happen. If it does, it's the last thing you'll see */ 480 /* This *shouldn't* happen. If it does, it's the last thing you'll see */
485 if (ei_status.dmaing) { 481 if (ei_status.dmaing) {
486 netdev_err(dev, "DMAing conflict in ne2k_pci_get_8390_hdr " 482 printk("%s: DMAing conflict in ne2k_pci_get_8390_hdr "
487 "[DMAstat:%d][irqlock:%d].\n", 483 "[DMAstat:%d][irqlock:%d].\n",
488 ei_status.dmaing, ei_status.irqlock); 484 dev->name, ei_status.dmaing, ei_status.irqlock);
489 return; 485 return;
490 } 486 }
491 487
@@ -521,9 +517,9 @@ static void ne2k_pci_block_input(struct net_device *dev, int count,
521 517
522 /* This *shouldn't* happen. If it does, it's the last thing you'll see */ 518 /* This *shouldn't* happen. If it does, it's the last thing you'll see */
523 if (ei_status.dmaing) { 519 if (ei_status.dmaing) {
524 netdev_err(dev, "DMAing conflict in ne2k_pci_block_input " 520 printk("%s: DMAing conflict in ne2k_pci_block_input "
525 "[DMAstat:%d][irqlock:%d].\n", 521 "[DMAstat:%d][irqlock:%d].\n",
526 ei_status.dmaing, ei_status.irqlock); 522 dev->name, ei_status.dmaing, ei_status.irqlock);
527 return; 523 return;
528 } 524 }
529 ei_status.dmaing |= 0x01; 525 ei_status.dmaing |= 0x01;
@@ -576,9 +572,9 @@ static void ne2k_pci_block_output(struct net_device *dev, int count,
576 572
577 /* This *shouldn't* happen. If it does, it's the last thing you'll see */ 573 /* This *shouldn't* happen. If it does, it's the last thing you'll see */
578 if (ei_status.dmaing) { 574 if (ei_status.dmaing) {
579 netdev_err(dev, "DMAing conflict in ne2k_pci_block_output." 575 printk("%s: DMAing conflict in ne2k_pci_block_output."
580 "[DMAstat:%d][irqlock:%d]\n", 576 "[DMAstat:%d][irqlock:%d]\n",
581 ei_status.dmaing, ei_status.irqlock); 577 dev->name, ei_status.dmaing, ei_status.irqlock);
582 return; 578 return;
583 } 579 }
584 ei_status.dmaing |= 0x01; 580 ei_status.dmaing |= 0x01;
@@ -623,7 +619,7 @@ static void ne2k_pci_block_output(struct net_device *dev, int count,
623 619
624 while ((inb(nic_base + EN0_ISR) & ENISR_RDC) == 0) 620 while ((inb(nic_base + EN0_ISR) & ENISR_RDC) == 0)
625 if (jiffies - dma_start > 2) { /* Avoid clock roll-over. */ 621 if (jiffies - dma_start > 2) { /* Avoid clock roll-over. */
626 netdev_warn(dev, "timeout waiting for Tx RDC.\n"); 622 printk(KERN_WARNING "%s: timeout waiting for Tx RDC.\n", dev->name);
627 ne2k_pci_reset_8390(dev); 623 ne2k_pci_reset_8390(dev);
628 NS8390_init(dev,1); 624 NS8390_init(dev,1);
629 break; 625 break;
@@ -644,24 +640,8 @@ static void ne2k_pci_get_drvinfo(struct net_device *dev,
644 strlcpy(info->bus_info, pci_name(pci_dev), sizeof(info->bus_info)); 640 strlcpy(info->bus_info, pci_name(pci_dev), sizeof(info->bus_info));
645} 641}
646 642
647static u32 ne2k_pci_get_msglevel(struct net_device *dev)
648{
649 struct ei_device *ei_local = netdev_priv(dev);
650
651 return ei_local->msg_enable;
652}
653
654static void ne2k_pci_set_msglevel(struct net_device *dev, u32 v)
655{
656 struct ei_device *ei_local = netdev_priv(dev);
657
658 ei_local->msg_enable = v;
659}
660
661static const struct ethtool_ops ne2k_pci_ethtool_ops = { 643static const struct ethtool_ops ne2k_pci_ethtool_ops = {
662 .get_drvinfo = ne2k_pci_get_drvinfo, 644 .get_drvinfo = ne2k_pci_get_drvinfo,
663 .get_msglevel = ne2k_pci_get_msglevel,
664 .set_msglevel = ne2k_pci_set_msglevel,
665}; 645};
666 646
667static void ne2k_pci_remove_one(struct pci_dev *pdev) 647static void ne2k_pci_remove_one(struct pci_dev *pdev)
diff --git a/drivers/net/ethernet/8390/pcnet_cs.c b/drivers/net/ethernet/8390/pcnet_cs.c
index eea33d667fb0..46c5aadaca8e 100644
--- a/drivers/net/ethernet/8390/pcnet_cs.c
+++ b/drivers/net/ethernet/8390/pcnet_cs.c
@@ -67,7 +67,7 @@
67#define PCNET_RDC_TIMEOUT (2*HZ/100) /* Max wait in jiffies for Tx RDC */ 67#define PCNET_RDC_TIMEOUT (2*HZ/100) /* Max wait in jiffies for Tx RDC */
68 68
69static const char *if_names[] = { "auto", "10baseT", "10base2"}; 69static const char *if_names[] = { "auto", "10baseT", "10base2"};
70static u32 pcnet_msg_enable; 70
71 71
72/*====================================================================*/ 72/*====================================================================*/
73 73
@@ -558,7 +558,6 @@ static int pcnet_config(struct pcmcia_device *link)
558 int start_pg, stop_pg, cm_offset; 558 int start_pg, stop_pg, cm_offset;
559 int has_shmem = 0; 559 int has_shmem = 0;
560 hw_info_t *local_hw_info; 560 hw_info_t *local_hw_info;
561 struct ei_device *ei_local;
562 561
563 dev_dbg(&link->dev, "pcnet_config\n"); 562 dev_dbg(&link->dev, "pcnet_config\n");
564 563
@@ -608,8 +607,6 @@ static int pcnet_config(struct pcmcia_device *link)
608 mii_phy_probe(dev); 607 mii_phy_probe(dev);
609 608
610 SET_NETDEV_DEV(dev, &link->dev); 609 SET_NETDEV_DEV(dev, &link->dev);
611 ei_local = netdev_priv(dev);
612 ei_local->msg_enable = pcnet_msg_enable;
613 610
614 if (register_netdev(dev) != 0) { 611 if (register_netdev(dev) != 0) {
615 pr_notice("register_netdev() failed\n"); 612 pr_notice("register_netdev() failed\n");
@@ -619,7 +616,7 @@ static int pcnet_config(struct pcmcia_device *link)
619 if (info->flags & (IS_DL10019|IS_DL10022)) { 616 if (info->flags & (IS_DL10019|IS_DL10022)) {
620 u_char id = inb(dev->base_addr + 0x1a); 617 u_char id = inb(dev->base_addr + 0x1a);
621 netdev_info(dev, "NE2000 (DL100%d rev %02x): ", 618 netdev_info(dev, "NE2000 (DL100%d rev %02x): ",
622 (info->flags & IS_DL10022) ? 22 : 19, id); 619 (info->flags & IS_DL10022) ? 22 : 19, id);
623 if (info->pna_phy) 620 if (info->pna_phy)
624 pr_cont("PNA, "); 621 pr_cont("PNA, ");
625 } else { 622 } else {
@@ -1066,9 +1063,9 @@ static void ei_watchdog(u_long arg)
1066 if (info->phy_id == info->eth_phy) { 1063 if (info->phy_id == info->eth_phy) {
1067 if (p) 1064 if (p)
1068 netdev_info(dev, "autonegotiation complete: " 1065 netdev_info(dev, "autonegotiation complete: "
1069 "%sbaseT-%cD selected\n", 1066 "%sbaseT-%cD selected\n",
1070 ((p & 0x0180) ? "100" : "10"), 1067 ((p & 0x0180) ? "100" : "10"),
1071 ((p & 0x0140) ? 'F' : 'H')); 1068 ((p & 0x0140) ? 'F' : 'H'));
1072 else 1069 else
1073 netdev_info(dev, "link partner did not autonegotiate\n"); 1070 netdev_info(dev, "link partner did not autonegotiate\n");
1074 } 1071 }
@@ -1084,7 +1081,7 @@ static void ei_watchdog(u_long arg)
1084 mdio_write(mii_addr, info->phy_id, 0, 0x0400); 1081 mdio_write(mii_addr, info->phy_id, 0, 0x0400);
1085 info->phy_id ^= info->pna_phy ^ info->eth_phy; 1082 info->phy_id ^= info->pna_phy ^ info->eth_phy;
1086 netdev_info(dev, "switched to %s transceiver\n", 1083 netdev_info(dev, "switched to %s transceiver\n",
1087 (info->phy_id == info->eth_phy) ? "ethernet" : "PNA"); 1084 (info->phy_id == info->eth_phy) ? "ethernet" : "PNA");
1088 mdio_write(mii_addr, info->phy_id, 0, 1085 mdio_write(mii_addr, info->phy_id, 0,
1089 (info->phy_id == info->eth_phy) ? 0x1000 : 0); 1086 (info->phy_id == info->eth_phy) ? 0x1000 : 0);
1090 info->link_status = 0; 1087 info->link_status = 0;
@@ -1131,9 +1128,9 @@ static void dma_get_8390_hdr(struct net_device *dev,
1131 unsigned int nic_base = dev->base_addr; 1128 unsigned int nic_base = dev->base_addr;
1132 1129
1133 if (ei_status.dmaing) { 1130 if (ei_status.dmaing) {
1134 netdev_err(dev, "DMAing conflict in dma_block_input." 1131 netdev_notice(dev, "DMAing conflict in dma_block_input."
1135 "[DMAstat:%1x][irqlock:%1x]\n", 1132 "[DMAstat:%1x][irqlock:%1x]\n",
1136 ei_status.dmaing, ei_status.irqlock); 1133 ei_status.dmaing, ei_status.irqlock);
1137 return; 1134 return;
1138 } 1135 }
1139 1136
@@ -1162,14 +1159,13 @@ static void dma_block_input(struct net_device *dev, int count,
1162 unsigned int nic_base = dev->base_addr; 1159 unsigned int nic_base = dev->base_addr;
1163 int xfer_count = count; 1160 int xfer_count = count;
1164 char *buf = skb->data; 1161 char *buf = skb->data;
1165 struct ei_device *ei_local = netdev_priv(dev);
1166 1162
1167 if ((netif_msg_rx_status(ei_local)) && (count != 4)) 1163 if ((ei_debug > 4) && (count != 4))
1168 netdev_dbg(dev, "[bi=%d]\n", count+4); 1164 netdev_dbg(dev, "[bi=%d]\n", count+4);
1169 if (ei_status.dmaing) { 1165 if (ei_status.dmaing) {
1170 netdev_err(dev, "DMAing conflict in dma_block_input." 1166 netdev_notice(dev, "DMAing conflict in dma_block_input."
1171 "[DMAstat:%1x][irqlock:%1x]\n", 1167 "[DMAstat:%1x][irqlock:%1x]\n",
1172 ei_status.dmaing, ei_status.irqlock); 1168 ei_status.dmaing, ei_status.irqlock);
1173 return; 1169 return;
1174 } 1170 }
1175 ei_status.dmaing |= 0x01; 1171 ei_status.dmaing |= 0x01;
@@ -1187,8 +1183,7 @@ static void dma_block_input(struct net_device *dev, int count,
1187 /* This was for the ALPHA version only, but enough people have been 1183 /* This was for the ALPHA version only, but enough people have been
1188 encountering problems that it is still here. */ 1184 encountering problems that it is still here. */
1189#ifdef PCMCIA_DEBUG 1185#ifdef PCMCIA_DEBUG
1190 /* DMA termination address check... */ 1186 if (ei_debug > 4) { /* DMA termination address check... */
1191 if (netif_msg_rx_status(ei_local)) {
1192 int addr, tries = 20; 1187 int addr, tries = 20;
1193 do { 1188 do {
1194 /* DON'T check for 'inb_p(EN0_ISR) & ENISR_RDC' here 1189 /* DON'T check for 'inb_p(EN0_ISR) & ENISR_RDC' here
@@ -1201,8 +1196,8 @@ static void dma_block_input(struct net_device *dev, int count,
1201 } while (--tries > 0); 1196 } while (--tries > 0);
1202 if (tries <= 0) 1197 if (tries <= 0)
1203 netdev_notice(dev, "RX transfer address mismatch," 1198 netdev_notice(dev, "RX transfer address mismatch,"
1204 "%#4.4x (expected) vs. %#4.4x (actual).\n", 1199 "%#4.4x (expected) vs. %#4.4x (actual).\n",
1205 ring_offset + xfer_count, addr); 1200 ring_offset + xfer_count, addr);
1206 } 1201 }
1207#endif 1202#endif
1208 outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */ 1203 outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
@@ -1218,12 +1213,12 @@ static void dma_block_output(struct net_device *dev, int count,
1218 pcnet_dev_t *info = PRIV(dev); 1213 pcnet_dev_t *info = PRIV(dev);
1219#ifdef PCMCIA_DEBUG 1214#ifdef PCMCIA_DEBUG
1220 int retries = 0; 1215 int retries = 0;
1221 struct ei_device *ei_local = netdev_priv(dev);
1222#endif 1216#endif
1223 u_long dma_start; 1217 u_long dma_start;
1224 1218
1225#ifdef PCMCIA_DEBUG 1219#ifdef PCMCIA_DEBUG
1226 netif_dbg(ei_local, tx_queued, dev, "[bo=%d]\n", count); 1220 if (ei_debug > 4)
1221 netdev_dbg(dev, "[bo=%d]\n", count);
1227#endif 1222#endif
1228 1223
1229 /* Round the count up for word writes. Do we need to do this? 1224 /* Round the count up for word writes. Do we need to do this?
@@ -1232,9 +1227,9 @@ static void dma_block_output(struct net_device *dev, int count,
1232 if (count & 0x01) 1227 if (count & 0x01)
1233 count++; 1228 count++;
1234 if (ei_status.dmaing) { 1229 if (ei_status.dmaing) {
1235 netdev_err(dev, "DMAing conflict in dma_block_output." 1230 netdev_notice(dev, "DMAing conflict in dma_block_output."
1236 "[DMAstat:%1x][irqlock:%1x]\n", 1231 "[DMAstat:%1x][irqlock:%1x]\n",
1237 ei_status.dmaing, ei_status.irqlock); 1232 ei_status.dmaing, ei_status.irqlock);
1238 return; 1233 return;
1239 } 1234 }
1240 ei_status.dmaing |= 0x01; 1235 ei_status.dmaing |= 0x01;
@@ -1261,8 +1256,7 @@ static void dma_block_output(struct net_device *dev, int count,
1261#ifdef PCMCIA_DEBUG 1256#ifdef PCMCIA_DEBUG
1262 /* This was for the ALPHA version only, but enough people have been 1257 /* This was for the ALPHA version only, but enough people have been
1263 encountering problems that it is still here. */ 1258 encountering problems that it is still here. */
1264 /* DMA termination address check... */ 1259 if (ei_debug > 4) { /* DMA termination address check... */
1265 if (netif_msg_tx_queued(ei_local)) {
1266 int addr, tries = 20; 1260 int addr, tries = 20;
1267 do { 1261 do {
1268 int high = inb_p(nic_base + EN0_RSARHI); 1262 int high = inb_p(nic_base + EN0_RSARHI);
@@ -1273,8 +1267,8 @@ static void dma_block_output(struct net_device *dev, int count,
1273 } while (--tries > 0); 1267 } while (--tries > 0);
1274 if (tries <= 0) { 1268 if (tries <= 0) {
1275 netdev_notice(dev, "Tx packet transfer address mismatch," 1269 netdev_notice(dev, "Tx packet transfer address mismatch,"
1276 "%#4.4x (expected) vs. %#4.4x (actual).\n", 1270 "%#4.4x (expected) vs. %#4.4x (actual).\n",
1277 (start_page << 8) + count, addr); 1271 (start_page << 8) + count, addr);
1278 if (retries++ == 0) 1272 if (retries++ == 0)
1279 goto retry; 1273 goto retry;
1280 } 1274 }
@@ -1283,10 +1277,10 @@ static void dma_block_output(struct net_device *dev, int count,
1283 1277
1284 while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0) 1278 while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0)
1285 if (time_after(jiffies, dma_start + PCNET_RDC_TIMEOUT)) { 1279 if (time_after(jiffies, dma_start + PCNET_RDC_TIMEOUT)) {
1286 netdev_warn(dev, "timeout waiting for Tx RDC.\n"); 1280 netdev_notice(dev, "timeout waiting for Tx RDC.\n");
1287 pcnet_reset_8390(dev); 1281 pcnet_reset_8390(dev);
1288 NS8390_init(dev, 1); 1282 NS8390_init(dev, 1);
1289 break; 1283 break;
1290 } 1284 }
1291 1285
1292 outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */ 1286 outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
diff --git a/drivers/net/ethernet/8390/smc-ultra.c b/drivers/net/ethernet/8390/smc-ultra.c
index 139385dcdaa7..b0fbce39661a 100644
--- a/drivers/net/ethernet/8390/smc-ultra.c
+++ b/drivers/net/ethernet/8390/smc-ultra.c
@@ -111,7 +111,6 @@ static struct isapnp_device_id ultra_device_ids[] __initdata = {
111MODULE_DEVICE_TABLE(isapnp, ultra_device_ids); 111MODULE_DEVICE_TABLE(isapnp, ultra_device_ids);
112#endif 112#endif
113 113
114static u32 ultra_msg_enable;
115 114
116#define START_PG 0x00 /* First page of TX buffer */ 115#define START_PG 0x00 /* First page of TX buffer */
117 116
@@ -212,7 +211,6 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr)
212 unsigned char num_pages, irqreg, addr, piomode; 211 unsigned char num_pages, irqreg, addr, piomode;
213 unsigned char idreg = inb(ioaddr + 7); 212 unsigned char idreg = inb(ioaddr + 7);
214 unsigned char reg4 = inb(ioaddr + 4) & 0x7f; 213 unsigned char reg4 = inb(ioaddr + 4) & 0x7f;
215 struct ei_device *ei_local = netdev_priv(dev);
216 214
217 if (!request_region(ioaddr, ULTRA_IO_EXTENT, DRV_NAME)) 215 if (!request_region(ioaddr, ULTRA_IO_EXTENT, DRV_NAME))
218 return -EBUSY; 216 return -EBUSY;
@@ -234,16 +232,16 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr)
234 goto out; 232 goto out;
235 } 233 }
236 234
237 if ((ultra_msg_enable & NETIF_MSG_DRV) && (version_printed++ == 0)) 235 if (ei_debug && version_printed++ == 0)
238 netdev_info(dev, version); 236 printk(version);
239 237
240 model_name = (idreg & 0xF0) == 0x20 ? "SMC Ultra" : "SMC EtherEZ"; 238 model_name = (idreg & 0xF0) == 0x20 ? "SMC Ultra" : "SMC EtherEZ";
241 239
242 for (i = 0; i < 6; i++) 240 for (i = 0; i < 6; i++)
243 dev->dev_addr[i] = inb(ioaddr + 8 + i); 241 dev->dev_addr[i] = inb(ioaddr + 8 + i);
244 242
245 netdev_info(dev, "%s at %#3x, %pM", model_name, 243 printk("%s: %s at %#3x, %pM", dev->name, model_name,
246 ioaddr, dev->dev_addr); 244 ioaddr, dev->dev_addr);
247 245
248 /* Switch from the station address to the alternate register set and 246 /* Switch from the station address to the alternate register set and
249 read the useful registers there. */ 247 read the useful registers there. */
@@ -267,7 +265,7 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr)
267 irq = irqmap[((irqreg & 0x40) >> 4) + ((irqreg & 0x0c) >> 2)]; 265 irq = irqmap[((irqreg & 0x40) >> 4) + ((irqreg & 0x0c) >> 2)];
268 266
269 if (irq == 0) { 267 if (irq == 0) {
270 pr_cont(", failed to detect IRQ line.\n"); 268 printk(", failed to detect IRQ line.\n");
271 retval = -EAGAIN; 269 retval = -EAGAIN;
272 goto out; 270 goto out;
273 } 271 }
@@ -298,7 +296,7 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr)
298 296
299 ei_status.mem = ioremap(dev->mem_start, (ei_status.stop_page - START_PG)*256); 297 ei_status.mem = ioremap(dev->mem_start, (ei_status.stop_page - START_PG)*256);
300 if (!ei_status.mem) { 298 if (!ei_status.mem) {
301 pr_cont(", failed to ioremap.\n"); 299 printk(", failed to ioremap.\n");
302 retval = -ENOMEM; 300 retval = -ENOMEM;
303 goto out; 301 goto out;
304 } 302 }
@@ -306,15 +304,14 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr)
306 dev->mem_end = dev->mem_start + (ei_status.stop_page - START_PG)*256; 304 dev->mem_end = dev->mem_start + (ei_status.stop_page - START_PG)*256;
307 305
308 if (piomode) { 306 if (piomode) {
309 pr_cont(", %s IRQ %d programmed-I/O mode.\n", 307 printk(",%s IRQ %d programmed-I/O mode.\n",
310 eeprom_irq ? "EEPROM" : "assigned ", dev->irq); 308 eeprom_irq ? "EEPROM" : "assigned ", dev->irq);
311 ei_status.block_input = &ultra_pio_input; 309 ei_status.block_input = &ultra_pio_input;
312 ei_status.block_output = &ultra_pio_output; 310 ei_status.block_output = &ultra_pio_output;
313 ei_status.get_8390_hdr = &ultra_pio_get_hdr; 311 ei_status.get_8390_hdr = &ultra_pio_get_hdr;
314 } else { 312 } else {
315 pr_cont(", %s IRQ %d memory %#lx-%#lx.\n", 313 printk(",%s IRQ %d memory %#lx-%#lx.\n", eeprom_irq ? "" : "assigned ",
316 eeprom_irq ? "" : "assigned ", dev->irq, dev->mem_start, 314 dev->irq, dev->mem_start, dev->mem_end-1);
317 dev->mem_end-1);
318 ei_status.block_input = &ultra_block_input; 315 ei_status.block_input = &ultra_block_input;
319 ei_status.block_output = &ultra_block_output; 316 ei_status.block_output = &ultra_block_output;
320 ei_status.get_8390_hdr = &ultra_get_8390_hdr; 317 ei_status.get_8390_hdr = &ultra_get_8390_hdr;
@@ -323,7 +320,6 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr)
323 320
324 dev->netdev_ops = &ultra_netdev_ops; 321 dev->netdev_ops = &ultra_netdev_ops;
325 NS8390_init(dev, 0); 322 NS8390_init(dev, 0);
326 ei_local->msg_enable = ultra_msg_enable;
327 323
328 retval = register_netdev(dev); 324 retval = register_netdev(dev);
329 if (retval) 325 if (retval)
@@ -360,15 +356,12 @@ static int __init ultra_probe_isapnp(struct net_device *dev)
360 /* found it */ 356 /* found it */
361 dev->base_addr = pnp_port_start(idev, 0); 357 dev->base_addr = pnp_port_start(idev, 0);
362 dev->irq = pnp_irq(idev, 0); 358 dev->irq = pnp_irq(idev, 0);
363 netdev_info(dev, 359 printk(KERN_INFO "smc-ultra.c: ISAPnP reports %s at i/o %#lx, irq %d.\n",
364 "smc-ultra.c: ISAPnP reports %s at i/o %#lx, irq %d.\n", 360 (char *) ultra_device_ids[i].driver_data,
365 (char *) ultra_device_ids[i].driver_data, 361 dev->base_addr, dev->irq);
366 dev->base_addr, dev->irq);
367 if (ultra_probe1(dev, dev->base_addr) != 0) { /* Shouldn't happen. */ 362 if (ultra_probe1(dev, dev->base_addr) != 0) { /* Shouldn't happen. */
368 netdev_err(dev, 363 printk(KERN_ERR "smc-ultra.c: Probe of ISAPnP card at %#lx failed.\n", dev->base_addr);
369 "smc-ultra.c: Probe of ISAPnP card at %#lx failed.\n", 364 pnp_device_detach(idev);
370 dev->base_addr);
371 pnp_device_detach(idev);
372 return -ENXIO; 365 return -ENXIO;
373 } 366 }
374 ei_status.priv = (unsigned long)idev; 367 ei_status.priv = (unsigned long)idev;
@@ -419,10 +412,9 @@ static void
419ultra_reset_8390(struct net_device *dev) 412ultra_reset_8390(struct net_device *dev)
420{ 413{
421 int cmd_port = dev->base_addr - ULTRA_NIC_OFFSET; /* ASIC base addr */ 414 int cmd_port = dev->base_addr - ULTRA_NIC_OFFSET; /* ASIC base addr */
422 struct ei_device *ei_local = netdev_priv(dev);
423 415
424 outb(ULTRA_RESET, cmd_port); 416 outb(ULTRA_RESET, cmd_port);
425 netif_dbg(ei_local, hw, dev, "resetting Ultra, t=%ld...\n", jiffies); 417 if (ei_debug > 1) printk("resetting Ultra, t=%ld...", jiffies);
426 ei_status.txing = 0; 418 ei_status.txing = 0;
427 419
428 outb(0x00, cmd_port); /* Disable shared memory for safety. */ 420 outb(0x00, cmd_port); /* Disable shared memory for safety. */
@@ -432,7 +424,7 @@ ultra_reset_8390(struct net_device *dev)
432 else 424 else
433 outb(0x01, cmd_port + 6); /* Enable interrupts and memory. */ 425 outb(0x01, cmd_port + 6); /* Enable interrupts and memory. */
434 426
435 netif_dbg(ei_local, hw, dev, "reset done\n"); 427 if (ei_debug > 1) printk("reset done\n");
436} 428}
437 429
438/* Grab the 8390 specific header. Similar to the block_input routine, but 430/* Grab the 8390 specific header. Similar to the block_input routine, but
@@ -538,11 +530,11 @@ static int
538ultra_close_card(struct net_device *dev) 530ultra_close_card(struct net_device *dev)
539{ 531{
540 int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET; /* CMDREG */ 532 int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET; /* CMDREG */
541 struct ei_device *ei_local = netdev_priv(dev);
542 533
543 netif_stop_queue(dev); 534 netif_stop_queue(dev);
544 535
545 netif_dbg(ei_local, ifdown, dev, "Shutting down ethercard.\n"); 536 if (ei_debug > 1)
537 printk("%s: Shutting down ethercard.\n", dev->name);
546 538
547 outb(0x00, ioaddr + 6); /* Disable interrupts. */ 539 outb(0x00, ioaddr + 6); /* Disable interrupts. */
548 free_irq(dev->irq, dev); 540 free_irq(dev->irq, dev);
@@ -564,10 +556,8 @@ static int irq[MAX_ULTRA_CARDS];
564 556
565module_param_array(io, int, NULL, 0); 557module_param_array(io, int, NULL, 0);
566module_param_array(irq, int, NULL, 0); 558module_param_array(irq, int, NULL, 0);
567module_param_named(msg_enable, ultra_msg_enable, uint, (S_IRUSR|S_IRGRP|S_IROTH));
568MODULE_PARM_DESC(io, "I/O base address(es)"); 559MODULE_PARM_DESC(io, "I/O base address(es)");
569MODULE_PARM_DESC(irq, "IRQ number(s) (assigned)"); 560MODULE_PARM_DESC(irq, "IRQ number(s) (assigned)");
570MODULE_PARM_DESC(msg_enable, "Debug message level (see linux/netdevice.h for bitmap)");
571MODULE_DESCRIPTION("SMC Ultra/EtherEZ ISA/PnP Ethernet driver"); 561MODULE_DESCRIPTION("SMC Ultra/EtherEZ ISA/PnP Ethernet driver");
572MODULE_LICENSE("GPL"); 562MODULE_LICENSE("GPL");
573 563
diff --git a/drivers/net/ethernet/8390/stnic.c b/drivers/net/ethernet/8390/stnic.c
index aca957d4e121..8df4c4157230 100644
--- a/drivers/net/ethernet/8390/stnic.c
+++ b/drivers/net/ethernet/8390/stnic.c
@@ -69,11 +69,6 @@ static void stnic_block_output (struct net_device *dev, int count,
69 69
70static void stnic_init (struct net_device *dev); 70static void stnic_init (struct net_device *dev);
71 71
72static u32 stnic_msg_enable;
73
74module_param_named(msg_enable, stnic_msg_enable, uint, (S_IRUSR|S_IRGRP|S_IROTH));
75MODULE_PARM_DESC(msg_enable, "Debug message level (see linux/netdevice.h for bitmap)");
76
77/* SH7750 specific read/write io. */ 72/* SH7750 specific read/write io. */
78static inline void 73static inline void
79STNIC_DELAY (void) 74STNIC_DELAY (void)
@@ -105,7 +100,6 @@ static int __init stnic_probe(void)
105{ 100{
106 struct net_device *dev; 101 struct net_device *dev;
107 int i, err; 102 int i, err;
108 struct ei_device *ei_local;
109 103
110 /* If we are not running on a SolutionEngine, give up now */ 104 /* If we are not running on a SolutionEngine, give up now */
111 if (! MACH_SE) 105 if (! MACH_SE)
@@ -131,10 +125,10 @@ static int __init stnic_probe(void)
131 share and the board will usually be enabled. */ 125 share and the board will usually be enabled. */
132 err = request_irq (dev->irq, ei_interrupt, 0, DRV_NAME, dev); 126 err = request_irq (dev->irq, ei_interrupt, 0, DRV_NAME, dev);
133 if (err) { 127 if (err) {
134 netdev_emerg(dev, " unable to get IRQ %d.\n", dev->irq); 128 printk (KERN_EMERG " unable to get IRQ %d.\n", dev->irq);
135 free_netdev(dev); 129 free_netdev(dev);
136 return err; 130 return err;
137 } 131 }
138 132
139 ei_status.name = dev->name; 133 ei_status.name = dev->name;
140 ei_status.word16 = 1; 134 ei_status.word16 = 1;
@@ -153,8 +147,6 @@ static int __init stnic_probe(void)
153 ei_status.block_output = &stnic_block_output; 147 ei_status.block_output = &stnic_block_output;
154 148
155 stnic_init (dev); 149 stnic_init (dev);
156 ei_local = netdev_priv(dev);
157 ei_local->msg_enable = stnic_msg_enable;
158 150
159 err = register_netdev(dev); 151 err = register_netdev(dev);
160 if (err) { 152 if (err) {
@@ -164,7 +156,7 @@ static int __init stnic_probe(void)
164 } 156 }
165 stnic_dev = dev; 157 stnic_dev = dev;
166 158
167 netdev_info(dev, "NS ST-NIC 83902A\n"); 159 printk (KERN_INFO "NS ST-NIC 83902A\n");
168 160
169 return 0; 161 return 0;
170} 162}
@@ -172,11 +164,10 @@ static int __init stnic_probe(void)
172static void 164static void
173stnic_reset (struct net_device *dev) 165stnic_reset (struct net_device *dev)
174{ 166{
175 struct ei_device *ei_local = netdev_priv(dev);
176
177 *(vhalf *) PA_83902_RST = 0; 167 *(vhalf *) PA_83902_RST = 0;
178 udelay (5); 168 udelay (5);
179 netif_warn(ei_local, hw, dev, "8390 reset done (%ld).\n", jiffies); 169 if (ei_debug > 1)
170 printk (KERN_WARNING "8390 reset done (%ld).\n", jiffies);
180 *(vhalf *) PA_83902_RST = ~0; 171 *(vhalf *) PA_83902_RST = ~0;
181 udelay (5); 172 udelay (5);
182} 173}
@@ -185,8 +176,6 @@ static void
185stnic_get_hdr (struct net_device *dev, struct e8390_pkt_hdr *hdr, 176stnic_get_hdr (struct net_device *dev, struct e8390_pkt_hdr *hdr,
186 int ring_page) 177 int ring_page)
187{ 178{
188 struct ei_device *ei_local = netdev_priv(dev);
189
190 half buf[2]; 179 half buf[2];
191 180
192 STNIC_WRITE (PG0_RSAR0, 0); 181 STNIC_WRITE (PG0_RSAR0, 0);
@@ -207,7 +196,8 @@ stnic_get_hdr (struct net_device *dev, struct e8390_pkt_hdr *hdr,
207 hdr->count = ((buf[1] >> 8) & 0xff) | (buf[1] << 8); 196 hdr->count = ((buf[1] >> 8) & 0xff) | (buf[1] << 8);
208#endif 197#endif
209 198
210 netif_dbg(ei_local, probe, dev, "ring %x status %02x next %02x count %04x.\n", 199 if (ei_debug > 1)
200 printk (KERN_DEBUG "ring %x status %02x next %02x count %04x.\n",
211 ring_page, hdr->status, hdr->next, hdr->count); 201 ring_page, hdr->status, hdr->next, hdr->count);
212 202
213 STNIC_WRITE (STNIC_CR, CR_RDMA | CR_PG0 | CR_STA); 203 STNIC_WRITE (STNIC_CR, CR_RDMA | CR_PG0 | CR_STA);
diff --git a/drivers/net/ethernet/8390/wd.c b/drivers/net/ethernet/8390/wd.c
index dd7d816bde52..03eb3eed49fa 100644
--- a/drivers/net/ethernet/8390/wd.c
+++ b/drivers/net/ethernet/8390/wd.c
@@ -60,7 +60,6 @@ static void wd_block_output(struct net_device *dev, int count,
60 const unsigned char *buf, int start_page); 60 const unsigned char *buf, int start_page);
61static int wd_close(struct net_device *dev); 61static int wd_close(struct net_device *dev);
62 62
63static u32 wd_msg_enable;
64 63
65#define WD_START_PG 0x00 /* First page of TX buffer */ 64#define WD_START_PG 0x00 /* First page of TX buffer */
66#define WD03_STOP_PG 0x20 /* Last page +1 of RX ring */ 65#define WD03_STOP_PG 0x20 /* Last page +1 of RX ring */
@@ -171,7 +170,6 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
171 int word16 = 0; /* 0 = 8 bit, 1 = 16 bit */ 170 int word16 = 0; /* 0 = 8 bit, 1 = 16 bit */
172 const char *model_name; 171 const char *model_name;
173 static unsigned version_printed; 172 static unsigned version_printed;
174 struct ei_device *ei_local = netdev_priv(dev);
175 173
176 for (i = 0; i < 8; i++) 174 for (i = 0; i < 8; i++)
177 checksum += inb(ioaddr + 8 + i); 175 checksum += inb(ioaddr + 8 + i);
@@ -182,19 +180,19 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
182 180
183 /* Check for semi-valid mem_start/end values if supplied. */ 181 /* Check for semi-valid mem_start/end values if supplied. */
184 if ((dev->mem_start % 0x2000) || (dev->mem_end % 0x2000)) { 182 if ((dev->mem_start % 0x2000) || (dev->mem_end % 0x2000)) {
185 netdev_warn(dev, 183 printk(KERN_WARNING "wd.c: user supplied mem_start or mem_end not on 8kB boundary - ignored.\n");
186 "wd.c: user supplied mem_start or mem_end not on 8kB boundary - ignored.\n");
187 dev->mem_start = 0; 184 dev->mem_start = 0;
188 dev->mem_end = 0; 185 dev->mem_end = 0;
189 } 186 }
190 187
191 if ((wd_msg_enable & NETIF_MSG_DRV) && (version_printed++ == 0)) 188 if (ei_debug && version_printed++ == 0)
192 netdev_info(dev, version); 189 printk(version);
193 190
194 for (i = 0; i < 6; i++) 191 for (i = 0; i < 6; i++)
195 dev->dev_addr[i] = inb(ioaddr + 8 + i); 192 dev->dev_addr[i] = inb(ioaddr + 8 + i);
196 193
197 netdev_info(dev, "WD80x3 at %#3x, %pM", ioaddr, dev->dev_addr); 194 printk("%s: WD80x3 at %#3x, %pM",
195 dev->name, ioaddr, dev->dev_addr);
198 196
199 /* The following PureData probe code was contributed by 197 /* The following PureData probe code was contributed by
200 Mike Jagdis <jaggy@purplet.demon.co.uk>. Puredata does software 198 Mike Jagdis <jaggy@purplet.demon.co.uk>. Puredata does software
@@ -246,9 +244,8 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
246 } 244 }
247#ifndef final_version 245#ifndef final_version
248 if ( !ancient && (inb(ioaddr+1) & 0x01) != (word16 & 0x01)) 246 if ( !ancient && (inb(ioaddr+1) & 0x01) != (word16 & 0x01))
249 pr_cont("\nWD80?3: Bus width conflict, %d (probe) != %d (reg report).", 247 printk("\nWD80?3: Bus width conflict, %d (probe) != %d (reg report).",
250 word16 ? 16 : 8, 248 word16 ? 16 : 8, (inb(ioaddr+1) & 0x01) ? 16 : 8);
251 (inb(ioaddr+1) & 0x01) ? 16 : 8);
252#endif 249#endif
253 } 250 }
254 251
@@ -262,7 +259,7 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
262 if (reg0 == 0xff || reg0 == 0) { 259 if (reg0 == 0xff || reg0 == 0) {
263 /* Future plan: this could check a few likely locations first. */ 260 /* Future plan: this could check a few likely locations first. */
264 dev->mem_start = 0xd0000; 261 dev->mem_start = 0xd0000;
265 pr_cont(" assigning address %#lx", dev->mem_start); 262 printk(" assigning address %#lx", dev->mem_start);
266 } else { 263 } else {
267 int high_addr_bits = inb(ioaddr+WD_CMDREG5) & 0x1f; 264 int high_addr_bits = inb(ioaddr+WD_CMDREG5) & 0x1f;
268 /* Some boards don't have the register 5 -- it returns 0xff. */ 265 /* Some boards don't have the register 5 -- it returns 0xff. */
@@ -300,8 +297,8 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
300 297
301 outb_p(0x00, nic_addr+EN0_IMR); /* Mask all intrs. again. */ 298 outb_p(0x00, nic_addr+EN0_IMR); /* Mask all intrs. again. */
302 299
303 if (netif_msg_drv(ei_local)) 300 if (ei_debug > 2)
304 pr_cont(" autoirq is %d", dev->irq); 301 printk(" autoirq is %d", dev->irq);
305 if (dev->irq < 2) 302 if (dev->irq < 2)
306 dev->irq = word16 ? 10 : 5; 303 dev->irq = word16 ? 10 : 5;
307 } else 304 } else
@@ -313,7 +310,7 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
313 share and the board will usually be enabled. */ 310 share and the board will usually be enabled. */
314 i = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev); 311 i = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev);
315 if (i) { 312 if (i) {
316 pr_cont(" unable to get IRQ %d.\n", dev->irq); 313 printk (" unable to get IRQ %d.\n", dev->irq);
317 return i; 314 return i;
318 } 315 }
319 316
@@ -341,8 +338,8 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
341 return -ENOMEM; 338 return -ENOMEM;
342 } 339 }
343 340
344 pr_cont(" %s, IRQ %d, shared memory at %#lx-%#lx.\n", 341 printk(" %s, IRQ %d, shared memory at %#lx-%#lx.\n",
345 model_name, dev->irq, dev->mem_start, dev->mem_end-1); 342 model_name, dev->irq, dev->mem_start, dev->mem_end-1);
346 343
347 ei_status.reset_8390 = wd_reset_8390; 344 ei_status.reset_8390 = wd_reset_8390;
348 ei_status.block_input = wd_block_input; 345 ei_status.block_input = wd_block_input;
@@ -351,7 +348,6 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
351 348
352 dev->netdev_ops = &wd_netdev_ops; 349 dev->netdev_ops = &wd_netdev_ops;
353 NS8390_init(dev, 0); 350 NS8390_init(dev, 0);
354 ei_local->msg_enable = wd_msg_enable;
355 351
356#if 1 352#if 1
357 /* Enable interrupt generation on softconfig cards -- M.U */ 353 /* Enable interrupt generation on softconfig cards -- M.U */
@@ -389,11 +385,9 @@ static void
389wd_reset_8390(struct net_device *dev) 385wd_reset_8390(struct net_device *dev)
390{ 386{
391 int wd_cmd_port = dev->base_addr - WD_NIC_OFFSET; /* WD_CMDREG */ 387 int wd_cmd_port = dev->base_addr - WD_NIC_OFFSET; /* WD_CMDREG */
392 struct ei_device *ei_local = netdev_priv(dev);
393 388
394 outb(WD_RESET, wd_cmd_port); 389 outb(WD_RESET, wd_cmd_port);
395 netif_dbg(ei_local, hw, dev, "resetting the WD80x3 t=%lu...\n", 390 if (ei_debug > 1) printk("resetting the WD80x3 t=%lu...", jiffies);
396 jiffies);
397 ei_status.txing = 0; 391 ei_status.txing = 0;
398 392
399 /* Set up the ASIC registers, just in case something changed them. */ 393 /* Set up the ASIC registers, just in case something changed them. */
@@ -401,7 +395,7 @@ wd_reset_8390(struct net_device *dev)
401 if (ei_status.word16) 395 if (ei_status.word16)
402 outb(NIC16 | ((dev->mem_start>>19) & 0x1f), wd_cmd_port+WD_CMDREG5); 396 outb(NIC16 | ((dev->mem_start>>19) & 0x1f), wd_cmd_port+WD_CMDREG5);
403 397
404 netif_dbg(ei_local, hw, dev, "reset done\n"); 398 if (ei_debug > 1) printk("reset done\n");
405} 399}
406 400
407/* Grab the 8390 specific header. Similar to the block_input routine, but 401/* Grab the 8390 specific header. Similar to the block_input routine, but
@@ -480,9 +474,9 @@ static int
480wd_close(struct net_device *dev) 474wd_close(struct net_device *dev)
481{ 475{
482 int wd_cmdreg = dev->base_addr - WD_NIC_OFFSET; /* WD_CMDREG */ 476 int wd_cmdreg = dev->base_addr - WD_NIC_OFFSET; /* WD_CMDREG */
483 struct ei_device *ei_local = netdev_priv(dev);
484 477
485 netif_dbg(ei_local, ifdown, dev, "Shutting down ethercard.\n"); 478 if (ei_debug > 1)
479 printk("%s: Shutting down ethercard.\n", dev->name);
486 ei_close(dev); 480 ei_close(dev);
487 481
488 /* Change from 16-bit to 8-bit shared memory so reboot works. */ 482 /* Change from 16-bit to 8-bit shared memory so reboot works. */
@@ -508,12 +502,10 @@ module_param_array(io, int, NULL, 0);
508module_param_array(irq, int, NULL, 0); 502module_param_array(irq, int, NULL, 0);
509module_param_array(mem, int, NULL, 0); 503module_param_array(mem, int, NULL, 0);
510module_param_array(mem_end, int, NULL, 0); 504module_param_array(mem_end, int, NULL, 0);
511module_param_named(msg_enable, wd_msg_enable, uint, (S_IRUSR|S_IRGRP|S_IROTH));
512MODULE_PARM_DESC(io, "I/O base address(es)"); 505MODULE_PARM_DESC(io, "I/O base address(es)");
513MODULE_PARM_DESC(irq, "IRQ number(s) (ignored for PureData boards)"); 506MODULE_PARM_DESC(irq, "IRQ number(s) (ignored for PureData boards)");
514MODULE_PARM_DESC(mem, "memory base address(es)(ignored for PureData boards)"); 507MODULE_PARM_DESC(mem, "memory base address(es)(ignored for PureData boards)");
515MODULE_PARM_DESC(mem_end, "memory end address(es)"); 508MODULE_PARM_DESC(mem_end, "memory end address(es)");
516MODULE_PARM_DESC(msg_enable, "Debug message level (see linux/netdevice.h for bitmap)");
517MODULE_DESCRIPTION("ISA Western Digital wd8003/wd8013 ; SMC Elite, Elite16 ethernet driver"); 509MODULE_DESCRIPTION("ISA Western Digital wd8003/wd8013 ; SMC Elite, Elite16 ethernet driver");
518MODULE_LICENSE("GPL"); 510MODULE_LICENSE("GPL");
519 511
diff --git a/drivers/net/ethernet/8390/zorro8390.c b/drivers/net/ethernet/8390/zorro8390.c
index 7b373e65f377..85ec4c2d2645 100644
--- a/drivers/net/ethernet/8390/zorro8390.c
+++ b/drivers/net/ethernet/8390/zorro8390.c
@@ -44,8 +44,6 @@
44static const char version[] = 44static const char version[] =
45 "8390.c:v1.10cvs 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n"; 45 "8390.c:v1.10cvs 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
46 46
47static u32 zorro8390_msg_enable;
48
49#include "lib8390.c" 47#include "lib8390.c"
50 48
51#define DRV_NAME "zorro8390" 49#define DRV_NAME "zorro8390"
@@ -88,9 +86,9 @@ static struct card_info {
88static void zorro8390_reset_8390(struct net_device *dev) 86static void zorro8390_reset_8390(struct net_device *dev)
89{ 87{
90 unsigned long reset_start_time = jiffies; 88 unsigned long reset_start_time = jiffies;
91 struct ei_device *ei_local = netdev_priv(dev);
92 89
93 netif_dbg(ei_local, hw, dev, "resetting - t=%ld...\n", jiffies); 90 if (ei_debug > 1)
91 netdev_dbg(dev, "resetting - t=%ld...\n", jiffies);
94 92
95 z_writeb(z_readb(NE_BASE + NE_RESET), NE_BASE + NE_RESET); 93 z_writeb(z_readb(NE_BASE + NE_RESET), NE_BASE + NE_RESET);
96 94
@@ -121,9 +119,8 @@ static void zorro8390_get_8390_hdr(struct net_device *dev,
121 * If it does, it's the last thing you'll see 119 * If it does, it's the last thing you'll see
122 */ 120 */
123 if (ei_status.dmaing) { 121 if (ei_status.dmaing) {
124 netdev_warn(dev, 122 netdev_err(dev, "%s: DMAing conflict [DMAstat:%d][irqlock:%d]\n",
125 "%s: DMAing conflict [DMAstat:%d][irqlock:%d]\n", 123 __func__, ei_status.dmaing, ei_status.irqlock);
126 __func__, ei_status.dmaing, ei_status.irqlock);
127 return; 124 return;
128 } 125 }
129 126
@@ -233,7 +230,7 @@ static void zorro8390_block_output(struct net_device *dev, int count,
233 while ((z_readb(NE_BASE + NE_EN0_ISR) & ENISR_RDC) == 0) 230 while ((z_readb(NE_BASE + NE_EN0_ISR) & ENISR_RDC) == 0)
234 if (time_after(jiffies, dma_start + 2 * HZ / 100)) { 231 if (time_after(jiffies, dma_start + 2 * HZ / 100)) {
235 /* 20ms */ 232 /* 20ms */
236 netdev_warn(dev, "timeout waiting for Tx RDC\n"); 233 netdev_err(dev, "timeout waiting for Tx RDC\n");
237 zorro8390_reset_8390(dev); 234 zorro8390_reset_8390(dev);
238 __NS8390_init(dev, 1); 235 __NS8390_init(dev, 1);
239 break; 236 break;
@@ -251,9 +248,8 @@ static int zorro8390_open(struct net_device *dev)
251 248
252static int zorro8390_close(struct net_device *dev) 249static int zorro8390_close(struct net_device *dev)
253{ 250{
254 struct ei_device *ei_local = netdev_priv(dev); 251 if (ei_debug > 1)
255 252 netdev_dbg(dev, "Shutting down ethercard\n");
256 netif_dbg(ei_local, ifdown, dev, "Shutting down ethercard\n");
257 __ei_close(dev); 253 __ei_close(dev);
258 return 0; 254 return 0;
259} 255}
@@ -297,7 +293,6 @@ static int zorro8390_init(struct net_device *dev, unsigned long board,
297 int err; 293 int err;
298 unsigned char SA_prom[32]; 294 unsigned char SA_prom[32];
299 int start_page, stop_page; 295 int start_page, stop_page;
300 struct ei_device *ei_local = netdev_priv(dev);
301 static u32 zorro8390_offsets[16] = { 296 static u32 zorro8390_offsets[16] = {
302 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 297 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e,
303 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e, 298 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e,
@@ -388,9 +383,6 @@ static int zorro8390_init(struct net_device *dev, unsigned long board,
388 383
389 dev->netdev_ops = &zorro8390_netdev_ops; 384 dev->netdev_ops = &zorro8390_netdev_ops;
390 __NS8390_init(dev, 0); 385 __NS8390_init(dev, 0);
391
392 ei_local->msg_enable = zorro8390_msg_enable;
393
394 err = register_netdev(dev); 386 err = register_netdev(dev);
395 if (err) { 387 if (err) {
396 free_irq(IRQ_AMIGA_PORTS, dev); 388 free_irq(IRQ_AMIGA_PORTS, dev);