Commit 0b58486e authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman

staging: wfx: simplify wfx_set_mcast_filter()

HIF functions return only serious errors (OOM or device freeze). The
current handling of errors in wfx_set_mcast_filter() does not bring
anything. Finally it may disturb the developer more than it helps.
Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-38-Jerome.Pouiller@silabs.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent db949071
......@@ -116,7 +116,7 @@ int wfx_fwd_probe_req(struct wfx_vif *wvif, bool enable)
static int wfx_set_mcast_filter(struct wfx_vif *wvif,
struct wfx_grp_addr_table *fp)
{
int i, ret;
int i;
// Temporary workaround for filters
return hif_set_data_filtering(wvif, false, true);
......@@ -124,25 +124,15 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif,
if (!fp->enable)
return hif_set_data_filtering(wvif, false, true);
for (i = 0; i < fp->num_addresses; i++) {
ret = hif_set_mac_addr_condition(wvif, i, fp->address_list[i]);
if (ret)
return ret;
}
ret = hif_set_uc_mc_bc_condition(wvif, 0, HIF_FILTER_UNICAST |
HIF_FILTER_BROADCAST);
if (ret)
return ret;
for (i = 0; i < fp->num_addresses; i++)
hif_set_mac_addr_condition(wvif, i, fp->address_list[i]);
hif_set_uc_mc_bc_condition(wvif, 0,
HIF_FILTER_UNICAST | HIF_FILTER_BROADCAST);
hif_set_config_data_filter(wvif, true, 0, BIT(1),
BIT(fp->num_addresses) - 1);
hif_set_data_filtering(wvif, true, true);
ret = hif_set_config_data_filter(wvif, true, 0, BIT(1),
BIT(fp->num_addresses) - 1);
if (ret)
return ret;
ret = hif_set_data_filtering(wvif, true, true);
return ret;
return 0;
}
void wfx_update_filtering(struct wfx_vif *wvif)
......
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