Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
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
Simple PCIe FMC carrier SPEC - Software
Commits
a5cbe2b0
Commit
a5cbe2b0
authored
Nov 15, 2018
by
Juan David González Cobas
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'updates-4.15'
parents
e459ef1b
ed527040
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
0 deletions
+33
-0
spec-pci.c
kernel/spec-pci.c
+12
-0
wr-nic-dio.c
kernel/wr-nic-dio.c
+5
-0
endpoint.c
kernel/wr_nic/endpoint.c
+14
-0
nic-core.c
kernel/wr_nic/nic-core.c
+2
-0
No files found.
kernel/spec-pci.c
View file @
a5cbe2b0
...
...
@@ -222,7 +222,11 @@ static int spec_probe(struct pci_dev *pdev,
#if KERNEL_VERSION(3, 16, 0) > LINUX_VERSION_CODE
ret
=
pci_enable_msi_block
(
pdev
,
1
);
#else
#if KERNEL_VERSION(4,11,0) > LINUX_VERSION_CODE
ret
=
pci_enable_msi_exact
(
pdev
,
1
);
#else
ret
=
pci_alloc_irq_vectors
(
pdev
,
1
,
1
,
PCI_IRQ_MSI
|
PCI_IRQ_LEGACY
);
#endif
#endif
if
(
ret
<
0
)
dev_err
(
&
pdev
->
dev
,
"%s: enable msi block: error %i
\n
"
,
...
...
@@ -280,7 +284,11 @@ out_unmap:
}
pci_set_drvdata
(
pdev
,
NULL
);
if
(
spec_use_msi
)
#if KERNEL_VERSION(4,11,0) > LINUX_VERSION_CODE
pci_disable_msi
(
pdev
);
#else
pci_free_irq_vectors
(
pdev
);
#endif
pci_disable_device
(
pdev
);
kfree
(
spec
);
return
ret
;
...
...
@@ -303,7 +311,11 @@ static void spec_remove(struct pci_dev *pdev)
}
pci_set_drvdata
(
pdev
,
NULL
);
kfree
(
spec
);
#if KERNEL_VERSION(4,11,0) > LINUX_VERSION_CODE
//pci_disable_msi(pdev);
#else
pci_free_irq_vectors
(
pdev
);
#endif
pci_disable_device
(
pdev
);
}
...
...
kernel/wr-nic-dio.c
View file @
a5cbe2b0
...
...
@@ -8,7 +8,12 @@
* by CERN, the European Institute for Nuclear Research.
*/
#include <linux/module.h>
#include <linux/version.h>
#if KERNEL_VERSION(4,11,0) > LINUX_VERSION_CODE
#include <linux/sched.h>
#else
#include <linux/sched/signal.h>
#endif
#include <linux/wait.h>
#include <linux/ktime.h>
#include <linux/atomic.h>
...
...
kernel/wr_nic/endpoint.c
View file @
a5cbe2b0
...
...
@@ -11,6 +11,7 @@
* published by the Free Software Foundation.
*/
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/etherdevice.h>
...
...
@@ -129,10 +130,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
);
...
...
@@ -146,7 +154,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
(
1
)
{
netif_carrier_on
(
dev
);
...
...
@@ -177,7 +187,11 @@ 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
);
#else
timer_setup
(
&
ep
->
ep_link_timer
,
wrn_ep_check_link
,
0
);
#endif
if
(
0
)
{
/* not on spec */
mod_timer
(
&
ep
->
ep_link_timer
,
jiffies
+
WRN_LINK_POLL_INTERVAL
);
...
...
kernel/wr_nic/nic-core.c
View file @
a5cbe2b0
...
...
@@ -425,7 +425,9 @@ static void __wrn_rx_descriptor(struct wrn_dev *wrn, int desc)
skb
->
protocol
=
eth_type_trans
(
skb
,
dev
);
skb
->
ip_summed
=
CHECKSUM_UNNECESSARY
;
#if KERNEL_VERSION(4,11,0) > LINUX_VERSION_CODE
dev
->
last_rx
=
jiffies
;
#endif
ep
->
stats
.
rx_packets
++
;
ep
->
stats
.
rx_bytes
+=
len
;
netif_receive_skb
(
skb
);
...
...
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