On 11.07.2022 20:34:23, Oliver Hartkopp wrote: > Enable the PF_CAN infrastructure to handle CAN XL frames. A new ethernet > protocol type ETH_P_CANXL is defined to tag skbuffs containing the CAN XL > frame data structure. > > As the length information is now a uint16 value for CAN XL a new helper > function can_get_data_len() is introduced to retrieve the data length > from all types of CAN frames. > > Signed-off-by: Oliver Hartkopp <socketcan@xxxxxxxxxxxx> > --- > include/linux/can/skb.h | 14 ++++++++++ > include/uapi/linux/if_ether.h | 1 + > net/can/af_can.c | 49 +++++++++++++++++++++++++++++------ > 3 files changed, 56 insertions(+), 8 deletions(-) > > diff --git a/include/linux/can/skb.h b/include/linux/can/skb.h > index 182749e858b3..d043bc4afd6d 100644 > --- a/include/linux/can/skb.h > +++ b/include/linux/can/skb.h > @@ -101,6 +101,20 @@ static inline bool can_is_canfd_skb(const struct sk_buff *skb) > { > /* the CAN specific type of skb is identified by its data length */ > return skb->len == CANFD_MTU; > } > > +/* get data length inside of CAN frame for all frame types */ > +static inline unsigned int can_get_data_len(struct sk_buff *skb) > +{ > + if(skb->len == CANXL_MTU) { ^^^ add space Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Attachment:
signature.asc
Description: PGP signature