From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: [memnic PATCH] linux: fix build with kernel >= 3.3 Date: Fri, 24 Jan 2014 16:59:35 +0100 Message-ID: <1390579175-23942-1-git-send-email-olivier.matz@6wind.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Signed-off-by: Olivier Matz --- 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 #include #include @@ -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