Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
31
Issues
31
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
Software for White Rabbit PTP Core
Commits
c47ddd2a
Commit
c47ddd2a
authored
Jul 19, 2018
by
Vraliens
Committed by
li hongming
Jul 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to merge proposed_master.
parent
ba69f77a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
275 additions
and
278 deletions
+275
-278
arp.c
lib/arp.c
+25
-26
ipv4.c
lib/ipv4.c
+3
-3
cmd_init.c
shell/cmd_init.c
+0
-1
unique-error
tools/build-random/unique-error
+1
-2
unique-warning
tools/build-random/unique-warning
+1
-2
pfilter-builder.c
tools/pfilter-builder.c
+243
-243
wrc_main.c
wrc_main.c
+2
-1
No files found.
lib/arp.c
View file @
c47ddd2a
...
@@ -32,7 +32,7 @@ static void arp_init(void)
...
@@ -32,7 +32,7 @@ static void arp_init(void)
saddr
.
ethertype
=
htons
(
0x0806
);
/* ARP */
saddr
.
ethertype
=
htons
(
0x0806
);
/* ARP */
arp_socket
=
ptpd_netif_create_socket
(
&
__static_arp_socket
,
&
saddr
,
arp_socket
=
ptpd_netif_create_socket
(
&
__static_arp_socket
,
&
saddr
,
PTPD_SOCK_RAW_ETHERNET
,
0
);
PTPD_SOCK_RAW_ETHERNET
,
0
);
}
}
static
int
process_arp
(
uint8_t
*
buf
,
int
len
)
static
int
process_arp
(
uint8_t
*
buf
,
int
len
)
...
@@ -51,30 +51,29 @@ static int process_arp(uint8_t * buf, int len)
...
@@ -51,30 +51,29 @@ static int process_arp(uint8_t * buf, int len)
getIP
(
myIP
);
getIP
(
myIP
);
if
(
((
buf
[
ARP_OPER
+
1
]
!=
1
)
||
memcmp
(
buf
+
ARP_TPA
,
myIP
,
4
))
==
0
)
if
(
((
buf
[
ARP_OPER
+
1
]
!=
1
)
||
memcmp
(
buf
+
ARP_TPA
,
myIP
,
4
))
==
0
)
{
{
memcpy
(
hisMAC
,
buf
+
ARP_SHA
,
6
);
memcpy
(
hisMAC
,
buf
+
ARP_SHA
,
6
);
memcpy
(
hisIP
,
buf
+
ARP_SPA
,
4
);
memcpy
(
hisIP
,
buf
+
ARP_SPA
,
4
);
// ------------- ARP ------------
// ------------- ARP ------------
// HW ethernet
// HW ethernet
buf
[
ARP_HTYPE
+
0
]
=
0
;
buf
[
ARP_HTYPE
+
0
]
=
0
;
buf
[
ARP_HTYPE
+
1
]
=
1
;
buf
[
ARP_HTYPE
+
1
]
=
1
;
// proto IP
// proto IP
buf
[
ARP_PTYPE
+
0
]
=
8
;
buf
[
ARP_PTYPE
+
0
]
=
8
;
buf
[
ARP_PTYPE
+
1
]
=
0
;
buf
[
ARP_PTYPE
+
1
]
=
0
;
// lengths
// lengths
buf
[
ARP_HLEN
]
=
6
;
buf
[
ARP_HLEN
]
=
6
;
buf
[
ARP_PLEN
]
=
4
;
buf
[
ARP_PLEN
]
=
4
;
// Response
// Response
buf
[
ARP_OPER
+
0
]
=
0
;
buf
[
ARP_OPER
+
0
]
=
0
;
buf
[
ARP_OPER
+
1
]
=
2
;
buf
[
ARP_OPER
+
1
]
=
2
;
// my MAC+IP
// my MAC+IP
get_mac_addr
(
buf
+
ARP_SHA
);
get_mac_addr
(
buf
+
ARP_SHA
);
memcpy
(
buf
+
ARP_SPA
,
myIP
,
4
);
memcpy
(
buf
+
ARP_SPA
,
myIP
,
4
);
// his MAC+IP
// his MAC+IP
memcpy
(
buf
+
ARP_THA
,
hisMAC
,
6
);
memcpy
(
buf
+
ARP_THA
,
hisMAC
,
6
);
memcpy
(
buf
+
ARP_TPA
,
hisIP
,
4
);
memcpy
(
buf
+
ARP_TPA
,
hisIP
,
4
);
return
ARP_END
;
return
ARP_END
;
}
}
return
0
;
return
0
;
...
@@ -90,7 +89,7 @@ static int arp_poll(void)
...
@@ -90,7 +89,7 @@ static int arp_poll(void)
return
0
;
/* can't do ARP w/o an address... */
return
0
;
/* can't do ARP w/o an address... */
if
((
len
=
ptpd_netif_recvfrom
(
arp_socket
,
if
((
len
=
ptpd_netif_recvfrom
(
arp_socket
,
&
addr
,
buf
,
sizeof
(
buf
),
0
))
>
0
)
{
&
addr
,
buf
,
sizeof
(
buf
),
0
))
>
0
)
{
if
((
len
=
process_arp
(
buf
,
len
))
>
0
)
if
((
len
=
process_arp
(
buf
,
len
))
>
0
)
ptpd_netif_sendto
(
arp_socket
,
&
addr
,
buf
,
len
,
0
);
ptpd_netif_sendto
(
arp_socket
,
&
addr
,
buf
,
len
,
0
);
return
1
;
return
1
;
...
...
lib/ipv4.c
View file @
c47ddd2a
...
@@ -87,7 +87,7 @@ static void ipv4_init(void)
...
@@ -87,7 +87,7 @@ static void ipv4_init(void)
/* time (rdate): UDP */
/* time (rdate): UDP */
rdate_socket
=
ptpd_netif_create_socket
(
&
__static_rdate_socket
,
NULL
,
rdate_socket
=
ptpd_netif_create_socket
(
&
__static_rdate_socket
,
NULL
,
PTPD_SOCK_UDP
,
37
/* time */
);
PTPD_SOCK_UDP
,
37
/* time */
);
/* remote update (rmupdate): UDP */
/* remote update (rmupdate): UDP */
rmupdate_socket
=
ptpd_netif_create_socket
(
&
__static_rmupdate_socket
,
NULL
,
rmupdate_socket
=
ptpd_netif_create_socket
(
&
__static_rmupdate_socket
,
NULL
,
...
@@ -97,7 +97,7 @@ static void ipv4_init(void)
...
@@ -97,7 +97,7 @@ static void ipv4_init(void)
memset
(
&
saddr
,
0
,
sizeof
(
saddr
));
memset
(
&
saddr
,
0
,
sizeof
(
saddr
));
saddr
.
ethertype
=
htons
(
0x0800
);
saddr
.
ethertype
=
htons
(
0x0800
);
icmp_socket
=
ptpd_netif_create_socket
(
&
__static_icmp_socket
,
&
saddr
,
icmp_socket
=
ptpd_netif_create_socket
(
&
__static_icmp_socket
,
&
saddr
,
PTPD_SOCK_RAW_ETHERNET
,
0
);
PTPD_SOCK_RAW_ETHERNET
,
0
);
syslog_init
();
syslog_init
();
}
}
...
@@ -297,7 +297,7 @@ void setIP(unsigned char *IP)
...
@@ -297,7 +297,7 @@ void setIP(unsigned char *IP)
{
{
uint8_t
tmp
[
4
];
uint8_t
tmp
[
4
];
// volatile unsigned int *eb_ip =
// volatile unsigned int *eb_ip =
//
(unsigned int *)(BASE_ETHERBONE_CFG + EB_IPV4);
//
(unsigned int *)(BASE_ETHERBONE_CFG + EB_IPV4);
// unsigned int ip;
// unsigned int ip;
// while (*eb_ip != ip)
// while (*eb_ip != ip)
// *eb_ip = ip;
// *eb_ip = ip;
...
...
shell/cmd_init.c
View file @
c47ddd2a
...
@@ -28,7 +28,6 @@ static int cmd_init(const char *args[])
...
@@ -28,7 +28,6 @@ static int cmd_init(const char *args[])
shell_show_build_init
();
shell_show_build_init
();
storage_init_show
();
storage_init_show
();
}
else
if
(
args
[
0
]
&&
!
strcasecmp
(
args
[
0
],
"boot"
))
{
}
else
if
(
args
[
0
]
&&
!
strcasecmp
(
args
[
0
],
"boot"
))
{
spll_very_init
();
shell_boot_script
();
shell_boot_script
();
}
}
...
...
tools/build-random/unique-error
View file @
c47ddd2a
...
@@ -2,12 +2,11 @@
...
@@ -2,12 +2,11 @@
declare
-A
err
declare
-A
err
HOW
=
"grep -wi error
$file
"
for
n
in
ko-build
*
;
do
for
n
in
ko-build
*
;
do
test
-d
$n
||
continue
test
-d
$n
||
continue
file
=
$n
/build
file
=
$n
/build
S
=
$(
$HOW
|
sort
|
md5sum
|
awk
'{print $1}'
)
S
=
$(
grep
-wi
error
$file
|
sort
|
md5sum
|
awk
'{print $1}'
)
err[
$S
]=
$n
err[
$S
]=
$n
done
done
for
n
in
${
err
[*]
}
;
do
for
n
in
${
err
[*]
}
;
do
...
...
tools/build-random/unique-warning
View file @
c47ddd2a
...
@@ -3,12 +3,11 @@
...
@@ -3,12 +3,11 @@
declare
-A
warn
declare
-A
warn
HOW
=
"grep -wi warning
$file
"
for
n
in
warn-build
*
;
do
for
n
in
warn-build
*
;
do
test
-d
$n
||
continue
test
-d
$n
||
continue
file
=
$n
/build
file
=
$n
/build
S
=
$(
$HOW
|
sort
|
md5sum
|
awk
'{print $1}'
)
S
=
$(
grep
-wi
warning
$file
|
sort
|
md5sum
|
awk
'{print $1}'
)
warn[
$S
]=
$n
warn[
$S
]=
$n
done
done
for
n
in
${
warn
[*]
}
;
do
for
n
in
${
warn
[*]
}
;
do
...
...
tools/pfilter-builder.c
View file @
c47ddd2a
This diff is collapsed.
Click to expand it.
wrc_main.c
View file @
c47ddd2a
...
@@ -63,7 +63,9 @@ static void wrc_initialize(void)
...
@@ -63,7 +63,9 @@ static void wrc_initialize(void)
timer_init
(
1
);
timer_init
(
1
);
get_hw_name
(
wrc_hw_name
);
get_hw_name
(
wrc_hw_name
);
#ifdef CONFIG_SDB_STORAGE
storage_read_hdl_cfg
();
storage_read_hdl_cfg
();
#endif
wrpc_w1_init
();
wrpc_w1_init
();
wrpc_w1_bus
.
detail
=
ONEWIRE_PORT
;
wrpc_w1_bus
.
detail
=
ONEWIRE_PORT
;
w1_scan_bus
(
&
wrpc_w1_bus
);
w1_scan_bus
(
&
wrpc_w1_bus
);
...
@@ -91,7 +93,6 @@ static void wrc_initialize(void)
...
@@ -91,7 +93,6 @@ static void wrc_initialize(void)
net_rst
();
net_rst
();
ep_init
(
mac_addr
);
ep_init
(
mac_addr
);
/* Sleep for 1s to make sure WRS v4.2 always realizes that
/* Sleep for 1s to make sure WRS v4.2 always realizes that
* the link is down */
* the link is down */
timer_delay_ms
(
200
);
timer_delay_ms
(
200
);
...
...
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