path: root/drivers/net/ethernet/intel/ixgbevf/vf.h
diff options
authorMark Rustad <mark.d.rustad@intel.com>2014-03-04 03:02:34 +0000
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-03-21 02:19:52 -0700
commitdbf8b0d891bd3e0436ca17530c372b6b51d6ddab (patch)
treec29d2aee2b4adaed712e3d8c7361cda143c90845 /drivers/net/ethernet/intel/ixgbevf/vf.h
parent388b2e4c0f09fa6f98f687b5ae8f3db6fd247e9d (diff)
ixgbevf: Check register reads for adapter removal
Check all register reads for adapter removal by checking the status register after any register read that returns 0xFFFFFFFF. Since the status register will never return 0xFFFFFFFF unless the adapter is removed, such a value from a status register read confirms the removal. Since this patch adds so much to ixgbe_read_reg, stop inlining it, to reduce driver bloat. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbevf/vf.h')
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.h b/drivers/net/ethernet/intel/ixgbevf/vf.h
index 8ebed729c70f..7cb1a520e561 100644
--- a/drivers/net/ethernet/intel/ixgbevf/vf.h
+++ b/drivers/net/ethernet/intel/ixgbevf/vf.h
@@ -172,16 +172,17 @@ struct ixgbevf_info {
const struct ixgbe_mac_operations *mac_ops;
+#define IXGBE_FAILED_READ_REG 0xffffffffU
+#define IXGBE_REMOVED(a) unlikely(!(a))
static inline void ixgbe_write_reg(struct ixgbe_hw *hw, u32 reg, u32 value)
writel(value, hw->hw_addr + reg);
#define IXGBE_WRITE_REG(h, r, v) ixgbe_write_reg(h, r, v)
-static inline u32 ixgbe_read_reg(struct ixgbe_hw *hw, u32 reg)
- return readl(hw->hw_addr + reg);
+u32 ixgbe_read_reg(struct ixgbe_hw *hw, u32 reg);
#define IXGBE_READ_REG(h, r) ixgbe_read_reg(h, r)
static inline void ixgbe_write_reg_array(struct ixgbe_hw *hw, u32 reg,