X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=drivers%2Fnet%2Fwireless%2Fwl1251%2Fevent.c;h=8c70b14b9191e8577037a3ac9b4e2e45cefdcbb3;hp=9f15ccaf8f05aec733882e98a3ff443fdb5737d0;hb=48f7897661fb92e22369766cdf6729fff74f9139;hpb=05d3962cc921c51059df69488c7f70ab8b6a5d88 diff --git a/drivers/net/wireless/wl1251/event.c b/drivers/net/wireless/wl1251/event.c index 9f15ccaf8f05..8c70b14b9191 100644 --- a/drivers/net/wireless/wl1251/event.c +++ b/drivers/net/wireless/wl1251/event.c @@ -67,29 +67,21 @@ static int wl1251_event_process(struct wl1251 *wl, struct event_mailbox *mbox) 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 && - wl->station_mode != STATION_ACTIVE_MODE) { + if (vector & SYNCHRONIZATION_TIMEOUT_EVENT_ID) { wl1251_debug(DEBUG_EVENT, "SYNCHRONIZATION_TIMEOUT_EVENT"); /* indicate to the stack, that beacons have been lost */ - ieee80211_beacon_loss(wl->vif); + if (wl->vif && wl->vif->type == NL80211_IFTYPE_STATION) + ieee80211_beacon_loss(wl->vif); } 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) { @@ -110,6 +102,27 @@ static int wl1251_event_process(struct wl1251 *wl, struct event_mailbox *mbox) } } + 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; }