Lines Matching refs:fbn
73 static void fbnic_ptp_refresh_time(struct fbnic_dev *fbd, struct fbnic_net *fbn) in fbnic_ptp_refresh_time() argument
79 hi = fbnic_rd32(fbn->fbd, FBNIC_PTP_CTR_VAL_HI); in fbnic_ptp_refresh_time()
88 WRITE_ONCE(fbn->time_high, hi - 16); in fbnic_ptp_refresh_time()
97 struct fbnic_net *fbn; in fbnic_ptp_do_aux_work() local
99 fbn = netdev_priv(fbd->netdev); in fbnic_ptp_do_aux_work()
102 fbnic_ptp_refresh_time(fbd, fbn); in fbnic_ptp_do_aux_work()
131 struct fbnic_net *fbn; in fbnic_ptp_adjtime() local
134 fbn = netdev_priv(fbd->netdev); in fbnic_ptp_adjtime()
137 u64_stats_update_begin(&fbn->time_seq); in fbnic_ptp_adjtime()
138 WRITE_ONCE(fbn->time_offset, READ_ONCE(fbn->time_offset) + delta); in fbnic_ptp_adjtime()
139 u64_stats_update_end(&fbn->time_seq); in fbnic_ptp_adjtime()
150 struct fbnic_net *fbn; in fbnic_ptp_gettimex64() local
155 fbn = netdev_priv(fbd->netdev); in fbnic_ptp_gettimex64()
169 time_ns = ((u64)hi << 32 | lo) + fbn->time_offset; in fbnic_ptp_gettimex64()
184 struct fbnic_net *fbn; in fbnic_ptp_settime64() local
189 fbn = netdev_priv(fbd->netdev); in fbnic_ptp_settime64()
198 u64_stats_update_begin(&fbn->time_seq); in fbnic_ptp_settime64()
199 WRITE_ONCE(fbn->time_offset, host_ns - dev_ns); in fbnic_ptp_settime64()
200 u64_stats_update_end(&fbn->time_seq); in fbnic_ptp_settime64()
225 struct fbnic_net *fbn = netdev_priv(fbd->netdev); in fbnic_ptp_reset() local
250 fbn->time_offset = 0; in fbnic_ptp_reset()
251 fbn->time_high = 0; in fbnic_ptp_reset()
254 void fbnic_time_init(struct fbnic_net *fbn) in fbnic_time_init() argument
260 u64_stats_init(&fbn->time_seq); in fbnic_time_init()
263 int fbnic_time_start(struct fbnic_net *fbn) in fbnic_time_start() argument
265 fbnic_ptp_refresh_time(fbn->fbd, fbn); in fbnic_time_start()
269 return ptp_schedule_worker(fbn->fbd->ptp, FBNIC_TS_HIGH_REFRESH_JIF); in fbnic_time_start()
272 void fbnic_time_stop(struct fbnic_net *fbn) in fbnic_time_stop() argument
274 ptp_cancel_worker_sync(fbn->fbd->ptp); in fbnic_time_stop()
275 fbnic_ptp_fresh_check(fbn->fbd); in fbnic_time_stop()