From: Daniele Venzano <webvenza@libero.it>
To: Jeff Garzik <jgarzik@pobox.com>, NetDev <netdev@oss.sgi.com>
Subject: [PATCH 1/5] sis900 printk audit
Date: Sat, 22 Jan 2005 22:46:57 +0100 (CET) [thread overview]
Message-ID: <20050122214657.18649.66345@localhost.localdomain> (raw)
[-- 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,
};
/**
next reply other threads:[~2005-01-22 21:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-22 21:46 Daniele Venzano [this message]
2005-01-22 21:46 ` [PATCH 2/5] sis900 printk audit 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050122214657.18649.66345@localhost.localdomain \
--to=webvenza@libero.it \
--cc=jgarzik@pobox.com \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).