mac80211: make it build with 3.10-rc1

Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 36661
This commit is contained in:
Jonas Gorski 2013-05-19 18:36:06 +00:00
parent 0a62b7c148
commit 89e299259c
3 changed files with 145 additions and 0 deletions

View file

@ -0,0 +1,66 @@
From e00adf39134028d65023c327b427074728c18f7e Mon Sep 17 00:00:00 2001
From: Akinobu Mita <akinobu.mita@gmail.com>
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 <akinobu.mita@gmail.com>
Acked-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
Acked-by: Bing Zhao <bzhao@marvell.com> [mwifiex]
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Michael Chan <mchan@broadcom.com>
Cc: Thomas Sailer <t.sailer@alumni.ethz.ch>
Cc: Jean-Paul Roubelat <jpr@f6fbb.org>
Cc: Bing Zhao <bzhao@marvell.com>
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Arend van Spriel <arend@broadcom.com>
Cc: "Franky (Zhenhui) Lin" <frankyl@broadcom.com>
Cc: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
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

View file

@ -0,0 +1,40 @@
From 16f4984678b93c03fc3fe31ed7c2bda491574ea7 Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jogo@openwrt.org>
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 <command-line>: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 <jogo@openwrt.org>
---
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 <linux/fb.h>
+
#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

View file

@ -0,0 +1,39 @@
From ccfc866db68eeaaeae8665baf5345debe6f26e94 Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jogo@openwrt.org>
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 <jogo@openwrt.org>
---
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 <akinobu.mita@gmail.com>
+ * 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