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
14c688f0
Commit
14c688f0
authored
Apr 24, 2019
by
Miguel Jimenez Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw/endpoint: Some fixes for kernels newer than 4.15.
parent
14d04c93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
3 deletions
+24
-3
endpoint.c
sw/kernel/endpoint.c
+24
-3
No files found.
sw/kernel/endpoint.c
View file @
14c688f0
...
...
@@ -163,10 +163,17 @@ static void wrn_update_link_status(struct net_device *dev)
}
/* Actual timer function. Takes the lock and calls above function */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static
void
wrn_ep_check_link
(
unsigned
long
dev_id
)
{
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_id
;
struct
wrn_ep
*
ep
=
netdev_priv
(
dev
);
#else
static
void
wrn_ep_check_link
(
struct
timer_list
*
t
)
{
struct
wrn_ep
*
ep
=
from_timer
(
ep
,
t
,
ep_link_timer
);
struct
net_device
*
dev
=
ep
->
mii
.
dev
;
#endif
unsigned
long
flags
;
spin_lock_irqsave
(
&
ep
->
lock
,
flags
);
...
...
@@ -180,7 +187,9 @@ static void wrn_ep_check_link(unsigned long dev_id)
int
wrn_ep_open
(
struct
net_device
*
dev
)
{
struct
wrn_ep
*
ep
=
netdev_priv
(
dev
);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
unsigned
long
timerarg
=
(
unsigned
long
)
dev
;
#endif
if
(
WR_IS_NODE
)
{
netif_carrier_on
(
dev
);
...
...
@@ -188,6 +197,10 @@ int wrn_ep_open(struct net_device *dev)
}
/* Prepare hardware registers: first config, then bring up */
writel
(
0
|
EP_VCR0_QMODE_W
(
0x3
)
/* unqualified port */
|
EP_VCR0_PRIO_VAL_W
(
4
),
/* some mid priority */
&
ep
->
ep_regs
->
VCR0
);
/*
* enable RX timestamping (it has no impact on performance)
...
...
@@ -207,10 +220,18 @@ int wrn_ep_open(struct net_device *dev)
wrn_phy_write
(
dev
,
0
,
MII_BMCR
,
BMCR_ANENABLE
|
BMCR_ANRESTART
);
/* Prepare the timer for link-up notifications */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
setup_timer
(
&
ep
->
ep_link_timer
,
wrn_ep_check_link
,
timerarg
);
/* Not on spec. On spec this part of the function is never reached
* due to return in if(WR_IS_NODE) */
mod_timer
(
&
ep
->
ep_link_timer
,
jiffies
+
WRN_LINK_POLL_INTERVAL
);
#else
timer_setup
(
&
ep
->
ep_link_timer
,
wrn_ep_check_link
,
0
);
#endif
if
(
WR_IS_SWITCH
)
{
/* not on spec */
mod_timer
(
&
ep
->
ep_link_timer
,
jiffies
+
WRN_LINK_POLL_INTERVAL
);
}
else
{
/* Assume it's already on */
netif_carrier_on
(
dev
);
}
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