# Re: \[PATCH\] can: dev: extend can\_put\_echo\_skb() to handle frame\_len

- From: Marc Kleine-Budde \<mkl@pengutronix.de\>
- Date: 2021-01-11 10:27:14 
- List: linux-can
- Page: https://ratatoskr.run/linux-can/2021/01/9355028
- Thread: https://ratatoskr.run/linux-can/2021/01/9354995/t.md

```text
On 1/11/21 7:13 AM, Vincent Mailhol wrote:
> Add a frame_len argument to can_put_echo_skb() which is used to save
> length of the CAN frame into field frame_len of struct can_skb_priv so
> that it can be later used after transmission completion. Convert all
> users of this function, too.
> 
> Drivers which implement BQL call can_put_echo_skb() with the output of
> can_skb_get_frame_len(skb) and drivers which do not simply pass zero
> as an input (in the same way that NULL would be given to
> can_get_echo_skb()). This way, we have a nice symmetry between the two
> echo functions.
> 
> Signed-off-by: Vincent Mailhol <redacted>
> --
> Hi Marc,
> 
> If you like the idea to modify can_put_echo_skb(), you can use this
> patch. Just put it between patches 12 and 13 of your series.

Applied.

Fixed the m_can driver aswell.

Assigned "frame_len" in can_put_echo_skb() unconditionally.

Changed the order so that is is applied before the get_echo_skb patch, although
no-one is using the added variable, it's nicer from the logical point of view.

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 |

```

## Attachments

- [signature.asc](https://ratatoskr.run/linux-can/2021/01/9355028/attachment/0) (application/pgp-signature, 488 bytes)
