From: Jerome Pouiller <Jerome.Pouiller@silabs.com>
To: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Kalle Valo" <kvalo@codeaurora.org>,
"David S . Miller" <davem@davemloft.net>,
"Jérôme Pouiller" <jerome.pouiller@silabs.com>
Subject: [PATCH 14/20] staging: wfx: drop struct wfx_grp_addr_table
Date: Wed, 15 Apr 2020 18:11:41 +0200 [thread overview]
Message-ID: <20200415161147.69738-15-Jerome.Pouiller@silabs.com> (raw)
In-Reply-To: <20200415161147.69738-1-Jerome.Pouiller@silabs.com>
From: Jérôme Pouiller <jerome.pouiller@silabs.com>
The struct wfx_grp_addr_table is only instantiated on one place. There
is no justifiation for this struct. Moreover, it is not consistent with
other fields related to filtering (filter_bssid, etc...).
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
drivers/staging/wfx/sta.c | 28 +++++++++++++---------------
drivers/staging/wfx/sta.h | 6 ------
drivers/staging/wfx/wfx.h | 4 +++-
3 files changed, 16 insertions(+), 22 deletions(-)
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 3a105d485237..70342bdd9d96 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -149,17 +149,16 @@ void wfx_update_filtering(struct wfx_vif *wvif)
hif_set_data_filtering(wvif, false, true);
return;
- if (!wvif->mcast_filter.enable) {
+ if (!wvif->filter_mcast) {
hif_set_data_filtering(wvif, false, true);
return;
}
- for (i = 0; i < wvif->mcast_filter.num_addresses; i++)
- hif_set_mac_addr_condition(wvif, i,
- wvif->mcast_filter.address_list[i]);
+ for (i = 0; i < wvif->filter_mcast_count; i++)
+ hif_set_mac_addr_condition(wvif, i, wvif->filter_mcast_addr[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(wvif->mcast_filter.num_addresses) - 1);
+ BIT(wvif->filter_mcast_count) - 1);
hif_set_data_filtering(wvif, true, true);
}
@@ -173,18 +172,17 @@ u64 wfx_prepare_multicast(struct ieee80211_hw *hw,
int count = netdev_hw_addr_list_count(mc_list);
while ((wvif = wvif_iterate(wdev, wvif)) != NULL) {
- memset(&wvif->mcast_filter, 0x00, sizeof(wvif->mcast_filter));
- if (!count ||
- count > ARRAY_SIZE(wvif->mcast_filter.address_list))
+ if (count > ARRAY_SIZE(wvif->filter_mcast_addr)) {
+ wvif->filter_mcast_count = 0;
continue;
+ }
+ wvif->filter_mcast_count = count;
i = 0;
netdev_hw_addr_list_for_each(ha, mc_list) {
- ether_addr_copy(wvif->mcast_filter.address_list[i],
- ha->addr);
+ ether_addr_copy(wvif->filter_mcast_addr[i], ha->addr);
i++;
}
- wvif->mcast_filter.num_addresses = count;
}
return 0;
@@ -220,12 +218,12 @@ void wfx_configure_filter(struct ieee80211_hw *hw,
wvif->filter_beacon = true;
if (*total_flags & FIF_ALLMULTI) {
- wvif->mcast_filter.enable = false;
- } else if (!wvif->mcast_filter.num_addresses) {
+ wvif->filter_mcast = false;
+ } else if (!wvif->filter_mcast_count) {
dev_dbg(wdev->dev, "disabling unconfigured multicast filter");
- wvif->mcast_filter.enable = false;
+ wvif->filter_mcast = false;
} else {
- wvif->mcast_filter.enable = true;
+ wvif->filter_mcast = true;
}
wfx_update_filtering(wvif);
diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h
index a90eaf5043a8..31097057563a 100644
--- a/drivers/staging/wfx/sta.h
+++ b/drivers/staging/wfx/sta.h
@@ -28,12 +28,6 @@ struct wfx_hif_event {
struct hif_ind_event evt;
};
-struct wfx_grp_addr_table {
- bool enable;
- int num_addresses;
- u8 address_list[8][ETH_ALEN];
-};
-
struct wfx_sta_priv {
int link_id;
int vif_id;
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 3941462097a4..53184fe2da4b 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -77,7 +77,6 @@ struct wfx_vif {
u32 link_id_map;
bool after_dtim_tx_allowed;
- struct wfx_grp_addr_table mcast_filter;
s8 wep_default_key_id;
struct sk_buff *wep_pending_skb;
@@ -88,6 +87,9 @@ struct wfx_vif {
struct work_struct update_tim_work;
+ int filter_mcast_count;
+ u8 filter_mcast_addr[8][ETH_ALEN];
+ bool filter_mcast;
bool filter_bssid;
bool filter_prbreq;
bool filter_beacon;
--
2.25.1
next prev parent reply other threads:[~2020-04-15 16:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-15 16:11 [PATCH 00/20] staging: wfx: simplify filtering Jerome Pouiller
2020-04-15 16:11 ` [PATCH 01/20] staging: wfx: update filtering even if not connected Jerome Pouiller
2020-04-15 16:11 ` [PATCH 02/20] staging: wfx: simplify wfx_update_filtering() Jerome Pouiller
2020-04-15 16:11 ` [PATCH 03/20] staging: wfx: rework wfx_configure_filter() Jerome Pouiller
2020-04-15 16:11 ` [PATCH 04/20] staging: wfx: simplify handling of beacon filter during join process Jerome Pouiller
2020-04-15 16:11 ` [PATCH 05/20] staging: wfx: wfx_update_filtering_work() is no more used Jerome Pouiller
2020-04-15 16:11 ` [PATCH 06/20] staging: wfx: do not wait for a dtim before associate Jerome Pouiller
2020-04-15 16:11 ` [PATCH 07/20] staging: wfx: disabling beacon filtering after hif_reset() is useless Jerome Pouiller
2020-04-15 16:11 ` [PATCH 08/20] staging: wfx: do not use built-in AUTO_ERP feature Jerome Pouiller
2020-04-15 16:11 ` [PATCH 09/20] staging: wfx: stop changing filtering rule in wfx_hw_scan() Jerome Pouiller
2020-04-15 16:11 ` [PATCH 10/20] staging: wfx: ensure that probe requests are filtered when AP Jerome Pouiller
2020-04-15 16:11 ` [PATCH 11/20] staging: wfx: drop useless wfx_fwd_probe_req() Jerome Pouiller
2020-04-15 16:11 ` [PATCH 12/20] staging: wfx: align semantic of beacon filter with other filters Jerome Pouiller
2020-04-16 13:52 ` Dan Carpenter
2020-04-15 16:11 ` [PATCH 13/20] staging: wfx: align semantic of probe request " Jerome Pouiller
2020-04-15 16:11 ` Jerome Pouiller [this message]
2020-04-15 16:11 ` [PATCH 15/20] staging: wfx: drop useless call to hif_set_rx_filter() Jerome Pouiller
2020-04-15 16:11 ` [PATCH 16/20] staging: wfx: drop useless attributes 'filter_prbreq' and 'filter_bssid' Jerome Pouiller
2020-04-15 16:11 ` [PATCH 17/20] staging: wfx: split out wfx_filter_beacon() Jerome Pouiller
2020-04-15 16:11 ` [PATCH 18/20] staging: wfx: drop useless filter update when starting AP Jerome Pouiller
2020-04-15 16:11 ` [PATCH 19/20] staging: wfx: drop useless attribute 'filter_mcast' Jerome Pouiller
2020-04-15 16:11 ` [PATCH 20/20] staging: wfx: update TODO Jerome Pouiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200415161147.69738-15-Jerome.Pouiller@silabs.com \
--to=jerome.pouiller@silabs.com \
--cc=davem@davemloft.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox