wlcore: check Rx-filter functions in the suspend path
authorArik Nemtsov <arik@wizery.com>
Thu, 21 Jun 2012 15:10:50 +0000 (18:10 +0300)
committerLuciano Coelho <coelho@ti.com>
Sat, 23 Jun 2012 06:32:32 +0000 (09:32 +0300)
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>
drivers/net/wireless/ti/wlcore/main.c
drivers/net/wireless/ti/wlcore/rx.c
drivers/net/wireless/ti/wlcore/rx.h

index 0b51522..e6e6654 100644 (file)
@@ -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;
        }
 
@@ -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++) {
@@ -1573,7 +1585,10 @@ 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);
@@ -1581,8 +1596,8 @@ static int wl1271_configure_suspend_sta(struct wl1271 *wl,
        if (ret < 0)
                wl1271_error("suspend: set wake up conditions failed: %d", ret);
 
+out_sleep:
        wl1271_ps_elp_sleep(wl);
-
 out:
        return ret;
 
index f42b969..f55e2f9 100644 (file)
@@ -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 */
index 79f7839..71eba18 100644 (file)
@@ -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