diff mbox series

[v3,3/4] iplink_can: print brp and dbrp bittiming variables

Message ID 20210618085322.147462-4-mailhol.vincent@wanadoo.fr (mailing list archive)
State New, archived
Delegated to: David Ahern
Headers show
Series iplink_can: cleaning, fixes and adding TDC support. | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Vincent Mailhol June 18, 2021, 8:53 a.m. UTC
Report the value of the bit-rate prescaler (brp) for both the nominal
and the data bittiming.

Currently, only the constant brp values (brp_{min,max,inc}) are being
reported. Also, brp is the only member of struct can_bittiming not
being reported.

Although brp is not used as an input for bittiming calculation, it
makes sense to output it.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 ip/iplink_can.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/ip/iplink_can.c b/ip/iplink_can.c
index ec4e122f..311c097d 100644
--- a/ip/iplink_can.c
+++ b/ip/iplink_can.c
@@ -348,6 +348,7 @@  static void can_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
 		print_uint(PRINT_ANY, "phase_seg2", "phase-seg2 %u ",
 			   bt->phase_seg2);
 		print_uint(PRINT_ANY, "sjw", " sjw %u", bt->sjw);
+		print_uint(PRINT_ANY, "brp", " brp %u", bt->brp);
 		close_json_object();
 	}
 
@@ -423,6 +424,7 @@  static void can_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
 		print_uint(PRINT_ANY, "phase_seg2", " dphase-seg2 %u",
 			   dbt->phase_seg2);
 		print_uint(PRINT_ANY, "sjw", " dsjw %u", dbt->sjw);
+		print_uint(PRINT_ANY, "brp", " dbrp %u", dbt->brp);
 		close_json_object();
 	}