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

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.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent db949071
Loading
Loading
Loading
Loading
+9 −19
Original line number Diff line number Diff line
@@ -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;

	ret = hif_set_config_data_filter(wvif, true, 0, BIT(1),
	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);
	if (ret)
		return ret;
	hif_set_data_filtering(wvif, true, true);

	ret = hif_set_data_filtering(wvif, true, true);

	return ret;
	return 0;
}

void wfx_update_filtering(struct wfx_vif *wvif)