diff options
author | Olof Johansson <olof@lixom.net> | 2007-05-08 01:47:49 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-05-08 01:47:54 -0400 |
commit | ceb51361370c003e13f782edb7171a8383e5c849 (patch) | |
tree | 25a8752cc27330174074000675816e98f9bf0a27 /drivers | |
parent | cd4ceb245be7926e94558e2b6cd279bfaa775908 (diff) |
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 <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/pasemi_mac.c | 25 | ||||
-rw-r--r-- | 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 6b4e925aa7f1..4c6d34d6989c 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c | |||
@@ -53,6 +53,16 @@ | |||
53 | #define RX_RING_SIZE 512 | 53 | #define RX_RING_SIZE 512 |
54 | #define TX_RING_SIZE 512 | 54 | #define TX_RING_SIZE 512 |
55 | 55 | ||
56 | #define DEFAULT_MSG_ENABLE \ | ||
57 | (NETIF_MSG_DRV | \ | ||
58 | NETIF_MSG_PROBE | \ | ||
59 | NETIF_MSG_LINK | \ | ||
60 | NETIF_MSG_TIMER | \ | ||
61 | NETIF_MSG_IFDOWN | \ | ||
62 | NETIF_MSG_IFUP | \ | ||
63 | NETIF_MSG_RX_ERR | \ | ||
64 | NETIF_MSG_TX_ERR) | ||
65 | |||
56 | #define TX_DESC(mac, num) ((mac)->tx->desc[(num) & (TX_RING_SIZE-1)]) | 66 | #define TX_DESC(mac, num) ((mac)->tx->desc[(num) & (TX_RING_SIZE-1)]) |
57 | #define TX_DESC_INFO(mac, num) ((mac)->tx->desc_info[(num) & (TX_RING_SIZE-1)]) | 67 | #define TX_DESC_INFO(mac, num) ((mac)->tx->desc_info[(num) & (TX_RING_SIZE-1)]) |
58 | #define RX_DESC(mac, num) ((mac)->rx->desc[(num) & (RX_RING_SIZE-1)]) | 68 | #define RX_DESC(mac, num) ((mac)->rx->desc[(num) & (RX_RING_SIZE-1)]) |
@@ -61,6 +71,14 @@ | |||
61 | 71 | ||
62 | #define BUF_SIZE 1646 /* 1500 MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */ | 72 | #define BUF_SIZE 1646 /* 1500 MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */ |
63 | 73 | ||
74 | MODULE_LICENSE("GPL"); | ||
75 | MODULE_AUTHOR ("Olof Johansson <olof@lixom.net>"); | ||
76 | MODULE_DESCRIPTION("PA Semi PWRficient Ethernet driver"); | ||
77 | |||
78 | static int debug = -1; /* -1 == use DEFAULT_MSG_ENABLE as value */ | ||
79 | module_param(debug, int, 0); | ||
80 | MODULE_PARM_DESC(debug, "PA Semi MAC bitmapped debugging message enable value"); | ||
81 | |||
64 | static struct pasdma_status *dma_status; | 82 | static struct pasdma_status *dma_status; |
65 | 83 | ||
66 | static int pasemi_get_mac_addr(struct pasemi_mac *mac) | 84 | 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) | |||
873 | return &mac->stats; | 891 | return &mac->stats; |
874 | } | 892 | } |
875 | 893 | ||
894 | |||
876 | static void pasemi_mac_set_rx_mode(struct net_device *dev) | 895 | static void pasemi_mac_set_rx_mode(struct net_device *dev) |
877 | { | 896 | { |
878 | struct pasemi_mac *mac = netdev_priv(dev); | 897 | struct pasemi_mac *mac = netdev_priv(dev); |
@@ -1007,6 +1026,8 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1007 | mac->rx_status = &dma_status->rx_sta[mac->dma_rxch]; | 1026 | mac->rx_status = &dma_status->rx_sta[mac->dma_rxch]; |
1008 | mac->tx_status = &dma_status->tx_sta[mac->dma_txch]; | 1027 | mac->tx_status = &dma_status->tx_sta[mac->dma_txch]; |
1009 | 1028 | ||
1029 | mac->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE); | ||
1030 | |||
1010 | err = register_netdev(dev); | 1031 | err = register_netdev(dev); |
1011 | 1032 | ||
1012 | if (err) { | 1033 | if (err) { |
@@ -1081,9 +1102,5 @@ int pasemi_mac_init_module(void) | |||
1081 | return pci_register_driver(&pasemi_mac_driver); | 1102 | return pci_register_driver(&pasemi_mac_driver); |
1082 | } | 1103 | } |
1083 | 1104 | ||
1084 | MODULE_LICENSE("GPL"); | ||
1085 | MODULE_AUTHOR ("Olof Johansson <olof@lixom.net>"); | ||
1086 | MODULE_DESCRIPTION("PA Semi PWRficient Ethernet driver"); | ||
1087 | |||
1088 | module_init(pasemi_mac_init_module); | 1105 | module_init(pasemi_mac_init_module); |
1089 | module_exit(pasemi_mac_cleanup_module); | 1106 | module_exit(pasemi_mac_cleanup_module); |
diff --git a/drivers/net/pasemi_mac.h b/drivers/net/pasemi_mac.h index 3dcc1f288adf..6539de1c2f23 100644 --- a/drivers/net/pasemi_mac.h +++ b/drivers/net/pasemi_mac.h | |||
@@ -75,6 +75,8 @@ struct pasemi_mac { | |||
75 | struct pasemi_mac_rxring *rx; | 75 | struct pasemi_mac_rxring *rx; |
76 | unsigned long tx_irq; | 76 | unsigned long tx_irq; |
77 | unsigned long rx_irq; | 77 | unsigned long rx_irq; |
78 | |||
79 | unsigned int msg_enable; | ||
78 | }; | 80 | }; |
79 | 81 | ||
80 | /* Software status descriptor (desc_info) */ | 82 | /* Software status descriptor (desc_info) */ |