608-rt2x00-allow_disabling_bands_through_dts.patch 766 B

12345678910111213141516171819
  1. --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
  2. +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
  3. @@ -1027,6 +1027,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. if (rt2x00dev->dev->platform_data) {
  18. struct rt2x00_platform_data *pdata;