diff options
author | Bryan O'Donoghue <bryan.odonoghue@linaro.org> | 2020-09-17 14:21:57 +0100 |
---|---|---|
committer | Bryan O'Donoghue <bryan.odonoghue@linaro.org> | 2020-11-03 10:34:03 +0000 |
commit | 726d81ca367e4ada6c10576be8f337b077b0c4f5 (patch) | |
tree | 4fd7ca8f1864e0ed1c061edd4a0a177b4c4a9527 | |
parent | f5bff6fec56e07cd3b839e3e1a52f18b2e1c873a (diff) |
wcn36xx: Fix beacon loss detection during sw scanath.master-03-11-20+wcn36xx-fw-offload-suspend-resume-t1
Testing on Android - which has a tendency to hammer away at WiFi scanning
I've found that if I disconnect an AP - literally pull the power out during
a scan that a loss of beacon indication is not generated by the firmware.
Instead the undocumented result code '29' is returned. The set of declared
response codes in downstream prima is.
typedef enum
{
WDI_STATUS_SUCCESS,
WDI_STATUS_SUCCESS_SYNC,
WDI_STATUS_PENDING,
WDI_STATUS_E_FAILURE,
WDI_STATUS_RES_FAILURE,
WDI_STATUS_MEM_FAILURE,
WDI_STATUS_E_NOT_ALLOWED,
WDI_STATUS_E_NOT_IMPLEMENT,
WDI_STATUS_DEV_INTERNAL_FAILURE,
WDI_STATUS_MAX
}WDI_Status;
No sign of 29 in this list, let alone what it indicates.
What we see when a scan is not in progress is the firmware generate a
beacon loss indication which then flows down into
wcn36xx_smd_missed_beacon_ind().
This patch addresses this difference in behavior by:
1. Capturing the result code of wcn36xx_smd_init_scan()
2. If and only if a software scan is in progress and we are associated with
an AP triggering ieee80211_connection_loss()
Once done I can reliably capture beacon loss both on the scan and non-scan
paths.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
-rw-r--r-- | drivers/net/wireless/ath/wcn36xx/main.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 5867bd9c2f64..e73d04ef2072 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -406,6 +406,8 @@ static void wcn36xx_change_opchannel(struct wcn36xx *wcn, int ch) static int wcn36xx_config(struct ieee80211_hw *hw, u32 changed) { struct wcn36xx *wcn = hw->priv; + struct wcn36xx_vif *vif_priv; + int ret; wcn36xx_dbg(WCN36XX_DBG_MAC, "mac config changed 0x%08x\n", changed); @@ -427,9 +429,15 @@ static int wcn36xx_config(struct ieee80211_hw *hw, u32 changed) /* A scan is ongoing, do not change the operating * channel, but start a scan session on the channel. */ - wcn36xx_smd_init_scan(wcn, HAL_SYS_MODE_SCAN, - wcn->sw_scan_vif); - wcn36xx_smd_start_scan(wcn, ch); + ret = wcn36xx_smd_init_scan(wcn, HAL_SYS_MODE_SCAN, + wcn->sw_scan_vif); + if (ret && wcn->sw_scan == true) { + vif_priv = wcn36xx_vif_to_priv(wcn->sw_scan_vif); + if (vif_priv->sta_assoc) + ieee80211_connection_loss(wcn->sw_scan_vif); + } else { + wcn36xx_smd_start_scan(wcn, ch); + } } else { wcn36xx_change_opchannel(wcn, ch); } |