Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Software for White Rabbit PTP Core
Manage
Activity
Members
Labels
Plan
Issues
39
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
Software for White Rabbit PTP Core
Commits
3aa70300
Commit
3aa70300
authored
13 years ago
by
Tomasz Wlostowski
Browse files
Options
Downloads
Patches
Plain Diff
endpoint.c: fixed casting bug causing invalid readout of the MAC address in get_mac_addr()
parent
dd547c21
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dev/endpoint.c
+9
-7
9 additions, 7 deletions
dev/endpoint.c
with
9 additions
and
7 deletions
dev/endpoint.c
+
9
−
7
View file @
3aa70300
...
...
@@ -45,12 +45,12 @@ static void set_mac_addr(uint8_t dev_addr[])
void
get_mac_addr
(
uint8_t
dev_addr
[])
{
dev_addr
[
5
]
=
(
uint8_t
)
(
EP
->
MACL
&
0x000000ff
);
dev_addr
[
4
]
=
(
uint8_t
)
(
EP
->
MACL
&
0x0000ff00
)
>>
8
;
dev_addr
[
3
]
=
(
uint8_t
)
(
EP
->
MACL
&
0x00ff0000
)
>>
16
;
dev_addr
[
2
]
=
(
uint8_t
)
(
EP
->
MACL
&
0xff000000
)
>>
24
;
dev_addr
[
1
]
=
(
uint8_t
)
(
EP
->
MACH
&
0x000000ff
);
dev_addr
[
0
]
=
(
uint8_t
)
(
EP
->
MACH
&
0x0000ff00
)
>>
8
;
dev_addr
[
5
]
=
(
EP
->
MACL
&
0x000000ff
);
dev_addr
[
4
]
=
(
EP
->
MACL
&
0x0000ff00
)
>>
8
;
dev_addr
[
3
]
=
(
EP
->
MACL
&
0x00ff0000
)
>>
16
;
dev_addr
[
2
]
=
(
EP
->
MACL
&
0xff000000
)
>>
24
;
dev_addr
[
1
]
=
(
EP
->
MACH
&
0x000000ff
);
dev_addr
[
0
]
=
(
EP
->
MACH
&
0x0000ff00
)
>>
8
;
}
...
...
@@ -90,8 +90,8 @@ int ep_enable(int enabled, int autoneg)
#if 1
pcs_write
(
MDIO_REG_MCR
,
MDIO_MCR_PDOWN
);
/* reset the PHY */
timer_delay
(
2000
);
pcs_write
(
MDIO_REG_MCR
,
MDIO_MCR_RESET
);
/* reset the PHY */
pcs_write
(
MDIO_REG_MCR
,
0
);
/* reset the PHY */
// pcs_write(MDIO_REG_MCR, MDIO_MCR_RESET); /* reset the PHY */
#endif
pcs_write
(
MDIO_REG_ADVERTISE
,
0
);
...
...
@@ -147,6 +147,8 @@ int ep_get_psval(int32_t *psval)
else
*
psval
=
0
;
// mprintf("**** PhaseVal: %d\n", *psval);
return
val
&
EP_DMSR_PS_RDY
?
1
:
0
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment