mac80211: make it work with 3.18.12+

3.18.12 backported 61ada528dea028331e99e8ceaed87c683ad25de2 ("sched/wait:
Provide infrastructure to deal with nested blocking") from 3.19, causing
the following error on load:

[   13.588000] compat: exports duplicate symbol woken_wake_function (owned by kernel)

Fix this by guarding it with a check for 3.18.11 or earlier instead of
3.19.

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

SVN-Revision: 45710
This commit is contained in:
Jonas Gorski 2015-05-21 19:32:16 +00:00
parent 4bb7b2186e
commit 072937888e
30 changed files with 98 additions and 69 deletions

View file

@ -0,0 +1,29 @@
--- a/backport-include/linux/wait.h
+++ b/backport-include/linux/wait.h
@@ -23,7 +23,7 @@ backport_wait_on_bit_io(void *word, int
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,12)
#define WQ_FLAG_WOKEN 0x02
#define wait_woken LINUX_BACKPORT(wait_woken)
--- a/compat/backport-3.19.c
+++ b/compat/backport-3.19.c
@@ -15,6 +15,7 @@
#include <linux/netdevice.h>
#include <linux/debugfs.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,12)
static inline bool is_kthread_should_stop(void)
{
return (current->flags & PF_KTHREAD) && kthread_should_stop();
@@ -79,6 +80,7 @@ int woken_wake_function(wait_queue_t *wa
return default_wake_function(wait, mode, sync, key);
}
EXPORT_SYMBOL(woken_wake_function);
+#endif
#ifdef __BACKPORT_NETDEV_RSS_KEY_FILL
u8 netdev_rss_key[NETDEV_RSS_KEY_LEN];

View file

@ -108,7 +108,8 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(key = rcu_dereference(tx->sdata->default_unicast_key)))
tx->key = key;
- else if (info->flags & IEEE80211_TX_CTL_INJECTED)
- tx->key = NULL;
+ else
tx->key = NULL;
- else if (!tx->sdata->drop_unencrypted)
- tx->key = NULL;
- else if (tx->skb->protocol == tx->sdata->control_port_protocol)
@ -119,8 +120,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
- tx->key = NULL;
- else if (ieee80211_is_mgmt(hdr->frame_control) &&
- !ieee80211_is_robust_mgmt_frame(tx->skb))
+ else
tx->key = NULL;
- tx->key = NULL;
- else {
- I802_DEBUG_INC(tx->local->tx_handlers_drop_unencrypted);
- return TX_DROP;

View file

@ -121,7 +121,11 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+ }
+ priv->wmi->multi_rmw_idx = 0;
+ }
+
- val = ath9k_regread(hw_priv, reg_offset);
- val &= ~clr;
- val |= set;
- ath9k_regwrite(hw_priv, val, reg_offset);
+ mutex_unlock(&priv->wmi->multi_rmw_mutex);
+}
+
@ -133,11 +137,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+
+ if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags))
+ return;
- val = ath9k_regread(hw_priv, reg_offset);
- val &= ~clr;
- val |= set;
- ath9k_regwrite(hw_priv, val, reg_offset);
+
+ atomic_inc(&priv->wmi->m_rmw_cnt);
+}
+

View file

@ -137,10 +137,11 @@
};
/* policy for the key attributes */
@@ -2207,6 +2208,20 @@ static int nl80211_set_wiphy(struct sk_b
@@ -2206,6 +2207,20 @@ static int nl80211_set_wiphy(struct sk_b
if (result)
return result;
}
+
+ if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_GAIN]) {
+ int idx, dbi = 0;
+
@ -154,7 +155,6 @@
+ if (result)
+ return result;
+ }
+
if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_TX] &&
info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]) {
u32 tx_ant, rx_ant;

View file

@ -63,7 +63,8 @@
+ led->cdev.name = gpio->name;
+ led->cdev.default_trigger = gpio->default_trigger;
+ led->cdev.brightness_set = ath_led_brightness;
+
- ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val);
+ ret = led_classdev_register(wiphy_dev(sc->hw->wiphy), &led->cdev);
+ if (ret < 0)
+ return ret;
@ -80,8 +81,7 @@
+
+ return 0;
+}
- ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val);
+
+int ath_create_gpio_led(struct ath_softc *sc, int gpio_num, const char *name,
+ const char *trigger, bool active_low)
+{

View file

@ -110,10 +110,13 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
rt2800_bbp_write(rt2x00dev, 83, 0x9a);
if (rt2x00_has_cap_external_lna_a(rt2x00dev))
@@ -3687,6 +3736,23 @@ static void rt2800_config_channel(struct
usleep_range(1000, 1500);
}
@@ -3684,6 +3733,23 @@ static void rt2800_config_channel(struct
rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
+ usleep_range(1000, 1500);
+ }
+
+ if (rt2x00_rt(rt2x00dev, RT3883)) {
+ if (!conf_is_ht40(conf))
+ rt2800_bbp_write(rt2x00dev, 105, 0x34);
@ -128,9 +131,6 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
+
+ rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
+
+ usleep_range(1000, 1500);
+ }
+
if (rt2x00_rt(rt2x00dev, RT5592)) {
rt2800_bbp_write(rt2x00dev, 195, 141);
rt2800_bbp_write(rt2x00dev, 196, conf_is_ht40(conf) ? 0x10 : 0x1a);
usleep_range(1000, 1500);
}