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
1fc9fea9
Commit
1fc9fea9
authored
Jul 28, 2018
by
li hongming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tcpip module present signal.
parent
76a3863c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
12 deletions
+26
-12
tcpip_config.c
dev/tcpip_config.c
+19
-5
tcpip-config.h
include/hw/tcpip-config.h
+2
-2
tcpip_config.h
include/tcpip_config.h
+5
-5
No files found.
dev/tcpip_config.c
View file @
1fc9fea9
...
@@ -7,16 +7,30 @@
...
@@ -7,16 +7,30 @@
#include "hw/tcpip-config.h"
#include "hw/tcpip-config.h"
#include "tcpip_config.h"
#include "tcpip_config.h"
enum
tcpip_status
tcpip_status
=
TCPIP_OK
;
extern
uint8_t
tcpip_status
=
TCPIP_NULL
;
uint8_t
tcpip_present
()
{
if
((
*
(
uint16_t
*
)(
BASE_TCPIP_CFG
+
TCPIP_STATUS_HIGH
))
>
0
)
{
tcpip_status
=
TCPIP_PRS
;
return
1
;
}
else
return
0
;
}
void
tcpip_init
(
void
)
void
tcpip_init
(
void
)
{
{
uint8_t
tcpip_mac_addr
[
6
];
uint8_t
tcpip_mac_addr
[
6
];
uint8_t
tmp_ip_addr
[
4
];
uint8_t
tmp_ip_addr
[
4
];
uint32_t
tmp_mac_addr
=
0
;
if
(
!
tcpip_present
())
{
pp_printf
(
"No TCPIP module is found!
\n
"
);
return
;
}
get_mac_addr
(
tcpip_mac_addr
);
get_mac_addr
(
tcpip_mac_addr
);
pp_printf
(
"mac is %x:%x
\n
"
,
tcpip_mac_addr
[
0
],
tcpip_mac_addr
[
1
]);
memcpy
((
uint8_t
*
)(
BASE_TCPIP_CFG
+
TCPIP_MAC_HIGH16
+
2
),
(
uint8_t
*
)
tcpip_mac_addr
,
2
);
memcpy
((
uint8_t
*
)(
BASE_TCPIP_CFG
+
TCPIP_MAC_HIGH16
+
2
),
(
uint8_t
*
)
tcpip_mac_addr
,
2
);
memcpy
((
uint8_t
*
)(
BASE_TCPIP_CFG
+
TCPIP_MAC_LOW32
),
(
uint8_t
*
)
tcpip_mac_addr
+
2
,
4
);
memcpy
((
uint8_t
*
)(
BASE_TCPIP_CFG
+
TCPIP_MAC_LOW32
),
(
uint8_t
*
)
tcpip_mac_addr
+
2
,
4
);
...
@@ -104,7 +118,7 @@ void tcpip_rx_tcp_port(uint16_t port)
...
@@ -104,7 +118,7 @@ void tcpip_rx_tcp_port(uint16_t port)
*
rtp
=
(
uint32_t
)
port
;
*
rtp
=
(
uint32_t
)
port
;
}
}
void
tcpip_poll
()
uint8_t
tcpip_poll
()
{
{
uint8_t
*
ip
;
uint8_t
*
ip
;
static
uint16_t
arp_count
=
0
;
static
uint16_t
arp_count
=
0
;
...
@@ -126,7 +140,7 @@ void tcpip_poll()
...
@@ -126,7 +140,7 @@ void tcpip_poll()
DEFINE_WRC_TASK
(
tcpip
)
=
{
DEFINE_WRC_TASK
(
tcpip
)
=
{
.
name
=
"tcpip"
,
.
name
=
"tcpip"
,
.
enable
=
&
link
_status
,
.
enable
=
&
tcpip
_status
,
.
init
=
tcpip_init
,
.
init
=
tcpip_init
,
.
job
=
tcpip_poll
,
.
job
=
tcpip_poll
,
};
};
...
...
include/hw/tcpip-config.h
View file @
1fc9fea9
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
#ifndef TCPIP_CONFIG
#ifndef TCPIP_CONFIG
#define TCPIP_CONFIG
#define TCPIP_CONFIG
#define
ERROR
_STATUS_HIGH 0
#define
TCPIP
_STATUS_HIGH 0
#define
ERROR
_STATUS_LOW 4
#define
TCPIP
_STATUS_LOW 4
#define SDB_ADDRESS_HIGH 8
#define SDB_ADDRESS_HIGH 8
#define SDB_ADDRSES_LOW 12
#define SDB_ADDRSES_LOW 12
...
...
include/tcpip_config.h
View file @
1fc9fea9
...
@@ -14,10 +14,10 @@ void tcpip_get_hisIP(uint8_t *ip);
...
@@ -14,10 +14,10 @@ void tcpip_get_hisIP(uint8_t *ip);
void
tcpip_set_hisMAC
(
uint8_t
mac_addr
[]);
void
tcpip_set_hisMAC
(
uint8_t
mac_addr
[]);
void
tcpip_rx_tcp_port
(
uint16_t
port
);
void
tcpip_rx_tcp_port
(
uint16_t
port
);
enum
tcpip_status
{
#define TCPIP_NULL 0
TCPIP_ARP
,
#define TCPIP_PRS 1
TCPIP_OK
,
#define TCPIP_ARP 2
};
#define TCPIP_OK 3
extern
enum
tcpip_status
tcpip_status
;
uint8_t
tcpip_status
;
#endif
#endif
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