Fix compilation on Linux 3.1 broken by VLAN API changes
authorproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Mon, 15 Aug 2011 18:59:22 +0000 (18:59 +0000)
committerproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Mon, 15 Aug 2011 18:59:22 +0000 (18:59 +0000)
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
net80211/ieee80211_linux.h
net80211/ieee80211_skb.c

index 86959bed58b996e2139fdbf7bd43c6b163568bc7..201e94d84a239d75502661c27b75535b4efad698 100644 (file)
@@ -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++;
index de1911c1f40f505d36ac6cb9ee14a45068909848..b1f95fc298e82a36df6253477655167295f50999 100644 (file)
@@ -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
index 234924225757206dd62dcede49afa6a30d2c016b..e486103555171a9c1fef290d6e644f0e4e725077 100644 (file)
@@ -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__));