Re: [PATCH 6/6] net: can: flexcan: use CAN FD frames for Tx/Rx

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

 



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.

>  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   |

Attachment: signature.asc
Description: OpenPGP digital 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