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
83
Issues
83
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
866dc42d
Commit
866dc42d
authored
Mar 23, 2020
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix indentation of
f8febec6
commit (no technical change)
parent
f8febec6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
27 deletions
+27
-27
endpoint.c
kernel/wr_nic/endpoint.c
+27
-27
No files found.
kernel/wr_nic/endpoint.c
View file @
866dc42d
...
...
@@ -54,7 +54,7 @@ int wrn_phy_read(struct net_device *dev, int phy_id, int location)
{
struct
wrn_ep
*
ep
=
netdev_priv
(
dev
);
u32
val
;
int
ctrl_adr
,
retries
;
int
ctrl_adr
,
retries
;
if
(
WR_IS_NODE
)
{
/*
...
...
@@ -66,31 +66,31 @@ int wrn_phy_read(struct net_device *dev, int phy_id, int location)
return
-
1
;
}
/* First check if there is previous MDIO operation still ongoing */
/* First check if there is previous MDIO operation still ongoing */
while
(
(
wrn_ep_read
(
ep
,
MDIO_ASR
)
&
EP_MDIO_ASR_READY
)
==
0
)
;
retries
=
100
;
while
(
retries
>
0
)
{
wrn_ep_write
(
ep
,
MDIO_CR
,
EP_MDIO_CR_ADDR_W
(
location
));
while
(
(
wrn_ep_read
(
ep
,
MDIO_ASR
)
&
EP_MDIO_ASR_READY
)
==
0
)
;
val
=
wrn_ep_read
(
ep
,
MDIO_ASR
);
/* control read from MDIO_CR to be sure we read value from requested
*
register */
ctrl_adr
=
EP_MDIO_CR_ADDR_R
(
wrn_ep_read
(
ep
,
MDIO_CR
));
if
(
ctrl_adr
==
location
)
break
;
else
{
/* there was a conflict, retry the read */
retries
--
;
}
}
/* If we got here with retries == 0, this means the read failed... */
if
(
retries
==
0
)
{
printk
(
"%s readout error on port wri%d
\n
"
,
__func__
,
ep
->
ep_number
+
1
);
}
;
retries
=
100
;
while
(
retries
>
0
)
{
wrn_ep_write
(
ep
,
MDIO_CR
,
EP_MDIO_CR_ADDR_W
(
location
));
while
(
(
wrn_ep_read
(
ep
,
MDIO_ASR
)
&
EP_MDIO_ASR_READY
)
==
0
)
;
val
=
wrn_ep_read
(
ep
,
MDIO_ASR
);
/* control read from MDIO_CR to be sure we read value from
* requested
register */
ctrl_adr
=
EP_MDIO_CR_ADDR_R
(
wrn_ep_read
(
ep
,
MDIO_CR
));
if
(
ctrl_adr
==
location
)
break
;
else
{
/* there was a conflict, retry the read */
retries
--
;
}
}
/* If we got here with retries == 0, this means the read failed... */
if
(
retries
==
0
)
{
printk
(
"%s readout error on port wri%d
\n
"
,
__func__
,
ep
->
ep_number
+
1
);
}
/* mask from wbgen macros */
return
EP_MDIO_ASR_RDATA_R
(
val
);
}
...
...
@@ -110,9 +110,9 @@ void wrn_phy_write(struct net_device *dev, int phy_id, int location,
return
;
}
/* First check if there is previous MDIO operation still ongoing */
/* First check if there is previous MDIO operation still ongoing */
while
(
(
wrn_ep_read
(
ep
,
MDIO_ASR
)
&
EP_MDIO_ASR_READY
)
==
0
)
;
;
wrn_ep_write
(
ep
,
MDIO_CR
,
EP_MDIO_CR_ADDR_W
(
location
)
...
...
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