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, ...@@ -138,10 +138,9 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif,
void wfx_update_filtering(struct wfx_vif *wvif) void wfx_update_filtering(struct wfx_vif *wvif)
{ {
int ret; int ret;
bool is_sta = wvif->vif && NL80211_IFTYPE_STATION == wvif->vif->type; int bf_enable;
bool filter_bssid = wvif->filter_bssid; int bf_count;
bool fwd_probe_req = wvif->fwd_probe_req; int n_filter_ies;
struct hif_mib_bcn_filter_enable bf_ctrl;
struct hif_ie_table_entry filter_ies[] = { struct hif_ie_table_entry filter_ies[] = {
{ {
.ie_id = WLAN_EID_VENDOR_SPECIFIC, .ie_id = WLAN_EID_VENDOR_SPECIFIC,
...@@ -161,33 +160,29 @@ void wfx_update_filtering(struct wfx_vif *wvif) ...@@ -161,33 +160,29 @@ void wfx_update_filtering(struct wfx_vif *wvif)
.has_appeared = 1, .has_appeared = 1,
} }
}; };
int n_filter_ies;
if (wvif->state == WFX_STATE_PASSIVE) if (wvif->state == WFX_STATE_PASSIVE)
return; return;
if (wvif->disable_beacon_filter) { if (wvif->disable_beacon_filter) {
bf_ctrl.enable = 0; bf_enable = 0;
bf_ctrl.bcn_count = 1; bf_count = 1;
n_filter_ies = 0; n_filter_ies = 0;
} else if (!is_sta) { } else if (wvif->vif->type != NL80211_IFTYPE_STATION) {
bf_ctrl.enable = HIF_BEACON_FILTER_ENABLE | bf_enable = HIF_BEACON_FILTER_ENABLE | HIF_BEACON_FILTER_AUTO_ERP;
HIF_BEACON_FILTER_AUTO_ERP; bf_count = 0;
bf_ctrl.bcn_count = 0;
n_filter_ies = 2; n_filter_ies = 2;
} else { } else {
bf_ctrl.enable = HIF_BEACON_FILTER_ENABLE; bf_enable = HIF_BEACON_FILTER_ENABLE;
bf_ctrl.bcn_count = 0; bf_count = 0;
n_filter_ies = 3; 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) if (!ret)
ret = hif_set_beacon_filter_table(wvif, n_filter_ies, ret = hif_set_beacon_filter_table(wvif, n_filter_ies, filter_ies);
filter_ies);
if (!ret) if (!ret)
ret = hif_beacon_filter_control(wvif, bf_ctrl.enable, ret = hif_beacon_filter_control(wvif, bf_enable, bf_count);
bf_ctrl.bcn_count);
if (!ret) if (!ret)
ret = wfx_set_mcast_filter(wvif, &wvif->mcast_filter); ret = wfx_set_mcast_filter(wvif, &wvif->mcast_filter);
if (ret) 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