summaryrefslogtreecommitdiff
path: root/target/linux/generic/files/include
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2011-07-27 18:00:18 +0000
committerJonas Gorski <jogo@openwrt.org>2011-07-27 18:00:18 +0000
commiteaa935658b7ec77bfd8b99b557ad196425b620f4 (patch)
tree85ae0f6e1bff3c06ac7b12de828d5a6a86194931 /target/linux/generic/files/include
parent8ff7756e829dde4fcf69eeb9cca673cc7c7bd945 (diff)
downloadmtk-20170518-eaa935658b7ec77bfd8b99b557ad196425b620f4.zip
mtk-20170518-eaa935658b7ec77bfd8b99b557ad196425b620f4.tar.gz
mtk-20170518-eaa935658b7ec77bfd8b99b557ad196425b620f4.tar.bz2
swconfig: Add generic switch identifiers
Also make switches available under a generic name "switch<num>" for device name agnostic access. The old device name is used as an alias for backward compatibility. SVN-Revision: 27800
Diffstat (limited to 'target/linux/generic/files/include')
-rw-r--r--target/linux/generic/files/include/linux/switch.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/target/linux/generic/files/include/linux/switch.h b/target/linux/generic/files/include/linux/switch.h
index ef2dc3a..6eefb7f 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;