net: wireless: bcmdhd: Enable P2P probe request handling only during discovery
authorJithu Jance <jithu@broadcom.com>
Fri, 16 Nov 2012 01:14:20 +0000 (17:14 -0800)
committerDmitry Shmidt <dimitrysh@google.com>
Fri, 16 Nov 2012 01:16:59 +0000 (17:16 -0800)
Change-Id: I2db29d5ed7f66f2a45feb890c81d510fcad24dd2
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcmdhd/dhd_linux.c
drivers/net/wireless/bcmdhd/wl_cfg80211.c
drivers/net/wireless/bcmdhd/wl_cfg80211.h
drivers/net/wireless/bcmdhd/wl_cfgp2p.c

index eb155614cd8c3d3374dd7be6f9c76f965dd8a2e4..1630c4727917ac940a42f266c8069b7e45b96b90 100644 (file)
@@ -3261,7 +3261,6 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
                setbit(eventmask, WLC_E_ACTION_FRAME_RX);
                setbit(eventmask, WLC_E_ACTION_FRAME_COMPLETE);
                setbit(eventmask, WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE);
-               setbit(eventmask, WLC_E_P2P_PROBREQ_MSG);
                setbit(eventmask, WLC_E_P2P_DISC_LISTEN_COMPLETE);
        }
 #endif /* WL_CFG80211 */
index b4f47d1393cdd495f17469e81b08a586ad114a08..2f28bf1d3f78f5350e83bcfbbc018fa554db6732 100644 (file)
@@ -331,7 +331,6 @@ static __used bool wl_is_ibssstarter(struct wl_priv *wl);
  */
 static s32 __wl_cfg80211_up(struct wl_priv *wl);
 static s32 __wl_cfg80211_down(struct wl_priv *wl);
-static s32 wl_add_remove_eventmsg(struct net_device *ndev, u16 event, bool add);
 static bool wl_is_linkdown(struct wl_priv *wl, const wl_event_msg_t *e);
 static bool wl_is_linkup(struct wl_priv *wl, const wl_event_msg_t *e, struct net_device *ndev);
 static bool wl_is_nonetwork(struct wl_priv *wl, const wl_event_msg_t *e);
@@ -7089,7 +7088,7 @@ static s32 wl_config_ifmode(struct wl_priv *wl, struct net_device *ndev, s32 ift
        return 0;
 }
 
-static s32 wl_add_remove_eventmsg(struct net_device *ndev, u16 event, bool add)
+s32 wl_add_remove_eventmsg(struct net_device *ndev, u16 event, bool add)
 {
        s8 iovbuf[WL_EVENTING_MASK_LEN + 12];
 
index dfb0d0de2f7ea1bbb9df9cac51350cafc1a3d625..6d237eee2ccb68203aaa7e2f54befacf5f9e4333 100644 (file)
@@ -689,4 +689,5 @@ void wl_cfg80211_enable_trace(int level);
 extern s32 wl_update_wiphybands(struct wl_priv *wl);
 extern s32 wl_cfg80211_if_is_group_owner(void);
 extern int wl_cfg80211_update_power_mode(struct net_device *dev);
+extern s32 wl_add_remove_eventmsg(struct net_device *ndev, u16 event, bool add);
 #endif                         /* _wl_cfg80211_h_ */
index 7bcd14486dd938dd7b4eb20698bcb360a0d0bb24..aedf9705b4408a87e05941e3bae35d87d7c6c276 100644 (file)
@@ -641,7 +641,7 @@ wl_cfgp2p_enable_discovery(struct wl_priv *wl, struct net_device *dev,
        }
 set_ie:
        ret = wl_cfgp2p_set_management_ie(wl, dev,
-                               wl_cfgp2p_find_idx(wl, dev),
+                               wl_to_p2p_bss_bssidx(wl, P2PAPI_BSSCFG_DEVICE),
                                VNDR_IE_PRBREQ_FLAG, ie, ie_len);
 
        if (unlikely(ret < 0)) {
@@ -1230,6 +1230,10 @@ wl_cfgp2p_listen_complete(struct wl_priv *wl, struct net_device *ndev,
                }
                cfg80211_remain_on_channel_expired(ndev, wl->last_roc_id, &wl->remain_on_chan,
                    wl->remain_on_chan_type, GFP_KERNEL);
+               if (wl_add_remove_eventmsg(wl_to_prmry_ndev(wl),
+                       WLC_E_P2P_PROBREQ_MSG, false) != BCME_OK) {
+                       CFGP2P_ERR((" failed to unset WLC_E_P2P_PROPREQ_MSG\n"));
+               }
        } else
                wl_clr_p2p_status(wl, LISTEN_EXPIRED);
 
@@ -1321,6 +1325,9 @@ wl_cfgp2p_discover_listen(struct wl_priv *wl, s32 channel, u32 duration_ms)
        } else
                wl_clr_p2p_status(wl, LISTEN_EXPIRED);
 
+       if (wl_add_remove_eventmsg(wl_to_prmry_ndev(wl), WLC_E_P2P_PROBREQ_MSG, true) != BCME_OK) {
+               CFGP2P_ERR((" failed to set WLC_E_P2P_PROPREQ_MSG\n"));
+       }
        wl_cfgp2p_set_p2p_mode(wl, WL_P2P_DISC_ST_LISTEN, channel, (u16) duration_ms,
                    wl_to_p2p_bss_bssidx(wl, P2PAPI_BSSCFG_DEVICE));
        _timer = &wl->p2p->listen_timer;