diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2016-06-17 06:23:19 +0000 |
---|---|---|
committer | Luka Perkov <luka@openwrt.org> | 2016-06-19 19:46:03 +0200 |
commit | 39af6a3f3ed457aeaac20daa956915de5f72f166 (patch) | |
tree | 54ca4acee30b0d47b053310a8a134858cc9c7481 /package/kernel/mac80211/patches/351-0008-brcmfmac-support-get_channel-cfg80211-callback.patch | |
parent | 20c515d82ac4e947435a54aa4f1fee936a857592 (diff) | |
download | master-187ad058-39af6a3f3ed457aeaac20daa956915de5f72f166.tar.gz master-187ad058-39af6a3f3ed457aeaac20daa956915de5f72f166.tar.bz2 master-187ad058-39af6a3f3ed457aeaac20daa956915de5f72f166.zip |
mac80211: brcmfmac: add support for get_channel
It's very useful for debugging problems with brcmfmac setting requested
channel.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@49382 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/mac80211/patches/351-0008-brcmfmac-support-get_channel-cfg80211-callback.patch')
-rw-r--r-- | package/kernel/mac80211/patches/351-0008-brcmfmac-support-get_channel-cfg80211-callback.patch | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/351-0008-brcmfmac-support-get_channel-cfg80211-callback.patch b/package/kernel/mac80211/patches/351-0008-brcmfmac-support-get_channel-cfg80211-callback.patch new file mode 100644 index 0000000000..cea4975735 --- /dev/null +++ b/package/kernel/mac80211/patches/351-0008-brcmfmac-support-get_channel-cfg80211-callback.patch @@ -0,0 +1,94 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com> +Date: Fri, 20 May 2016 13:38:58 +0200 +Subject: [PATCH] brcmfmac: support get_channel cfg80211 callback +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This is important for brcmfmac as some of released firmwares (e.g. +brcmfmac4366b-pcie.bin) may pick different channel than requested. This +has been tested with BCM4366B1 in D-Link DIR-885L. + +Signed-off-by: Rafał Miłecki <zajec5@gmail.com> +Signed-off-by: Kalle Valo <kvalo@codeaurora.org> +--- + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -4863,6 +4863,68 @@ exit: + return err; + } + ++static int brcmf_cfg80211_get_channel(struct wiphy *wiphy, ++ struct wireless_dev *wdev, ++ struct cfg80211_chan_def *chandef) ++{ ++ struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); ++ struct net_device *ndev = wdev->netdev; ++ struct brcmf_if *ifp; ++ struct brcmu_chan ch; ++ enum nl80211_band band = 0; ++ enum nl80211_chan_width width = 0; ++ u32 chanspec; ++ int freq, err; ++ ++ if (!ndev) ++ return -ENODEV; ++ ifp = netdev_priv(ndev); ++ ++ err = brcmf_fil_iovar_int_get(ifp, "chanspec", &chanspec); ++ if (err) { ++ brcmf_err("chanspec failed (%d)\n", err); ++ return err; ++ } ++ ++ ch.chspec = chanspec; ++ cfg->d11inf.decchspec(&ch); ++ ++ switch (ch.band) { ++ case BRCMU_CHAN_BAND_2G: ++ band = NL80211_BAND_2GHZ; ++ break; ++ case BRCMU_CHAN_BAND_5G: ++ band = NL80211_BAND_5GHZ; ++ break; ++ } ++ ++ switch (ch.bw) { ++ case BRCMU_CHAN_BW_80: ++ width = NL80211_CHAN_WIDTH_80; ++ break; ++ case BRCMU_CHAN_BW_40: ++ width = NL80211_CHAN_WIDTH_40; ++ break; ++ case BRCMU_CHAN_BW_20: ++ width = NL80211_CHAN_WIDTH_20; ++ break; ++ case BRCMU_CHAN_BW_80P80: ++ width = NL80211_CHAN_WIDTH_80P80; ++ break; ++ case BRCMU_CHAN_BW_160: ++ width = NL80211_CHAN_WIDTH_160; ++ break; ++ } ++ ++ freq = ieee80211_channel_to_frequency(ch.control_ch_num, band); ++ chandef->chan = ieee80211_get_channel(wiphy, freq); ++ chandef->width = width; ++ chandef->center_freq1 = ieee80211_channel_to_frequency(ch.chnum, band); ++ chandef->center_freq2 = 0; ++ ++ return 0; ++} ++ + static int brcmf_cfg80211_crit_proto_start(struct wiphy *wiphy, + struct wireless_dev *wdev, + enum nl80211_crit_proto_id proto, +@@ -5025,6 +5087,7 @@ static struct cfg80211_ops brcmf_cfg8021 + .mgmt_tx = brcmf_cfg80211_mgmt_tx, + .remain_on_channel = brcmf_p2p_remain_on_channel, + .cancel_remain_on_channel = brcmf_cfg80211_cancel_remain_on_channel, ++ .get_channel = brcmf_cfg80211_get_channel, + .start_p2p_device = brcmf_p2p_start_device, + .stop_p2p_device = brcmf_p2p_stop_device, + .crit_proto_start = brcmf_cfg80211_crit_proto_start, |