mac80211: update to 2015-12-03
[openwrt/staging/mkresin.git] / package / kernel / mac80211 / patches / 609-rt2x00-allow_disabling_bands_through_dts.patch
1 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
2 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
3 @@ -26,6 +26,7 @@
4 #include <linux/module.h>
5 #include <linux/slab.h>
6 #include <linux/log2.h>
7 +#include <linux/of.h>
8
9 #include "rt2x00.h"
10 #include "rt2x00lib.h"
11 @@ -951,6 +952,16 @@ static int rt2x00lib_probe_hw_modes(stru
12 struct ieee80211_rate *rates;
13 unsigned int num_rates;
14 unsigned int i;
15 +#ifdef CONFIG_OF
16 + struct device_node *np = rt2x00dev->dev->of_node;
17 + unsigned int enabled;
18 + if (!of_property_read_u32(np, "ralink,2ghz",
19 + &enabled) && !enabled)
20 + spec->supported_bands &= ~SUPPORT_BAND_2GHZ;
21 + if (!of_property_read_u32(np, "ralink,5ghz",
22 + &enabled) && !enabled)
23 + spec->supported_bands &= ~SUPPORT_BAND_5GHZ;
24 +#endif /* CONFIG_OF */
25
26 if (rt2x00dev->dev->platform_data) {
27 struct rt2x00_platform_data *pdata;