Commit 02d0727c authored by Nadim Zubidat's avatar Nadim Zubidat Committed by John W. Linville

wlcore: memset wl->rx_filter_enabled to zero after recovery

zero rx_filter_enabled array after recovery to avoid
cases were the driver will keep trying to clear a
filter which is not configured in FW.

Such case will cause consecutive recoveries due to
command execution failures.

While on it, convert rx_filter_enabled to bitmap,
to save some memory and make sparse happy (it
doesn't like sizeof(bool array)).
Signed-off-by: default avatarNadim Zubidat <nadimz@ti.com>
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent bb6bd25c
...@@ -1914,6 +1914,7 @@ static void wlcore_op_stop_locked(struct wl1271 *wl) ...@@ -1914,6 +1914,7 @@ static void wlcore_op_stop_locked(struct wl1271 *wl)
memset(wl->links_map, 0, sizeof(wl->links_map)); memset(wl->links_map, 0, sizeof(wl->links_map));
memset(wl->roc_map, 0, sizeof(wl->roc_map)); memset(wl->roc_map, 0, sizeof(wl->roc_map));
memset(wl->session_ids, 0, sizeof(wl->session_ids)); memset(wl->session_ids, 0, sizeof(wl->session_ids));
memset(wl->rx_filter_enabled, 0, sizeof(wl->rx_filter_enabled));
wl->active_sta_count = 0; wl->active_sta_count = 0;
wl->active_link_count = 0; wl->active_link_count = 0;
......
...@@ -302,7 +302,7 @@ int wl1271_rx_filter_enable(struct wl1271 *wl, ...@@ -302,7 +302,7 @@ int wl1271_rx_filter_enable(struct wl1271 *wl,
{ {
int ret; int ret;
if (wl->rx_filter_enabled[index] == enable) { if (!!test_bit(index, wl->rx_filter_enabled) == enable) {
wl1271_warning("Request to enable an already " wl1271_warning("Request to enable an already "
"enabled rx filter %d", index); "enabled rx filter %d", index);
return 0; return 0;
...@@ -316,7 +316,10 @@ int wl1271_rx_filter_enable(struct wl1271 *wl, ...@@ -316,7 +316,10 @@ int wl1271_rx_filter_enable(struct wl1271 *wl,
return ret; return ret;
} }
wl->rx_filter_enabled[index] = enable; if (enable)
__set_bit(index, wl->rx_filter_enabled);
else
__clear_bit(index, wl->rx_filter_enabled);
return 0; return 0;
} }
...@@ -326,7 +329,7 @@ int wl1271_rx_filter_clear_all(struct wl1271 *wl) ...@@ -326,7 +329,7 @@ int wl1271_rx_filter_clear_all(struct wl1271 *wl)
int i, ret = 0; 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 (!test_bit(i, wl->rx_filter_enabled))
continue; continue;
ret = wl1271_rx_filter_enable(wl, i, 0, NULL); ret = wl1271_rx_filter_enable(wl, i, 0, NULL);
if (ret) if (ret)
......
...@@ -451,7 +451,7 @@ struct wl1271 { ...@@ -451,7 +451,7 @@ struct wl1271 {
size_t fw_status_priv_len; size_t fw_status_priv_len;
/* RX Data filter rule state - enabled/disabled */ /* RX Data filter rule state - enabled/disabled */
bool rx_filter_enabled[WL1271_MAX_RX_FILTERS]; unsigned long rx_filter_enabled[BITS_TO_LONGS(WL1271_MAX_RX_FILTERS)];
/* size of the private static data */ /* size of the private static data */
size_t static_data_priv_len; size_t static_data_priv_len;
......
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