From 89e299259ca01e415bfc4af16ddf0eccc1ff64a5 Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Sun, 19 May 2013 18:36:06 +0000 Subject: [PATCH] mac80211: make it build with 3.10-rc1 Signed-off-by: Jonas Gorski SVN-Revision: 36661 --- ...s-net-rename-random32-to-prandom_u32.patch | 66 +++++++++++++++++++ ...ng-include-in-else-for-compat-3.10.h.patch | 40 +++++++++++ ...-renaming-of-random32-to-prandom_u32.patch | 39 +++++++++++ 3 files changed, 145 insertions(+) create mode 100644 package/mac80211/patches/050-drivers-net-rename-random32-to-prandom_u32.patch create mode 100644 package/mac80211/patches/100-compat-add-missing-include-in-else-for-compat-3.10.h.patch create mode 100644 package/mac80211/patches/101-compat-handle-renaming-of-random32-to-prandom_u32.patch diff --git a/package/mac80211/patches/050-drivers-net-rename-random32-to-prandom_u32.patch b/package/mac80211/patches/050-drivers-net-rename-random32-to-prandom_u32.patch new file mode 100644 index 0000000000..a50896940b --- /dev/null +++ b/package/mac80211/patches/050-drivers-net-rename-random32-to-prandom_u32.patch @@ -0,0 +1,66 @@ +From e00adf39134028d65023c327b427074728c18f7e Mon Sep 17 00:00:00 2001 +From: Akinobu Mita +Date: Tue, 7 May 2013 16:18:15 -0700 +Subject: [PATCH] drivers/net: rename random32() to prandom_u32() + +Use preferable function name which implies using a pseudo-random number +generator. + +[akpm@linux-foundation.org: convert team_mode_random.c] +Signed-off-by: Akinobu Mita +Acked-by: Thomas Sailer +Acked-by: Bing Zhao [mwifiex] +Cc: "David S. Miller" +Cc: Michael Chan +Cc: Thomas Sailer +Cc: Jean-Paul Roubelat +Cc: Bing Zhao +Cc: Brett Rudley +Cc: Arend van Spriel +Cc: "Franky (Zhenhui) Lin" +Cc: Hante Meuleman +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +--- + drivers/net/wireless/brcm80211/brcmfmac/p2p.c | 2 +- + drivers/net/wireless/mwifiex/cfg80211.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +index 2b90da0..e7a1a47 100644 +--- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c ++++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +@@ -1117,7 +1117,7 @@ static void brcmf_p2p_afx_handler(struct work_struct *work) + if (afx_hdl->is_listen && afx_hdl->my_listen_chan) + /* 100ms ~ 300ms */ + err = brcmf_p2p_discover_listen(p2p, afx_hdl->my_listen_chan, +- 100 * (1 + (random32() % 3))); ++ 100 * (1 + prandom_u32() % 3)); + else + err = brcmf_p2p_act_frm_search(p2p, afx_hdl->peer_listen_chan); + +diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c +index a0cb077..d3c8ece 100644 +--- a/drivers/net/wireless/mwifiex/cfg80211.c ++++ b/drivers/net/wireless/mwifiex/cfg80211.c +@@ -216,7 +216,7 @@ mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, + mwifiex_form_mgmt_frame(skb, buf, len); + mwifiex_queue_tx_pkt(priv, skb); + +- *cookie = random32() | 1; ++ *cookie = prandom_u32() | 1; + cfg80211_mgmt_tx_status(wdev, *cookie, buf, len, true, GFP_ATOMIC); + + wiphy_dbg(wiphy, "info: management frame transmitted\n"); +@@ -271,7 +271,7 @@ mwifiex_cfg80211_remain_on_channel(struct wiphy *wiphy, + duration); + + if (!ret) { +- *cookie = random32() | 1; ++ *cookie = prandom_u32() | 1; + priv->roc_cfg.cookie = *cookie; + priv->roc_cfg.chan = *chan; + +-- +1.7.10.4 + diff --git a/package/mac80211/patches/100-compat-add-missing-include-in-else-for-compat-3.10.h.patch b/package/mac80211/patches/100-compat-add-missing-include-in-else-for-compat-3.10.h.patch new file mode 100644 index 0000000000..2e485ed28b --- /dev/null +++ b/package/mac80211/patches/100-compat-add-missing-include-in-else-for-compat-3.10.h.patch @@ -0,0 +1,40 @@ +From 16f4984678b93c03fc3fe31ed7c2bda491574ea7 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sat, 18 May 2013 02:05:30 +0200 +Subject: [PATCH 1/2] compat: add missing include in #else for compat-3.10.h + +When compiling against 3.10-rc1, the build fails as follows: + + CC [M] compat/main.o +In file included from include/linux/compat-2.6.h:75:0, + from :0: +include/linux/compat-3.10.h:91:52: warning: 'struct fb_info' declared inside parameter list [enabled by default] +include/linux/compat-3.10.h:91:52: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] +include/linux/compat-3.10.h: In function 'backport_fb_enable_skip_vt_switch': +include/linux/compat-3.10.h:93:6: error: dereferencing pointer to incomplete type + +Fix this adding the missing include to the else branch to stay true to +the original commit, instead of pulling it out of the #if #else #endif +block. + +Signed-off-by: Jonas Gorski +--- + include/linux/compat-3.10.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/linux/compat-3.10.h b/include/linux/compat-3.10.h +index f972203..9d6e55c 100644 +--- a/include/linux/compat-3.10.h ++++ b/include/linux/compat-3.10.h +@@ -87,6 +87,8 @@ static inline void fb_enable_skip_vt_switch(struct fb_info *info) + * clash on the backport for 3.12 as the routine would + * already be defined *but* we'd need it for 3.11. + */ ++#include ++ + #define fb_enable_skip_vt_switch LINUX_BACKPORT(fb_enable_skip_vt_switch) + static inline void fb_enable_skip_vt_switch(struct fb_info *info) + { +-- +1.7.10.4 + diff --git a/package/mac80211/patches/101-compat-handle-renaming-of-random32-to-prandom_u32.patch b/package/mac80211/patches/101-compat-handle-renaming-of-random32-to-prandom_u32.patch new file mode 100644 index 0000000000..c5807da6c7 --- /dev/null +++ b/package/mac80211/patches/101-compat-handle-renaming-of-random32-to-prandom_u32.patch @@ -0,0 +1,39 @@ +From ccfc866db68eeaaeae8665baf5345debe6f26e94 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sat, 18 May 2013 11:25:22 +0200 +Subject: [PATCH 2/2] compat: handle renaming of random32() to prandom_u32() + +496f2f93b1cc286f5a4f4f9acdc1e5314978683f renamed random32() to +prandom_u32(), so add an appropriate macro for older kernels. + +Signed-off-by: Jonas Gorski +--- + include/linux/compat-3.10.h | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/include/linux/compat-3.10.h b/include/linux/compat-3.10.h +index 9d6e55c..1baa996 100644 +--- a/include/linux/compat-3.10.h ++++ b/include/linux/compat-3.10.h +@@ -75,6 +75,18 @@ static inline void fb_enable_skip_vt_switch(struct fb_info *info) + module_driver(__pcmcia_driver, pcmcia_register_driver, \ + pcmcia_unregister_driver) + ++/** ++ * backport of: ++ * ++ * commit 496f2f93b1cc286f5a4f4f9acdc1e5314978683f ++ * Author: Akinobu Mita ++ * Date: Mon Dec 17 16:04:23 2012 -0800 ++ * ++ * random32: rename random32 to prandom ++ * ++ */ ++#define prandom_u32() random32() ++ + #else /* kernel is >= 3.10 */ + /* + * We'd delete this upstream ever got this, we use our +-- +1.7.10.4 +