Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193891
b: refs/heads/master
c: c041076
h: refs/heads/master
i:
  193889: a1025d4
  193887: e5c0742
v: v3
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Mar 31, 2010
1 parent 3cbac49 commit 41f7cbe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 37 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e5ab157813993356f021757d0b0dcbdca7c55a1
refs/heads/master: c041076a9f79a7cf28e808f73cc76f24cbf97093
12 changes: 5 additions & 7 deletions trunk/drivers/net/igb/e1000_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/types.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/netdevice.h>

#include "e1000_regs.h"
#include "e1000_defines.h"
Expand Down Expand Up @@ -507,14 +508,11 @@ struct e1000_hw {
u8 revision_id;
};

#ifdef DEBUG
extern char *igb_get_hw_dev_name(struct e1000_hw *hw);
extern struct net_device *igb_get_hw_dev(struct e1000_hw *hw);
#define hw_dbg(format, arg...) \
printk(KERN_DEBUG "%s: " format, igb_get_hw_dev_name(hw), ##arg)
#else
#define hw_dbg(format, arg...)
#endif
#endif
netdev_dbg(igb_get_hw_dev(hw), format, ##arg)

/* These functions must be implemented by drivers */
s32 igb_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value);
s32 igb_write_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value);
#endif /* _E1000_HW_H_ */
32 changes: 3 additions & 29 deletions trunk/drivers/net/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,42 +226,16 @@ static cycle_t igb_read_clock(const struct cyclecounter *tc)
return stamp;
}

#ifdef DEBUG
/**
* igb_get_hw_dev_name - return device name string
* igb_get_hw_dev - return device
* used by hardware layer to print debugging information
**/
char *igb_get_hw_dev_name(struct e1000_hw *hw)
struct net_device *igb_get_hw_dev(struct e1000_hw *hw)
{
struct igb_adapter *adapter = hw->back;
return adapter->netdev->name;
return adapter->netdev;
}

/**
* igb_get_time_str - format current NIC and system time as string
*/
static char *igb_get_time_str(struct igb_adapter *adapter,
char buffer[160])
{
cycle_t hw = adapter->cycles.read(&adapter->cycles);
struct timespec nic = ns_to_timespec(timecounter_read(&adapter->clock));
struct timespec sys;
struct timespec delta;
getnstimeofday(&sys);

delta = timespec_sub(nic, sys);

sprintf(buffer,
"HW %llu, NIC %ld.%09lus, SYS %ld.%09lus, NIC-SYS %lds + %09luns",
hw,
(long)nic.tv_sec, nic.tv_nsec,
(long)sys.tv_sec, sys.tv_nsec,
(long)delta.tv_sec, delta.tv_nsec);

return buffer;
}
#endif

/**
* igb_init_module - Driver Registration Routine
*
Expand Down

0 comments on commit 41f7cbe

Please sign in to comment.