diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2015-04-02 17:07:00 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-02 20:04:59 +0200 |
commit | a54acb3a6f853e8394c4cb7b6a4d93c88f13eefd (patch) | |
tree | b1e887d2bc8c205d4fe3b331e40fddba5de6ee01 /net/core/net-sysfs.c | |
parent | crypto: algif - explicitly mark end of data (diff) | |
download | linux-a54acb3a6f853e8394c4cb7b6a4d93c88f13eefd.tar.xz linux-a54acb3a6f853e8394c4cb7b6a4d93c88f13eefd.zip |
dev: introduce dev_get_iflink()
The goal of this patch is to prepare the removal of the iflink field. It
introduces a new ndo function, which will be implemented by virtual interfaces.
There is no functional change into this patch. All readers of iflink field
now call dev_get_iflink().
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/net-sysfs.c')
-rw-r--r-- | net/core/net-sysfs.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index cc5cf689809c..4238d6da5c60 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -109,11 +109,19 @@ NETDEVICE_SHOW_RO(dev_id, fmt_hex); NETDEVICE_SHOW_RO(dev_port, fmt_dec); NETDEVICE_SHOW_RO(addr_assign_type, fmt_dec); NETDEVICE_SHOW_RO(addr_len, fmt_dec); -NETDEVICE_SHOW_RO(iflink, fmt_dec); NETDEVICE_SHOW_RO(ifindex, fmt_dec); NETDEVICE_SHOW_RO(type, fmt_dec); NETDEVICE_SHOW_RO(link_mode, fmt_dec); +static ssize_t iflink_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + struct net_device *ndev = to_net_dev(dev); + + return sprintf(buf, fmt_dec, dev_get_iflink(ndev)); +} +static DEVICE_ATTR_RO(iflink); + static ssize_t format_name_assign_type(const struct net_device *dev, char *buf) { return sprintf(buf, fmt_dec, dev->name_assign_type); |