Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

qed: Add support for Timestamping the unicast PTP packets.

This patch adds driver changes to detect/timestamp the unicast PTP packets.

Changes from previous version:
-------------------------------
v2: Defined a macro for unicast ptp param mask.

Please consider applying this to "net-next".

Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Sudarsana Reddy Kalluru and committed by
David S. Miller
cedeac9d 3c13ce74

+6 -2
+6 -2
drivers/net/ethernet/qlogic/qed/qed_ptp.c
··· 44 44 /* Add/subtract the Adjustment_Value when making a Drift adjustment */ 45 45 #define QED_DRIFT_CNTR_DIRECTION_SHIFT 31 46 46 #define QED_TIMESTAMP_MASK BIT(16) 47 + /* Param mask for Hardware to detect/timestamp the unicast PTP packets */ 48 + #define QED_PTP_UCAST_PARAM_MASK 0xF 47 49 48 50 static enum qed_resc_lock qed_ptcdev_to_resc(struct qed_hwfn *p_hwfn) 49 51 { ··· 245 243 return -EINVAL; 246 244 } 247 245 248 - qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_PTP_PARAM_MASK, 0); 246 + qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_PTP_PARAM_MASK, 247 + QED_PTP_UCAST_PARAM_MASK); 249 248 qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_PTP_RULE_MASK, rule_mask); 250 249 qed_wr(p_hwfn, p_ptt, NIG_REG_RX_PTP_EN, enable_cfg); 251 250 ··· 256 253 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_RULE_MASK, 0x3FFF); 257 254 } else { 258 255 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_PTP_EN, enable_cfg); 259 - qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_PARAM_MASK, 0); 256 + qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_PARAM_MASK, 257 + QED_PTP_UCAST_PARAM_MASK); 260 258 qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_RULE_MASK, rule_mask); 261 259 } 262 260