Skip to content

Commit

Permalink
mac802154: Drop IEEE802154_HW_RX_DROP_BAD_CKSUM
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Alexander Aring <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Stefan Schmidt <[email protected]>
  • Loading branch information
miquelraynal authored and Stefan-Schmidt committed Oct 12, 2022
1 parent ea562d8 commit a4b5b4c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
3 changes: 2 additions & 1 deletion drivers/net/ieee802154/mac802154_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ static int hwsim_hw_start(struct ieee802154_hw *hw)
struct hwsim_phy *phy = hw->priv;

phy->suspended = false;

return 0;
}

Expand Down Expand Up @@ -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);
Expand Down
4 changes: 0 additions & 4 deletions include/net/mac802154.h
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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. */
Expand Down
7 changes: 2 additions & 5 deletions net/mac802154/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit a4b5b4c

Please sign in to comment.