diff options
Diffstat (limited to 'drivers/net/can/dev.c')
-rw-r--r-- | drivers/net/can/dev.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 5fe34d64ca2a..26c89aaeba62 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c | |||
@@ -637,6 +637,22 @@ static int can_changelink(struct net_device *dev, | |||
637 | return 0; | 637 | return 0; |
638 | } | 638 | } |
639 | 639 | ||
640 | static size_t can_get_size(const struct net_device *dev) | ||
641 | { | ||
642 | struct can_priv *priv = netdev_priv(dev); | ||
643 | size_t size; | ||
644 | |||
645 | size = nla_total_size(sizeof(u32)); /* IFLA_CAN_STATE */ | ||
646 | size += sizeof(struct can_ctrlmode); /* IFLA_CAN_CTRLMODE */ | ||
647 | size += nla_total_size(sizeof(u32)); /* IFLA_CAN_RESTART_MS */ | ||
648 | size += sizeof(struct can_bittiming); /* IFLA_CAN_BITTIMING */ | ||
649 | size += sizeof(struct can_clock); /* IFLA_CAN_CLOCK */ | ||
650 | if (priv->bittiming_const) /* IFLA_CAN_BITTIMING_CONST */ | ||
651 | size += sizeof(struct can_bittiming_const); | ||
652 | |||
653 | return size; | ||
654 | } | ||
655 | |||
640 | static int can_fill_info(struct sk_buff *skb, const struct net_device *dev) | 656 | static int can_fill_info(struct sk_buff *skb, const struct net_device *dev) |
641 | { | 657 | { |
642 | struct can_priv *priv = netdev_priv(dev); | 658 | struct can_priv *priv = netdev_priv(dev); |
@@ -687,6 +703,7 @@ static struct rtnl_link_ops can_link_ops __read_mostly = { | |||
687 | .setup = can_setup, | 703 | .setup = can_setup, |
688 | .newlink = can_newlink, | 704 | .newlink = can_newlink, |
689 | .changelink = can_changelink, | 705 | .changelink = can_changelink, |
706 | .get_size = can_get_size, | ||
690 | .fill_info = can_fill_info, | 707 | .fill_info = can_fill_info, |
691 | .fill_xstats = can_fill_xstats, | 708 | .fill_xstats = can_fill_xstats, |
692 | }; | 709 | }; |