From: Olof Johansson <olof@lixom.net>
To: jgarzik@pobox.com
Cc: netdev@vger.kernel.org
Subject: [PATCH v4 7/9] pasemi_mac: Add msglevel support and "debug" module param
Date: Tue, 8 May 2007 00:47:49 -0500 [thread overview]
Message-ID: <20070508054749.GH14321@lixom.net> (raw)
In-Reply-To: 20070508053500.358169000@localhost.localdomain
[-- Attachment #1: n-8 --]
[-- Type: text/plain, Size: 2614 bytes --]
Add msglevel support for pasemi_mac. Move the MODULE_* defines to the
top to go together with the variable (similar to tg3).
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: netdev-2.6/drivers/net/pasemi_mac.c
===================================================================
--- netdev-2.6.orig/drivers/net/pasemi_mac.c
+++ netdev-2.6/drivers/net/pasemi_mac.c
@@ -53,6 +53,16 @@
#define RX_RING_SIZE 512
#define TX_RING_SIZE 512
+#define DEFAULT_MSG_ENABLE \
+ (NETIF_MSG_DRV | \
+ NETIF_MSG_PROBE | \
+ NETIF_MSG_LINK | \
+ NETIF_MSG_TIMER | \
+ NETIF_MSG_IFDOWN | \
+ NETIF_MSG_IFUP | \
+ NETIF_MSG_RX_ERR | \
+ NETIF_MSG_TX_ERR)
+
#define TX_DESC(mac, num) ((mac)->tx->desc[(num) & (TX_RING_SIZE-1)])
#define TX_DESC_INFO(mac, num) ((mac)->tx->desc_info[(num) & (TX_RING_SIZE-1)])
#define RX_DESC(mac, num) ((mac)->rx->desc[(num) & (RX_RING_SIZE-1)])
@@ -61,6 +71,14 @@
#define BUF_SIZE 1646 /* 1500 MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR ("Olof Johansson <olof@lixom.net>");
+MODULE_DESCRIPTION("PA Semi PWRficient Ethernet driver");
+
+static int debug = -1; /* -1 == use DEFAULT_MSG_ENABLE as value */
+module_param(debug, int, 0);
+MODULE_PARM_DESC(debug, "PA Semi MAC bitmapped debugging message enable value");
+
static struct pasdma_status *dma_status;
static int pasemi_get_mac_addr(struct pasemi_mac *mac)
@@ -873,6 +891,7 @@ static struct net_device_stats *pasemi_m
return &mac->stats;
}
+
static void pasemi_mac_set_rx_mode(struct net_device *dev)
{
struct pasemi_mac *mac = netdev_priv(dev);
@@ -1007,6 +1026,8 @@ pasemi_mac_probe(struct pci_dev *pdev, c
mac->rx_status = &dma_status->rx_sta[mac->dma_rxch];
mac->tx_status = &dma_status->tx_sta[mac->dma_txch];
+ mac->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
+
err = register_netdev(dev);
if (err) {
@@ -1081,9 +1102,5 @@ int pasemi_mac_init_module(void)
return pci_register_driver(&pasemi_mac_driver);
}
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR ("Olof Johansson <olof@lixom.net>");
-MODULE_DESCRIPTION("PA Semi PWRficient Ethernet driver");
-
module_init(pasemi_mac_init_module);
module_exit(pasemi_mac_cleanup_module);
Index: netdev-2.6/drivers/net/pasemi_mac.h
===================================================================
--- netdev-2.6.orig/drivers/net/pasemi_mac.h
+++ netdev-2.6/drivers/net/pasemi_mac.h
@@ -75,6 +75,8 @@ struct pasemi_mac {
struct pasemi_mac_rxring *rx;
unsigned long tx_irq;
unsigned long rx_irq;
+
+ unsigned int msg_enable;
};
/* Software status descriptor (desc_info) */
--
next prev parent reply other threads:[~2007-05-08 6:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20070508053500.358169000@localhost.localdomain>
2007-05-08 5:47 ` [PATCH v4 1/9] pasemi_mac: Move the IRQ mapping from the PCI layer to the driver Olof Johansson
2007-05-08 5:48 ` Jeff Garzik
2007-05-08 5:47 ` [PATCH v4 2/9] pasemi_mac: Abstract and fix up interrupt restart routines Olof Johansson
2007-05-08 5:47 ` [PATCH v4 3/9] pasemi_mac: Timer and interrupt fixes Olof Johansson
2007-05-08 5:47 ` [PATCH v4 4/9] pasemi_mac: Add SKB reuse / copy-break Olof Johansson
2007-05-08 5:47 ` [PATCH v4 5/9] pasemi_mac: Minor cleanup / define fixes Olof Johansson
2007-05-08 5:47 ` [PATCH v4 6/9] pasemi_mac: Logic cleanup / rx performance improvements Olof Johansson
2007-05-08 5:47 ` Olof Johansson [this message]
2007-05-08 5:47 ` [PATCH v4 8/9] pasemi_mac: PHY support Olof Johansson
2007-05-08 5:48 ` [PATCH v4 9/9] pasemi_mac: Use local-mac-address instead of mac-address if available Olof Johansson
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=20070508054749.GH14321@lixom.net \
--to=olof@lixom.net \
--cc=jgarzik@pobox.com \
--cc=netdev@vger.kernel.org \
/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).