diff options
author | Florian Fainelli <florian@openwrt.org> | 2010-04-06 18:09:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-07 05:07:49 -0400 |
commit | 7cd2e6e38cd4402e09a286368f7a349e267aeb58 (patch) | |
tree | c4197fb96fd98389144f675b67b9636d512a57a6 /drivers | |
parent | 2cc3c6b1bc2d68ddb003a94f7313999f7984735f (diff) |
au1000-eth: implement set/get_msglevel
{set,get}_msglevel is required to use netif_{err,dbg} macros.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/au1000_eth.c | 19 | ||||
-rw-r--r-- | drivers/net/au1000_eth.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index 49f56b4654f6..0c59d4c5bc01 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c | |||
@@ -75,6 +75,10 @@ static int au1000_debug = 5; | |||
75 | static int au1000_debug = 3; | 75 | static int au1000_debug = 3; |
76 | #endif | 76 | #endif |
77 | 77 | ||
78 | #define AU1000_DEF_MSG_ENABLE (NETIF_MSG_DRV | \ | ||
79 | NETIF_MSG_PROBE | \ | ||
80 | NETIF_MSG_LINK) | ||
81 | |||
78 | #define DRV_NAME "au1000_eth" | 82 | #define DRV_NAME "au1000_eth" |
79 | #define DRV_VERSION "1.6" | 83 | #define DRV_VERSION "1.6" |
80 | #define DRV_AUTHOR "Pete Popov <ppopov@embeddedalley.com>" | 84 | #define DRV_AUTHOR "Pete Popov <ppopov@embeddedalley.com>" |
@@ -583,11 +587,25 @@ au1000_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | |||
583 | info->regdump_len = 0; | 587 | info->regdump_len = 0; |
584 | } | 588 | } |
585 | 589 | ||
590 | static void au1000_set_msglevel(struct net_device *dev, u32 value) | ||
591 | { | ||
592 | struct au1000_private *aup = netdev_priv(dev); | ||
593 | aup->msg_enable = value; | ||
594 | } | ||
595 | |||
596 | static u32 au1000_get_msglevel(struct net_device *dev) | ||
597 | { | ||
598 | struct au1000_private *aup = netdev_priv(dev); | ||
599 | return aup->msg_enable; | ||
600 | } | ||
601 | |||
586 | static const struct ethtool_ops au1000_ethtool_ops = { | 602 | static const struct ethtool_ops au1000_ethtool_ops = { |
587 | .get_settings = au1000_get_settings, | 603 | .get_settings = au1000_get_settings, |
588 | .set_settings = au1000_set_settings, | 604 | .set_settings = au1000_set_settings, |
589 | .get_drvinfo = au1000_get_drvinfo, | 605 | .get_drvinfo = au1000_get_drvinfo, |
590 | .get_link = ethtool_op_get_link, | 606 | .get_link = ethtool_op_get_link, |
607 | .get_msglevel = au1000_get_msglevel, | ||
608 | .set_msglevel = au1000_set_msglevel, | ||
591 | }; | 609 | }; |
592 | 610 | ||
593 | 611 | ||
@@ -1050,6 +1068,7 @@ static int __devinit au1000_probe(struct platform_device *pdev) | |||
1050 | aup = netdev_priv(dev); | 1068 | aup = netdev_priv(dev); |
1051 | 1069 | ||
1052 | spin_lock_init(&aup->lock); | 1070 | spin_lock_init(&aup->lock); |
1071 | aup->msg_enable = (au1000_debug < 4 ? AU1000_DEF_MSG_ENABLE : au1000_debug); | ||
1053 | 1072 | ||
1054 | /* Allocate the data buffers */ | 1073 | /* Allocate the data buffers */ |
1055 | /* Snooping works fine with eth on all au1xxx */ | 1074 | /* Snooping works fine with eth on all au1xxx */ |
diff --git a/drivers/net/au1000_eth.h b/drivers/net/au1000_eth.h index 344c600fbf58..d06ec008fbf1 100644 --- a/drivers/net/au1000_eth.h +++ b/drivers/net/au1000_eth.h | |||
@@ -125,4 +125,6 @@ struct au1000_private { | |||
125 | dma_addr_t dma_addr; /* dma address of rx/tx buffers */ | 125 | dma_addr_t dma_addr; /* dma address of rx/tx buffers */ |
126 | 126 | ||
127 | spinlock_t lock; /* Serialise access to device */ | 127 | spinlock_t lock; /* Serialise access to device */ |
128 | |||
129 | u32 msg_enable; | ||
128 | }; | 130 | }; |