330-v4.18-0003-brcmfmac-use-nl80211_band-directly-to-get-ieee80211-.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From aed14219067ab96e5eeb7730e9bceed10d9be989 Mon Sep 17 00:00:00 2001
  2. From: Franky Lin <[email protected]>
  3. Date: Thu, 26 Apr 2018 12:16:48 +0200
  4. Subject: [PATCH] brcmfmac: use nl80211_band directly to get ieee80211 channel
  5. The enum nl80211_band used to retrieve wiphy->bands is the same as
  6. wiphy->bands->band which is checked by wiphy_register(). So it can be used
  7. directly as parameter of ieee80211_channel_to_frequency().
  8. Reviewed-by: Arend van Spriel <[email protected]>
  9. Signed-off-by: Franky Lin <[email protected]>
  10. Signed-off-by: Arend van Spriel <[email protected]>
  11. Signed-off-by: Kalle Valo <[email protected]>
  12. ---
  13. drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 8 ++++----
  14. 1 file changed, 4 insertions(+), 4 deletions(-)
  15. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  16. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  17. @@ -2729,7 +2729,7 @@ static s32 brcmf_inform_single_bss(struc
  18. {
  19. struct wiphy *wiphy = cfg_to_wiphy(cfg);
  20. struct cfg80211_bss *bss;
  21. - struct ieee80211_supported_band *band;
  22. + enum nl80211_band band;
  23. struct brcmu_chan ch;
  24. u16 channel;
  25. u32 freq;
  26. @@ -2752,11 +2752,11 @@ static s32 brcmf_inform_single_bss(struc
  27. channel = bi->ctl_ch;
  28. if (channel <= CH_MAX_2G_CHANNEL)
  29. - band = wiphy->bands[NL80211_BAND_2GHZ];
  30. + band = NL80211_BAND_2GHZ;
  31. else
  32. - band = wiphy->bands[NL80211_BAND_5GHZ];
  33. + band = NL80211_BAND_5GHZ;
  34. - freq = ieee80211_channel_to_frequency(channel, band->band);
  35. + freq = ieee80211_channel_to_frequency(channel, band);
  36. bss_data.chan = ieee80211_get_channel(wiphy, freq);
  37. bss_data.scan_width = NL80211_BSS_CHAN_WIDTH_20;
  38. bss_data.boottime_ns = ktime_to_ns(ktime_get_boottime());