bcmdhd: set correct bw for p2p connection
Bibhay Ranjan [Thu, 3 Dec 2015 13:04:19 +0000 (18:04 +0530)]
if the bw sent from the upper layers does
not match with the bw of the AP connection,
p2p connection happens on MCC always. With
this fix, the bw of the p2p connection is
set as AP's bw.

Bug 1694567

Change-Id: I5f9c73bc51e360e2b3e5e7cf6443d1de4434a136
Signed-off-by: Bibhay Ranjan <bibhayr@nvidia.com>
Reviewed-on: http://git-master/r/841024
Reviewed-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/net/wireless/bcmdhd/wl_cfg80211.c

index 2d7326a..8f2751c 100755 (executable)
@@ -6458,8 +6458,17 @@ wl_cfg80211_set_channel(struct wiphy *wiphy, struct net_device *dev,
                                                   to 5, 10, 20 ,40 ,80, 160, 80+80 MHz
                                                   respectively. In below case, 0x1000 = 2
                                                   which is for 20 MHz */
-                                               if((chanspec & 0x3800) == 0x1000)
+                                               if ((chanspec & 0x3800) == WL_CHANSPEC_BW_20) {
                                                        bw = WL_CHANSPEC_BW_20;
+                                               } else if ((chanspec & 0x3800) == WL_CHANSPEC_BW_40) {
+                                                       bw = WL_CHANSPEC_BW_40;
+                                               } else if ((chanspec & 0x3800) == WL_CHANSPEC_BW_80) {
+                                                       bw = WL_CHANSPEC_BW_80;
+                                               } else if ((chanspec & 0x3800) == WL_CHANSPEC_BW_160) {
+                                                       bw = WL_CHANSPEC_BW_160;
+                                               } else if ((chanspec & 0x3800) == WL_CHANSPEC_BW_8080) {
+                                                       bw = WL_CHANSPEC_BW_8080;
+                                               }
                                        }
                                } else {
                                        /* In 2.4 GHz supported bw is 20 MHz */