From c86f6a92354ee847ef8b06ce1061ff45989e9148 Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Wed, 27 Jul 2011 18:00:18 +0000 Subject: swconfig: Add generic switch identifiers Also make switches available under a generic name "switch" for device name agnostic access. The old device name is used as an alias for backward compatibility. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27800 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/generic/files/include/linux/switch.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'target/linux/generic/files/include') diff --git a/target/linux/generic/files/include/linux/switch.h b/target/linux/generic/files/include/linux/switch.h index ef2dc3ad9f..6eefb7fe6b 100644 --- a/target/linux/generic/files/include/linux/switch.h +++ b/target/linux/generic/files/include/linux/switch.h @@ -36,8 +36,9 @@ enum { SWITCH_ATTR_TYPE, /* device */ SWITCH_ATTR_ID, - SWITCH_ATTR_NAME, SWITCH_ATTR_DEV_NAME, + SWITCH_ATTR_ALIAS, + SWITCH_ATTR_NAME, SWITCH_ATTR_VLANS, SWITCH_ATTR_PORTS, SWITCH_ATTR_CPU_PORT, @@ -146,10 +147,12 @@ struct switch_dev_ops { struct switch_dev { const struct switch_dev_ops *ops; - const char *name; + /* will be automatically filled */ + char devname[IFNAMSIZ]; - /* NB: either devname or netdev must be set */ - const char *devname; + const char *name; + /* NB: either alias or netdev must be set */ + const char *alias; struct net_device *netdev; int ports; -- cgit v1.2.3