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