aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb/igb.h
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2008-11-22 00:30:24 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-22 00:30:24 -0500
commitf5f4cf08467db10de061a1b90037a56a360d3554 (patch)
treef590f5a39dca1a57012f5eb62302ca56b7d3e27a /drivers/net/igb/igb.h
parent21fc578dcaa66dd30bad3c2f2cd7578e2865e8f2 (diff)
igb: do not use phy ops in ethtool test cleanup for non-copper parts
Currently the igb driver is experiencing a panic due to a null function pointer being used during the cleanup of the ethtool looback test on fiber/serdes parts. This patch prevents that and adds a check prior to calling any phy function. 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/igb/igb.h')
-rw-r--r--drivers/net/igb/igb.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
index acf2569b98f4..2121b8bc6ea7 100644
--- a/drivers/net/igb/igb.h
+++ b/drivers/net/igb/igb.h
@@ -332,4 +332,36 @@ extern void igb_free_rx_resources(struct igb_ring *);
332extern void igb_update_stats(struct igb_adapter *); 332extern void igb_update_stats(struct igb_adapter *);
333extern void igb_set_ethtool_ops(struct net_device *); 333extern void igb_set_ethtool_ops(struct net_device *);
334 334
335static inline s32 igb_reset_phy(struct e1000_hw *hw)
336{
337 if (hw->phy.ops.reset_phy)
338 return hw->phy.ops.reset_phy(hw);
339
340 return 0;
341}
342
343static inline s32 igb_read_phy_reg(struct e1000_hw *hw, u32 offset, u16 *data)
344{
345 if (hw->phy.ops.read_phy_reg)
346 return hw->phy.ops.read_phy_reg(hw, offset, data);
347
348 return 0;
349}
350
351static inline s32 igb_write_phy_reg(struct e1000_hw *hw, u32 offset, u16 data)
352{
353 if (hw->phy.ops.write_phy_reg)
354 return hw->phy.ops.write_phy_reg(hw, offset, data);
355
356 return 0;
357}
358
359static inline s32 igb_get_phy_info(struct e1000_hw *hw)
360{
361 if (hw->phy.ops.get_phy_info)
362 return hw->phy.ops.get_phy_info(hw);
363
364 return 0;
365}
366
335#endif /* _IGB_H_ */ 367#endif /* _IGB_H_ */