Symbol ksize is not exported in kernel older than 2.6.29.
authorHauke Mehrtens <hauke@hauke-m.de>
Tue, 21 Apr 2009 20:43:58 +0000 (22:43 +0200)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 28 Apr 2009 22:31:26 +0000 (15:31 -0700)
This reverts commit ad80a7a983e36c6d8f4ae57e4c472deb9cf1391c from wireless-testing on older kernel versions.
Thanks Mathijs de Bruin for reporting.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
compat/compat.diff

index e265090cd82cbd19d9395c1dca04bc416e3f5fbd..5d35d27124abd7c5fb60b96492d3969c33e7bf45 100644 (file)
  cfg80211-$(CONFIG_WIRELESS_EXT) += wext-compat.o
  
  ccflags-y += -D__CHECK_ENDIAN__
+--- a/net/wireless/core.h
++++ b/net/wireless/core.h
+@@ -85,7 +85,11 @@ struct cfg80211_internal_bss {
+       struct rb_node rbn;
+       unsigned long ts;
+       struct kref ref;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+       bool hold, ies_allocated;
++#else
++      bool hold;
++#endif
+       /* must be last because of priv member */
+       struct cfg80211_bss pub;
+--- a/net/wireless/scan.c
++++ b/net/wireless/scan.c
+@@ -58,10 +58,12 @@ static void bss_release(struct kref *ref)
+       bss = container_of(ref, struct cfg80211_internal_bss, ref);
+       if (bss->pub.free_priv)
+               bss->pub.free_priv(&bss->pub);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+       if (bss->ies_allocated)
+               kfree(bss->pub.information_elements);
++#endif
+       kfree(bss);
+ }
+@@ -364,13 +366,26 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev,
+       found = rb_find_bss(dev, res);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+       if (found) {
++#else
++      if (found && overwrite) {
++              list_replace(&found->list, &res->list);
++              rb_replace_node(&found->rbn, &res->rbn,
++                              &dev->bss_tree);
++              /* XXX: workaround */
++              res->hold = found->hold;
++              kref_put(&found->ref, bss_release);
++              found = res;
++      } else if (found) {
++#endif
+               kref_get(&found->ref);
+               found->pub.beacon_interval = res->pub.beacon_interval;
+               found->pub.tsf = res->pub.tsf;
+               found->pub.signal = res->pub.signal;
+               found->pub.capability = res->pub.capability;
+               found->ts = res->ts;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+               /* overwrite IEs */
+               if (overwrite) {
+@@ -399,6 +414,7 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev,
+                       }
+               }
++#endif
+               kref_put(&res->ref, bss_release);
+       } else {
+               /* this "consumes" the reference */