[Madwifi-devel] [PATCH] VLAN fix for Linux 2.6.21
Status: Beta
Brought to you by:
otaku
From: Pavel R. <pr...@gn...> - 2007-03-07 00:46:28
|
Hello! We need this fix for compiling on Linux 2.6.21 with VLAN support enabled. The patch breaking MadWifi compilation was applied after 2.6.21-rc2 to the main branch, and we can expect it in 2.6.21. Some other branches, such as wireless-dev, don't have the VLAN change yet, so we cannot just check for Linux version at this point. The patch changes the code for the latest API and provides compatibility for older API. That's the recommended practice. The patch has been applied to madwifi-old-openhal as revision 2179. It needs to be in the trunk. I think it's important that MadWifi 0.9.3 compiles for Linux 2.6.21, or we'll be again under pressure to release. VLAN is often enabled on vendor kernels, it's not some exotic option. Description: ==== Fix compilation with VLAN enabled for linux-2.6 git branch vlan_devices is gone. The code should use vlan_group_set_device() instead. Provide compatibility define for older kernels. ==== Patch: ==== Index: net80211/ieee80211_linux.c =================================================================== --- net80211/ieee80211_linux.c (revision 2178) +++ net80211/ieee80211_linux.c (working copy) @@ -162,7 +162,7 @@ struct ieee80211vap *vap = dev->priv; if (vap->iv_vlgrp != NULL) - vap->iv_vlgrp->vlan_devices[vid] = NULL; + vlan_group_set_device(vap->iv_vlgrp, vid, NULL); } #endif /* IEEE80211_VLAN_TAG_USED */ Index: net80211/ieee80211_linux.h =================================================================== --- net80211/ieee80211_linux.h (revision 2178) +++ net80211/ieee80211_linux.h (working copy) @@ -491,6 +491,13 @@ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20) #define vlan_hwaccel_receive_skb(skb, grp, tag) vlan_hwaccel_rx(skb, grp, tag) #endif + +#ifndef VLAN_GROUP_ARRAY_LEN +#define vlan_group_set_device(group, vid, dev) do { \ + group->vlan_devices[vid] = dev; \ +while (0); +#endif + #else #define IEEE80211_VLAN_TAG_USED 0 #endif ==== -- Regards, Pavel Roskin |