diff mbox

[net-next] can: add can_free_echo_skb() for upcoming drivers

Message ID 4A9D3D14.90201@grandegger.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Wolfgang Grandegger Sept. 1, 2009, 3:26 p.m. UTC
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.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
 drivers/net/can/dev.c   |   18 +++++++++++++++++-
 include/linux/can/dev.h |    1 +
 2 files changed, 18 insertions(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Sept. 4, 2009, 3:46 a.m. UTC | #1
Can a CAN expert please review these patches?  They are rotting
in patchwork and I want to move forward with them somehow.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Oliver Hartkopp Sept. 4, 2009, 5:27 a.m. UTC | #2
David Miller wrote:
> 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 <wg@grandegger.com>
L:      socketcan-core@lists.berlios.de (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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wolfgang Grandegger Sept. 4, 2009, 7:49 a.m. UTC | #3
Hello Dave,

David Miller wrote:
> 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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Sept. 4, 2009, 9:13 a.m. UTC | #4
From: Wolfgang Grandegger <wg@grandegger.com>
Date: Fri, 04 Sep 2009 09:49:38 +0200

> David Miller wrote:
>> 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.

> 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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wolfgang Grandegger Sept. 4, 2009, 2:34 p.m. UTC | #5
On 09/04/2009 11:13 AM, David Miller wrote:
> From: Wolfgang Grandegger<wg@grandegger.com>
> Date: Fri, 04 Sep 2009 09:49:38 +0200
>
>> David Miller wrote:
>>> 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.
>
>> 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.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: net-next-2.6/drivers/net/can/dev.c
===================================================================
--- net-next-2.6.orig/drivers/net/can/dev.c
+++ net-next-2.6/drivers/net/can/dev.c
@@ -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_device 
 EXPORT_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)
Index: net-next-2.6/include/linux/can/dev.h
===================================================================
--- net-next-2.6.orig/include/linux/can/dev.h
+++ net-next-2.6/include/linux/can/dev.h
@@ -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 */