net: wireless: bcmdhd: Fake PNO event to wake up the wpa_supplicant
authorDmitry Shmidt <dimitrysh@google.com>
Fri, 20 Jan 2012 22:15:05 +0000 (14:15 -0800)
committerDmitry Shmidt <dimitrysh@google.com>
Fri, 27 Jan 2012 23:32:32 +0000 (15:32 -0800)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcmdhd/dhd_linux.c
drivers/net/wireless/bcmdhd/wl_cfg80211.c

index d4cc56f4043208d33c30d6164d46623ca786b342..f25fc324f2499624e0dec294b3950a8f85cfbe54 100644 (file)
@@ -1501,10 +1501,12 @@ dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, void *pktbuf, int numpkt, uint8 chan)
                        &data);
 
                        wl_event_to_host_order(&event);
+                       tout = DHD_EVENT_TIMEOUT_MS;
                        if (event.event_type == WLC_E_BTA_HCI_EVENT) {
                                dhd_bta_doevt(dhdp, data, event.datalen);
+                       } else if (event.event_type == WLC_E_PFN_NET_FOUND) {
+                               tout *= 2;
                        }
-                       tout = DHD_EVENT_TIMEOUT_MS;
                }
 
                ASSERT(ifidx < DHD_MAX_IFS && dhd->iflist[ifidx]);
index 32241d52adde1e5cb70906b78af4dae766d6168c..23aee57d745df9d9eca305d7a52a26d81012e798 100644 (file)
@@ -256,6 +256,8 @@ static s32 wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
        const wl_event_msg_t *e, void *data);
 static s32 wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
        const wl_event_msg_t *e, void *data);
+static s32 wl_notify_pfn_status(struct wl_priv *wl, struct net_device *ndev,
+       const wl_event_msg_t *e, void *data);
 /*
  * register/deregister sdio function
  */
@@ -4787,6 +4789,19 @@ wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
        return 0;
 }
 
+static s32
+wl_notify_pfn_status(struct wl_priv *wl, struct net_device *ndev,
+       const wl_event_msg_t *e, void *data)
+{
+       WL_ERR((" PNO Event\n"));
+
+       mutex_lock(&wl->usr_sync);
+       /* TODO: Use cfg80211_sched_scan_results(wiphy); */
+       cfg80211_disconnected(ndev, 0, NULL, 0, GFP_KERNEL);
+       mutex_unlock(&wl->usr_sync);
+       return 0;
+}
+
 static s32
 wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
        const wl_event_msg_t *e, void *data)
@@ -4997,7 +5012,7 @@ static void wl_init_event_handler(struct wl_priv *wl)
        wl->evt_handler[WLC_E_P2P_DISC_LISTEN_COMPLETE] = wl_cfgp2p_listen_complete;
        wl->evt_handler[WLC_E_ACTION_FRAME_COMPLETE] = wl_cfgp2p_action_tx_complete;
        wl->evt_handler[WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE] = wl_cfgp2p_action_tx_complete;
-
+       wl->evt_handler[WLC_E_PFN_NET_FOUND] = wl_notify_pfn_status;
 }
 
 static s32 wl_init_priv_mem(struct wl_priv *wl)
@@ -5759,9 +5774,6 @@ wl_cfg80211_event(struct net_device *ndev, const wl_event_msg_t * e, void *data)
        WL_DBG(("event_type (%d):" "WLC_E_" "%s\n", event_type, estr));
 #endif /* (WL_DBG_LEVEL > 0) */
 
-       if (event_type == WLC_E_PFN_NET_FOUND)
-               WL_ERR((" PNO Event\n"));
-
        if (likely(!wl_enq_event(wl, ndev, event_type, e, data)))
                wl_wakeup_event(wl);
 }