diff options
author | Ecco Park <eccopark@broadcom.com> | 2013-11-01 06:04:40 +0900 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2016-05-01 23:35:31 +0200 |
commit | 1243ceb71bb70a5e07c4b3b24035b18b1f32a3a1 (patch) | |
tree | a1f02dffb32d6724ec699828304b7c8db67f60cd | |
parent | eb8922047233b10a7d3818c0c9ac1108560d6396 (diff) | |
download | kernel_samsung_tuna-1243ceb71bb70a5e07c4b3b24035b18b1f32a3a1.zip kernel_samsung_tuna-1243ceb71bb70a5e07c4b3b24035b18b1f32a3a1.tar.gz kernel_samsung_tuna-1243ceb71bb70a5e07c4b3b24035b18b1f32a3a1.tar.bz2 |
net: wireless: bcmdhd: cancel current PNO if connection will happen
Issue : Manta: Lack of WLS causes PNO problem
Problem : we found that race condition happens
between connection and PNO sometimes.
Connection is failed due to this race condition.
Solution: we need to cancel PNO explicitly if the connection
request start in DHD driver.
Bug : 11174374
Signed-off-by: Ecco Park <eccopark@broadcom.com>
Change-Id: I7bf81d127901a74e9f47d6cc4ee7b265c6936dc3
-rw-r--r-- | drivers/net/wireless/bcmdhd/dhd_pno.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/bcmdhd/wl_cfg80211.c | 12 |
2 files changed, 23 insertions, 7 deletions
diff --git a/drivers/net/wireless/bcmdhd/dhd_pno.c b/drivers/net/wireless/bcmdhd/dhd_pno.c index 609010f..5e6f14d 100644 --- a/drivers/net/wireless/bcmdhd/dhd_pno.c +++ b/drivers/net/wireless/bcmdhd/dhd_pno.c @@ -857,15 +857,23 @@ dhd_pno_set_for_ssid(dhd_pub_t *dhd, wlc_ssid_t* ssid_list, int nssid, scan_fr, pno_repeat, pno_freq_expo_max, nchan)); _params = &(_pno_state->pno_params_arr[INDEX_OF_LEGACY_PARAMS]); - if (!(_pno_state->pno_mode & DHD_PNO_LEGACY_MODE)) { - _pno_state->pno_mode |= DHD_PNO_LEGACY_MODE; - err = _dhd_pno_reinitialize_prof(dhd, _params, DHD_PNO_LEGACY_MODE); + if (_pno_state->pno_mode & DHD_PNO_LEGACY_MODE) { + DHD_ERROR(("%s : Legacy PNO mode was already started, " + "will disable previous one to start new one\n", __FUNCTION__)); + err = dhd_pno_stop_for_ssid(dhd); if (err < 0) { - DHD_ERROR(("%s : failed to reinitialize profile (err %d)\n", + DHD_ERROR(("%s : failed to stop legacy PNO (err %d)\n", __FUNCTION__, err)); goto exit; } } + _pno_state->pno_mode |= DHD_PNO_LEGACY_MODE; + err = _dhd_pno_reinitialize_prof(dhd, _params, DHD_PNO_LEGACY_MODE); + if (err < 0) { + DHD_ERROR(("%s : failed to reinitialize profile (err %d)\n", + __FUNCTION__, err)); + goto exit; + } memset(_chan_list, 0, sizeof(_chan_list)); tot_nchan = nchan; if (tot_nchan > 0 && channel_list) { @@ -930,7 +938,7 @@ dhd_pno_set_for_ssid(dhd_pub_t *dhd, wlc_ssid_t* ssid_list, int nssid, goto exit; } if ((err = _dhd_pno_add_ssid(dhd, ssid_list, nssid)) < 0) { - DHD_ERROR(("failed to add ssid list (err %d) in firmware\n", err)); + DHD_ERROR(("failed to add ssid list(err %d), %d in firmware\n", err, nssid)); goto exit; } for (i = 0; i < nssid; i++) { diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.c b/drivers/net/wireless/bcmdhd/wl_cfg80211.c index c13306f..066a7bd 100644 --- a/drivers/net/wireless/bcmdhd/wl_cfg80211.c +++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.c @@ -334,6 +334,7 @@ static s32 wl_notify_escan_complete(struct wl_priv *wl, static s32 wl_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev, u8 *peer, enum nl80211_tdls_operation oper); #endif /* LINUX_VERSION_CODE > KERNEL_VERSION(3, 2, 0) */ +static int wl_cfg80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev); /* * event & event Q handlers for cfg80211 interfaces @@ -3132,6 +3133,11 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, wl_notify_escan_complete(wl, dev, true, true); } #endif +#ifdef WL_SCHED_SCAN + if (wl->sched_scan_req) { + wl_cfg80211_sched_scan_stop(wiphy, wl_to_prmry_ndev(wl)); + } +#endif #if defined(ESCAN_RESULT_PATCH) if (sme->bssid) memcpy(connect_req_bssid, sme->bssid, ETHER_ADDR_LEN); @@ -6324,7 +6330,8 @@ fail: #define PNO_TIME 30 #define PNO_REPEAT 4 #define PNO_FREQ_EXPO_MAX 2 -int wl_cfg80211_sched_scan_start(struct wiphy *wiphy, +static int +wl_cfg80211_sched_scan_start(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_sched_scan_request *request) { @@ -6388,7 +6395,8 @@ int wl_cfg80211_sched_scan_start(struct wiphy *wiphy, return 0; } -int wl_cfg80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev) +static int +wl_cfg80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev) { struct wl_priv *wl = wiphy_priv(wiphy); |