Re: [PATCH rework v1] canxl: add virtual CAN network identifier support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12.02.2024 16:26:34, Oliver Hartkopp wrote:
> I'm currently in discussion with Guy Harris who's working on the Linux-CAN
> support in Wireshark.
> 
> We current have two approaches how to integrate the VCID into the struct
> canxl_frame:
> 
> 1. Add the VCID at a specific 16 bit offset (above the 11 bit Prio ID)
> 2. Create a endian-dependent data structure with a separate uint8 VCID
> 
> 1: https://lore.kernel.org/linux-can/20240212151404.60828-1-socketcan@xxxxxxxxxxxx/
> 2: https://lore.kernel.org/linux-can/20240128183758.68401-1-socketcan@xxxxxxxxxxxx/
> 
> The endian-dependent data structure looks like this:
> 
> struct canxl_frame {
> #if defined(__LITTLE_ENDIAN)
>         __u16 prio;   /* 11 bit priority for arbitration */
>         __u8  vcid;   /* virtual CAN network identifier */
>         __u8  __res0; /* reserved / padding must be set to zero */
> #elif defined(__BIG_ENDIAN)
>         __u8  __res0; /* reserved / padding must be set to zero */
>         __u8  vcid;   /* virtual CAN network identifier */
>         __u16 prio;   /* 11 bit priority for arbitration */
> #else
> #error "Unknown endianness"
> #endif
>         __u8  flags;  /* additional flags for CAN XL */
>         __u8  sdt;    /* SDU (service data unit) type */
>         __u16 len;    /* frame payload length in byte */
>         __u32 af;     /* acceptance field */
>         __u8  data[CANXL_MAX_DLEN];
> };
> 
> @Guy: Besides the fact that suggestion 2 does not win a design prize I'm not
> sure whether solution 1 or 2 are better to maintain over lifetime.
> 
> Feedback about the two suggestions is highly appreciated.

Then I'll skip the virtual CAN network identifier support patches for
now.

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


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux