Skip to content

Commit

Permalink
net/bnxt: fix check for PTP support in FW
Browse files Browse the repository at this point in the history
[ upstream commit a642112 ]

On Thor, driver must use HWRM to access the timestamp information.
Driver should not advertise PTP support to application
if PTP information is not available via HWRM commands.

Fixes: 6cbd89f ("net/bnxt: support PTP for Thor")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
  • Loading branch information
Kalesh AP authored and cpaelzer committed Aug 9, 2021
1 parent 024de73 commit 831b94f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/net/bnxt/bnxt_hwrm.c
Expand Up @@ -551,9 +551,13 @@ static int bnxt_hwrm_ptp_qcfg(struct bnxt *bp)

HWRM_CHECK_RESULT();

if (!BNXT_CHIP_THOR(bp) &&
!(resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS))
return 0;
if (BNXT_CHIP_THOR(bp)) {
if (!(resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS))
return 0;
} else {
if (!(resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS))
return 0;
}

if (resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_ONE_STEP_TX_TS)
bp->flags |= BNXT_FLAG_FW_CAP_ONE_STEP_TX_TS;
Expand Down

0 comments on commit 831b94f

Please sign in to comment.