Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[sfrench/cifs-2.6.git] / drivers / net / can / dev.c
index f0b9a1e1db46d18a3fdeded05ee8bba2187b6151..564e31c9fee449ba1e56a61a8347429eb1942a59 100644 (file)
@@ -589,6 +589,22 @@ static int can_changelink(struct net_device *dev,
        return 0;
 }
 
+static size_t can_get_size(const struct net_device *dev)
+{
+       struct can_priv *priv = netdev_priv(dev);
+       size_t size;
+
+       size = nla_total_size(sizeof(u32));   /* IFLA_CAN_STATE */
+       size += sizeof(struct can_ctrlmode);  /* IFLA_CAN_CTRLMODE */
+       size += nla_total_size(sizeof(u32));  /* IFLA_CAN_RESTART_MS */
+       size += sizeof(struct can_bittiming); /* IFLA_CAN_BITTIMING */
+       size += sizeof(struct can_clock);     /* IFLA_CAN_CLOCK */
+       if (priv->bittiming_const)            /* IFLA_CAN_BITTIMING_CONST */
+               size += sizeof(struct can_bittiming_const);
+
+       return size;
+}
+
 static int can_fill_info(struct sk_buff *skb, const struct net_device *dev)
 {
        struct can_priv *priv = netdev_priv(dev);
@@ -639,6 +655,7 @@ static struct rtnl_link_ops can_link_ops __read_mostly = {
        .setup          = can_setup,
        .newlink        = can_newlink,
        .changelink     = can_changelink,
+       .get_size       = can_get_size,
        .fill_info      = can_fill_info,
        .fill_xstats    = can_fill_xstats,
 };