From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Woodhouse Subject: [PATCH] Expose netdevice dev_id through sysfs Date: Sun, 20 Apr 2008 12:22:52 +0100 Message-ID: <1208690572.9212.433.camel@pmac.infradead.org> References: <20080407143805.GA9492@bongo.bofh.it> <1208167737.31695.32.camel@pmac.infradead.org> <1208171478.31695.58.camel@pmac.infradead.org> <3ae72650804140455l4bb2afc2i4c54e58f3be1f931@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: davem@davemloft.net Return-path: Received: from pentafluge.infradead.org ([213.146.154.40]:33328 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751101AbYDTLWy (ORCPT ); Sun, 20 Apr 2008 07:22:54 -0400 In-Reply-To: <3ae72650804140455l4bb2afc2i4c54e58f3be1f931@mail.gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: Expose dev_id to userspace, because it helps to disambiguate between interfaces where the MAC address is unique. This should allow us to simplify the handling of persistent naming for S390 network devices in udev -- because it can depend on a simple attribute of the device like the other match criteria, rather than having a special case for SUBSYSTEMS=="ccwgroup". Signed-off-by: David Woodhouse --- ./linux-2.6.24.ppc/net/core/net-sysfs.c~ 2008-04-13 13:38:24.000000000 +0100 +++ ./linux-2.6.24.ppc/net/core/net-sysfs.c 2008-04-14 10:58:32.000000000 +0100 @@ -87,6 +87,7 @@ static ssize_t netdev_store(struct devic return ret; } +NETDEVICE_SHOW(dev_id, fmt_hex); NETDEVICE_SHOW(addr_len, fmt_dec); NETDEVICE_SHOW(iflink, fmt_dec); NETDEVICE_SHOW(ifindex, fmt_dec); @@ -210,6 +211,7 @@ static ssize_t store_tx_queue_len(struct static struct device_attribute net_class_attributes[] = { __ATTR(addr_len, S_IRUGO, show_addr_len, NULL), + __ATTR(dev_id, S_IRUGO, show_dev_id, NULL), __ATTR(iflink, S_IRUGO, show_iflink, NULL), __ATTR(ifindex, S_IRUGO, show_ifindex, NULL), __ATTR(features, S_IRUGO, show_features, NULL), -- dwmw2