]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
bcmdhd: set the correct bw in the firmware
authorShital Jaju <shital.jaju@broadcom.com>
Fri, 8 Aug 2014 07:04:40 +0000 (12:34 +0530)
committerDhiren Parmar <dparmar@nvidia.com>
Wed, 20 Aug 2014 15:46:33 +0000 (08:46 -0700)
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 <bibhayr@nvidia.com>
Reviewed-on: http://git-master/r/482473
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
drivers/net/wireless/bcmdhd/wl_cfg80211.c

index 62a013b02555b8757007e90a766dc92fefaadcdb..d6c3427b203dbe07839ed6918050120b6d4375cc 100644 (file)
@@ -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