mac802154: Drop IEEE802154_HW_RX_DROP_BAD_CKSUM
authorMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 7 Oct 2022 08:53:08 +0000 (10:53 +0200)
committerStefan Schmidt <stefan@datenfreihafen.org>
Wed, 12 Oct 2022 10:57:19 +0000 (12:57 +0200)
This IEEE802154_HW_RX_DROP_BAD_CKSUM flag was only used by hwsim to
reflect the fact that it would not validate the checksum (FCS). So this
was only useful while the only filtering level hwsim was capable of was
"NONE". Now that the driver has been improved we no longer need this
flag.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Alexander Aring <aahringo@redhat.com>
Link: https://lore.kernel.org/r/20221007085310.503366-7-miquel.raynal@bootlin.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
drivers/net/ieee802154/mac802154_hwsim.c
include/net/mac802154.h
net/mac802154/rx.c

index 75d802e0b68537eeedb6e1b508561b93c2207e56..1db7da3ccc1a0e3ce5c0610a6e5029a9c9b1f880 100644 (file)
@@ -287,6 +287,7 @@ static int hwsim_hw_start(struct ieee802154_hw *hw)
        struct hwsim_phy *phy = hw->priv;
 
        phy->suspended = false;
+
        return 0;
 }
 
@@ -933,7 +934,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev,
        phy->idx = idx;
        INIT_LIST_HEAD(&phy->edges);
 
-       hw->flags = IEEE802154_HW_PROMISCUOUS | IEEE802154_HW_RX_DROP_BAD_CKSUM;
+       hw->flags = IEEE802154_HW_PROMISCUOUS;
        hw->parent = dev;
 
        err = ieee802154_register_hw(hw);
index 357d25ef627a36cb6946d126688da1c8a2955edd..4a3a9de9da73398d16805db90a9682f9107b23ad 100644 (file)
@@ -111,9 +111,6 @@ struct ieee802154_hw {
  *     promiscuous mode setting.
  *
  * @IEEE802154_HW_RX_OMIT_CKSUM: Indicates that receiver omits FCS.
- *
- * @IEEE802154_HW_RX_DROP_BAD_CKSUM: Indicates that receiver will not filter
- *     frames with bad checksum.
  */
 enum ieee802154_hw_flags {
        IEEE802154_HW_TX_OMIT_CKSUM     = BIT(0),
@@ -123,7 +120,6 @@ enum ieee802154_hw_flags {
        IEEE802154_HW_AFILT             = BIT(4),
        IEEE802154_HW_PROMISCUOUS       = BIT(5),
        IEEE802154_HW_RX_OMIT_CKSUM     = BIT(6),
-       IEEE802154_HW_RX_DROP_BAD_CKSUM = BIT(7),
 };
 
 /* Indicates that receiver omits FCS and xmitter will add FCS on it's own. */
index 8543c28948a0641677309bea321944c4a184e36b..80dd52bc6bf138b19975d7bedbd47126b44ce1a0 100644 (file)
@@ -277,11 +277,8 @@ void ieee802154_rx(struct ieee802154_local *local, struct sk_buff *skb)
         * IEEE802154_FILTERING_NONE level during a scan.
         */
 
-       /* Check if transceiver doesn't validate the checksum.
-        * If not we validate the checksum here.
-        */
-       if (local->hw.flags & IEEE802154_HW_RX_DROP_BAD_CKSUM ||
-           local->phy->filtering == IEEE802154_FILTERING_NONE) {
+       /* Level 1 filtering: Check the FCS by software when relevant */
+       if (local->hw.phy->filtering == IEEE802154_FILTERING_NONE) {
                crc = crc_ccitt(0, skb->data, skb->len);
                if (crc) {
                        rcu_read_unlock();