Lines Matching full:gp2
22 static int iwl_mld_get_systime(struct iwl_mld *mld, u32 *gp2) in iwl_mld_get_systime() argument
24 *gp2 = iwl_read_prph(mld->trans, mld->trans->mac_cfg->base->gp2_reg_addr); in iwl_mld_get_systime()
26 if (*gp2 == 0x5a5a5a5a) in iwl_mld_get_systime()
32 static void iwl_mld_ptp_update_new_read(struct iwl_mld *mld, u32 gp2) in iwl_mld_ptp_update_new_read() argument
34 IWL_DEBUG_PTP(mld, "PTP: last_gp2=%u, new gp2 read=%u\n", in iwl_mld_ptp_update_new_read()
35 mld->ptp_data.last_gp2, gp2); in iwl_mld_ptp_update_new_read()
40 if (gp2 < mld->ptp_data.last_gp2) { in iwl_mld_ptp_update_new_read()
41 if (mld->ptp_data.last_gp2 - gp2 < in iwl_mld_ptp_update_new_read()
44 "PTP: ignore old read (gp2=%u, last_gp2=%u)\n", in iwl_mld_ptp_update_new_read()
45 gp2, mld->ptp_data.last_gp2); in iwl_mld_ptp_update_new_read()
55 mld->ptp_data.last_gp2 = gp2; in iwl_mld_ptp_update_new_read()
75 /* It is possible that a GP2 timestamp was received from fw before the in iwl_mld_ptp_get_adj_time()
108 u32 gp2; in iwl_mld_ptp_gettime() local
111 if (iwl_mld_get_systime(mld, &gp2)) { in iwl_mld_ptp_gettime()
117 ns = iwl_mld_ptp_get_adj_time(mld, (u64)gp2 * NSEC_PER_USEC); in iwl_mld_ptp_gettime()
143 u32 gp2; in iwl_mld_ptp_adjfine() local
149 if (iwl_mld_get_systime(mld, &gp2)) { in iwl_mld_ptp_adjfine()
156 iwl_mld_ptp_get_adj_time(mld, gp2 * NSEC_PER_USEC); in iwl_mld_ptp_adjfine()
157 data->scale_update_gp2 = gp2; in iwl_mld_ptp_adjfine()
178 u32 gp2; in iwl_mld_ptp_work() local
181 if (!iwl_mld_get_systime(mld, &gp2)) in iwl_mld_ptp_work()
182 iwl_mld_ptp_update_new_read(mld, gp2); in iwl_mld_ptp_work()
184 IWL_DEBUG_PTP(mld, "PTP work: failed to read GP2\n"); in iwl_mld_ptp_work()
189 iwl_mld_get_crosstimestamp_fw(struct iwl_mld *mld, u32 *gp2, u64 *sys_time) in iwl_mld_get_crosstimestamp_fw() argument
223 *gp2 = div_u64(gp2_10ns, 100); in iwl_mld_get_crosstimestamp_fw()
240 /* Raw value read from GP2 register in usec */ in iwl_mld_phc_get_crosstimestamp()
241 u32 gp2; in iwl_mld_phc_get_crosstimestamp() local
242 /* GP2 value in ns*/ in iwl_mld_phc_get_crosstimestamp()
249 ret = iwl_mld_get_crosstimestamp_fw(mld, &gp2, &sys_time); in iwl_mld_phc_get_crosstimestamp()
258 gp2_ns = iwl_mld_ptp_get_adj_time(mld, (u64)gp2 * NSEC_PER_USEC); in iwl_mld_phc_get_crosstimestamp()
262 "Got Sync Time: GP2:%u, last_GP2: %u, GP2_ns: %lld, sys_time: %lld\n", in iwl_mld_phc_get_crosstimestamp()
263 gp2, mld->ptp_data.last_gp2, gp2_ns, (s64)sys_time); in iwl_mld_phc_get_crosstimestamp()