Skip to contentSkip to conversation

can: add the missing netlink get_xstats_size callback

PATCH Applied Wolfgang Grandegger 2 participants 4 messages Nov 12, 2009 – Nov 16, 2009 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 can: add the missing netlink get_xstats_size callback

This patch adds the missing "get_xstats_size" callback for the netlink interface, which is required if "fill_xstats" is used, as pointed out by Patrick McHardy.

---
 drivers/net/can/dev.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/can/dev.c +6 -0
Index: net-next-2.6/drivers/net/can/dev.c
===================================================================
@@ -677,6 +677,11 @@ nla_put_failure:
 	return -EMSGSIZE;
 }
 
+static size_t can_get_xstats_size(const struct net_device *dev)
+{
+	return sizeof(struct can_device_stats);
+}
+
 static int can_fill_xstats(struct sk_buff *skb, const struct net_device *dev)
 {
 	struct can_priv *priv = netdev_priv(dev);
@@ -705,6 +710,7 @@ static struct rtnl_link_ops can_link_ops
 	.changelink	= can_changelink,
 	.get_size	= can_get_size,
 	.fill_info	= can_fill_info,
+	.get_xstats_size = can_get_xstats_size,
 	.fill_xstats	= can_fill_xstats,
 };

A message that is not in the archive (sent off-list or not yet received): 20091113.195824.48418352.davem-fT/PcQaiUtIeIZ0/[email protected]

#3 lore raw
Quoted 10 lines · David Miller

From: Wolfgang Grandegger <[email protected]>
Date: Thu, 12 Nov 2009 16:34:05 +0100

Quoted 5 lines

This patch adds the missing "get_xstats_size" callback for the netlink interface, which is required if "fill_xstats" is used, as pointed out by Patrick McHardy.

Applied.

It would make sense to apply this patch to net-2.6 as well.

Wolfgang.

maintainer
#4 lore raw

From: Wolfgang Grandegger <[email protected]>
Date: Sun, 15 Nov 2009 12:58:04 +0100

Quoted 8 lines
Quoted 7 lines · David Miller

From: Wolfgang Grandegger <[email protected]>
Date: Thu, 12 Nov 2009 16:34:05 +0100

Quoted 4 lines

This patch adds the missing "get_xstats_size" callback for the netlink interface, which is required if "fill_xstats" is used, as pointed out by Patrick McHardy.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Applied.

It would make sense to apply this patch to net-2.6 as well.

I only applied it to net-2.6