All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] can: add can_free_echo_skb() for upcoming drivers
@ 2009-09-01 15:26 Wolfgang Grandegger
  2009-09-04  3:46 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Grandegger @ 2009-09-01 15:26 UTC (permalink / raw)
  To: Linux Netdev List; +Cc: SocketCAN Core Mailing List

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(-)

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 */

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] can: add can_free_echo_skb() for upcoming drivers
  2009-09-01 15:26 [PATCH net-next] can: add can_free_echo_skb() for upcoming drivers Wolfgang Grandegger
@ 2009-09-04  3:46 ` David Miller
       [not found]   ` <20090903.204641.193482962.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2009-09-04  3:46 UTC (permalink / raw)
  To: wg; +Cc: netdev, socketcan-core, urs.thuermann, oliver.hartkopp


Can a CAN expert please review these patches?  They are rotting
in patchwork and I want to move forward with them somehow.

Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] can: add can_free_echo_skb() for upcoming drivers
       [not found]   ` <20090903.204641.193482962.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
@ 2009-09-04  5:27     ` Oliver Hartkopp
  2009-09-04  7:49     ` Wolfgang Grandegger
  1 sibling, 0 replies; 6+ messages in thread
From: Oliver Hartkopp @ 2009-09-04  5:27 UTC (permalink / raw)
  To: David Miller
  Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	oliver.hartkopp-l29pVbxQd1IUtdQbppsyvg,
	wg-5Yr1BZd7O62+XT7JhA+gdA, urs.thuermann-l29pVbxQd1IUtdQbppsyvg

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-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
L:      socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org (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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] can: add can_free_echo_skb() for upcoming drivers
       [not found]   ` <20090903.204641.193482962.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
  2009-09-04  5:27     ` Oliver Hartkopp
@ 2009-09-04  7:49     ` Wolfgang Grandegger
  2009-09-04  9:13       ` David Miller
  1 sibling, 1 reply; 6+ messages in thread
From: Wolfgang Grandegger @ 2009-09-04  7:49 UTC (permalink / raw)
  To: David Miller
  Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	oliver.hartkopp-l29pVbxQd1IUtdQbppsyvg,
	urs.thuermann-l29pVbxQd1IUtdQbppsyvg

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] can: add can_free_echo_skb() for upcoming drivers
  2009-09-04  7:49     ` Wolfgang Grandegger
@ 2009-09-04  9:13       ` David Miller
       [not found]         ` <20090904.021350.234672852.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2009-09-04  9:13 UTC (permalink / raw)
  To: wg; +Cc: netdev, socketcan-core, urs.thuermann, oliver.hartkopp

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] can: add can_free_echo_skb() for upcoming drivers
       [not found]         ` <20090904.021350.234672852.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
@ 2009-09-04 14:34           ` Wolfgang Grandegger
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Grandegger @ 2009-09-04 14:34 UTC (permalink / raw)
  To: David Miller
  Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	oliver.hartkopp-l29pVbxQd1IUtdQbppsyvg,
	urs.thuermann-l29pVbxQd1IUtdQbppsyvg

On 09/04/2009 11:13 AM, David Miller wrote:
> From: Wolfgang Grandegger<wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
> 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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-09-04 14:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-01 15:26 [PATCH net-next] can: add can_free_echo_skb() for upcoming drivers Wolfgang Grandegger
2009-09-04  3:46 ` David Miller
     [not found]   ` <20090903.204641.193482962.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2009-09-04  5:27     ` Oliver Hartkopp
2009-09-04  7:49     ` Wolfgang Grandegger
2009-09-04  9:13       ` David Miller
     [not found]         ` <20090904.021350.234672852.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2009-09-04 14:34           ` Wolfgang Grandegger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.