From 2774fa543ee6d187d9f4328b2262ff584fb6be52 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 15 Aug 2011 18:59:22 +0000 Subject: [PATCH] Fix compilation on Linux 3.1 broken by VLAN API changes Don't define IEEE80211_VLAN_TAG_USED on Linux 3.1 and newer. Don't use vlan_hwaccel_rx() if IEEE80211_VLAN_TAG_USED is not 1. git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4163 0192ed92-7a03-0410-a25b-9323aeb14dbd --- net80211/ieee80211_input.c | 2 ++ net80211/ieee80211_linux.h | 3 ++- net80211/ieee80211_skb.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/net80211/ieee80211_input.c b/net80211/ieee80211_input.c index 86959be..201e94d 100644 --- a/net80211/ieee80211_input.c +++ b/net80211/ieee80211_input.c @@ -1194,11 +1194,13 @@ ieee80211_deliver_data(struct ieee80211_node *ni, struct sk_buff *skb) skb->protocol = eth_type_trans(skb, dev); #endif tni = SKB_NI(skb); +#if IEEE80211_VLAN_TAG_USED if ((ni->ni_vlan != 0) && (vap->iv_vlgrp != NULL)) /* Attach VLAN tag. */ ret = vlan_hwaccel_rx(skb, vap->iv_vlgrp, ni->ni_vlan); else +#endif ret = netif_rx(skb); if (ret == NET_RX_DROP) vap->iv_devstats.rx_dropped++; diff --git a/net80211/ieee80211_linux.h b/net80211/ieee80211_linux.h index de1911c..b1f95fc 100644 --- a/net80211/ieee80211_linux.h +++ b/net80211/ieee80211_linux.h @@ -615,7 +615,8 @@ int ieee80211_proc_vcreate(struct ieee80211vap *, struct file_operations *, char *); void ieee80211_proc_cleanup(struct ieee80211vap *); -#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0) && \ + (defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)) #define IEEE80211_VLAN_TAG_USED 1 #ifndef VLAN_GROUP_ARRAY_PART_LEN diff --git a/net80211/ieee80211_skb.c b/net80211/ieee80211_skb.c index 2349242..e486103 100644 --- a/net80211/ieee80211_skb.c +++ b/net80211/ieee80211_skb.c @@ -570,6 +570,7 @@ ieee80211_skb_references(void) { #ifdef IEEE80211_DEBUG_REFCNT +#if IEEE80211_VLAN_TAG_USED int vlan_hwaccel_rx_debug(struct sk_buff *skb, struct vlan_group *grp, unsigned short vlan_tag, const char *func, int line) { @@ -577,6 +578,7 @@ int vlan_hwaccel_rx_debug(struct sk_buff *skb, untrack_skb(skb, 0, __func__, __LINE__), grp, vlan_tag); } +#endif int netif_rx_debug(struct sk_buff *skb, const char *func, int line) { return netif_rx(untrack_skb(skb, 0, __func__, __LINE__)); -- 2.35.1