summaryrefslogtreecommitdiff
path: root/target/linux/generic/files/include
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2013-04-09 14:19:09 +0000
committerJohn Crispin <john@openwrt.org>2013-04-09 14:19:09 +0000
commitfff58a5801f538b6600d41fc7116414cbc730786 (patch)
tree720d3d2d93d266dd589e860820dbfbca46133062 /target/linux/generic/files/include
parentf13ae9965cd593f42f18f2e7192a27cdce7441c4 (diff)
downloadmtk-20170518-fff58a5801f538b6600d41fc7116414cbc730786.zip
mtk-20170518-fff58a5801f538b6600d41fc7116414cbc730786.tar.gz
mtk-20170518-fff58a5801f538b6600d41fc7116414cbc730786.tar.bz2
allow loading port maps from OF
Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 36283
Diffstat (limited to 'target/linux/generic/files/include')
-rw-r--r--target/linux/generic/files/include/linux/switch.h7
-rw-r--r--target/linux/generic/files/include/uapi/linux/switch.h9
2 files changed, 16 insertions, 0 deletions
diff --git a/target/linux/generic/files/include/linux/switch.h b/target/linux/generic/files/include/linux/switch.h
index bd4fae4..b53431e 100644
--- a/target/linux/generic/files/include/linux/switch.h
+++ b/target/linux/generic/files/include/linux/switch.h
@@ -98,6 +98,7 @@ struct switch_dev_ops {
};
struct switch_dev {
+ struct device_node *of_node;
const struct switch_dev_ops *ops;
/* will be automatically filled */
char devname[IFNAMSIZ];
@@ -118,6 +119,7 @@ struct switch_dev {
struct mutex sw_mutex;
struct switch_port *portbuf;
+ struct switch_portmap *portmap;
char buf[128];
@@ -131,6 +133,11 @@ struct switch_port {
u32 flags;
};
+struct switch_portmap {
+ u32 virt;
+ const char *s;
+};
+
struct switch_val {
const struct switch_attr *attr;
int port_vlan;
diff --git a/target/linux/generic/files/include/uapi/linux/switch.h b/target/linux/generic/files/include/uapi/linux/switch.h
index 581caf1..a59b239 100644
--- a/target/linux/generic/files/include/uapi/linux/switch.h
+++ b/target/linux/generic/files/include/uapi/linux/switch.h
@@ -39,6 +39,7 @@ enum {
SWITCH_ATTR_NAME,
SWITCH_ATTR_VLANS,
SWITCH_ATTR_PORTS,
+ SWITCH_ATTR_PORTMAP,
SWITCH_ATTR_CPU_PORT,
/* attributes */
SWITCH_ATTR_OP_ID,
@@ -55,6 +56,14 @@ enum {
SWITCH_ATTR_MAX
};
+enum {
+ /* port map */
+ SWITCH_PORTMAP_PORTS,
+ SWITCH_PORTMAP_SEGMENT,
+ SWITCH_PORTMAP_VIRT,
+ SWITCH_PORTMAP_MAX
+};
+
/* commands */
enum {
SWITCH_CMD_UNSPEC,