wl1251: improve PS report handling
authorGrazvydas Ignotas <notasas@gmail.com>
Sat, 19 Apr 2014 18:06:09 +0000 (21:06 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sat, 19 Apr 2014 23:09:30 +0000 (02:09 +0300)
drivers/net/wireless/wl1251/event.c
drivers/net/wireless/wl1251/ps.c

index bd1e90f..8c70b14 100644 (file)
@@ -109,12 +109,17 @@ static int wl1251_event_process(struct wl1251 *wl, struct event_mailbox *mbox)
                        if (ret < 0)
                                wl1251_error("beacon filter enable failed");
 
-               } else if (mbox->ps_status == ENTER_POWER_SAVE_FAIL)
-                       wl->station_mode = STATION_ACTIVE_MODE;
-               else if (mbox->ps_status == EXIT_POWER_SAVE_FAIL)
-                       wl->station_mode = STATION_POWER_SAVE_MODE;
+               } else if (wl->ps_transitioning) {
+                       if (mbox->ps_status == ENTER_POWER_SAVE_FAIL)
+                               wl->station_mode = STATION_ACTIVE_MODE;
+                       /* always happens on exit from idle - ignore for now
+                       else if (mbox->ps_status == EXIT_POWER_SAVE_FAIL)
+                               wl->station_mode = STATION_POWER_SAVE_MODE;
+                       */
+               }
 
-               //wl1251_error("ps_status %d", mbox->ps_status);
+               //wl1251_error("ps_status %d, mode %d",
+               //      mbox->ps_status, wl->station_mode);
                wl->ps_transitioning = false;
        }
 
index c449857..0dbdd24 100644 (file)
@@ -177,8 +177,9 @@ int wl1251_ps_set_mode(struct wl1251 *wl, enum wl1251_station_mode mode)
 
                break;
        }
+       if (mode != wl->station_mode)
+               wl->ps_transitioning = true;
        wl->station_mode = mode;
-       wl->ps_transitioning = true;
        wl->ps_change_jiffies = jiffies;
 
        return ret;