Lines Matching refs:global_ds
79 struct gptp_global_ds *global_ds = GPTP_GLOBAL_DS(); in gptp_change_port_state_debug() local
81 if (global_ds->selected_role[port] == state) { in gptp_change_port_state_debug()
87 state2str(global_ds->selected_role[port]), in gptp_change_port_state_debug()
91 global_ds->selected_role[port] = state; in gptp_change_port_state_debug()
507 struct gptp_global_ds *global_ds; in gptp_mi_pss_send_state_machine() local
510 global_ds = GPTP_GLOBAL_DS(); in gptp_mi_pss_send_state_machine()
534 (global_ds->selected_role[port] == GPTP_PORT_MASTER)) { in gptp_mi_pss_send_state_machine()
582 if ((global_ds->selected_role[port] == GPTP_PORT_MASTER) && in gptp_mi_pss_send_state_machine()
595 (global_ds->selected_role[port] == in gptp_mi_pss_send_state_machine()
702 struct gptp_global_ds *global_ds; in gptp_mi_clk_slave_sync_compute() local
709 global_ds = GPTP_GLOBAL_DS(); in gptp_mi_clk_slave_sync_compute()
720 global_ds->sync_receipt_time.second = sync_receipt_time / NSEC_PER_SEC; in gptp_mi_clk_slave_sync_compute()
721 global_ds->sync_receipt_time.fract_nsecond = in gptp_mi_clk_slave_sync_compute()
723 global_ds->sync_receipt_time.second += pss->precise_orig_ts.second; in gptp_mi_clk_slave_sync_compute()
724 global_ds->sync_receipt_time.fract_nsecond += in gptp_mi_clk_slave_sync_compute()
727 global_ds->sync_receipt_local_time = port_ds->delay_asymmetry; in gptp_mi_clk_slave_sync_compute()
728 global_ds->sync_receipt_local_time /= pss->rate_ratio; in gptp_mi_clk_slave_sync_compute()
729 global_ds->sync_receipt_local_time += in gptp_mi_clk_slave_sync_compute()
731 global_ds->sync_receipt_local_time += pss->upstream_tx_time; in gptp_mi_clk_slave_sync_compute()
733 global_ds->gm_time_base_indicator = pss->gm_time_base_indicator; in gptp_mi_clk_slave_sync_compute()
734 global_ds->last_gm_phase_change.high = pss->last_gm_phase_change.high; in gptp_mi_clk_slave_sync_compute()
735 global_ds->last_gm_phase_change.low = pss->last_gm_phase_change.low; in gptp_mi_clk_slave_sync_compute()
736 global_ds->last_gm_freq_change = pss->last_gm_freq_change; in gptp_mi_clk_slave_sync_compute()
745 struct gptp_global_ds *global_ds; in gptp_update_local_port_clock() local
755 global_ds = GPTP_GLOBAL_DS(); in gptp_update_local_port_clock()
768 second_diff = global_ds->sync_receipt_time.second - in gptp_update_local_port_clock()
769 (global_ds->sync_receipt_local_time / NSEC_PER_SEC); in gptp_update_local_port_clock()
771 (global_ds->sync_receipt_time.fract_nsecond / GPTP_POW2_16) - in gptp_update_local_port_clock()
772 (global_ds->sync_receipt_local_time % NSEC_PER_SEC); in gptp_update_local_port_clock()
882 struct gptp_global_ds *global_ds; in gptp_mi_clk_master_sync_offset_state_machine() local
885 global_ds = GPTP_GLOBAL_DS(); in gptp_mi_clk_master_sync_offset_state_machine()
899 if (global_ds->selected_role[0] == GPTP_PORT_PASSIVE) { in gptp_mi_clk_master_sync_offset_state_machine()
901 memset(&global_ds->clk_src_phase_offset, 0x0, in gptp_mi_clk_master_sync_offset_state_machine()
903 global_ds->clk_src_freq_offset = 0; in gptp_mi_clk_master_sync_offset_state_machine()
904 } else if (global_ds->clk_src_time_base_indicator_prev in gptp_mi_clk_master_sync_offset_state_machine()
905 != global_ds->clk_src_time_base_indicator) { in gptp_mi_clk_master_sync_offset_state_machine()
906 memcpy(&global_ds->clk_src_phase_offset, in gptp_mi_clk_master_sync_offset_state_machine()
907 &global_ds->last_gm_phase_change, in gptp_mi_clk_master_sync_offset_state_machine()
910 global_ds->clk_src_freq_offset = in gptp_mi_clk_master_sync_offset_state_machine()
911 global_ds->last_gm_freq_change; in gptp_mi_clk_master_sync_offset_state_machine()
925 struct gptp_global_ds *global_ds; in gptp_mi_setup_sync_send_time() local
929 global_ds = GPTP_GLOBAL_DS(); in gptp_mi_setup_sync_send_time()
934 global_ds->clk_master_sync_itv; in gptp_mi_setup_sync_send_time()
947 struct gptp_global_ds *global_ds; in gptp_mi_set_ps_sync_cmss() local
951 global_ds = GPTP_GLOBAL_DS(); in gptp_mi_set_ps_sync_cmss()
981 sync_info->upstream_tx_time = global_ds->local_time.low; in gptp_mi_set_ps_sync_cmss()
986 global_ds->clk_src_time_base_indicator; in gptp_mi_set_ps_sync_cmss()
989 &global_ds->clk_src_phase_offset, in gptp_mi_set_ps_sync_cmss()
992 sync_info->last_gm_freq_change = global_ds->clk_src_freq_offset; in gptp_mi_set_ps_sync_cmss()
1053 struct gptp_global_ds *global_ds; in gptp_compute_gm_rate_ratio() local
1057 global_ds = GPTP_GLOBAL_DS(); in gptp_compute_gm_rate_ratio()
1063 memcpy(&local_time_n, &global_ds->local_time, in gptp_compute_gm_rate_ratio()
1074 global_ds->gm_rate_ratio = 1.0; in gptp_compute_gm_rate_ratio()
1137 global_ds->gm_rate_ratio = new_gm_rate; in gptp_compute_gm_rate_ratio()
1143 struct gptp_global_ds *global_ds; in gptp_mi_clk_master_sync_rcv_state_machine() local
1161 global_ds = GPTP_GLOBAL_DS(); in gptp_mi_clk_master_sync_rcv_state_machine()
1177 global_ds->local_time.high = 0U; in gptp_mi_clk_master_sync_rcv_state_machine()
1178 global_ds->local_time.low = in gptp_mi_clk_master_sync_rcv_state_machine()
1184 global_ds->clk_src_time_base_indicator_prev = in gptp_mi_clk_master_sync_rcv_state_machine()
1185 global_ds->clk_src_time_base_indicator; in gptp_mi_clk_master_sync_rcv_state_machine()
1187 global_ds->clk_src_time_base_indicator = in gptp_mi_clk_master_sync_rcv_state_machine()
1190 memcpy(&global_ds->clk_src_last_gm_phase_change, in gptp_mi_clk_master_sync_rcv_state_machine()
1194 global_ds->clk_src_last_gm_freq_change = in gptp_mi_clk_master_sync_rcv_state_machine()
1428 struct gptp_global_ds *global_ds; in gptp_mi_port_announce_information_state_machine() local
1438 global_ds = GPTP_GLOBAL_DS(); in gptp_mi_port_announce_information_state_machine()
1449 SET_RESELECT(global_ds, port); in gptp_mi_port_announce_information_state_machine()
1450 CLEAR_SELECTED(global_ds, port); in gptp_mi_port_announce_information_state_machine()
1470 CLEAR_SELECTED(global_ds, port); in gptp_mi_port_announce_information_state_machine()
1471 SET_RESELECT(global_ds, port); in gptp_mi_port_announce_information_state_machine()
1477 if (IS_SELECTED(global_ds, port) && bmca_data->updt_info) { in gptp_mi_port_announce_information_state_machine()
1483 global_ds->master_steps_removed; in gptp_mi_port_announce_information_state_machine()
1495 if (IS_SELECTED(global_ds, port) && bmca_data->updt_info) { in gptp_mi_port_announce_information_state_machine()
1505 (global_ds->gm_present && in gptp_mi_port_announce_information_state_machine()
1558 CLEAR_SELECTED(global_ds, port); in gptp_mi_port_announce_information_state_machine()
1559 SET_RESELECT(global_ds, port); in gptp_mi_port_announce_information_state_machine()
1585 struct gptp_global_ds *global_ds; in gptp_updt_role_disabled_tree() local
1588 global_ds = GPTP_GLOBAL_DS(); in gptp_updt_role_disabled_tree()
1596 (void)memset(&global_ds->last_gm_priority, 0xFF, in gptp_updt_role_disabled_tree()
1600 global_ds->path_trace.len = htons(GPTP_CLOCK_ID_LEN); in gptp_updt_role_disabled_tree()
1601 memcpy(global_ds->path_trace.path_sequence, GPTP_DEFAULT_DS()->clk_id, in gptp_updt_role_disabled_tree()
1615 struct gptp_global_ds *global_ds; in compute_best_vector() local
1622 global_ds = GPTP_GLOBAL_DS(); in compute_best_vector()
1624 gm_prio = &global_ds->gm_priority; in compute_best_vector()
1650 (global_ds->gm_present && in compute_best_vector()
1710 if (&global_ds->gm_priority.root_system_id != in compute_best_vector()
1712 memcpy(&global_ds->gm_priority.root_system_id, in compute_best_vector()
1717 global_ds->gm_priority.steps_removed = in compute_best_vector()
1720 if (&global_ds->gm_priority.src_port_id != in compute_best_vector()
1722 memcpy(&global_ds->gm_priority.src_port_id, in compute_best_vector()
1727 global_ds->gm_priority.port_number = best_vector->port_number; in compute_best_vector()
1735 struct gptp_global_ds *global_ds, in update_bmca() argument
1777 global_ds->master_steps_removed)) { in update_bmca()
1821 struct gptp_global_ds *global_ds; in gptp_updt_roles_tree() local
1827 global_ds = GPTP_GLOBAL_DS(); in gptp_updt_roles_tree()
1830 gm_prio = &global_ds->gm_priority; in gptp_updt_roles_tree()
1831 last_gm_prio = &global_ds->last_gm_priority; in gptp_updt_roles_tree()
1843 global_ds->global_flags.octets[1] = in gptp_updt_roles_tree()
1844 global_ds->sys_flags.octets[1]; in gptp_updt_roles_tree()
1845 global_ds->current_utc_offset = in gptp_updt_roles_tree()
1846 global_ds->sys_current_utc_offset; in gptp_updt_roles_tree()
1847 global_ds->time_source = global_ds->sys_time_source; in gptp_updt_roles_tree()
1848 global_ds->master_steps_removed = 0U; in gptp_updt_roles_tree()
1855 global_ds->global_flags.octets[1] = in gptp_updt_roles_tree()
1857 global_ds->current_utc_offset = in gptp_updt_roles_tree()
1858 global_ds->sys_current_utc_offset; in gptp_updt_roles_tree()
1859 global_ds->time_source = bmca_data->ann_time_source; in gptp_updt_roles_tree()
1860 global_ds->master_steps_removed = in gptp_updt_roles_tree()
1865 update_bmca(port, best_port, global_ds, default_ds, gm_prio); in gptp_updt_roles_tree()
1869 global_ds->gm_present = in gptp_updt_roles_tree()
1875 if (global_ds->selected_role[port] == GPTP_PORT_SLAVE) { in gptp_updt_roles_tree()
1888 global_ds->path_trace.len = htons(GPTP_CLOCK_ID_LEN); in gptp_updt_roles_tree()
1889 memcpy(global_ds->path_trace.path_sequence, in gptp_updt_roles_tree()
1939 struct gptp_global_ds *global_ds; in gptp_mi_port_announce_transmit_state_machine() local
1944 global_ds = GPTP_GLOBAL_DS(); in gptp_mi_port_announce_transmit_state_machine()
1972 if (IS_SELECTED(global_ds, port) && in gptp_mi_port_announce_transmit_state_machine()
1978 } else if (IS_SELECTED(global_ds, port) && in gptp_mi_port_announce_transmit_state_machine()
1981 (global_ds->selected_role[port] == in gptp_mi_port_announce_transmit_state_machine()
1993 if (global_ds->selected_role[port] == GPTP_PORT_MASTER) { in gptp_mi_port_announce_transmit_state_machine()