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
55f4d582
Commit
55f4d582
authored
Apr 04, 2019
by
Miguel Jimenez Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some function calls for newer kernels.
parent
d33c1830
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
5 deletions
+35
-5
nic-core.c
sw/kernel/nic-core.c
+35
-5
No files found.
sw/kernel/nic-core.c
View file @
55f4d582
...
...
@@ -17,14 +17,44 @@
#include <linux/errno.h>
#include <linux/spinlock.h>
#include <linux/net_tstamp.h>
#include <linux/version.h>
#include <asm/unaligned.h>
#include "wr-nic.h"
#if WR_IS_SWITCH
#include "wr_pstats.h"
#endif
#include "nic-mem.h"
#undef WRN_TRANS_UPDATE
#if KERNEL_VERSION(4, 7, 0) <= LINUX_VERSION_CODE
#define WRN_TRANS_UPDATE
#endif
#ifdef RHEL_RELEASE_VERSION
#if RHEL_RELEASE_VERSION(7, 0) <= RHEL_RELEASE_CODE
#define WRN_TRANS_UPDATE
#endif
#endif
#ifdef WRN_TRANS_UPDATE
#define trans_update(dev) netif_trans_update(dev)
#else
#define trans_update(dev) ((dev)->trans_start = jiffies)
#endif
#undef WRN_LAST_RX_RECORD
#if KERNEL_VERSION(4,11,0) <= LINUX_VERSION_CODE
#define WRN_LAST_RX_RECORD
#endif
#ifdef RHEL_RELEASE_VERSION
#if RHEL_RELEASE_VERSION(7, 0) <= RHEL_RELEASE_CODE
#define WRN_LAST_RX_RECORD
#endif
#endif
#ifdef WRN_LAST_RX_RECORD
#define record_last_rx(dev)
#else
#define record_last_rx(dev) ((dev)->last_rx = jiffies)
#endif
/*
* The following functions are the standard network device operations.
* They act on the _endpoint_ (as each Linux interface is one endpoint)
...
...
@@ -221,7 +251,7 @@ static int wrn_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* We are done, this is trivial maiintainance*/
ep
->
stats
.
tx_packets
++
;
ep
->
stats
.
tx_bytes
+=
len
;
dev
->
trans_start
=
jiffies
;
trans_update
(
dev
)
;
//spin_unlock_irqrestore(&ep->lock, flags);
return
0
;
...
...
@@ -440,7 +470,7 @@ static void __wrn_rx_descriptor(struct wrn_dev *wrn, int desc)
skb
->
protocol
=
eth_type_trans
(
skb
,
dev
);
skb
->
ip_summed
=
CHECKSUM_UNNECESSARY
;
dev
->
last_rx
=
jiffies
;
record_last_rx
(
dev
)
;
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