OSDN Git Service

staging: wfx: delayed_link_loss cannot happen
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Tue, 17 Dec 2019 16:15:39 +0000 (16:15 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Dec 2019 14:56:32 +0000 (15:56 +0100)
Original code allows to detect an BSS loss during a scan and delaying
the handling of BSS loss. However, there it is no real problem to just
make these two events mutually exclusive (there is just a performance
penalty).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191217161318.31402-54-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/scan.c
drivers/staging/wfx/sta.c
drivers/staging/wfx/wfx.h

index bdbce69..dde2f88 100644 (file)
@@ -95,10 +95,6 @@ void wfx_hw_scan_work(struct work_struct *work)
        mutex_unlock(&wvif->wdev->conf_mutex);
        mutex_unlock(&wvif->scan_lock);
        __ieee80211_scan_completed_compat(wvif->wdev->hw, ret < 0);
-       if (wvif->delayed_link_loss) {
-               wvif->delayed_link_loss = false;
-               wfx_cqm_bssloss_sm(wvif, 1, 0, 0);
-       }
 }
 
 int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
index 7ae763e..3296bc3 100644 (file)
@@ -63,7 +63,6 @@ void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad)
        int tx = 0;
 
        mutex_lock(&wvif->bss_loss_lock);
-       wvif->delayed_link_loss = 0;
        cancel_work_sync(&wvif->bss_params_work);
 
        if (init) {
@@ -429,18 +428,9 @@ static void wfx_event_handler_work(struct work_struct *work)
                switch (event->evt.event_id) {
                case HIF_EVENT_IND_BSSLOST:
                        cancel_work_sync(&wvif->unjoin_work);
-                       if (mutex_trylock(&wvif->scan_lock)) {
-                               wfx_cqm_bssloss_sm(wvif, 1, 0, 0);
-                               mutex_unlock(&wvif->scan_lock);
-                       } else {
-                               /* Scan is in progress. Delay reporting.
-                                * Scan complete will trigger bss_loss_work
-                                */
-                               wvif->delayed_link_loss = 1;
-                               /* Also start a watchdog. */
-                               schedule_delayed_work(&wvif->bss_loss_work,
-                                                     5 * HZ);
-                       }
+                       mutex_lock(&wvif->scan_lock);
+                       wfx_cqm_bssloss_sm(wvif, 1, 0, 0);
+                       mutex_unlock(&wvif->scan_lock);
                        break;
                case HIF_EVENT_IND_BSSREGAINED:
                        wfx_cqm_bssloss_sm(wvif, 0, 0, 0);
@@ -497,8 +487,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif)
 {
        mutex_lock(&wvif->wdev->conf_mutex);
 
-       wvif->delayed_link_loss = false;
-
        if (!wvif->state)
                goto done;
 
index 5e7c911..db433be 100644 (file)
@@ -70,7 +70,6 @@ struct wfx_vif {
        int                     id;
        enum wfx_state          state;
 
-       int                     delayed_link_loss;
        int                     bss_loss_state;
        u32                     bss_loss_confirm_id;
        struct mutex            bss_loss_lock;