compat-drivers: netlink_callback min_dump_alloc only exists since 3.1
authorJohannes Berg <johannes.berg@intel.com>
Thu, 7 Mar 2013 20:36:01 +0000 (12:36 -0800)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Thu, 7 Mar 2013 20:39:50 +0000 (12:39 -0800)
The netlink callback min_dump_alloc only exists on kernel
3.1 so only enable using it for those kernels. If you're
on an older 64-bit kernel and want this functionality of
resizing the data sent to userspace for a wiphy dump then
you better upgrade.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
patches/collateral-evolutions/network/70-disable-dump-adjust-on-old-kernels.patch [new file with mode: 0644]

diff --git a/patches/collateral-evolutions/network/70-disable-dump-adjust-on-old-kernels.patch b/patches/collateral-evolutions/network/70-disable-dump-adjust-on-old-kernels.patch
new file mode 100644 (file)
index 0000000..a1c1250
--- /dev/null
@@ -0,0 +1,21 @@
+On older kernels, we can't do this workaround, so if you use
+an old 64-bit kernel with compat you'd better upgrade.
+
+--- a/net/wireless/nl80211.c
++++ b/net/wireless/nl80211.c
+@@ -1321,6 +1321,7 @@ static int nl80211_dump_wiphy(struct sk_
+                                        cb->nlh->nlmsg_seq, NLM_F_MULTI,
+                                        dev);
+               if (ret < 0) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)
+                       /*
+                        * If sending the wiphy data didn't fit (ENOBUFS or
+                        * EMSGSIZE returned), this SKB is still empty (so
+@@ -1340,6 +1341,7 @@ static int nl80211_dump_wiphy(struct sk_
+                               mutex_unlock(&cfg80211_mutex);
+                               return 1;
+                       }
++#endif
+                       idx--;
+                       break;
+               }