if (vector & BSS_LOSE_EVENT_ID) {
wl1251_debug(DEBUG_EVENT, "BSS_LOSE_EVENT");
-
- if (wl->psm_requested &&
- wl->station_mode != STATION_ACTIVE_MODE) {
- ret = wl1251_ps_set_mode(wl, STATION_ACTIVE_MODE);
- if (ret < 0)
- return ret;
- }
+ wl->bss_lost = 1;
+ ieee80211_queue_delayed_work(wl->hw, &wl->ps_work, 0);
}
if (vector & SYNCHRONIZATION_TIMEOUT_EVENT_ID) {
}
if (vector & REGAINED_BSS_EVENT_ID) {
- if (wl->psm_requested) {
- ret = wl1251_ps_set_mode(wl, STATION_POWER_SAVE_MODE);
- if (ret < 0)
- return ret;
- }
+ wl->bss_lost = 0;
+ ieee80211_queue_delayed_work(wl->hw, &wl->ps_work, 0);
}
if (wl->vif && wl->rssi_thold) {
}
}
+ if (vector & PS_REPORT_EVENT_ID) {
+ if (mbox->ps_status == ENTER_POWER_SAVE_SUCCESS) {
+ /* enable beacon filtering */
+ ret = wl1251_acx_beacon_filter_opt(wl, true);
+ if (ret < 0)
+ wl1251_error("beacon filter enable failed");
+
+ } 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, mode %d",
+ // mbox->ps_status, wl->station_mode);
+ wl->ps_transitioning = false;
+ }
+
return 0;
}