Patchwork [net-next,REPOST] 8390 ei_debug : Reenable the use of debugging in 8390 based chips

login
register
mail settings
Submitter Matthew Whitehead
Date Oct. 15, 2013, 2:46 a.m.
Message ID <1381805161-18833-1-git-send-email-tedheadster@gmail.com>
Download mbox | patch
Permalink /patch/283448/
State Rejected
Delegated to: David Miller
Headers show

Comments

Matthew Whitehead - Oct. 15, 2013, 2:46 a.m.
Ethernet boards based on the 8390 chip had an '#ifdef notdef' disabling the
use of the debug variable ei_debug. Reenable it for those of us who still
occasionally use it.

Also handle the case of the 'ne' driver which uses 8390p.o rather than
8390.o. In that case ei_debug is aliased to eip_debug so it doesn't clash
with the previously exported ei_debug.

Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>
---
 drivers/net/ethernet/8390/8390.h     |    5 ++++-
 drivers/net/ethernet/8390/8390p.c    |    1 +
 drivers/net/ethernet/8390/axnet_cs.c |    5 -----
 drivers/net/ethernet/8390/lib8390.c  |    8 ++++++--
 drivers/net/ethernet/8390/ne.c       |    1 +
 5 files changed, 12 insertions(+), 8 deletions(-)
David Miller - Oct. 17, 2013, 7:59 p.m.
From: Matthew Whitehead <tedheadster@gmail.com>
Date: Mon, 14 Oct 2013 22:46:01 -0400

> Ethernet boards based on the 8390 chip had an '#ifdef notdef' disabling the
> use of the debug variable ei_debug. Reenable it for those of us who still
> occasionally use it.
> 
> Also handle the case of the 'ne' driver which uses 8390p.o rather than
> 8390.o. In that case ei_debug is aliased to eip_debug so it doesn't clash
> with the previously exported ei_debug.
> 
> Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>

I'd rather not encourage the use of things like this.

We have a standard, run time, way to enable and disable debugging
output on a per-netdevice basis.  And the "default" value of which can
be controlled by a module parameter if need be.

Please convert the driver to this method instead.

Thank you.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/8390/8390.h b/drivers/net/ethernet/8390/8390.h
index 2923c51..e6c547d 100644
--- a/drivers/net/ethernet/8390/8390.h
+++ b/drivers/net/ethernet/8390/8390.h
@@ -21,7 +21,10 @@  struct e8390_pkt_hdr {
   unsigned short count; /* header + packet length in bytes */
 };
 
-#ifdef notdef
+#if (defined EI_DEBUG && defined EIP_DEBUG)
+#define ei_debug eip_debug
+extern int eip_debug;
+#elif (defined EI_DEBUG && ! defined EIP_DEBUG)
 extern int ei_debug;
 #else
 #define ei_debug 1
diff --git a/drivers/net/ethernet/8390/8390p.c b/drivers/net/ethernet/8390/8390p.c
index e8fc2e8..0a27dea 100644
--- a/drivers/net/ethernet/8390/8390p.c
+++ b/drivers/net/ethernet/8390/8390p.c
@@ -7,6 +7,7 @@  static const char version[] =
 #define ei_outb(_v, _p)	outb(_v, _p)
 #define ei_inb_p(_p)	inb_p(_p)
 #define ei_outb_p(_v, _p) outb_p(_v, _p)
+#define EIP_DEBUG 1
 
 #include "lib8390.c"
 
diff --git a/drivers/net/ethernet/8390/axnet_cs.c b/drivers/net/ethernet/8390/axnet_cs.c
index d801c141..581560c 100644
--- a/drivers/net/ethernet/8390/axnet_cs.c
+++ b/drivers/net/ethernet/8390/axnet_cs.c
@@ -810,11 +810,6 @@  module_pcmcia_driver(axnet_cs_driver);
 #define ei_block_input (ei_local->block_input)
 #define ei_get_8390_hdr (ei_local->get_8390_hdr)
 
-/* use 0 for production, 1 for verification, >2 for debug */
-#ifndef ei_debug
-int ei_debug = 1;
-#endif
-
 /* Index to functions. */
 static void ei_tx_intr(struct net_device *dev);
 static void ei_tx_err(struct net_device *dev);
diff --git a/drivers/net/ethernet/8390/lib8390.c b/drivers/net/ethernet/8390/lib8390.c
index b329f5c..889d1fd 100644
--- a/drivers/net/ethernet/8390/lib8390.c
+++ b/drivers/net/ethernet/8390/lib8390.c
@@ -100,8 +100,12 @@ 
 #define ei_get_8390_hdr (ei_local->get_8390_hdr)
 
 /* use 0 for production, 1 for verification, >2 for debug */
-#ifndef ei_debug
-int ei_debug = 1;
+#if (defined EI_DEBUG && defined EIP_DEBUG)
+int eip_debug = EI_DEBUG;
+EXPORT_SYMBOL(eip_debug);
+#elif (defined EI_DEBUG && ! defined EIP_DEBUG)
+int ei_debug = EI_DEBUG;
+EXPORT_SYMBOL(ei_debug);
 #endif
 
 /* Index to functions. */
diff --git a/drivers/net/ethernet/8390/ne.c b/drivers/net/ethernet/8390/ne.c
index b2e8405..4136b31 100644
--- a/drivers/net/ethernet/8390/ne.c
+++ b/drivers/net/ethernet/8390/ne.c
@@ -54,6 +54,7 @@  static const char version2[] =
 #include <linux/platform_device.h>
 
 #include <asm/io.h>
+#define EIP_DEBUG 1
 
 #include "8390.h"