staging: wfx: drop multicast filtering
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Mon, 7 Sep 2020 10:14:56 +0000 (12:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2020 07:23:01 +0000 (09:23 +0200)
The device allows to filter multicast frames. The driver has the
necessary code to take advantage of this feature. However, some bugs
has been reported on this feature. So, it was temporary disabled.

Finally, the things work well as-is for more than one year now. So there
is no plan to enable this feature in near future.

Since we dislike to maintain dead code, drop it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/hif_api_mib.h
drivers/staging/wfx/hif_tx_mib.c
drivers/staging/wfx/hif_tx_mib.h
drivers/staging/wfx/main.c
drivers/staging/wfx/sta.c
drivers/staging/wfx/sta.h
drivers/staging/wfx/wfx.h

index 6f14347..d0e0a9e 100644 (file)
@@ -82,42 +82,6 @@ struct hif_mib_gl_set_multi_msg {
        u8     reserved2[3];
 } __packed;
 
-enum hif_mac_addr_type {
-       HIF_MAC_ADDR_A1 = 0x0,
-       HIF_MAC_ADDR_A2 = 0x1,
-       HIF_MAC_ADDR_A3 = 0x2
-};
-
-struct hif_mib_mac_addr_data_frame_condition {
-       u8     condition_idx;
-       u8     address_type;
-       u8     mac_address[ETH_ALEN];
-} __packed;
-
-#define HIF_FILTER_UNICAST   0x1
-#define HIF_FILTER_MULTICAST 0x2
-#define HIF_FILTER_BROADCAST 0x4
-
-struct hif_mib_uc_mc_bc_data_frame_condition {
-       u8     condition_idx;
-       u8     allowed_frames;
-       u8     reserved[2];
-} __packed;
-
-struct hif_mib_config_data_filter {
-       u8     filter_idx;
-       u8     enable;
-       u8     reserved1[2];
-       u8     eth_type_cond;
-       u8     port_cond;
-       u8     magic_cond;
-       u8     mac_cond;
-       u8     ipv4_cond;
-       u8     ipv6_cond;
-       u8     uc_mc_bc_cond;
-       u8     reserved2;
-} __packed;
-
 struct hif_mib_set_data_filtering {
        u8     invert_matching:1;
        u8     reserved1:7;
index 3b20b74..7f24e9f 100644 (file)
@@ -228,46 +228,6 @@ int hif_set_tx_rate_retry_policy(struct wfx_vif *wvif,
        return ret;
 }
 
-int hif_set_mac_addr_condition(struct wfx_vif *wvif,
-                              int idx, const u8 *mac_addr)
-{
-       struct hif_mib_mac_addr_data_frame_condition val = {
-               .condition_idx = idx,
-               .address_type = HIF_MAC_ADDR_A1,
-       };
-
-       ether_addr_copy(val.mac_address, mac_addr);
-       return hif_write_mib(wvif->wdev, wvif->id,
-                            HIF_MIB_ID_MAC_ADDR_DATAFRAME_CONDITION,
-                            &val, sizeof(val));
-}
-
-int hif_set_uc_mc_bc_condition(struct wfx_vif *wvif, int idx, u8 allowed_frames)
-{
-       struct hif_mib_uc_mc_bc_data_frame_condition val = {
-               .condition_idx = idx,
-               .allowed_frames = allowed_frames,
-       };
-
-       return hif_write_mib(wvif->wdev, wvif->id,
-                            HIF_MIB_ID_UC_MC_BC_DATAFRAME_CONDITION,
-                            &val, sizeof(val));
-}
-
-int hif_set_config_data_filter(struct wfx_vif *wvif, bool enable, int idx,
-                              int mac_filters, int frames_types_filters)
-{
-       struct hif_mib_config_data_filter val = {
-               .enable = enable,
-               .filter_idx = idx,
-               .mac_cond = mac_filters,
-               .uc_mc_bc_cond = frames_types_filters,
-       };
-
-       return hif_write_mib(wvif->wdev, wvif->id,
-                            HIF_MIB_ID_CONFIG_DATA_FILTER, &val, sizeof(val));
-}
-
 int hif_set_data_filtering(struct wfx_vif *wvif, bool enable, bool invert)
 {
        struct hif_mib_set_data_filtering val = {
index 1a6f422..d4cac63 100644 (file)
@@ -37,12 +37,6 @@ int hif_set_association_mode(struct wfx_vif *wvif, int ampdu_density,
                             bool greenfield, bool short_preamble);
 int hif_set_tx_rate_retry_policy(struct wfx_vif *wvif,
                                 int policy_index, u8 *rates);
-int hif_set_mac_addr_condition(struct wfx_vif *wvif,
-                              int idx, const u8 *mac_addr);
-int hif_set_uc_mc_bc_condition(struct wfx_vif *wvif,
-                              int idx, u8 allowed_frames);
-int hif_set_config_data_filter(struct wfx_vif *wvif, bool enable, int idx,
-                              int mac_filters, int frames_types_filters);
 int hif_set_data_filtering(struct wfx_vif *wvif, bool enable, bool invert);
 int hif_keep_alive_period(struct wfx_vif *wvif, int period);
 int hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx, __be32 *addr);
index 2af4914..1017a22 100644 (file)
@@ -142,7 +142,6 @@ static const struct ieee80211_ops wfx_ops = {
        .set_rts_threshold      = wfx_set_rts_threshold,
        .set_default_unicast_key = wfx_set_default_unicast_key,
        .bss_info_changed       = wfx_bss_info_changed,
-       .prepare_multicast      = wfx_prepare_multicast,
        .configure_filter       = wfx_configure_filter,
        .ampdu_action           = wfx_ampdu_action,
        .flush                  = wfx_flush,
index feebb7c..8700d2f 100644 (file)
@@ -91,59 +91,12 @@ static void wfx_filter_beacon(struct wfx_vif *wvif, bool filter_beacon)
        }
 }
 
-static void wfx_filter_mcast(struct wfx_vif *wvif, bool filter_mcast)
-{
-       int i;
-
-       // Temporary workaround for filters
-       hif_set_data_filtering(wvif, false, true);
-       return;
-
-       if (!filter_mcast) {
-               hif_set_data_filtering(wvif, false, true);
-               return;
-       }
-       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->filter_mcast_count) - 1);
-       hif_set_data_filtering(wvif, true, true);
-}
-
-u64 wfx_prepare_multicast(struct ieee80211_hw *hw,
-                         struct netdev_hw_addr_list *mc_list)
-{
-       int i;
-       struct netdev_hw_addr *ha;
-       struct wfx_vif *wvif = NULL;
-       struct wfx_dev *wdev = hw->priv;
-       int count = netdev_hw_addr_list_count(mc_list);
-
-       while ((wvif = wvif_iterate(wdev, wvif)) != NULL) {
-               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->filter_mcast_addr[i], ha->addr);
-                       i++;
-               }
-       }
-
-       return 0;
-}
-
 void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
                          unsigned int *total_flags, u64 unused)
 {
        struct wfx_vif *wvif = NULL;
        struct wfx_dev *wdev = hw->priv;
-       bool filter_bssid, filter_prbreq, filter_beacon, filter_mcast;
+       bool filter_bssid, filter_prbreq, filter_beacon;
 
        // Notes:
        //   - Probe responses (FIF_BCN_PRBRESP_PROMISC) are never filtered
@@ -167,15 +120,7 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
                        filter_beacon = true;
                wfx_filter_beacon(wvif, filter_beacon);
 
-               if (*total_flags & FIF_ALLMULTI) {
-                       filter_mcast = false;
-               } else if (!wvif->filter_mcast_count) {
-                       dev_dbg(wdev->dev, "disabling unconfigured multicast filter");
-                       filter_mcast = false;
-               } else {
-                       filter_mcast = true;
-               }
-               wfx_filter_mcast(wvif, filter_mcast);
+               hif_set_data_filtering(wvif, false, true);
 
                if (*total_flags & FIF_OTHER_BSS)
                        filter_bssid = false;
index 6b15a64..610cfb0 100644 (file)
@@ -25,8 +25,6 @@ int wfx_config(struct ieee80211_hw *hw, u32 changed);
 int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value);
 void wfx_set_default_unicast_key(struct ieee80211_hw *hw,
                                 struct ieee80211_vif *vif, int idx);
-u64 wfx_prepare_multicast(struct ieee80211_hw *hw,
-                         struct netdev_hw_addr_list *mc_list);
 void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
                          unsigned int *total_flags, u64 unused);
 
index 241eaaf..56fbfab 100644 (file)
@@ -79,9 +79,6 @@ struct wfx_vif {
 
        struct work_struct      update_tim_work;
 
-       int                     filter_mcast_count;
-       u8                      filter_mcast_addr[8][ETH_ALEN];
-
        unsigned long           uapsd_mask;
 
        /* avoid some operations in parallel with scan */