aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2014-01-22 03:05:56 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-23 00:57:17 -0500
commit3bad540ed8285fb53f6365420bba0320d8cd2066 (patch)
tree89801857c75c7cf93d18294096452bd8aebbe957 /net
parentba7d49b1f0f8e5f24294a880ed576964059af5ef (diff)
bonding: convert netlink to use slave data info api
Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/rtnetlink.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index a56bccf6629e..db6a239e0bcc 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -800,28 +800,6 @@ static size_t rtnl_port_size(const struct net_device *dev)
800 return port_self_size; 800 return port_self_size;
801} 801}
802 802
803static size_t rtnl_bond_slave_size(const struct net_device *dev)
804{
805 struct net_device *bond;
806 size_t slave_size =
807 nla_total_size(sizeof(struct nlattr)) + /* IFLA_BOND_SLAVE */
808 nla_total_size(1) + /* IFLA_BOND_SLAVE_STATE */
809 nla_total_size(1) + /* IFLA_BOND_SLAVE_MII_STATUS */
810 nla_total_size(4) + /* IFLA_BOND_SLAVE_LINK_FAILURE_COUNT */
811 nla_total_size(MAX_ADDR_LEN) + /* IFLA_BOND_SLAVE_PERM_HWADDR */
812 nla_total_size(2) + /* IFLA_BOND_SLAVE_QUEUE_ID */
813 nla_total_size(2) + /* IFLA_BOND_SLAVE_AD_AGGREGATOR_ID */
814 0;
815
816 if (netif_is_bond_slave((struct net_device *)dev)) {
817 bond = netdev_master_upper_dev_get((struct net_device *)dev);
818 if (bond && bond->netdev_ops->ndo_get_slave)
819 return slave_size;
820 }
821
822 return 0;
823}
824
825static noinline size_t if_nlmsg_size(const struct net_device *dev, 803static noinline size_t if_nlmsg_size(const struct net_device *dev,
826 u32 ext_filter_mask) 804 u32 ext_filter_mask)
827{ 805{
@@ -851,7 +829,6 @@ static noinline size_t if_nlmsg_size(const struct net_device *dev,
851 + rtnl_port_size(dev) /* IFLA_VF_PORTS + IFLA_PORT_SELF */ 829 + rtnl_port_size(dev) /* IFLA_VF_PORTS + IFLA_PORT_SELF */
852 + rtnl_link_get_size(dev) /* IFLA_LINKINFO */ 830 + rtnl_link_get_size(dev) /* IFLA_LINKINFO */
853 + rtnl_link_get_af_size(dev) /* IFLA_AF_SPEC */ 831 + rtnl_link_get_af_size(dev) /* IFLA_AF_SPEC */
854 + rtnl_bond_slave_size(dev) /* IFLA_SLAVE */
855 + nla_total_size(MAX_PHYS_PORT_ID_LEN); /* IFLA_PHYS_PORT_ID */ 832 + nla_total_size(MAX_PHYS_PORT_ID_LEN); /* IFLA_PHYS_PORT_ID */
856} 833}
857 834
@@ -949,34 +926,6 @@ static int rtnl_phys_port_id_fill(struct sk_buff *skb, struct net_device *dev)
949 return 0; 926 return 0;
950} 927}
951 928
952static size_t rtnl_bond_slave_fill(struct sk_buff *skb, struct net_device *dev)
953{
954 struct net_device *bond;
955 struct nlattr *nest;
956 int err;
957
958 if (!netif_is_bond_slave(dev))
959 return 0;
960
961 bond = netdev_master_upper_dev_get(dev);
962 if (!bond || !bond->netdev_ops->ndo_get_slave)
963 return 0;
964
965 nest = nla_nest_start(skb, IFLA_BOND_SLAVE);
966 if (!nest)
967 return -EMSGSIZE;
968
969 err = bond->netdev_ops->ndo_get_slave(dev, skb);
970 if (err) {
971 nla_nest_cancel(skb, nest);
972 return (err == -EMSGSIZE) ? err : 0;
973 }
974
975 nla_nest_end(skb, nest);
976
977 return 0;
978}
979
980static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, 929static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
981 int type, u32 pid, u32 seq, u32 change, 930 int type, u32 pid, u32 seq, u32 change,
982 unsigned int flags, u32 ext_filter_mask) 931 unsigned int flags, u32 ext_filter_mask)