[dpdk-dev] [memnic PATCH] linux: fix build with kernel >= 3.3

Olivier Matz olivier.matz at 6wind.com
Fri Jan 24 16:59:35 CET 2014


Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
---
 linux/memnic_net.c | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/linux/memnic_net.c b/linux/memnic_net.c
index 747ae51..b6018fb 100644
--- a/linux/memnic_net.c
+++ b/linux/memnic_net.c
@@ -2,6 +2,7 @@
  *   BSD LICENSE
  *
  *   Copyright(c) 2013-2014 NEC All rights reserved.
+ *   Copyright(c) 2014 6WIND S.A.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -29,6 +30,7 @@
  */
 /* Dual BSD/GPL */
 
+#include <linux/version.h>
 #include <linux/etherdevice.h>
 #include <linux/kthread.h>
 
@@ -259,13 +261,35 @@ static void memnic_tx_timeout(struct net_device *netdev)
 {
 }
 
-static void memnic_vlan_rx_add_vid(struct net_device *netdev, unsigned short vid)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+static int memnic_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
+{
+	return 0;
+}
+
+static int memnic_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
+{
+	return 0;
+}
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
+static int memnic_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
+{
+	return 0;
+}
+
+static int memnic_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid)
+{
+	return 0;
+}
+#else
+static void memnic_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
 {
 }
 
-static void memnic_vlan_rx_kill_vid(struct net_device *netdev, unsigned short vid)
+static void memnic_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid)
 {
 }
+#endif
 
 static int memnic_ioctl(struct net_device *netdev, struct ifreq *req, int cmd)
 {
-- 
1.8.4.rc3



More information about the dev mailing list