Lines Matching refs:link

15 int can_set_netlink_message(Link *link, sd_netlink_message *m) {  in can_set_netlink_message()  argument
18 assert(link); in can_set_netlink_message()
19 assert(link->network); in can_set_netlink_message()
30 r = sd_netlink_message_open_container_union(m, IFLA_INFO_DATA, link->kind); in can_set_netlink_message()
34 if (link->network->can_bitrate > 0) { in can_set_netlink_message()
36 .bitrate = link->network->can_bitrate, in can_set_netlink_message()
37 .sample_point = link->network->can_sample_point, in can_set_netlink_message()
38 .sjw = link->network->can_sync_jump_width, in can_set_netlink_message()
41 log_link_debug(link, "Setting bitrate = %d bit/s", bt.bitrate); in can_set_netlink_message()
42 if (link->network->can_sample_point > 0) in can_set_netlink_message()
43 …log_link_debug(link, "Setting sample point = %d.%d%%", bt.sample_point / 10, bt.sample_point % 10); in can_set_netlink_message()
45 log_link_debug(link, "Using default sample point"); in can_set_netlink_message()
50 } else if (link->network->can_time_quanta_ns > 0) { in can_set_netlink_message()
52 .tq = link->network->can_time_quanta_ns, in can_set_netlink_message()
53 .prop_seg = link->network->can_propagation_segment, in can_set_netlink_message()
54 .phase_seg1 = link->network->can_phase_buffer_segment_1, in can_set_netlink_message()
55 .phase_seg2 = link->network->can_phase_buffer_segment_2, in can_set_netlink_message()
56 .sjw = link->network->can_sync_jump_width, in can_set_netlink_message()
59 log_link_debug(link, "Setting time quanta = %"PRIu32" nsec", bt.tq); in can_set_netlink_message()
65 if (link->network->can_data_bitrate > 0) { in can_set_netlink_message()
67 .bitrate = link->network->can_data_bitrate, in can_set_netlink_message()
68 .sample_point = link->network->can_data_sample_point, in can_set_netlink_message()
69 .sjw = link->network->can_data_sync_jump_width, in can_set_netlink_message()
72 log_link_debug(link, "Setting data bitrate = %d bit/s", bt.bitrate); in can_set_netlink_message()
73 if (link->network->can_data_sample_point > 0) in can_set_netlink_message()
74 …log_link_debug(link, "Setting data sample point = %d.%d%%", bt.sample_point / 10, bt.sample_point … in can_set_netlink_message()
76 log_link_debug(link, "Using default data sample point"); in can_set_netlink_message()
81 } else if (link->network->can_data_time_quanta_ns > 0) { in can_set_netlink_message()
83 .tq = link->network->can_data_time_quanta_ns, in can_set_netlink_message()
84 .prop_seg = link->network->can_data_propagation_segment, in can_set_netlink_message()
85 .phase_seg1 = link->network->can_data_phase_buffer_segment_1, in can_set_netlink_message()
86 .phase_seg2 = link->network->can_data_phase_buffer_segment_2, in can_set_netlink_message()
87 .sjw = link->network->can_data_sync_jump_width, in can_set_netlink_message()
90 log_link_debug(link, "Setting data time quanta = %"PRIu32" nsec", bt.tq); in can_set_netlink_message()
96 if (link->network->can_restart_us > 0) { in can_set_netlink_message()
99 if (link->network->can_restart_us == USEC_INFINITY) in can_set_netlink_message()
102 restart_ms = DIV_ROUND_UP(link->network->can_restart_us, USEC_PER_MSEC); in can_set_netlink_message()
104 … log_link_debug(link, "Setting restart = %s", FORMAT_TIMESPAN(restart_ms * 1000, MSEC_PER_SEC)); in can_set_netlink_message()
110 if (link->network->can_control_mode_mask != 0) { in can_set_netlink_message()
112 .mask = link->network->can_control_mode_mask, in can_set_netlink_message()
113 .flags = link->network->can_control_mode_flags, in can_set_netlink_message()
121 if (link->network->can_termination_set) { in can_set_netlink_message()
122 … log_link_debug(link, "Setting can-termination to '%u'.", link->network->can_termination); in can_set_netlink_message()
124 … r = sd_netlink_message_append_u16(m, IFLA_CAN_TERMINATION, link->network->can_termination); in can_set_netlink_message()