Commit a4b5b4c5 authored by Miquel Raynal's avatar Miquel Raynal Committed by Stefan Schmidt

mac802154: Drop IEEE802154_HW_RX_DROP_BAD_CKSUM

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: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Acked-by: default avatarAlexander Aring <aahringo@redhat.com>
Link: https://lore.kernel.org/r/20221007085310.503366-7-miquel.raynal@bootlin.comSigned-off-by: default avatarStefan Schmidt <stefan@datenfreihafen.org>
parent ea562d8c
...@@ -287,6 +287,7 @@ static int hwsim_hw_start(struct ieee802154_hw *hw) ...@@ -287,6 +287,7 @@ static int hwsim_hw_start(struct ieee802154_hw *hw)
struct hwsim_phy *phy = hw->priv; struct hwsim_phy *phy = hw->priv;
phy->suspended = false; phy->suspended = false;
return 0; return 0;
} }
...@@ -933,7 +934,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev, ...@@ -933,7 +934,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev,
phy->idx = idx; phy->idx = idx;
INIT_LIST_HEAD(&phy->edges); INIT_LIST_HEAD(&phy->edges);
hw->flags = IEEE802154_HW_PROMISCUOUS | IEEE802154_HW_RX_DROP_BAD_CKSUM; hw->flags = IEEE802154_HW_PROMISCUOUS;
hw->parent = dev; hw->parent = dev;
err = ieee802154_register_hw(hw); err = ieee802154_register_hw(hw);
......
...@@ -111,9 +111,6 @@ struct ieee802154_hw { ...@@ -111,9 +111,6 @@ struct ieee802154_hw {
* promiscuous mode setting. * promiscuous mode setting.
* *
* @IEEE802154_HW_RX_OMIT_CKSUM: Indicates that receiver omits FCS. * @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 { enum ieee802154_hw_flags {
IEEE802154_HW_TX_OMIT_CKSUM = BIT(0), IEEE802154_HW_TX_OMIT_CKSUM = BIT(0),
...@@ -123,7 +120,6 @@ enum ieee802154_hw_flags { ...@@ -123,7 +120,6 @@ enum ieee802154_hw_flags {
IEEE802154_HW_AFILT = BIT(4), IEEE802154_HW_AFILT = BIT(4),
IEEE802154_HW_PROMISCUOUS = BIT(5), IEEE802154_HW_PROMISCUOUS = BIT(5),
IEEE802154_HW_RX_OMIT_CKSUM = BIT(6), 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. */ /* Indicates that receiver omits FCS and xmitter will add FCS on it's own. */
......
...@@ -277,11 +277,8 @@ void ieee802154_rx(struct ieee802154_local *local, struct sk_buff *skb) ...@@ -277,11 +277,8 @@ void ieee802154_rx(struct ieee802154_local *local, struct sk_buff *skb)
* IEEE802154_FILTERING_NONE level during a scan. * IEEE802154_FILTERING_NONE level during a scan.
*/ */
/* Check if transceiver doesn't validate the checksum. /* Level 1 filtering: Check the FCS by software when relevant */
* If not we validate the checksum here. if (local->hw.phy->filtering == IEEE802154_FILTERING_NONE) {
*/
if (local->hw.flags & IEEE802154_HW_RX_DROP_BAD_CKSUM ||
local->phy->filtering == IEEE802154_FILTERING_NONE) {
crc = crc_ccitt(0, skb->data, skb->len); crc = crc_ccitt(0, skb->data, skb->len);
if (crc) { if (crc) {
rcu_read_unlock(); rcu_read_unlock();
......
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