can: add can_free_echo_skb() for upcoming drivers
Subsystems (3)
PATCH 1/1 can: add can_free_echo_skb() for upcoming drivers
This patch adds the function can_free_echo_skb to the CAN device interface to allow upcoming drivers to release echo skb's in case of error.
--- drivers/net/can/dev.c | 18 +++++++++++++++++- include/linux/can/dev.h | 1 + 2 files changed, 18 insertions(+), 1 deletion(-)
drivers/net/can/dev.c +17 -1
@@ -315,7 +315,7 @@ void can_get_echo_skb(struct net_device {struct can_priv *priv =netdev_priv (dev); -if ((dev->flags &IFF_ECHO ) && priv->echo_skb[idx]) { +if (priv->echo_skb[idx]) {netif_rx (priv->echo_skb[idx]); priv->echo_skb[idx] =NULL ; }
@@ -323,6 +323,22 @@ void can_get_echo_skb(struct net_deviceEXPORT_SYMBOL_GPL (can_get_echo_skb);/* +* Remove the skb from the stack and free it. +* +* The function is typically called when TX failed. +*/ +void can_free_echo_skb (struct net_device *dev,int idx) +{ +struct can_priv *priv =netdev_priv (dev); + +if (priv->echo_skb[idx]) { +kfree_skb (priv->echo_skb[idx]); + priv->echo_skb[idx] =NULL ; + } +} +EXPORT_SYMBOL_GPL (can_free_echo_skb); + +/* * CAN device restart for bus-off recovery */ void can_restart (unsigned long data)
include/linux/can/dev.h +1 -0
@@ -66,5 +66,6 @@ void can_bus_off(struct net_device *dev)void can_put_echo_skb (struct sk_buff *skb,struct net_device *dev,int idx);void can_get_echo_skb (struct net_device *dev,int idx); +void can_free_echo_skb (struct net_device *dev,int idx);#endif /* CAN_DEV_H */
David Miller
maintainerCan a CAN expert please review these patches? They are rotting in patchwork and I want to move forward with them somehow.
Thanks.
A message that is not in the archive (sent off-list or not yet received): 20090903.204641.193482962.davem-fT/PcQaiUtIeIZ0/[email protected]
Quoted 2 lines · David Miller
Can a CAN expert please review these patches? They are rotting in patchwork and I want to move forward with them somehow.
Hello Dave,
Wolfgang *is* the CAN expert for CAN drivers :-)
We've split the things up:
CAN network layer: Oliver Hartkopp / Urs Thuermann CAN network drivers: Wolfgang Grandegger
As written in MAINTAINERS:
CAN NETWORK DRIVERS
M: Wolfgang Grandegger <[email protected]> L: [email protected] (subscribers-only) W: http://developer.berlios.de/projects/socketcan/ S: Maintained
Btw. All three patches sitting in patchwork are ok from my side and i've personally reviewed them. I thought that Wolfgang was already known to maintain this stuff, so i did not put my Acked-by ...
Best regards,
Oliver
Hello Dave,
Quoted 2 lines · David Miller
Can a CAN expert please review these patches? They are rotting in patchwork and I want to move forward with them somehow.I'
I'm maintaining the CAN device drivers interface and drivers as listed in MAINTAINERS. Though, these patches have already the official blessing.
Do you want me to setup a git repository "can-next-2.6" where you can pull from? So far, not that much can-drv patches have been posted to this list.
Wolfgang.
David Miller
maintainerFrom: Wolfgang Grandegger <[email protected]>
Date: Fri, 04 Sep 2009 09:49:38 +0200
Quoted 6 lines
Quoted 2 lines · David Miller
Can a CAN expert please review these patches? They are rotting in patchwork and I want to move forward with them somehow.I'
I'm maintaining the CAN device drivers interface and drivers as listed in
MAINTAINERS. Though, these patches have already the official blessing.
My bad :-) I'll apply these then.
Quoted 3 lines
Do you want me to setup a git repository "can-next-2.6" where you can pull from? So far, not that much can-drv patches have been posted to this list.
You can do that in the future if you like, sure. But it is not a requirement, as with the rate you guys send things I am handling it efficiently using patchwork.
A message that is not in the archive (sent off-list or not yet received): 20090904.021350.234672852.davem-fT/PcQaiUtIeIZ0/[email protected]
Quoted 12 lines · David Miller
From: Wolfgang Grandegger<[email protected]>
Date: Fri, 04 Sep 2009 09:49:38 +0200Quoted 6 lines
Quoted 2 lines · David Miller
Can a CAN expert please review these patches? They are rotting in patchwork and I want to move forward with them somehow.I'
I'm maintaining the CAN device drivers interface and drivers as listed in
MAINTAINERS. Though, these patches have already the official blessing.My bad :-) I'll apply these then.
Quoted 7 lines
Quoted 3 lines
Do you want me to setup a git repository "can-next-2.6" where you can pull from? So far, not that much can-drv patches have been posted to this list.
You can do that in the future if you like, sure. But it is not a requirement, as with the rate you guys send things I am handling it efficiently using patchwork.
OK, then I will continue sending patches for the time being. Please let me know when a git repository would ease your work.
Thanks,
Wolfgang.