Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ceb51361370c003e13f782edb7171a8383e5c849
Commit:     ceb51361370c003e13f782edb7171a8383e5c849
Parent:     cd4ceb245be7926e94558e2b6cd279bfaa775908
Author:     Olof Johansson <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:47:49 2007 -0500
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue May 8 01:47:54 2007 -0400

    pasemi_mac: Add msglevel support and "debug" module param
    
    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 <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/pasemi_mac.c |   25 +++++++++++++++++++++----
 drivers/net/pasemi_mac.h |    2 ++
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index 6b4e925..4c6d34d 100644
--- a/drivers/net/pasemi_mac.c
+++ b/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 <[EMAIL PROTECTED]>");
+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_mac_get_stats(struct 
net_device *dev)
        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, const struct 
pci_device_id *ent)
        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 <[EMAIL PROTECTED]>");
-MODULE_DESCRIPTION("PA Semi PWRficient Ethernet driver");
-
 module_init(pasemi_mac_init_module);
 module_exit(pasemi_mac_cleanup_module);
diff --git a/drivers/net/pasemi_mac.h b/drivers/net/pasemi_mac.h
index 3dcc1f2..6539de1 100644
--- a/drivers/net/pasemi_mac.h
+++ b/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) */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to