ROAMING_TRIGGER_LOW_RSSI_EVENT_ID |
ROAMING_TRIGGER_REGAINED_RSSI_EVENT_ID |
REGAINED_BSS_EVENT_ID | BT_PTA_SENSE_EVENT_ID |
- BT_PTA_PREDICTION_EVENT_ID | JOIN_EVENT_COMPLETE_ID;
+ BT_PTA_PREDICTION_EVENT_ID | JOIN_EVENT_COMPLETE_ID |
+ PS_REPORT_EVENT_ID;
ret = wl1251_event_unmask(wl);
if (ret < 0) {
return 0;
}
+#define WL1251_PS_ENTRY_RETRIES 3
+static int wl1251_event_ps_report(struct wl1251 *wl,
+ struct event_mailbox *mbox)
+{
+ int ret = 0;
+
+ wl1251_debug(DEBUG_EVENT, "ps status: %x", mbox->ps_status);
+
+ switch (mbox->ps_status) {
+ case ENTER_POWER_SAVE_FAIL:
+ if (!wl->psm) {
+ wl->ps_entry_retry = 0;
+ break;
+ }
+
+ if (wl->ps_entry_retry < WL1251_PS_ENTRY_RETRIES) {
+ ret = wl1251_ps_set_mode(wl, STATION_POWER_SAVE_MODE);
+ wl->ps_entry_retry++;
+ } else {
+ wl1251_error("Power save entry failed, giving up");
+ wl->ps_entry_retry = 0;
+ }
+ break;
+ case ENTER_POWER_SAVE_SUCCESS:
+ default:
+ wl->ps_entry_retry = 0;
+ break;
+ }
+
+ return 0;
+}
+
static void wl1251_event_mbox_dump(struct event_mailbox *mbox)
{
wl1251_debug(DEBUG_EVENT, "MBOX DUMP:");
}
}
+ if (vector & PS_REPORT_EVENT_ID) {
+ wl1251_debug(DEBUG_EVENT, "PS_REPORT_EVENT_ID");
+ ret = wl1251_event_ps_report(wl, mbox);
+ if (ret < 0)
+ return ret;
+ }
+
if (vector & SYNCHRONIZATION_TIMEOUT_EVENT_ID) {
wl1251_debug(DEBUG_EVENT, "SYNCHRONIZATION_TIMEOUT_EVENT");
/* need to unlock mutex to avoid deadlocking with rtnl */
EVENT_MBOX_ALL_EVENT_ID = 0x7fffffff,
};
+enum {
+ ENTER_POWER_SAVE_FAIL = 0,
+ ENTER_POWER_SAVE_SUCCESS,
+ EXIT_POWER_SAVE_FAIL,
+ EXIT_POWER_SAVE_SUCCESS
+};
+
struct event_debug_report {
u8 debug_event_id;
u8 num_params;
wl->next_tx_complete = 0;
wl->elp = false;
wl->psm = 0;
+ wl->ps_entry_retry = 0;
wl->tx_queue_stopped = false;
wl->power_level = WL1251_DEFAULT_POWER_LEVEL;
wl->channel = WL1251_DEFAULT_CHANNEL;
wl->elp = false;
wl->psm = 0;
wl->psm_requested = false;
+ wl->ps_entry_retry = 0;
wl->tx_queue_stopped = false;
wl->power_level = WL1251_DEFAULT_POWER_LEVEL;
wl->beacon_int = WL1251_DEFAULT_BEACON_INT;