wl1251: Prepare for idle mode support
[pandora-wifi.git] / drivers / net / wireless / wl12xx / wl1251_event.c
index 689ebed..070cd44 100644 (file)
@@ -72,14 +72,16 @@ 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 (vector & BSS_LOSE_EVENT_ID) {
                wl1251_debug(DEBUG_EVENT, "BSS_LOSE_EVENT");
 
-               if (wl->psm_requested && wl->psm) {
+               if (wl->psm_requested &&
+                   wl->station_mode != STATION_ACTIVE_MODE) {
                        ret = wl1251_ps_set_mode(wl, STATION_ACTIVE_MODE);
                        if (ret < 0)
                                return ret;
                }
        }
 
                        ret = wl1251_ps_set_mode(wl, STATION_ACTIVE_MODE);
                        if (ret < 0)
                                return ret;
                }
        }
 
-       if (vector & SYNCHRONIZATION_TIMEOUT_EVENT_ID) {
+       if (vector & SYNCHRONIZATION_TIMEOUT_EVENT_ID &&
+           wl->station_mode != STATION_ACTIVE_MODE) {
                wl1251_debug(DEBUG_EVENT, "SYNCHRONIZATION_TIMEOUT_EVENT");
                /* need to unlock mutex to avoid deadlocking with rtnl */
                mutex_unlock(&wl->mutex);
                wl1251_debug(DEBUG_EVENT, "SYNCHRONIZATION_TIMEOUT_EVENT");
                /* need to unlock mutex to avoid deadlocking with rtnl */
                mutex_unlock(&wl->mutex);