fm10k/base: fix ieee1588 adjustment direction

The SYSTIME_CFG.Adjust field has a Direction bit to indicate whether the
adjustment is positive or negative. However, we incorrectly read the
documentation and the direction bit should be set 1 when positive, not
when negative.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
This commit is contained in:
Wang Xiao W 2015-09-10 12:38:22 +08:00 committed by Thomas Monjalon
parent d6eaec3589
commit b56d0781aa
2 changed files with 3 additions and 3 deletions

View File

@ -1969,8 +1969,8 @@ STATIC s32 fm10k_adjust_systime_pf(struct fm10k_hw *hw, s32 ppb)
if (systime_adjust > FM10K_SW_SYSTIME_ADJUST_MASK)
return FM10K_ERR_PARAM;
if (ppb < 0)
systime_adjust |= FM10K_SW_SYSTIME_ADJUST_DIR_NEGATIVE;
if (ppb > 0)
systime_adjust |= FM10K_SW_SYSTIME_ADJUST_DIR_POSITIVE;
FM10K_WRITE_SW_REG(hw, FM10K_SW_SYSTIME_ADJUST, (u32)systime_adjust);

View File

@ -486,7 +486,7 @@ struct fm10k_hw;
#define FM10K_SW_SYSTIME_CFG_ADJUST_MASK 0xFF000000
#define FM10K_SW_SYSTIME_ADJUST 0x0224D
#define FM10K_SW_SYSTIME_ADJUST_MASK 0x3FFFFFFF
#define FM10K_SW_SYSTIME_ADJUST_DIR_NEGATIVE 0x80000000
#define FM10K_SW_SYSTIME_ADJUST_DIR_POSITIVE 0x80000000
#define FM10K_SW_SYSTIME_PULSE(_n) ((_n) + 0x02252)
#ifndef ETH_ALEN