mac80211: sync with master branch as of 9edff13abd97
[openwrt/staging/dedeckeh.git] / package / kernel / mac80211 / patches / 608-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 @@ -955,6 +955,16 @@ static int rt2x00lib_probe_hw_modes(stru
4 struct ieee80211_rate *rates;
5 unsigned int num_rates;
6 unsigned int i;
7 +#ifdef CONFIG_OF
8 + struct device_node *np = rt2x00dev->dev->of_node;
9 + unsigned int enabled;
10 + if (!of_property_read_u32(np, "ralink,2ghz",
11 + &enabled) && !enabled)
12 + spec->supported_bands &= ~SUPPORT_BAND_2GHZ;
13 + if (!of_property_read_u32(np, "ralink,5ghz",
14 + &enabled) && !enabled)
15 + spec->supported_bands &= ~SUPPORT_BAND_5GHZ;
16 +#endif /* CONFIG_OF */
17
18 if (rt2x00dev->dev->platform_data) {
19 struct rt2x00_platform_data *pdata;