summaryrefslogtreecommitdiff
path: root/drivers/net/can/dev
diff options
context:
space:
mode:
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>2021-01-11 17:19:27 +0300
committerMarc Kleine-Budde <mkl@pengutronix.de>2021-01-14 10:43:43 +0300
commit1dcb6e57db833419483d0df2d956b1cc2a802683 (patch)
tree74fb05db22febf0dcc26db16ce80e49da8933b4a /drivers/net/can/dev
parentf0ef72febc9a6a569d92cdf6c7996015dfa8e8bb (diff)
downloadlinux-1dcb6e57db833419483d0df2d956b1cc2a802683.tar.xz
can: dev: can_put_echo_skb(): extend to handle frame_len
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. Link: https://lore.kernel.org/r/20210111061335.39983-1-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/r/20210111141930.693847-13-mkl@pengutronix.de Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Diffstat (limited to 'drivers/net/can/dev')
-rw-r--r--drivers/net/can/dev/skb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/can/dev/skb.c b/drivers/net/can/dev/skb.c
index 24f782a23409..c184b4dce19e 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,9 @@ 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 */
+ can_skb_prv(skb)->frame_len = frame_len;
+
/* save this skb for tx interrupt echo handling */
priv->echo_skb[idx] = skb;
} else {