wr-nic: remove usage of last_rx

This commit is similar to 481b8821, and it takes care of removing
references to last_rx. Although this was done in b45d71b7, we refine
it to take care of RHEL kernel versioning and move the logic to the
beginning of the file.
Signed-off-by: Juan David González Cobas's avatarJuan David Gonzalez Cobas <dcobas@cern.ch>
parent a5cbe2b0
......@@ -39,6 +39,23 @@
#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)
......@@ -425,9 +442,7 @@ 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
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