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

staging: wfx: simplify wfx_update_filtering()

wfx_update_filtering() has no reason to instantiate a struct
hif_mib_bcn_filter_enable. Drop it and simplify the code.
Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-39-Jerome.Pouiller@silabs.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0b58486e
......@@ -138,10 +138,9 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif,
void wfx_update_filtering(struct wfx_vif *wvif)
{
int ret;
bool is_sta = wvif->vif && NL80211_IFTYPE_STATION == wvif->vif->type;
bool filter_bssid = wvif->filter_bssid;
bool fwd_probe_req = wvif->fwd_probe_req;
struct hif_mib_bcn_filter_enable bf_ctrl;
int bf_enable;
int bf_count;
int n_filter_ies;
struct hif_ie_table_entry filter_ies[] = {
{
.ie_id = WLAN_EID_VENDOR_SPECIFIC,
......@@ -161,33 +160,29 @@ void wfx_update_filtering(struct wfx_vif *wvif)
.has_appeared = 1,
}
};
int n_filter_ies;
if (wvif->state == WFX_STATE_PASSIVE)
return;
if (wvif->disable_beacon_filter) {
bf_ctrl.enable = 0;
bf_ctrl.bcn_count = 1;
bf_enable = 0;
bf_count = 1;
n_filter_ies = 0;
} else if (!is_sta) {
bf_ctrl.enable = HIF_BEACON_FILTER_ENABLE |
HIF_BEACON_FILTER_AUTO_ERP;
bf_ctrl.bcn_count = 0;
} else if (wvif->vif->type != NL80211_IFTYPE_STATION) {
bf_enable = HIF_BEACON_FILTER_ENABLE | HIF_BEACON_FILTER_AUTO_ERP;
bf_count = 0;
n_filter_ies = 2;
} else {
bf_ctrl.enable = HIF_BEACON_FILTER_ENABLE;
bf_ctrl.bcn_count = 0;
bf_enable = HIF_BEACON_FILTER_ENABLE;
bf_count = 0;
n_filter_ies = 3;
}
ret = hif_set_rx_filter(wvif, filter_bssid, fwd_probe_req);
ret = hif_set_rx_filter(wvif, wvif->filter_bssid, wvif->fwd_probe_req);
if (!ret)
ret = hif_set_beacon_filter_table(wvif, n_filter_ies,
filter_ies);
ret = hif_set_beacon_filter_table(wvif, n_filter_ies, filter_ies);
if (!ret)
ret = hif_beacon_filter_control(wvif, bf_ctrl.enable,
bf_ctrl.bcn_count);
ret = hif_beacon_filter_control(wvif, bf_enable, bf_count);
if (!ret)
ret = wfx_set_mcast_filter(wvif, &wvif->mcast_filter);
if (ret)
......
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