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