X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=datapath%2Fvlan.h;h=13ae6a7e3715bd971e836cf29bf11515f7f58897;hb=56c091ec8cb20fb00f8af0e9a3f8b381ecaae03d;hp=7e1084e5cb783f799092de8f8491f8f485ad62cc;hpb=3728652303e1d58fe67b90dfa2a07668289902c8;p=sliver-openvswitch.git diff --git a/datapath/vlan.h b/datapath/vlan.h index 7e1084e5c..13ae6a7e3 100644 --- a/datapath/vlan.h +++ b/datapath/vlan.h @@ -1,9 +1,19 @@ /* - * Copyright (c) 2011 Nicira Networks. - * Distributed under the terms of the GNU GPL version 2. + * Copyright (c) 2007-2011 Nicira, Inc. * - * Significant portions of this file may be copied from parts of the Linux - * kernel, by Linus Torvalds and others. + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA */ #ifndef VLAN_H @@ -36,13 +46,6 @@ * equivalent to those on 2.6.33+. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) -#define NEED_VLAN_FIELD -#endif - -#ifndef NEED_VLAN_FIELD -static inline void vlan_copy_skb_tci(struct sk_buff *skb) { } - static inline u16 vlan_get_tci(struct sk_buff *skb) { #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) @@ -59,32 +62,4 @@ static inline void vlan_set_tci(struct sk_buff *skb, u16 vlan_tci) #endif skb->vlan_tci = vlan_tci; } -#else -void vlan_copy_skb_tci(struct sk_buff *skb); -u16 vlan_get_tci(struct sk_buff *skb); -void vlan_set_tci(struct sk_buff *skb, u16 vlan_tci); - -#undef vlan_tx_tag_present -bool vlan_tx_tag_present(struct sk_buff *skb); - -#undef vlan_tx_tag_get -u16 vlan_tx_tag_get(struct sk_buff *skb); - -#define __vlan_hwaccel_put_tag rpl__vlan_hwaccel_put_tag -struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, u16 vlan_tci); -#endif /* NEED_VLAN_FIELD */ - -static inline int vlan_deaccel_tag(struct sk_buff *skb) -{ - if (!vlan_tx_tag_present(skb)) - return 0; - - skb = __vlan_put_tag(skb, vlan_tx_tag_get(skb)); - if (unlikely(!skb)) - return -ENOMEM; - - vlan_set_tci(skb, 0); - return 0; -} - #endif /* vlan.h */