Commit 55f4d582 authored by Miguel Jimenez Lopez's avatar Miguel Jimenez Lopez

Fix some function calls for newer kernels.

parent d33c1830
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment