Skip to content

Commit cedeac9

Browse files
Sudarsana Reddy Kallurudavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Ariel Elior <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3c13ce7 commit cedeac9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/net/ethernet/qlogic/qed/qed_ptp.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
/* Add/subtract the Adjustment_Value when making a Drift adjustment */
4545
#define QED_DRIFT_CNTR_DIRECTION_SHIFT 31
4646
#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
4749

4850
static enum qed_resc_lock qed_ptcdev_to_resc(struct qed_hwfn *p_hwfn)
4951
{
@@ -243,7 +245,8 @@ static int qed_ptp_hw_cfg_filters(struct qed_dev *cdev,
243245
return -EINVAL;
244246
}
245247

246-
qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_PTP_PARAM_MASK, 0);
248+
qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_PTP_PARAM_MASK,
249+
QED_PTP_UCAST_PARAM_MASK);
247250
qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_PTP_RULE_MASK, rule_mask);
248251
qed_wr(p_hwfn, p_ptt, NIG_REG_RX_PTP_EN, enable_cfg);
249252

@@ -253,7 +256,8 @@ static int qed_ptp_hw_cfg_filters(struct qed_dev *cdev,
253256
qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_RULE_MASK, 0x3FFF);
254257
} else {
255258
qed_wr(p_hwfn, p_ptt, NIG_REG_TX_PTP_EN, enable_cfg);
256-
qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_PARAM_MASK, 0);
259+
qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_PARAM_MASK,
260+
QED_PTP_UCAST_PARAM_MASK);
257261
qed_wr(p_hwfn, p_ptt, NIG_REG_TX_LLH_PTP_RULE_MASK, rule_mask);
258262
}
259263

0 commit comments

Comments
 (0)