WL_ERR(("name is NULL\n"));
return NULL;
}
- if (wl->iface_cnt == IFACE_MAX_CNT)
- return ERR_PTR(-ENOMEM);
if (wl->p2p_supported && (wlif_type != -1)) {
if (wl_get_p2p_status(wl, IF_DELETING)) {
/* wait till IF_DEL is complete
WL_ERR(("timeount < 0, return -EAGAIN\n"));
return ERR_PTR(-EAGAIN);
}
+ /* It should be now be safe to put this check here since we are sure
+ * by now netdev_notifier (unregister) would have been called */
+ if (wl->iface_cnt == IFACE_MAX_CNT)
+ return ERR_PTR(-ENOMEM);
}
if (wl->p2p && !wl->p2p->on && strstr(name, WL_P2P_INTERFACE_PREFIX)) {
p2p_on(wl) = true;
WL_DBG(("Enter \n"));
wl_clr_p2p_status(wl, IF_DELETING);
-
+ wake_up_interruptible(&wl->netif_change_event);
return 0;
}
/* Arm scan timeout timer */
mod_timer(&wl->scan_timeout, jiffies + WL_SCAN_TIMER_INTERVAL_MS * HZ / 1000);
iscan_req = false;
+ wl->scan_request = request;
if (request) { /* scan bss */
ssids = request->ssids;
if (wl->iscan_on && (!ssids || !ssids->ssid_len || request->n_ssids != 1)) {
/* we don't do iscan in ibss */
ssids = this_ssid;
}
- wl->scan_request = request;
wl_set_drv_status(wl, SCANNING, ndev);
if (iscan_req) {
err = wl_do_iscan(wl, request);
scan_out:
wl_clr_drv_status(wl, SCANNING, ndev);
- wl->scan_request = NULL;
+ if (wl->scan_request) {
+ if (timer_pending(&wl->scan_timeout))
+ del_timer_sync(&wl->scan_timeout);
+ cfg80211_scan_done(wl->scan_request, true);
+ wl->scan_request = NULL;
+ }
return err;
}
signal = notif_bss_info->rssi * 100;
-#if defined(WLP2P) && defined(WL_ENABLE_P2P_IF)
- if (wl->p2p && wl->p2p_net && wl->scan_request &&
- ((wl->scan_request->dev == wl->p2p_net) ||
- (wl->scan_request->dev == wl_to_p2p_bss_ndev(wl, P2PAPI_BSSCFG_CONNECTION)))){
-#else
- if (p2p_is_on(wl) && ( p2p_scan(wl) ||
- (wl->scan_request->dev == wl_to_p2p_bss_ndev(wl, P2PAPI_BSSCFG_CONNECTION)))) {
-#endif
- /* find the P2PIE, if we do not find it, we will discard this frame */
- wifi_p2p_ie_t * p2p_ie;
- if ((p2p_ie = wl_cfgp2p_find_p2pie((u8 *)beacon_proberesp->variable,
- wl_get_ielen(wl))) == NULL) {
- WL_ERR(("Couldn't find P2PIE in probe response/beacon\n"));
- kfree(notif_bss_info);
- return err;
- }
- else if( wl_cfgp2p_retreive_p2pattrib(p2p_ie, P2P_SEID_DEV_INFO) == NULL)
- {
- WL_DBG(("Couldn't find P2P_SEID_DEV_INFO in probe response/beacon\n"));
- kfree(notif_bss_info);
- return err;
- }
- }
if (!mgmt->u.probe_resp.timestamp) {
struct timeval tv;
WL_DBG(("P2P: GO_NEG_PHASE status cleared \n"));
wl_clr_p2p_status(wl, GO_NEG_PHASE);
}
+
+ if (act_frm && (act_frm->subtype == P2P_PAF_GON_RSP)) {
+ /* Cancel the dwell time of req frame */
+ WL_DBG(("P2P: Received GO NEG Resp frame, cancelling the dwell time\n"));
+ wl_cfgp2p_set_p2p_mode(wl, WL_P2P_DISC_ST_SCAN, 0, 0,
+ wl_to_p2p_bss_bssidx(wl, P2PAPI_BSSCFG_DEVICE));
+ }
} else {
mgmt_frame = (u8 *)((wl_event_rx_frame_data_t *)rxframe + 1);
}
wl_scan_results_t *list;
u32 bi_length;
u32 i;
+ wifi_p2p_ie_t * p2p_ie;
u8 *p2p_dev_addr = NULL;
WL_DBG((" enter event type : %d, status : %d \n",
ntoh32(e->event_type), ntoh32(e->status)));
WL_ERR(("Buffer is too small: ignoring\n"));
goto exit;
}
+#if defined(WLP2P) && defined(WL_ENABLE_P2P_IF)
+ if (wl->p2p_net && wl->scan_request &&
+ wl->scan_request->dev == wl->p2p_net) {
+#else
+ if (p2p_is_on(wl) && p2p_scan(wl)) {
+#endif
+ /* p2p scan && allow only probe response */
+ if (bi->flags & WL_BSS_FLAGS_FROM_BEACON)
+ goto exit;
+ if ((p2p_ie = wl_cfgp2p_find_p2pie(((u8 *) bi) + bi->ie_offset,
+ bi->ie_length)) == NULL) {
+ WL_ERR(("Couldn't find P2PIE in probe"
+ " response/beacon\n"));
+ goto exit;
+ }
+ }
#define WLC_BSS_RSSI_ON_CHANNEL 0x0002
for (i = 0; i < list->count; i++) {
bss = bss ? (wl_bss_info_t *)((uintptr)bss + dtoh32(bss->length))