> -----Original Message----- > From: Pankaj Bansal > Sent: Tuesday, July 31, 2018 5:45 PM > To: 'Marc Kleine-Budde' <mkl@xxxxxxxxxxxxxx>; linux-can@xxxxxxxxxxxxxxx > Subject: RE: [PATCH 6/6] net: can: flexcan: use CAN FD frames for Tx/Rx > > > > > -----Original Message----- > > From: Marc Kleine-Budde [mailto:mkl@xxxxxxxxxxxxxx] > > Sent: Tuesday, July 31, 2018 1:29 PM > > To: Pankaj Bansal <pankaj.bansal@xxxxxxx>; linux-can@xxxxxxxxxxxxxxx > > Subject: Re: [PATCH 6/6] net: can: flexcan: use CAN FD frames for > > Tx/Rx > > > > On 07/31/2018 09:55 AM, Pankaj Bansal wrote: > > >>> I thought this command configures the CAN interface in FD mode. > > >>> And normal command > > >>> -> ip link set can0 up type can bitrate 125000 > > >>> configures CAN interface In CAN 2.0 mode. > > >> > > >> Yes - If your driver supports this "ip" command. But your patches > > >> switch the driver into CAN-FD mode unconditionally. > > > > > > I have limited the payload size to 8 bytes only in flexcan_probe: " > > > BUT, > > limit the only possible payload value to be 8, because the CAN FD > > changes are not in place yet." > > > + if (devtype_data->payload_size != CAN_MAX_DLEN) { > > > + dev_err(&pdev->dev, "payload_size %d not supported\n", > > > + devtype_data->payload_size); > > > + err = -ENODEV; > > > + goto failed_register; > > > + } > > > Also I am not advertising the CAN_CTRLMODE_FD in > > can.ctrlmode_supported. > > > > > > Is there any other change in my patches that conveys that the > > > interface > > supports CAN FD? > > > > You allocate and use CAN-FD frames, thus this will fail on existing > > applications that don't switch on CAN-FD mode on the socket. > > > > I tried with changes that you suggested : > diff --git a/candump.c b/candump.c > index f98d1c3..be3a23d 100644 > --- a/candump.c > +++ b/candump.c > @@ -535,9 +535,10 @@ int main(int argc, char **argv) > > } /* if (nptr) */ > > +#if 0 > /* try to switch the socket into CAN FD mode */ > setsockopt(s[i], SOL_CAN_RAW, CAN_RAW_FD_FRAMES, > &canfd_on, sizeof(canfd_on)); > - > +#endif > if (rcvbuf_size) { > > int curr_rcvbuf_size; > > I got the same output: Sorry, I forgot to update the correct can-utils in rootfs. The previous statement is not correct. I get no output on RX side.: # ip link set can0 up type can bitrate 125000 [ 41.609921] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready # ip link set can1 up type can bitrate 125000 [ 52.075718] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready # candump can0 & # candump can1 & # cangen can0 -n 10 can0 2A1 [5] D7 A1 16 4E 05 can0 384 [8] 50 2B A0 4C 6E BD 02 6C can0 0F0 [0] can0 1CB [8] 67 D1 FF 46 8F C0 34 5E can0 072 [8] 66 5C A6 53 CC 37 67 60 can0 412 [8] D1 2C 65 7F 95 23 E8 67 can0 034 [5] 18 6C 33 44 EF can0 7DE [1] 6D can0 136 [4] 85 0E 81 67 can0 5AF [5] 28 A2 14 5F 9F # cangen -e can0 -n 10 can0 0B60AFD1 [8] 27 D5 63 21 E6 8D 49 66 can0 07C3AE2B [8] 09 A8 C0 26 FF 3D ED 70 can0 0CFB65AE [5] C2 0A A8 6F 6C can0 1A5BA056 [6] 17 4C 64 76 D2 94 can0 17C49830 [6] FF A9 B7 4D C6 D8 can0 0D6DFF1E [8] 21 A0 F6 73 93 62 84 44 can0 092124CE [6] 31 AD 56 43 5C DF can0 1D1A844D [3] E6 FF 27 can0 183D8A3B [8] 04 C2 C4 4E 66 38 01 60 can0 047FA08B [8] 65 76 EE 50 3A 06 7B 71 # cangen -e can1 -n 10 can1 1DD38243 [8] 24 62 13 1D 36 33 83 10 can1 124959BE [8] 19 75 06 75 F8 A2 BD 60 can1 1FD3BC68 [8] C9 31 AD 4A 98 C2 57 34 can1 0F27D025 [4] D3 A0 69 14 can1 1B3034E9 [0] can1 13620CB3 [8] C1 6D 6D 4D 3A FC 42 26 can1 0BBF2F97 [2] 04 37 can1 1CC72A74 [8] 8D 59 2C 73 B8 AC 9A 1A can1 0B21AF01 [1] EE can1 1D2984C9 [7] B7 AB 28 5E 32 41 FD # > > # ip link set can0 up type can bitrate 125000 [ 264.890127] IPv6: > ADDRCONF(NETDEV_CHANGE): can0: link becomes ready # ip link set can1 > up type can bitrate 125000 [ 280.073214] IPv6: > ADDRCONF(NETDEV_CHANGE): can1: link becomes ready # candump can0 > & # candump can1 & # cangen can0 -n 10 > can0 09A [3] 81 63 4F > can1 09A [03] 81 63 4F > can1 264 [04] 7C 07 E1 2F > can0 264 [4] 7C 07 E1 2F > can1 53F [05] 77 4C 9B 6B F5 > can0 53F [5] 77 4C 9B 6B F5 > can1 465 [03] A7 F7 27 > can0 465 [3] A7 F7 27 > can1 570 [08] 68 2D 0D 6D 6C EE DA 43 > can0 570 [8] 68 2D 0D 6D 6C EE DA 43 > can0 10B [8] 10 DA 9C 28 93 9E B3 7F > can1 10B [08] 10 DA 9C 28 93 9E B3 7F > can1 4C8 [06] B5 3D 43 16 35 14 > can0 4C8 [6] B5 3D 43 16 35 14 > can1 06F [04] 9A E8 00 5D > can0 06F [4] 9A E8 00 5D > can0 197 [8] EE 22 78 74 FB 1B 44 1E > can1 197 [08] EE 22 78 74 FB 1B 44 1E > can1 450 [08] C6 C8 F3 05 8F A1 13 00 > can0 450 [8] C6 C8 F3 05 8F A1 13 00 > # cangen -e can0 -n 10 > can0 1665376A [4] D8 3E 2A 7F > can1 1665376A [04] D8 3E 2A 7F > can1 1E6B4A2E [01] DD > can0 1E6B4A2E [1] DD > can1 1EBB1C5C [08] 2E 63 59 51 28 AA B4 49 > can0 1EBB1C5C [8] 2E 63 59 51 28 AA B4 49 > can1 19F2E803 [08] 78 E5 BD 43 DD E9 EF 6D > can0 19F2E803 [8] 78 E5 BD 43 DD E9 EF 6D > can0 1D1DD346 [8] B5 B4 F4 37 43 27 B1 5A > can1 1D1DD346 [08] B5 B4 F4 37 43 27 B1 5A > can1 1AD678D2 [02] B9 70 > can0 1AD678D2 [2] B9 70 > can0 1DD9789B [6] CE 23 B0 2E B3 57 > can1 1DD9789B [06] CE 23 B0 2E B3 57 > can1 1A497CC6 [06] C9 F8 2A 2C 30 B4 > can0 1A497CC6 [6] C9 F8 2A 2C 30 B4 > can0 03531F4A [2] B9 9D > can1 03531F4A [02] B9 9D > can1 133AFC43 [07] 03 CA 11 74 9F 18 F6 > can0 133AFC43 [7] 03 CA 11 74 9F 18 F6 > # cangen -R can0 -n 10 > can0 2B2 [0] remote request > can1 2B2 [00] > can1 48D [04] 03 CA 11 74 > can0 48D [4] remote request > can1 664 [02] 03 CA > can0 664 [2] remote request > can0 7A2 [1] remote request > can1 7A2 [01] 03 > can1 356 [08] 03 CA 11 74 9F 18 F6 00 > can0 356 [8] remote request > can0 7C1 [4] remote request > can1 7C1 [04] 03 CA 11 74 > can1 2ED [04] 03 CA 11 74 > can0 2ED [4] remote request > can0 375 [3] remote request > can1 375 [03] 03 CA 11 > can1 414 [08] 03 CA 11 74 9F 18 F6 00 > can0 414 [8] remote request > can0 563 [8] remote request > can1 563 [08] 03 CA 11 74 9F 18 F6 00 > # > > > > > static struct sk_buff *can_rx_offload_offload_one(struct > > > can_rx_offload *offload { > > > struct sk_buff *skb = NULL; > > > struct can_rx_offload_cb *cb; > > > - struct can_frame *cf; > > > + struct canfd_frame *cf; > > > int ret; > > > > > > /* If queue is full or skb not available, read to discard mailbox */ > > > if (likely(skb_queue_len(&offload->skb_queue) <= > > > offload->skb_queue_len_max)) > > > - skb = alloc_can_skb(offload->dev, &cf); > > > + skb = alloc_canfd_skb(offload->dev, &cf); > > > > > > > Marc > > > > -- > > Pengutronix e.K. | Marc Kleine-Budde | > > Industrial Linux Solutions | Phone: +49-231-2826-924 | > > Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | > > Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | ��.n��������+%������w��{.n�����{����*jg��������ݢj����G�������j:+v���w�m������w�������h�����٥