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
84
Issues
84
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
81250fc8
Commit
81250fc8
authored
Jun 10, 2014
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace: fix most compiler warnings
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
09b2e14d
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
21 additions
and
63 deletions
+21
-63
switch_hw.h
userspace/include/switch_hw.h
+2
-2
shw_io.c
userspace/libswitchhw/shw_io.c
+1
-0
lm32-vuart.c
userspace/tools/lm32-vuart.c
+7
-4
rtu_stat.c
userspace/tools/rtu_stat.c
+2
-0
shw_ver.c
userspace/tools/shw_ver.c
+1
-3
spll_dbg_proxy.c
userspace/tools/spll_dbg_proxy.c
+2
-2
wr_date.c
userspace/tools/wr_date.c
+0
-1
wr_phytool.c
userspace/tools/wr_phytool.c
+2
-1
wrsw_pstats.c
userspace/tools/wrsw_pstats.c
+3
-10
wrsw_vlans.c
userspace/tools/wrsw_vlans.c
+1
-0
hal_ports.c
userspace/wrsw_hal/hal_ports.c
+0
-29
rtu_drv.c
userspace/wrsw_rtud/rtu_drv.c
+0
-3
rtu_fd.c
userspace/wrsw_rtud/rtu_fd.c
+0
-8
No files found.
userspace/include/switch_hw.h
View file @
81250fc8
...
...
@@ -14,6 +14,6 @@
/* System reference clock rate (in Hertz). Update together with REF_CLOCK_PERIOD_PS */
#define REF_CLOCK_RATE_HZ 62500000
int
shw_init
();
int
shw_init
(
void
);
int
shw_fpga_mmap_init
(
void
);
#endif
userspace/libswitchhw/shw_io.c
View file @
81250fc8
...
...
@@ -22,6 +22,7 @@
#include <pio.h>
#include <trace.h>
#include <string.h>
#include <stdio.h>
#include "shw_io.h"
...
...
userspace/tools/lm32-vuart.c
View file @
81250fc8
...
...
@@ -3,8 +3,10 @@
#include <termios.h>
#include <unistd.h>
#include <stdlib.h>
#include <shw_io.h>
#include <fpga_io.h>
#include "shw_io.h"
#include "fpga_io.h"
#include "switch_hw.h"
#define VUART_BASE 0x10000
#define VUART_TDR 0x10
...
...
@@ -16,13 +18,14 @@ int vuart_tx(char *buf, int size)
{
while
(
size
--
)
_fpga_writel
(
VUART_BASE
+
VUART_TDR
,
*
buf
++
);
return
0
;
}
int
vuart_rx
(
char
*
buf
,
int
size
)
{
int
n_rx
;
int
n_rx
=
0
;
int
rdr
;
while
(
size
--
)
{
rdr
=
_fpga_readl
(
VUART_BASE
+
VUART_RDR
);
if
(
rdr
&
RDR_RDY
)
{
...
...
userspace/tools/rtu_stat.c
View file @
81250fc8
...
...
@@ -109,6 +109,7 @@ int fetch_rtu_vd(rtudexp_vd_entry_t *d, int *n_entries)
n
+=
list
.
num_entries
;
}
while
(
start
>
0
);
*
n_entries
=
n
;
return
0
;
}
/**
...
...
@@ -277,4 +278,5 @@ int main(int argc, char **argv)
printf
(
"
\n
"
);
}
printf
(
"
\n
"
);
return
0
;
}
userspace/tools/shw_ver.c
View file @
81250fc8
...
...
@@ -25,7 +25,7 @@
#include <shw_io.h>
#include <hwiu.h>
#include "
pio
.h"
#include "
switch_hw
.h"
#ifndef __GIT_VER__
...
...
@@ -87,8 +87,6 @@ int main(int argc, char **argv)
shw_io_init
();
shw_io_configure_all
();
shw_io_t
*
all_io
=
(
shw_io_t
*
)
_all_shw_io
;
switch
(
func
)
{
case
'p'
:
...
...
userspace/tools/spll_dbg_proxy.c
View file @
81250fc8
...
...
@@ -25,6 +25,8 @@
#include <fpga_io.h>
#include <regs/softpll-regs.h>
#include "switch_hw.h"
/* TCP Port to listen on */
#define MY_PORT 12345
...
...
@@ -202,8 +204,6 @@ void proxy_stuff(int fd)
}
extern
void
shw_fpga_mmap_init
();
int
main
(
int
argc
,
char
*
argv
[])
{
int
sock_fd
;
...
...
userspace/tools/wr_date.c
View file @
81250fc8
...
...
@@ -209,7 +209,6 @@ int wrdate_internal_set(struct PPSG_WB *pps)
struct
timeval
tvh
,
tvr
;
/* host, rabbit */
signed
long
long
diff64
;
signed
long
diff
;
unsigned
long
prev
;
int
tai_offset
;
tai_offset
=
fix_host_tai
();
...
...
userspace/tools/wr_phytool.c
View file @
81250fc8
...
...
@@ -30,6 +30,7 @@
#include "rt_ipc.h"
#include "hal_client.h"
#include "switch_hw.h"
#define WRS3_FPGA_BASE 0x10000000
#define WRS3_FPGA_SIZE 0x100000
...
...
@@ -246,7 +247,7 @@ void calc_trans(int ep, int argc, char *argv[])
if
(
rts_connect
()
<
0
)
{
printf
(
"Can't connect to the RT subsys
\n
"
);
return
-
1
;
return
;
}
...
...
userspace/tools/wrsw_pstats.c
View file @
81250fc8
...
...
@@ -14,7 +14,7 @@
#include <switch_hw.h>
#include <hal_client.h>
static
void
parse_sysfs
(
int
init
);
#define pstats_rd(reg) \
_fpga_readl(FPGA_BASE_PSTATS + offsetof(struct PSTATS_WB, reg))
...
...
@@ -32,8 +32,6 @@ struct cnt_word {
struct
cnt_word
cnt_pp
[
NPORTS
][
CNT_PP
];
extern
int
shw_fpga_mmap_init
();
char
info
[][
20
]
=
{{
"Tu-run|"
},
// 0
{
"Ro-run|"
},
// 1
{
"Riv-cd|"
},
// 2
...
...
@@ -74,14 +72,11 @@ char info[][20] = {{"Tu-run|"}, // 0
{
"RTUfwd|"
},
// 37 ---
{
"TRUrsp|"
}
// 38
};
static
void
read_cntval
(
int
port
,
int
adr
,
uint32_t
*
data
);
int
pstats_init
(
void
)
{
int
err
,
i
,
j
;
uint32_t
mem_val
[
2
];
int
ret
=
0
;
err
=
shw_fpga_mmap_init
();
if
(
err
)
{
printf
(
"shw_fpga_mmap_init failed with %d
\n
"
,
err
);
...
...
@@ -100,7 +95,7 @@ int pstats_init(void)
return
0
;
}
void
parse_sysfs
(
int
init
)
static
void
parse_sysfs
(
int
init
)
{
FILE
*
file
;
uint32_t
port
,
cntr
,
val
;
...
...
@@ -191,8 +186,6 @@ void print_info(char *prgname)
int
main
(
int
argc
,
char
**
argv
)
{
time_t
last_show
=
0
;
int
option
=
0
;
int
prio_cnts
[]
=
{
21
,
22
,
23
,
24
,
25
,
26
,
27
,
28
};
//8
int
def_cnts
[]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
37
};
//30
int
rtu_cnts
[]
=
{
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
37
,
38
};
//10
...
...
userspace/tools/wrsw_vlans.c
View file @
81250fc8
...
...
@@ -96,6 +96,7 @@ static int parse_mask(char *arg)
for_each_port
(
p1
)
printf
(
" %i"
,
p1
);
printf
(
"
\n
"
);
return
0
;
}
static
void
exit_mask
(
int
present
)
...
...
userspace/wrsw_hal/hal_ports.c
View file @
81250fc8
...
...
@@ -126,34 +126,6 @@ int any_port_locked()
return
rts_state
.
current_ref
;
}
/* generates a unique MAC address for port if_name (currently produced from the MAC of the
management port). */
/* FIXME: MAC addresses should be kept in some EEPROM */
static
int
get_mac_address
(
const
char
*
if_name
,
uint8_t
*
mac_addr
)
{
struct
ifreq
ifr
;
int
idx
;
sscanf
(
if_name
,
"wr%d"
,
&
idx
);
strncpy
(
ifr
.
ifr_name
,
"eth0"
,
sizeof
(
ifr
.
ifr_name
));
if
(
ioctl
(
fd_raw
,
SIOCGIFHWADDR
,
&
ifr
)
<
0
)
return
-
1
;
if
(
mac_addr
)
{
mac_addr
[
0
]
=
0x8
|
0x2
;
// locally administered MAC
mac_addr
[
1
]
=
0x00
;
mac_addr
[
2
]
=
0x30
;
mac_addr
[
3
]
=
ifr
.
ifr_hwaddr
.
sa_data
[
3
];
mac_addr
[
4
]
=
ifr
.
ifr_hwaddr
.
sa_data
[
4
];
mac_addr
[
5
]
=
(
ifr
.
ifr_hwaddr
.
sa_data
[
5
]
&
0xc0
)
+
(
idx
+
2
);
}
return
0
;
}
/* Resets the state variables of a particular port and re-starts its state machines */
static
void
reset_port_state
(
hal_port_state_t
*
p
)
{
...
...
@@ -226,7 +198,6 @@ int hal_init_port(const char *name, int index)
{
char
key_name
[
128
];
char
val
[
128
];
char
cmd
[
128
];
hal_port_state_t
*
p
=
&
ports
[
index
];
/* check if the port is compiled into the firmware, if not, just ignore it. */
...
...
userspace/wrsw_rtud/rtu_drv.c
View file @
81250fc8
...
...
@@ -52,9 +52,6 @@
#include "rtu_drv.h"
#include "wr_rtu.h"
extern
int
shw_fpga_mmap_init
();
static
void
write_mfifo_addr
(
uint32_t
zbt_addr
);
static
void
write_mfifo_data
(
uint32_t
word
);
...
...
userspace/wrsw_rtud/rtu_fd.c
View file @
81250fc8
...
...
@@ -81,11 +81,6 @@ struct hw_req *hw_req_list;
*/
static
struct
filtering_entry
rtu_htab
[
HTAB_ENTRIES
][
RTU_BUCKETS
];
/**
* \brief Mirror of Aging RAM.
*/
static
uint32_t
rtu_agr_htab
[
RTU_ARAM_WORDS
];
/**
* \brief Max time that a dynamic MAC entry can remain
* in the MAC table after being used. [seconds]
...
...
@@ -106,9 +101,6 @@ static struct hw_req *tail(struct hw_req *head);
static
void
clean_list
(
struct
hw_req
*
head
);
static
int
hw_request
(
int
type
,
struct
rtu_addr
addr
,
struct
filtering_entry
*
ent
);
static
inline
int
to_hw_addr
(
struct
rtu_addr
addr
);
static
inline
struct
rtu_addr
from_hw_addr
(
int
hw_addr
);
static
void
clean_fd
(
void
);
static
void
clean_vd
(
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