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
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
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
8604cb0c
Commit
8604cb0c
authored
Dec 05, 2018
by
li hongming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set mac ready signal for tcpip module when receiving the arp.
parent
0b710156
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
tcpip_config.c
dev/tcpip_config.c
+2
-0
arp.c
lib/arp.c
+8
-8
No files found.
dev/tcpip_config.c
View file @
8604cb0c
...
...
@@ -103,6 +103,8 @@ void tcpip_set_hisMAC(uint8_t mac_addr[])
{
memcpy
((
uint8_t
*
)(
BASE_TCPIP_CFG
+
TCPIP_UDP_TX_DST_MAC_HIGH16
+
2
),
(
uint8_t
*
)
mac_addr
,
2
);
memcpy
((
uint8_t
*
)(
BASE_TCPIP_CFG
+
TCPIP_UDP_TX_DST_MAC_LOW32
),
(
uint8_t
*
)
mac_addr
+
2
,
4
);
// Set the mac ready signal
memset
((
uint8_t
*
)(
BASE_TCPIP_CFG
+
TCPIP_UDP_TX_DST_MAC_HIGH16
),
0xFF
,
2
);
}
void
tcpip_get_hisMAC
(
uint8_t
mac_addr
[])
...
...
lib/arp.c
View file @
8604cb0c
...
...
@@ -84,16 +84,16 @@ static int process_arp(uint8_t * buf, int len)
return
ARP_END
;
}
}
}
tcpip_get_hisIP
(
hisIP
);
if
(
((
buf
[
ARP_OPER
+
1
]
!=
2
)
||
memcmp
(
buf
+
ARP_SPA
,
hisIP
,
4
))
==
0
)
}
else
if
(
buf
[
ARP_OPER
+
1
]
==
2
)
{
memcpy
(
hisMAC
,
buf
+
ARP_SHA
,
6
);
tcpip_set_hisMAC
(
hisMAC
);
tcpip_status
=
TCPIP_OK
;
tcpip_get_hisIP
(
hisIP
);
if
(
memcmp
(
buf
+
ARP_SPA
,
hisIP
,
4
)
==
0
)
{
memcpy
(
hisMAC
,
buf
+
ARP_SHA
,
6
);
tcpip_set_hisMAC
(
hisMAC
);
tcpip_status
=
TCPIP_OK
;
}
}
return
0
;
}
...
...
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