netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] sis900 printk audit
@ 2005-01-22 21:46 Daniele Venzano
  2005-01-22 21:46 ` [PATCH 2/5] " Daniele Venzano
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Daniele Venzano @ 2005-01-22 21:46 UTC (permalink / raw)
  To: Jeff Garzik, NetDev

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]



Infrastructure needed for standard netif messages
 - add msg_level to sis900_private
 - define default msg level
 - set default value for sis900_debug
Update module parameter description
Ethtool support for debugging output level
   


Signed-off-by: Daniele Venzano <webvenza@libero.it>


[-- Attachment #2: Type: text/plain, Size: 2495 bytes --]

Index: sis900.c
===================================================================
--- a/drivers/net/sis900.c	(revision 83)
+++ b/drivers/net/sis900.c	(revision 84)
@@ -82,9 +82,14 @@
 static int max_interrupt_work = 40;
 static int multicast_filter_limit = 128;
 
-#define sis900_debug debug
-static int sis900_debug;
+static int sis900_debug = -1; /* Use SIS900_DEF_MSG as value */
 
+#define SIS900_DEF_MSG \
+	(NETIF_MSG_DRV		| \
+	 NETIF_MSG_LINK		| \
+	 NETIF_MSG_RX_ERR	| \
+	 NETIF_MSG_TX_ERR)
+
 /* Time in jiffies before concluding the transmitter is hung. */
 #define TX_TIMEOUT  (4*HZ)
 /* SiS 900 is capable of 32 bits BM DMA */
@@ -160,6 +165,8 @@
 	struct timer_list timer; /* Link status detection timer. */
 	u8 autong_complete; /* 1: auto-negotiate complete  */
 
+	u32 msg_enable;
+
 	unsigned int cur_rx, dirty_rx; /* producer/comsumer pointers for Tx/Rx ring */
 	unsigned int cur_tx, dirty_tx;
 
@@ -182,10 +189,10 @@
 
 module_param(multicast_filter_limit, int, 0444);
 module_param(max_interrupt_work, int, 0444);
-module_param(debug, int, 0444);
+module_param(sis900_debug, int, 0444);
 MODULE_PARM_DESC(multicast_filter_limit, "SiS 900/7016 maximum number of filtered multicast addresses");
 MODULE_PARM_DESC(max_interrupt_work, "SiS 900/7016 maximum events handled per interrupt");
-MODULE_PARM_DESC(debug, "SiS 900/7016 debug level (2-4)");
+MODULE_PARM_DESC(sis900_debug, "SiS 900/7016 bitmapped debugging message level");
 
 static int sis900_open(struct net_device *net_dev);
 static int sis900_mii_probe (struct net_device * net_dev);
@@ -456,6 +463,11 @@
 	net_dev->tx_timeout = sis900_tx_timeout;
 	net_dev->watchdog_timeo = TX_TIMEOUT;
 	net_dev->ethtool_ops = &sis900_ethtool_ops;
+
+	if (sis900_debug > 0)
+		sis_priv->msg_enable = sis900_debug;
+	else
+		sis_priv->msg_enable = SIS900_DEF_MSG;
 	
 	ret = register_netdev(net_dev);
 	if (ret)
@@ -1906,8 +1918,22 @@
 	strcpy (info->bus_info, pci_name(sis_priv->pci_dev));
 }
 
+static u32 sis900_get_msglevel(struct net_device *net_dev)
+{
+	struct sis900_private *sis_priv = net_dev->priv;
+	return sis_priv->msg_enable;
+}
+  
+static void sis900_set_msglevel(struct net_device *net_dev, u32 value)
+{
+	struct sis900_private *sis_priv = net_dev->priv;
+	sis_priv->msg_enable = value;
+}
+
 static struct ethtool_ops sis900_ethtool_ops = {
-	.get_drvinfo =		sis900_get_drvinfo,
+	.get_drvinfo 	= sis900_get_drvinfo,
+	.get_msglevel	= sis900_get_msglevel,
+	.set_msglevel	= sis900_set_msglevel,
 };
 
 /**

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-01-23 18:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-22 21:46 [PATCH 1/5] sis900 printk audit Daniele Venzano
2005-01-22 21:46 ` [PATCH 2/5] " Daniele Venzano
2005-01-22 21:46 ` [PATCH 3/5] " Daniele Venzano
2005-01-22 22:26   ` Francois Romieu
2005-01-23  9:10     ` [PATCH 6/5] " Daniele Venzano
2005-01-22 21:47 ` [PATCH 4/5] " Daniele Venzano
2005-01-22 21:47 ` [PATCH 5/5] " Daniele Venzano
2005-01-22 22:26 ` [PATCH 1/5] " Francois Romieu
2005-01-23  8:52   ` Daniele Venzano
2005-01-23 16:16     ` Francois Romieu
2005-01-23 18:31       ` Daniele Venzano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).