On 11.11.2024 00:56:01, Vincent Mailhol wrote: > Add the netlink interface for CAN XL. > > Signed-off-by: Vincent Mailhol <mailhol.vincent@xxxxxxxxxx> > --- > drivers/net/can/dev/netlink.c | 78 +++++++++++++++++++++++++++++--- > include/linux/can/bittiming.h | 2 + > include/linux/can/dev.h | 13 ++++-- > include/uapi/linux/can/netlink.h | 7 +++ > 4 files changed, 90 insertions(+), 10 deletions(-) > > diff --git a/drivers/net/can/dev/netlink.c b/drivers/net/can/dev/netlink.c > index 6c3fa5aa22cf..3c89b304c5b8 100644 > --- a/drivers/net/can/dev/netlink.c > +++ b/drivers/net/can/dev/netlink.c > @@ -22,6 +22,9 @@ static const struct nla_policy can_policy[IFLA_CAN_MAX + 1] = { > [IFLA_CAN_TERMINATION] = { .type = NLA_U16 }, > [IFLA_CAN_TDC] = { .type = NLA_NESTED }, > [IFLA_CAN_CTRLMODE_EXT] = { .type = NLA_NESTED }, > + [IFLA_CAN_XL_DATA_BITTIMING] = { .len = sizeof(struct can_bittiming) }, > + [IFLA_CAN_XL_DATA_BITTIMING_CONST] = { .len = sizeof(struct can_bittiming_const) }, > + [IFLA_CAN_XL_TDC] = { .type = NLA_NESTED }, I haven't looked at the can_xl IP-core docs yet. I don't want to pass "struct can_bittiming_const" via netlink to user space. It's not sufficient to fully describe the CAN-FD controllers, as tseg1_min cannot equally divided into prop_seg and phase_seg1. Better make it a NLA_NESTED, as you did for the TDC. Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung Nürnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Attachment:
signature.asc
Description: PGP signature