Re: [PATCH] can: dev: extend can_put_echo_skb() to handle frame_len

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

 



On 1/11/21 7:13 AM, Vincent Mailhol wrote:
[...]

> diff --git a/drivers/net/can/dev/skb.c b/drivers/net/can/dev/skb.c
> index 568dc28f7a4e..64bd2b60febc 100644
> --- a/drivers/net/can/dev/skb.c
> +++ b/drivers/net/can/dev/skb.c
> @@ -38,7 +38,7 @@ void can_flush_echo_skb(struct net_device *dev)
>   * priv->echo_skb, if necessary.
>   */
>  int can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
> -		     unsigned int idx)
> +		     unsigned int idx, unsigned int frame_len)
>  {
>  	struct can_priv *priv = netdev_priv(dev);
>  
> @@ -62,6 +62,10 @@ int can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
>  		skb->ip_summed = CHECKSUM_UNNECESSARY;
>  		skb->dev = dev;
>  
> +		/* save frame_len to reuse it when transmission is completed */
> +		if (frame_len)
> +			can_skb_prv(skb)->frame_len = frame_len;
> +

I think we can assign it unconditionally?

>  		/* save this skb for tx interrupt echo handling */
>  		priv->echo_skb[idx] = skb;
>  	} else {

regards,
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: 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