Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
87a2d1b6
Commit
87a2d1b6
authored
Mar 11, 2020
by
Jean-Claude BAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VLANS: Change behavior for priority, vid and ptp vid
parent
f8c4444f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
201 additions
and
75 deletions
+201
-75
Kconfig_vlans.in
Kconfig_vlans.in
+127
-55
gen_kconfig_vlans.sh
userspace/host_tools/gen_kconfig_vlans.sh
+8
-4
wrs_vlans.c
userspace/tools/wrs_vlans.c
+66
-16
No files found.
Kconfig_vlans.in
View file @
87a2d1b6
...
...
@@ -9,7 +9,7 @@ config VLANS_ENABLE
config VLANS_RAW_PORT_CONFIG
depends on VLANS_ENABLE
bool "Enable raw
configuration for VLANS
"
bool "Enable raw
ports configuration
"
default n
help
Enable raw configuration for VLANS
...
...
@@ -106,7 +106,8 @@ endchoice # choice VLANS_PORT01_MODE
choice VLANS_PORT01_UNTAG
prompt "Untag frames"
default VLANS_PORT01_UNTAG_ALL
default VLANS_PORT01_UNTAG_ALL if VLANS_PORT01_MODE_ACCESS
default VLANS_PORT01_UNTAG_NONE
depends on VLANS_PORT01_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -124,6 +125,7 @@ endchoice #choice VLANS_PORT01_UNTAG
config VLANS_PORT01_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT01_MODE_ACCESS || VLANS_PORT01_MODE_DISABLED || VLANS_PORT01_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -133,6 +135,7 @@ config VLANS_PORT01_PRIO
config VLANS_PORT01_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT01_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -149,8 +152,9 @@ config VLANS_PORT01_VID
config VLANS_PORT01_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT01_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT01_MODE_TRUNK || VLANS_PORT01_MODE_DISABLED || VLANS_PORT01_MODE_UNQUALIFIED
default VLANS_PORT01_VID if VLANS_PORT01_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -242,7 +246,8 @@ endchoice # choice VLANS_PORT02_MODE
choice VLANS_PORT02_UNTAG
prompt "Untag frames"
default VLANS_PORT02_UNTAG_ALL
default VLANS_PORT02_UNTAG_ALL if VLANS_PORT02_MODE_ACCESS
default VLANS_PORT02_UNTAG_NONE
depends on VLANS_PORT02_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -260,6 +265,7 @@ endchoice #choice VLANS_PORT02_UNTAG
config VLANS_PORT02_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT02_MODE_ACCESS || VLANS_PORT02_MODE_DISABLED || VLANS_PORT02_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -269,6 +275,7 @@ config VLANS_PORT02_PRIO
config VLANS_PORT02_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT02_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -285,8 +292,9 @@ config VLANS_PORT02_VID
config VLANS_PORT02_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT02_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT02_MODE_TRUNK || VLANS_PORT02_MODE_DISABLED || VLANS_PORT02_MODE_UNQUALIFIED
default VLANS_PORT02_VID if VLANS_PORT02_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -378,7 +386,8 @@ endchoice # choice VLANS_PORT03_MODE
choice VLANS_PORT03_UNTAG
prompt "Untag frames"
default VLANS_PORT03_UNTAG_ALL
default VLANS_PORT03_UNTAG_ALL if VLANS_PORT03_MODE_ACCESS
default VLANS_PORT03_UNTAG_NONE
depends on VLANS_PORT03_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -396,6 +405,7 @@ endchoice #choice VLANS_PORT03_UNTAG
config VLANS_PORT03_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT03_MODE_ACCESS || VLANS_PORT03_MODE_DISABLED || VLANS_PORT03_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -405,6 +415,7 @@ config VLANS_PORT03_PRIO
config VLANS_PORT03_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT03_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -421,8 +432,9 @@ config VLANS_PORT03_VID
config VLANS_PORT03_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT03_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT03_MODE_TRUNK || VLANS_PORT03_MODE_DISABLED || VLANS_PORT03_MODE_UNQUALIFIED
default VLANS_PORT03_VID if VLANS_PORT03_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -514,7 +526,8 @@ endchoice # choice VLANS_PORT04_MODE
choice VLANS_PORT04_UNTAG
prompt "Untag frames"
default VLANS_PORT04_UNTAG_ALL
default VLANS_PORT04_UNTAG_ALL if VLANS_PORT04_MODE_ACCESS
default VLANS_PORT04_UNTAG_NONE
depends on VLANS_PORT04_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -532,6 +545,7 @@ endchoice #choice VLANS_PORT04_UNTAG
config VLANS_PORT04_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT04_MODE_ACCESS || VLANS_PORT04_MODE_DISABLED || VLANS_PORT04_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -541,6 +555,7 @@ config VLANS_PORT04_PRIO
config VLANS_PORT04_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT04_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -557,8 +572,9 @@ config VLANS_PORT04_VID
config VLANS_PORT04_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT04_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT04_MODE_TRUNK || VLANS_PORT04_MODE_DISABLED || VLANS_PORT04_MODE_UNQUALIFIED
default VLANS_PORT04_VID if VLANS_PORT04_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -650,7 +666,8 @@ endchoice # choice VLANS_PORT05_MODE
choice VLANS_PORT05_UNTAG
prompt "Untag frames"
default VLANS_PORT05_UNTAG_ALL
default VLANS_PORT05_UNTAG_ALL if VLANS_PORT05_MODE_ACCESS
default VLANS_PORT05_UNTAG_NONE
depends on VLANS_PORT05_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -668,6 +685,7 @@ endchoice #choice VLANS_PORT05_UNTAG
config VLANS_PORT05_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT05_MODE_ACCESS || VLANS_PORT05_MODE_DISABLED || VLANS_PORT05_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -677,6 +695,7 @@ config VLANS_PORT05_PRIO
config VLANS_PORT05_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT05_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -693,8 +712,9 @@ config VLANS_PORT05_VID
config VLANS_PORT05_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT05_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT05_MODE_TRUNK || VLANS_PORT05_MODE_DISABLED || VLANS_PORT05_MODE_UNQUALIFIED
default VLANS_PORT05_VID if VLANS_PORT05_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -786,7 +806,8 @@ endchoice # choice VLANS_PORT06_MODE
choice VLANS_PORT06_UNTAG
prompt "Untag frames"
default VLANS_PORT06_UNTAG_ALL
default VLANS_PORT06_UNTAG_ALL if VLANS_PORT06_MODE_ACCESS
default VLANS_PORT06_UNTAG_NONE
depends on VLANS_PORT06_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -804,6 +825,7 @@ endchoice #choice VLANS_PORT06_UNTAG
config VLANS_PORT06_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT06_MODE_ACCESS || VLANS_PORT06_MODE_DISABLED || VLANS_PORT06_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -813,6 +835,7 @@ config VLANS_PORT06_PRIO
config VLANS_PORT06_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT06_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -829,8 +852,9 @@ config VLANS_PORT06_VID
config VLANS_PORT06_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT06_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT06_MODE_TRUNK || VLANS_PORT06_MODE_DISABLED || VLANS_PORT06_MODE_UNQUALIFIED
default VLANS_PORT06_VID if VLANS_PORT06_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -922,7 +946,8 @@ endchoice # choice VLANS_PORT07_MODE
choice VLANS_PORT07_UNTAG
prompt "Untag frames"
default VLANS_PORT07_UNTAG_ALL
default VLANS_PORT07_UNTAG_ALL if VLANS_PORT07_MODE_ACCESS
default VLANS_PORT07_UNTAG_NONE
depends on VLANS_PORT07_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -940,6 +965,7 @@ endchoice #choice VLANS_PORT07_UNTAG
config VLANS_PORT07_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT07_MODE_ACCESS || VLANS_PORT07_MODE_DISABLED || VLANS_PORT07_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -949,6 +975,7 @@ config VLANS_PORT07_PRIO
config VLANS_PORT07_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT07_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -965,8 +992,9 @@ config VLANS_PORT07_VID
config VLANS_PORT07_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT07_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT07_MODE_TRUNK || VLANS_PORT07_MODE_DISABLED || VLANS_PORT07_MODE_UNQUALIFIED
default VLANS_PORT07_VID if VLANS_PORT07_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -1058,7 +1086,8 @@ endchoice # choice VLANS_PORT08_MODE
choice VLANS_PORT08_UNTAG
prompt "Untag frames"
default VLANS_PORT08_UNTAG_ALL
default VLANS_PORT08_UNTAG_ALL if VLANS_PORT08_MODE_ACCESS
default VLANS_PORT08_UNTAG_NONE
depends on VLANS_PORT08_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -1076,6 +1105,7 @@ endchoice #choice VLANS_PORT08_UNTAG
config VLANS_PORT08_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT08_MODE_ACCESS || VLANS_PORT08_MODE_DISABLED || VLANS_PORT08_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -1085,6 +1115,7 @@ config VLANS_PORT08_PRIO
config VLANS_PORT08_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT08_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -1101,8 +1132,9 @@ config VLANS_PORT08_VID
config VLANS_PORT08_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT08_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT08_MODE_TRUNK || VLANS_PORT08_MODE_DISABLED || VLANS_PORT08_MODE_UNQUALIFIED
default VLANS_PORT08_VID if VLANS_PORT08_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -1194,7 +1226,8 @@ endchoice # choice VLANS_PORT09_MODE
choice VLANS_PORT09_UNTAG
prompt "Untag frames"
default VLANS_PORT09_UNTAG_ALL
default VLANS_PORT09_UNTAG_ALL if VLANS_PORT09_MODE_ACCESS
default VLANS_PORT09_UNTAG_NONE
depends on VLANS_PORT09_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -1212,6 +1245,7 @@ endchoice #choice VLANS_PORT09_UNTAG
config VLANS_PORT09_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT09_MODE_ACCESS || VLANS_PORT09_MODE_DISABLED || VLANS_PORT09_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -1221,6 +1255,7 @@ config VLANS_PORT09_PRIO
config VLANS_PORT09_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT09_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -1237,8 +1272,9 @@ config VLANS_PORT09_VID
config VLANS_PORT09_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT09_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT09_MODE_TRUNK || VLANS_PORT09_MODE_DISABLED || VLANS_PORT09_MODE_UNQUALIFIED
default VLANS_PORT09_VID if VLANS_PORT09_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -1330,7 +1366,8 @@ endchoice # choice VLANS_PORT10_MODE
choice VLANS_PORT10_UNTAG
prompt "Untag frames"
default VLANS_PORT10_UNTAG_ALL
default VLANS_PORT10_UNTAG_ALL if VLANS_PORT10_MODE_ACCESS
default VLANS_PORT10_UNTAG_NONE
depends on VLANS_PORT10_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -1348,6 +1385,7 @@ endchoice #choice VLANS_PORT10_UNTAG
config VLANS_PORT10_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT10_MODE_ACCESS || VLANS_PORT10_MODE_DISABLED || VLANS_PORT10_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -1357,6 +1395,7 @@ config VLANS_PORT10_PRIO
config VLANS_PORT10_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT10_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -1373,8 +1412,9 @@ config VLANS_PORT10_VID
config VLANS_PORT10_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT10_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT10_MODE_TRUNK || VLANS_PORT10_MODE_DISABLED || VLANS_PORT10_MODE_UNQUALIFIED
default VLANS_PORT10_VID if VLANS_PORT10_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -1466,7 +1506,8 @@ endchoice # choice VLANS_PORT11_MODE
choice VLANS_PORT11_UNTAG
prompt "Untag frames"
default VLANS_PORT11_UNTAG_ALL
default VLANS_PORT11_UNTAG_ALL if VLANS_PORT11_MODE_ACCESS
default VLANS_PORT11_UNTAG_NONE
depends on VLANS_PORT11_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -1484,6 +1525,7 @@ endchoice #choice VLANS_PORT11_UNTAG
config VLANS_PORT11_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT11_MODE_ACCESS || VLANS_PORT11_MODE_DISABLED || VLANS_PORT11_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -1493,6 +1535,7 @@ config VLANS_PORT11_PRIO
config VLANS_PORT11_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT11_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -1509,8 +1552,9 @@ config VLANS_PORT11_VID
config VLANS_PORT11_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT11_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT11_MODE_TRUNK || VLANS_PORT11_MODE_DISABLED || VLANS_PORT11_MODE_UNQUALIFIED
default VLANS_PORT11_VID if VLANS_PORT11_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -1602,7 +1646,8 @@ endchoice # choice VLANS_PORT12_MODE
choice VLANS_PORT12_UNTAG
prompt "Untag frames"
default VLANS_PORT12_UNTAG_ALL
default VLANS_PORT12_UNTAG_ALL if VLANS_PORT12_MODE_ACCESS
default VLANS_PORT12_UNTAG_NONE
depends on VLANS_PORT12_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -1620,6 +1665,7 @@ endchoice #choice VLANS_PORT12_UNTAG
config VLANS_PORT12_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT12_MODE_ACCESS || VLANS_PORT12_MODE_DISABLED || VLANS_PORT12_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -1629,6 +1675,7 @@ config VLANS_PORT12_PRIO
config VLANS_PORT12_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT12_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -1645,8 +1692,9 @@ config VLANS_PORT12_VID
config VLANS_PORT12_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT12_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT12_MODE_TRUNK || VLANS_PORT12_MODE_DISABLED || VLANS_PORT12_MODE_UNQUALIFIED
default VLANS_PORT12_VID if VLANS_PORT12_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -1738,7 +1786,8 @@ endchoice # choice VLANS_PORT13_MODE
choice VLANS_PORT13_UNTAG
prompt "Untag frames"
default VLANS_PORT13_UNTAG_ALL
default VLANS_PORT13_UNTAG_ALL if VLANS_PORT13_MODE_ACCESS
default VLANS_PORT13_UNTAG_NONE
depends on VLANS_PORT13_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -1756,6 +1805,7 @@ endchoice #choice VLANS_PORT13_UNTAG
config VLANS_PORT13_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT13_MODE_ACCESS || VLANS_PORT13_MODE_DISABLED || VLANS_PORT13_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -1765,6 +1815,7 @@ config VLANS_PORT13_PRIO
config VLANS_PORT13_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT13_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -1781,8 +1832,9 @@ config VLANS_PORT13_VID
config VLANS_PORT13_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT13_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT13_MODE_TRUNK || VLANS_PORT13_MODE_DISABLED || VLANS_PORT13_MODE_UNQUALIFIED
default VLANS_PORT13_VID if VLANS_PORT13_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -1874,7 +1926,8 @@ endchoice # choice VLANS_PORT14_MODE
choice VLANS_PORT14_UNTAG
prompt "Untag frames"
default VLANS_PORT14_UNTAG_ALL
default VLANS_PORT14_UNTAG_ALL if VLANS_PORT14_MODE_ACCESS
default VLANS_PORT14_UNTAG_NONE
depends on VLANS_PORT14_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -1892,6 +1945,7 @@ endchoice #choice VLANS_PORT14_UNTAG
config VLANS_PORT14_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT14_MODE_ACCESS || VLANS_PORT14_MODE_DISABLED || VLANS_PORT14_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -1901,6 +1955,7 @@ config VLANS_PORT14_PRIO
config VLANS_PORT14_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT14_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -1917,8 +1972,9 @@ config VLANS_PORT14_VID
config VLANS_PORT14_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT14_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT14_MODE_TRUNK || VLANS_PORT14_MODE_DISABLED || VLANS_PORT14_MODE_UNQUALIFIED
default VLANS_PORT14_VID if VLANS_PORT14_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -2010,7 +2066,8 @@ endchoice # choice VLANS_PORT15_MODE
choice VLANS_PORT15_UNTAG
prompt "Untag frames"
default VLANS_PORT15_UNTAG_ALL
default VLANS_PORT15_UNTAG_ALL if VLANS_PORT15_MODE_ACCESS
default VLANS_PORT15_UNTAG_NONE
depends on VLANS_PORT15_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -2028,6 +2085,7 @@ endchoice #choice VLANS_PORT15_UNTAG
config VLANS_PORT15_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT15_MODE_ACCESS || VLANS_PORT15_MODE_DISABLED || VLANS_PORT15_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -2037,6 +2095,7 @@ config VLANS_PORT15_PRIO
config VLANS_PORT15_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT15_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -2053,8 +2112,9 @@ config VLANS_PORT15_VID
config VLANS_PORT15_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT15_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT15_MODE_TRUNK || VLANS_PORT15_MODE_DISABLED || VLANS_PORT15_MODE_UNQUALIFIED
default VLANS_PORT15_VID if VLANS_PORT15_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -2146,7 +2206,8 @@ endchoice # choice VLANS_PORT16_MODE
choice VLANS_PORT16_UNTAG
prompt "Untag frames"
default VLANS_PORT16_UNTAG_ALL
default VLANS_PORT16_UNTAG_ALL if VLANS_PORT16_MODE_ACCESS
default VLANS_PORT16_UNTAG_NONE
depends on VLANS_PORT16_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -2164,6 +2225,7 @@ endchoice #choice VLANS_PORT16_UNTAG
config VLANS_PORT16_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT16_MODE_ACCESS || VLANS_PORT16_MODE_DISABLED || VLANS_PORT16_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -2173,6 +2235,7 @@ config VLANS_PORT16_PRIO
config VLANS_PORT16_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT16_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -2189,8 +2252,9 @@ config VLANS_PORT16_VID
config VLANS_PORT16_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT16_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT16_MODE_TRUNK || VLANS_PORT16_MODE_DISABLED || VLANS_PORT16_MODE_UNQUALIFIED
default VLANS_PORT16_VID if VLANS_PORT16_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -2282,7 +2346,8 @@ endchoice # choice VLANS_PORT17_MODE
choice VLANS_PORT17_UNTAG
prompt "Untag frames"
default VLANS_PORT17_UNTAG_ALL
default VLANS_PORT17_UNTAG_ALL if VLANS_PORT17_MODE_ACCESS
default VLANS_PORT17_UNTAG_NONE
depends on VLANS_PORT17_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -2300,6 +2365,7 @@ endchoice #choice VLANS_PORT17_UNTAG
config VLANS_PORT17_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT17_MODE_ACCESS || VLANS_PORT17_MODE_DISABLED || VLANS_PORT17_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -2309,6 +2375,7 @@ config VLANS_PORT17_PRIO
config VLANS_PORT17_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT17_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -2325,8 +2392,9 @@ config VLANS_PORT17_VID
config VLANS_PORT17_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT17_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT17_MODE_TRUNK || VLANS_PORT17_MODE_DISABLED || VLANS_PORT17_MODE_UNQUALIFIED
default VLANS_PORT17_VID if VLANS_PORT17_MODE_ACCESS
default ""
help
VID used for the PTP messages
...
...
@@ -2418,7 +2486,8 @@ endchoice # choice VLANS_PORT18_MODE
choice VLANS_PORT18_UNTAG
prompt "Untag frames"
default VLANS_PORT18_UNTAG_ALL
default VLANS_PORT18_UNTAG_ALL if VLANS_PORT18_MODE_ACCESS
default VLANS_PORT18_UNTAG_NONE
depends on VLANS_PORT18_MODE_ACCESS || VLANS_RAW_PORT_CONFIG
help
Decide whether VLAN-tags should be removed
...
...
@@ -2436,6 +2505,7 @@ endchoice #choice VLANS_PORT18_UNTAG
config VLANS_PORT18_PRIO
int "Priority"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT18_MODE_ACCESS || VLANS_PORT18_MODE_DISABLED || VLANS_PORT18_MODE_UNQUALIFIED
default -1
range -1 7
help
...
...
@@ -2445,6 +2515,7 @@ config VLANS_PORT18_PRIO
config VLANS_PORT18_VID
string "VID"
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT18_MODE_ACCESS
default ""
help
This value based on the port's mode is used as:
...
...
@@ -2461,8 +2532,9 @@ config VLANS_PORT18_VID
config VLANS_PORT18_PTP_VID
string "PTP VID"
depends on VLANS_RAW_PORT_CONFIG
default VLANS_PORT18_VID
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT18_MODE_TRUNK || VLANS_PORT18_MODE_DISABLED || VLANS_PORT18_MODE_UNQUALIFIED
default VLANS_PORT18_VID if VLANS_PORT18_MODE_ACCESS
default ""
help
VID used for the PTP messages
userspace/host_tools/gen_kconfig_vlans.sh
View file @
87a2d1b6
...
...
@@ -35,7 +35,7 @@ function print_header() {
echo
-e
"
\t
Enable VLAN configuration via dot-config"
echo
-e
"
\n
config VLANS_RAW_PORT_CONFIG"
echo
-e
"
\t
depends on VLANS_ENABLE"
echo
-e
"
\t
bool
\"
Enable raw
configuration for VLANS
\"
"
echo
-e
"
\t
bool
\"
Enable raw
ports configuration
\"
"
echo
-e
"
\t
default n"
echo
-e
"
\t
help"
echo
-e
"
\t
Enable raw configuration for VLANS
\n
"
...
...
@@ -96,7 +96,8 @@ function print_port_config() {
echo
-e
"
\n
choice VLANS_PORT
${
portStr
}
_UNTAG"
echo
-e
"
\t
prompt
\"
Untag frames
\"
"
echo
-e
"
\t
default VLANS_PORT
${
portStr
}
_UNTAG_ALL"
echo
-e
"
\t
default VLANS_PORT
${
portStr
}
_UNTAG_ALL if VLANS_PORT
${
portStr
}
_MODE_ACCESS"
echo
-e
"
\t
default VLANS_PORT
${
portStr
}
_UNTAG_NONE"
echo
-e
"
\t
depends on VLANS_PORT
${
portStr
}
_MODE_ACCESS || VLANS_RAW_PORT_CONFIG"
echo
-e
"
\t
help"
echo
-e
"
\t
Decide whether VLAN-tags should be removed"
...
...
@@ -115,6 +116,7 @@ function print_port_config() {
echo
-e
"
\n
config VLANS_PORT
${
portStr
}
_PRIO"
echo
-e
"
\t
int
\"
Priority
\"
"
echo
-e
"
\t
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT
${
portStr
}
_MODE_ACCESS || VLANS_PORT
${
portStr
}
_MODE_DISABLED || VLANS_PORT
${
portStr
}
_MODE_UNQUALIFIED"
echo
-e
"
\t
default -1"
echo
-e
"
\t
range -1 7"
echo
-e
"
\t
help"
...
...
@@ -124,13 +126,15 @@ function print_port_config() {
echo
-e
"
\n
config VLANS_PORT
${
portStr
}
_VID"
echo
-e
"
\t
string
\"
VID
\"
"
echo
-e
"
\t
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT
${
portStr
}
_MODE_ACCESS"
echo
-e
"
\t
default
\"\"
"
help_vlan_port_vid
echo
-e
"
\n
config VLANS_PORT
${
portStr
}
_PTP_VID"
echo
-e
"
\t
string
\"
PTP VID
\"
"
echo
-e
"
\t
depends on VLANS_RAW_PORT_CONFIG"
echo
-e
"
\t
default VLANS_PORT
${
portStr
}
_VID"
echo
-e
"
\t
depends on VLANS_RAW_PORT_CONFIG || VLANS_PORT
${
portStr
}
_MODE_TRUNK || VLANS_PORT
${
portStr
}
_MODE_DISABLED || VLANS_PORT
${
portStr
}
_MODE_UNQUALIFIED"
echo
-e
"
\t
default VLANS_PORT
${
portStr
}
_VID if VLANS_PORT
${
portStr
}
_MODE_ACCESS"
echo
-e
"
\t
default
\"\"
"
echo
-e
"
\t
help"
echo
-e
"
\t
VID used for the PTP messages"
...
...
userspace/tools/wrs_vlans.c
View file @
87a2d1b6
...
...
@@ -26,6 +26,7 @@
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <ctype.h>
#include <minipc.h>
#include <rtud_exports.h>
#include "regs/endpoint-regs.h"
...
...
@@ -387,6 +388,25 @@ int main(int argc, char *argv[])
return
0
;
}
static
char
*
trimWhitespace
(
char
*
str
)
{
char
*
end
;
// Trim leading space
while
(
isspace
((
unsigned
char
)
*
str
))
str
++
;
if
(
*
str
==
0
)
// All spaces?
return
str
;
// Trim trailing space
end
=
str
+
strlen
(
str
)
-
1
;
while
(
end
>
str
&&
isspace
((
unsigned
char
)
*
end
))
end
--
;
// Write new null terminator character
end
[
1
]
=
'\0'
;
return
str
;
}
static
void
set_p_pmode
(
int
ep
,
int
arg_mode
)
{
vlans
[
ep
].
pmode
=
arg_mode
;
...
...
@@ -985,6 +1005,7 @@ static int read_dot_config(char *dot_config_file)
char
*
val_ch
;
int
i
;
int
mode
;
int
rawPortConfig
;
int
vlan0_port_mask
=
0
;
if
(
access
(
dot_config_file
,
R_OK
))
{
...
...
@@ -1035,6 +1056,10 @@ static int read_dot_config(char *dot_config_file)
return
-
2
;
}
/* Check if raw configuration is enabled */
ret
=
libwr_cfg_get
(
"VLANS_RAW_PORT_CONFIG"
);
rawPortConfig
=
ret
&&
(
!
strcmp
(
ret
,
"y"
));
for
(
port
=
1
;
port
<=
NPORTS
;
port
++
)
{
portmask
=
portmask
|
(
1
<<
(
port
-
1
));
mode
=
QMODE_INVALID
;
...
...
@@ -1073,8 +1098,10 @@ static int read_dot_config(char *dot_config_file)
}
/* check UNTAG all or none only for ACCESS
* for other modes use untag none by default */
if
(
mode
==
QMODE_ACCESS
)
{
* for other modes use untag none by default.
* If raw port configuration is enable, does not
* take care of the mode */
if
(
rawPortConfig
||
mode
==
QMODE_ACCESS
)
{
sprintf
(
buff
,
"VLANS_PORT%02d_UNTAG_ALL"
,
port
);
ret
=
libwr_cfg_get
(
buff
);
if
(
ret
&&
!
strcmp
(
ret
,
"y"
))
{
...
...
@@ -1099,28 +1126,51 @@ static int read_dot_config(char *dot_config_file)
}
/* update a mask for vlan0 */
if
(
mode
!=
QMODE_ACCESS
&&
mode
!=
QMODE_TRUNK
)
{
if
(
rawPortConfig
||
(
mode
!=
QMODE_ACCESS
&&
mode
!=
QMODE_TRUNK
)
)
{
vlan0_port_mask
|=
1
<<
(
port
-
1
);
}
sprintf
(
buff
,
"VLANS_PORT%02d_PRIO"
,
port
);
val_ch
=
libwr_cfg_get
(
buff
);
if
(
val_ch
)
{
if
(
wrs_msg_level
>=
LOG_DEBUG
)
printf
(
"Found %s=%s
\n
"
,
buff
,
val_ch
);
set_p_prio
(
port
-
1
,
val_ch
);
// Priority
if
(
rawPortConfig
||
mode
!=
QMODE_TRUNK
)
{
char
*
strPrio
;
sprintf
(
buff
,
"VLANS_PORT%02d_PRIO"
,
port
);
val_ch
=
libwr_cfg_get
(
buff
);
strPrio
=
val_ch
?
trimWhitespace
(
val_ch
)
:
""
;
if
(
strPrio
[
0
]
!=
0
)
{
if
(
wrs_msg_level
>=
LOG_DEBUG
)
printf
(
"Found %s=%s
\n
"
,
buff
,
strPrio
);
set_p_prio
(
port
-
1
,
strPrio
);
}
else
{
if
(
mode
!=
QMODE_TRUNK
)
{
pr_error
(
"Priority not defined for the port (%d) in"
" TRUNK mode!
\n
"
,
port
);
}
if
(
!
rawPortConfig
)
{
exit
(
1
);
/* Exit only if not raw port configuration */
}
}
}
if
(
mode
==
QMODE_ACCESS
)
{
// PVID
if
(
rawPortConfig
||
mode
==
QMODE_ACCESS
)
{
char
*
strVid
;
sprintf
(
buff
,
"VLANS_PORT%02d_VID"
,
port
);
val_ch
=
libwr_cfg_get
(
buff
);
if
(
val_ch
)
{
strVid
=
val_ch
?
trimWhitespace
(
val_ch
)
:
""
;
if
(
strVid
[
0
]
!=
0
)
{
if
(
wrs_msg_level
>=
LOG_DEBUG
)
printf
(
"Found %s=%s
\n
"
,
buff
,
val_ch
);
set_p_vid
(
port
-
1
,
val_ch
);
printf
(
"Found %s=%s
\n
"
,
buff
,
strVid
);
set_p_vid
(
port
-
1
,
strVid
);
}
else
{
pr_error
(
"VID not defined for the port (%d) in"
" ACCESS mode!
\n
"
,
port
);
exit
(
1
);
if
(
mode
==
QMODE_ACCESS
)
pr_error
(
"VID not defined for the port (%d) in"
" ACCESS mode!
\n
"
,
port
);
if
(
!
rawPortConfig
)
{
exit
(
1
);
/* Exit only if not raw port configuration */
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment