Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Network Interface Card
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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 Network Interface Card
Commits
44e80e40
Commit
44e80e40
authored
Feb 07, 2013
by
Alessandro Rubini
Committed by
Miguel Jimenez Lopez
Sep 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wr_nic: use if(WR_IS_NODE) in endpoint.c
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
a5cac0f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
endpoint.c
kernel/wr_nic/endpoint.c
+23
-0
No files found.
kernel/wr_nic/endpoint.c
View file @
44e80e40
...
...
@@ -55,6 +55,11 @@ int wrn_phy_read(struct net_device *dev, int phy_id, int location)
struct
wrn_ep
*
ep
=
netdev_priv
(
dev
);
u32
val
;
if
(
WR_IS_NODE
)
{
WARN_ON
(
1
);
/* SPEC: no access */
return
-
1
;
}
wrn_ep_write
(
ep
,
MDIO_CR
,
EP_MDIO_CR_ADDR_W
(
location
));
while
(
(
wrn_ep_read
(
ep
,
MDIO_ASR
)
&
EP_MDIO_ASR_READY
)
==
0
)
;
...
...
@@ -67,6 +72,12 @@ void wrn_phy_write(struct net_device *dev, int phy_id, int location,
int
value
)
{
struct
wrn_ep
*
ep
=
netdev_priv
(
dev
);
if
(
WR_IS_NODE
)
{
WARN_ON
(
1
);
/* SPEC: no access */
return
;
}
wrn_ep_write
(
ep
,
MDIO_CR
,
EP_MDIO_CR_ADDR_W
(
location
)
|
EP_MDIO_CR_DATA_W
(
value
)
...
...
@@ -157,6 +168,11 @@ int wrn_ep_open(struct net_device *dev)
unsigned
long
timerarg
=
(
unsigned
long
)
dev
;
int
prio
,
prio_map
;
if
(
WR_IS_NODE
)
{
netif_carrier_on
(
dev
);
return
0
;
/* No access to EP registers in the SPEC */
}
/* Prepare hardware registers: first config, then bring up */
writel
(
0
|
EP_VCR0_QMODE_W
(
0x3
)
/* unqualified port */
...
...
@@ -204,6 +220,13 @@ int wrn_ep_close(struct net_device *dev)
{
struct
wrn_ep
*
ep
=
netdev_priv
(
dev
);
if
(
WR_IS_NODE
)
return
0
;
/* No access to EP registers in the SPEC */
/*
* Beware: the system loops in the del_timer_sync below if timer_setup
* had not been called either (see "if (WR_IS_NODE)" in ep_open above)
*/
writel
(
0
,
&
ep
->
ep_regs
->
ECR
);
del_timer_sync
(
&
ep
->
ep_link_timer
);
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