From 2f3e0c33d3a7d4d41d2670cbff3153a522d9bfac Mon Sep 17 00:00:00 2001 From: Shital Jaju Date: Fri, 8 Aug 2014 12:34:40 +0530 Subject: [PATCH] bcmdhd: set the correct bw in the firmware Due to incorrect bw setting, fw will always start the MCC for P2P GO if the APs present in the environment in that channel are all only 20 MHz. This issue happens only for higher 5GHz passive channels (149, 153, 157, 161) which are passive by default. Bug 200025947 Change-Id: Idf79e9ce60362584a999d8f244f98c10cc170611 Signed-off-by: bibhayr Reviewed-on: http://git-master/r/482473 GVS: Gerrit_Virtual_Submit Reviewed-by: Rakesh Goyal Reviewed-by: Bharat Nihalani --- drivers/net/wireless/bcmdhd/wl_cfg80211.c | 39 +++++++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.c b/drivers/net/wireless/bcmdhd/wl_cfg80211.c index 62a013b0255..d6c3427b203 100644 --- a/drivers/net/wireless/bcmdhd/wl_cfg80211.c +++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.c @@ -5192,10 +5192,17 @@ wl_cfg80211_change_bss(struct wiphy *wiphy, return 0; } +#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) && !0) +static s32 +wl_cfg80211_set_channel(struct wiphy *wiphy, struct net_device *dev, + struct ieee80211_channel *chan, + struct cfg80211_chan_def chandef) +#else static s32 wl_cfg80211_set_channel(struct wiphy *wiphy, struct net_device *dev, struct ieee80211_channel *chan, enum nl80211_channel_type channel_type) +#endif { s32 _chan; chanspec_t chspec = 0; @@ -5212,11 +5219,37 @@ wl_cfg80211_set_channel(struct wiphy *wiphy, struct net_device *dev, if (!wl) return ERR_PTR(-EINVAL); + +#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) && !0) + enum nl80211_channel_type channel_type = NL80211_CHAN_HT20; +#endif + dev = ndev_to_wlc_ndev(dev, wl); _chan = ieee80211_frequency_to_channel(chan->center_freq); - WL_ERR(("netdev_ifidx(%d), chan_type(%d) target channel(%d) \n", + WL_ERR(("netdev_ifidx(%d), chan_type(%d) target channel(%d)\n", dev->ifindex, channel_type, _chan)); +#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)) && !0) + WL_ERR(("chan_width = %d\n", chandef.width)); + switch (chandef.width) { + case NL80211_CHAN_WIDTH_40: + bw = WL_CHANSPEC_BW_40; + break; + case NL80211_CHAN_WIDTH_80: + bw = WL_CHANSPEC_BW_80; + break; + case NL80211_CHAN_WIDTH_80P80: + bw = WL_CHANSPEC_BW_8080; + break; + case NL80211_CHAN_WIDTH_160: + bw = WL_CHANSPEC_BW_160; + break; + default: + bw = WL_CHANSPEC_BW_20; + break; + } + goto set_channel; +#endif if (chan->band == IEEE80211_BAND_5GHZ) { param.band = WLC_BAND_5G; @@ -6115,8 +6148,8 @@ wl_cfg80211_start_ap( #if ((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) && !0) if ((err = wl_cfg80211_set_channel(wiphy, dev, dev->ieee80211_ptr->preset_chandef.chan, - NL80211_CHAN_HT20) < 0)) { - WL_ERR(("Set channel failed \n")); + dev->ieee80211_ptr->preset_chandef) < 0)) { + WL_ERR(("Set channel failed\n")); goto fail; } #endif -- 2.39.2