332a7b610b74ad6d24b799e6027476feadbd1f95
[openwrt/staging/blogic.git] / patches / 0002-disable-dump-adjust-on-old-kernels.patch
1 On older kernels, we can't do this workaround, so if you use
2 an old 64-bit kernel with compat you'd better upgrade.
3
4 For more details of this work around refer to this commit
5 upstream that deals with the code added:
6
7 commit 645e77def93f1dd0e211c7244fbe152dac8a7100
8 Author: Johannes Berg <johannes.berg@intel.com>
9 Date: Fri Mar 1 14:03:49 2013 +0100
10
11 nl80211: increase wiphy dump size dynamically
12
13 Given a device with many channels capabilities the wiphy
14 information can still overflow even though its size in
15 3.9 was reduced to 3.8 levels. For new userspace and
16 kernel 3.10 we're going to implement a new "split dump"
17 protocol that can use multiple messages per wiphy.
18
19 For now though, add a workaround to be able to send more
20 information to userspace. Since generic netlink doesn't
21 have a way to set the minimum dump size globally, and we
22 wouldn't really want to set it globally anyway, increase
23 the size only when needed, as described in the comments.
24 As userspace might not be prepared for large buffers, we
25 can only use 4k.
26
27 Also increase the size for the get_wiphy command.
28
29 --- a/net/wireless/nl80211.c
30 +++ b/net/wireless/nl80211.c
31 @@ -2010,6 +2010,7 @@ static int nl80211_dump_wiphy(struct sk_
32 cb->nlh->nlmsg_seq,
33 NLM_F_MULTI, state);
34 if (ret < 0) {
35 +#if LINUX_VERSION_IS_GEQ(3,1,0)
36 /*
37 * If sending the wiphy data didn't fit (ENOBUFS
38 * or EMSGSIZE returned), this SKB is still
39 @@ -2031,6 +2032,7 @@ static int nl80211_dump_wiphy(struct sk_
40 rtnl_unlock();
41 return 1;
42 }
43 +#endif
44 idx--;
45 break;
46 }