aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2010-03-25 09:10:08 -0400
committerDavid S. Miller <davem@davemloft.net>2010-03-31 02:02:26 -0400
commitc041076a9f79a7cf28e808f73cc76f24cbf97093 (patch)
tree6cd3b7fa661e7b835185f058f8c560c6f870db80 /drivers/net
parent7e5ab157813993356f021757d0b0dcbdca7c55a1 (diff)
igb: update hw_debug macro to make use of netdev_dbg call
This change updates the igb driver to make use of the netdev_dbg function macros now provided in netdevice.h This is meant to be provided as an alternative to the patch provided by Joe Perches. It also removes igb_get_time_str since I found that it is unused code that is no longer used even in debug. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/igb/e1000_hw.h12
-rw-r--r--drivers/net/igb/igb_main.c32
2 files changed, 8 insertions, 36 deletions
diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
index 593d5fa5a3de..cb8db78b1a05 100644
--- a/drivers/net/igb/e1000_hw.h
+++ b/drivers/net/igb/e1000_hw.h
@@ -31,6 +31,7 @@
31#include <linux/types.h> 31#include <linux/types.h>
32#include <linux/delay.h> 32#include <linux/delay.h>
33#include <linux/io.h> 33#include <linux/io.h>
34#include <linux/netdevice.h>
34 35
35#include "e1000_regs.h" 36#include "e1000_regs.h"
36#include "e1000_defines.h" 37#include "e1000_defines.h"
@@ -507,14 +508,11 @@ struct e1000_hw {
507 u8 revision_id; 508 u8 revision_id;
508}; 509};
509 510
510#ifdef DEBUG 511extern struct net_device *igb_get_hw_dev(struct e1000_hw *hw);
511extern char *igb_get_hw_dev_name(struct e1000_hw *hw);
512#define hw_dbg(format, arg...) \ 512#define hw_dbg(format, arg...) \
513 printk(KERN_DEBUG "%s: " format, igb_get_hw_dev_name(hw), ##arg) 513 netdev_dbg(igb_get_hw_dev(hw), format, ##arg)
514#else 514
515#define hw_dbg(format, arg...)
516#endif
517#endif
518/* These functions must be implemented by drivers */ 515/* These functions must be implemented by drivers */
519s32 igb_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value); 516s32 igb_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value);
520s32 igb_write_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value); 517s32 igb_write_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value);
518#endif /* _E1000_HW_H_ */
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 2501c5d580b8..7d755dd2688d 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -226,43 +226,17 @@ static cycle_t igb_read_clock(const struct cyclecounter *tc)
226 return stamp; 226 return stamp;
227} 227}
228 228
229#ifdef DEBUG
230/** 229/**
231 * igb_get_hw_dev_name - return device name string 230 * igb_get_hw_dev - return device
232 * used by hardware layer to print debugging information 231 * used by hardware layer to print debugging information
233 **/ 232 **/
234char *igb_get_hw_dev_name(struct e1000_hw *hw) 233struct net_device *igb_get_hw_dev(struct e1000_hw *hw)
235{ 234{
236 struct igb_adapter *adapter = hw->back; 235 struct igb_adapter *adapter = hw->back;
237 return adapter->netdev->name; 236 return adapter->netdev;
238} 237}
239 238
240/** 239/**
241 * igb_get_time_str - format current NIC and system time as string
242 */
243static char *igb_get_time_str(struct igb_adapter *adapter,
244 char buffer[160])
245{
246 cycle_t hw = adapter->cycles.read(&adapter->cycles);
247 struct timespec nic = ns_to_timespec(timecounter_read(&adapter->clock));
248 struct timespec sys;
249 struct timespec delta;
250 getnstimeofday(&sys);
251
252 delta = timespec_sub(nic, sys);
253
254 sprintf(buffer,
255 "HW %llu, NIC %ld.%09lus, SYS %ld.%09lus, NIC-SYS %lds + %09luns",
256 hw,
257 (long)nic.tv_sec, nic.tv_nsec,
258 (long)sys.tv_sec, sys.tv_nsec,
259 (long)delta.tv_sec, delta.tv_nsec);
260
261 return buffer;
262}
263#endif
264
265/**
266 * igb_init_module - Driver Registration Routine 240 * igb_init_module - Driver Registration Routine
267 * 241 *
268 * igb_init_module is the first routine called when the driver is 242 * igb_init_module is the first routine called when the driver is