Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* Marvell RVU Ethernet driver
0003  *
0004  * Copyright (C) 2020 Marvell.
0005  *
0006  */
0007 
0008 #ifndef OTX2_PTP_H
0009 #define OTX2_PTP_H
0010 
0011 static inline u64 otx2_ptp_convert_rx_timestamp(u64 timestamp)
0012 {
0013     return be64_to_cpu(*(__be64 *)&timestamp);
0014 }
0015 
0016 static inline u64 otx2_ptp_convert_tx_timestamp(u64 timestamp)
0017 {
0018     return timestamp;
0019 }
0020 
0021 static inline u64 cn10k_ptp_convert_timestamp(u64 timestamp)
0022 {
0023     return ((timestamp >> 32) * NSEC_PER_SEC) + (timestamp & 0xFFFFFFFFUL);
0024 }
0025 
0026 int otx2_ptp_init(struct otx2_nic *pfvf);
0027 void otx2_ptp_destroy(struct otx2_nic *pfvf);
0028 
0029 int otx2_ptp_clock_index(struct otx2_nic *pfvf);
0030 int otx2_ptp_tstamp2time(struct otx2_nic *pfvf, u64 tstamp, u64 *tsns);
0031 
0032 #endif