Commit c439a1ca authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Luciano Coelho

wlcore: check Rx-filter functions in the suspend path

Propagate some missing return values for Rx-filter related functions.
This and makes sure we always fail the suspend in case of SDIO errors.
Signed-off-by: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent ea0a3cf9
...@@ -1513,8 +1513,15 @@ static int wl1271_configure_wowlan(struct wl1271 *wl, ...@@ -1513,8 +1513,15 @@ static int wl1271_configure_wowlan(struct wl1271 *wl,
int i, ret; int i, ret;
if (!wow || wow->any || !wow->n_patterns) { if (!wow || wow->any || !wow->n_patterns) {
wl1271_acx_default_rx_filter_enable(wl, 0, FILTER_SIGNAL); ret = wl1271_acx_default_rx_filter_enable(wl, 0,
wl1271_rx_filter_clear_all(wl); FILTER_SIGNAL);
if (ret)
goto out;
ret = wl1271_rx_filter_clear_all(wl);
if (ret)
goto out;
return 0; return 0;
} }
...@@ -1530,8 +1537,13 @@ static int wl1271_configure_wowlan(struct wl1271 *wl, ...@@ -1530,8 +1537,13 @@ static int wl1271_configure_wowlan(struct wl1271 *wl,
} }
} }
wl1271_acx_default_rx_filter_enable(wl, 0, FILTER_SIGNAL); ret = wl1271_acx_default_rx_filter_enable(wl, 0, FILTER_SIGNAL);
wl1271_rx_filter_clear_all(wl); if (ret)
goto out;
ret = wl1271_rx_filter_clear_all(wl);
if (ret)
goto out;
/* Translate WoWLAN patterns into filters */ /* Translate WoWLAN patterns into filters */
for (i = 0; i < wow->n_patterns; i++) { for (i = 0; i < wow->n_patterns; i++) {
...@@ -1573,7 +1585,10 @@ static int wl1271_configure_suspend_sta(struct wl1271 *wl, ...@@ -1573,7 +1585,10 @@ static int wl1271_configure_suspend_sta(struct wl1271 *wl,
if (ret < 0) if (ret < 0)
goto out; goto out;
wl1271_configure_wowlan(wl, wow); ret = wl1271_configure_wowlan(wl, wow);
if (ret < 0)
goto out_sleep;
ret = wl1271_acx_wake_up_conditions(wl, wlvif, ret = wl1271_acx_wake_up_conditions(wl, wlvif,
wl->conf.conn.suspend_wake_up_event, wl->conf.conn.suspend_wake_up_event,
wl->conf.conn.suspend_listen_interval); wl->conf.conn.suspend_listen_interval);
...@@ -1581,8 +1596,8 @@ static int wl1271_configure_suspend_sta(struct wl1271 *wl, ...@@ -1581,8 +1596,8 @@ static int wl1271_configure_suspend_sta(struct wl1271 *wl,
if (ret < 0) if (ret < 0)
wl1271_error("suspend: set wake up conditions failed: %d", ret); wl1271_error("suspend: set wake up conditions failed: %d", ret);
out_sleep:
wl1271_ps_elp_sleep(wl); wl1271_ps_elp_sleep(wl);
out: out:
return ret; return ret;
......
...@@ -318,14 +318,19 @@ int wl1271_rx_filter_enable(struct wl1271 *wl, ...@@ -318,14 +318,19 @@ int wl1271_rx_filter_enable(struct wl1271 *wl,
return 0; return 0;
} }
void wl1271_rx_filter_clear_all(struct wl1271 *wl) int wl1271_rx_filter_clear_all(struct wl1271 *wl)
{ {
int i; int i, ret = 0;
for (i = 0; i < WL1271_MAX_RX_FILTERS; i++) { for (i = 0; i < WL1271_MAX_RX_FILTERS; i++) {
if (!wl->rx_filter_enabled[i]) if (!wl->rx_filter_enabled[i])
continue; continue;
wl1271_rx_filter_enable(wl, i, 0, NULL); ret = wl1271_rx_filter_enable(wl, i, 0, NULL);
if (ret)
goto out;
} }
out:
return ret;
} }
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
...@@ -148,6 +148,6 @@ u8 wl1271_rate_to_idx(int rate, enum ieee80211_band band); ...@@ -148,6 +148,6 @@ u8 wl1271_rate_to_idx(int rate, enum ieee80211_band band);
int wl1271_rx_filter_enable(struct wl1271 *wl, int wl1271_rx_filter_enable(struct wl1271 *wl,
int index, bool enable, int index, bool enable,
struct wl12xx_rx_filter *filter); struct wl12xx_rx_filter *filter);
void wl1271_rx_filter_clear_all(struct wl1271 *wl); int wl1271_rx_filter_clear_all(struct wl1271 *wl);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment