Re: [RFC] net: can: flexcan: can FD Format (FDF) changes

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

 



On 07/31/2018 07:18 PM, Pankaj Bansal wrote:

@@ -563,6 +612,12 @@ static netdev_tx_t flexcan_start_xmit(struct sk_buff *skb, struct net_device *de
if (cf->can_id & CAN_RTR_FLAG)
  		ctrl |= FLEXCAN_MB_CNT_RTR;
+	if (priv->can.ctrlmode & CAN_CTRLMODE_FD)
+		ctrl |= FLEXCAN_MB_CNT_EDL;

This looks completely wrong.

Whether the CAN frame in the skb is a CAN or CAN FD frame type must be derived from the skb->len ( which can be CAN_MTU or CANFD_MTU ).

I think you meant:

if (can_is_canfd_skb(skb))
	ctrl |= FLEXCAN_MB_CNT_EDL;

Right?

With "if (priv->can.ctrlmode & CAN_CTRLMODE_FD)" you would ALWAYS send only CAN FD frames. But CAN_CTRLMODE_FD means, that the controller is enabled to handle CAN2.0 _and_ CAN FD frames - and not CAN FD only.

Regards,
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-can" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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