Skip to content

Commit

Permalink
wlcore: check Rx-filter functions in the suspend path
Browse files Browse the repository at this point in the history
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: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
  • Loading branch information
Arik Nemtsov authored and Luciano Coelho committed Jun 23, 2012
1 parent ea0a3cf commit c439a1c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
27 changes: 21 additions & 6 deletions drivers/net/wireless/ti/wlcore/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1513,8 +1513,15 @@ static int wl1271_configure_wowlan(struct wl1271 *wl,
int i, ret;

if (!wow || wow->any || !wow->n_patterns) {
wl1271_acx_default_rx_filter_enable(wl, 0, FILTER_SIGNAL);
wl1271_rx_filter_clear_all(wl);
ret = wl1271_acx_default_rx_filter_enable(wl, 0,
FILTER_SIGNAL);
if (ret)
goto out;

ret = wl1271_rx_filter_clear_all(wl);
if (ret)
goto out;

return 0;
}

Expand All @@ -1530,8 +1537,13 @@ static int wl1271_configure_wowlan(struct wl1271 *wl,
}
}

wl1271_acx_default_rx_filter_enable(wl, 0, FILTER_SIGNAL);
wl1271_rx_filter_clear_all(wl);
ret = wl1271_acx_default_rx_filter_enable(wl, 0, FILTER_SIGNAL);
if (ret)
goto out;

ret = wl1271_rx_filter_clear_all(wl);
if (ret)
goto out;

/* Translate WoWLAN patterns into filters */
for (i = 0; i < wow->n_patterns; i++) {
Expand Down Expand Up @@ -1573,16 +1585,19 @@ static int wl1271_configure_suspend_sta(struct wl1271 *wl,
if (ret < 0)
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,
wl->conf.conn.suspend_wake_up_event,
wl->conf.conn.suspend_listen_interval);

if (ret < 0)
wl1271_error("suspend: set wake up conditions failed: %d", ret);

out_sleep:
wl1271_ps_elp_sleep(wl);

out:
return ret;

Expand Down
11 changes: 8 additions & 3 deletions drivers/net/wireless/ti/wlcore/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,19 @@ int wl1271_rx_filter_enable(struct wl1271 *wl,
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++) {
if (!wl->rx_filter_enabled[i])
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 */
2 changes: 1 addition & 1 deletion drivers/net/wireless/ti/wlcore/rx.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,6 @@ u8 wl1271_rate_to_idx(int rate, enum ieee80211_band band);
int wl1271_rx_filter_enable(struct wl1271 *wl,
int index, bool enable,
struct wl12xx_rx_filter *filter);
void wl1271_rx_filter_clear_all(struct wl1271 *wl);
int wl1271_rx_filter_clear_all(struct wl1271 *wl);

#endif

0 comments on commit c439a1c

Please sign in to comment.