aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/8390/etherh.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/8390/etherh.c')
-rw-r--r--drivers/net/ethernet/8390/etherh.c51
1 files changed, 32 insertions, 19 deletions
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
70static unsigned int net_debug = NET_DEBUG; 67static u32 etherh_msg_enable;
71 68
72struct etherh_priv { 69struct 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
624static u32 etherh_get_msglevel(struct net_device *dev)
625{
626 struct ei_device *ei_local = netdev_priv(dev);
627
628 return ei_local->msg_enable;
629}
630
631static void etherh_set_msglevel(struct net_device *dev, u32 v)
632{
633 struct ei_device *ei_local = netdev_priv(dev);
634
635 ei_local->msg_enable = v;
636}
637
628static const struct ethtool_ops etherh_ethtool_ops = { 638static 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
635static const struct net_device_ops etherh_netdev_ops = { 647static 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