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
83
Issues
83
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
645708b1
Commit
645708b1
authored
Jun 13, 2014
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/wrsw_vlans: added ep listing
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
1749516a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
+31
-2
wrsw_vlans.c
userspace/tools/wrsw_vlans.c
+29
-2
wrsw_vlans.h
userspace/tools/wrsw_vlans.h
+2
-0
No files found.
userspace/tools/wrsw_vlans.c
View file @
645708b1
...
...
@@ -52,6 +52,7 @@ struct option ropts[] = {
{
"evid"
,
1
,
NULL
,
OPT_EP_VID
},
{
"eprio"
,
1
,
NULL
,
OPT_EP_PRIO
},
{
"eumask"
,
1
,
NULL
,
OPT_EP_UMASK
},
{
"elist"
,
0
,
NULL
,
OPT_EP_LIST
},
{
"rvid"
,
1
,
NULL
,
OPT_RTU_VID
},
{
"rfid"
,
1
,
NULL
,
OPT_RTU_FID
},
{
"rmask"
,
1
,
NULL
,
OPT_RTU_PMASK
},
...
...
@@ -209,7 +210,10 @@ int main(int argc, char *argv[])
vlans
[
i
].
valid_mask
|=
VALID_UNTAG
;
}
break
;
case
OPT_EP_LIST
:
// list endpoint stuff
list_ep_vlans
();
break
;
/****************************************************/
/* RTU settings */
case
OPT_RTU_VID
:
...
...
@@ -278,6 +282,7 @@ int print_help(char *prgname)
"
\t
--eprio <priority> sets priority for retagging
\n
"
"
\t
--evid <vid> sets VLAN Id for port
\n
"
"
\t
--eumask <hex mask> sets untag mask for port
\n
"
"
\t
--elist lists current EP configuration
\n
"
"RTU options:
\n
"
"
\t
--rvid <vid> configure VLAN <vid> in rtud
\n
"
"
\t
--del delete selected VLAN from rtud
\n
"
...
...
@@ -413,10 +418,32 @@ void list_rtu_vlans(void)
printf
(
"
\n
"
);
}
void
list_ep_vlans
(
void
)
{
uint32_t
v
,
r
;
int
ep
;
static
char
*
names
[]
=
{
"ACCESS"
,
"TRUNK"
,
"disabled"
,
"unqualified"
};
printf
(
"# QMODE FIX_PRIO PRIO PVID MAC
\n
"
);
printf
(
"#---------------------------------------------
\n
"
);
for
(
ep
=
0
;
ep
<
NPORTS
;
ep
++
)
{
r
=
offsetof
(
struct
EP_WB
,
VCR0
);
v
=
ep_read
(
ep
,
r
);
printf
(
" %2i %i %6.6s %i %i %4i %04x%08x
\n
"
,
ep
,
v
&
3
,
names
[
v
&
3
],
v
&
EP_VCR0_FIX_PRIO
?
1
:
0
,
EP_VCR0_PRIO_VAL_R
(
v
),
EP_VCR0_PVID_R
(
v
),
(
int
)
ep_read
(
ep
,
offsetof
(
struct
EP_WB
,
MACH
)),
(
int
)
ep_read
(
ep
,
offsetof
(
struct
EP_WB
,
MACL
)));
}
return
;
}
int
clear_all
()
{
struct
rtu_vlans_t
*
p
;
uint32_t
v
,
r
;
uint32_t
r
;
int
val
,
i
;
int
ep
;
...
...
userspace/tools/wrsw_vlans.h
View file @
645708b1
...
...
@@ -51,6 +51,7 @@
#define OPT_EP_VID 12
#define OPT_EP_PRIO 13
#define OPT_EP_UMASK 14
#define OPT_EP_LIST 15
#define OPT_RTU_VID 20
#define OPT_RTU_FID 21
#define OPT_RTU_PMASK 22
...
...
@@ -88,6 +89,7 @@ int clear_all();
int
set_rtu_vlan
(
int
vid
,
int
fid
,
int
pmask
,
int
drop
,
int
prio
,
int
del
,
int
flags
);
void
free_rtu_vlans
(
struct
rtu_vlans_t
*
ptr
);
void
list_rtu_vlans
(
void
);
void
list_ep_vlans
(
void
);
struct
rtu_vlans_t
*
rtu_retrieve_config
(
void
);
struct
rtu_vlans_t
*
rtu_find_vlan
(
struct
rtu_vlans_t
*
conf
,
int
vid
,
int
fid
);
int
config_rtud
(
void
);
...
...
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