Correctly use RHEL_RELEASE_CODE for Fedora and RHEL

This reverts commit 4f44a1026b.
This commit is contained in:
Robert Schmidt
2022-06-20 11:33:29 +02:00
parent 4f44a1026b
commit 2124e43d3a
4 changed files with 34 additions and 7 deletions
+9 -3
View File
@@ -198,7 +198,9 @@ int nas_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
// End debug information
netif_stop_queue(dev);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) \
|| (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,4) \
&& RHEL_RELEASE_CODE != RHEL_RELEASE_VERSION(9,99))
netif_trans_update(dev);
#else
dev->trans_start = jiffies;
@@ -267,7 +269,9 @@ void nas_tx_timeout(struct net_device *dev)
printk("TX_TIMEOUT: begin\n");
// (struct nas_priv *)(dev->priv)->stats.tx_errors++;
(priv->stats).tx_errors++;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) \
|| (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,4) \
&& RHEL_RELEASE_CODE != RHEL_RELEASE_VERSION(9,99))
netif_trans_update(dev);
#else
dev->trans_start = jiffies;
@@ -285,7 +289,9 @@ static const struct net_device_ops nasmesh_netdev_ops = {
.ndo_set_mac_address = NULL,
.ndo_set_config = nas_set_config,
.ndo_do_ioctl = nas_CTL_ioctl,
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,11,0)
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,11,0) \
|| (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,5) \
&& RHEL_RELEASE_CODE != RHEL_RELEASE_VERSION(9,99))
.extended.ndo_change_mtu = nas_change_mtu,
#else
.ndo_change_mtu = nas_change_mtu,