ieee802154: hwsim: Save the current filtering level and use it
authorMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 19 Oct 2022 13:44:22 +0000 (15:44 +0200)
committerStefan Schmidt <stefan@datenfreihafen.org>
Mon, 24 Oct 2022 07:34:02 +0000 (09:34 +0200)
commit19177eedcf4412a90ec1ebaffac3514d0a3b4ff2
treeb1e0bbdb2cf205c146742d7121aeb3b836c8f275
parent9a60850e8cd9160beba79aa6d529332eb18c9bc7
ieee802154: hwsim: Save the current filtering level and use it

Save the requested filtering level in the ->set_promiscuous()
helper. The logic is: either we want to enable promiscuous mode and we
want to disable filters entirely, or we want to use the highest
filtering level by default. This is of course an assumption that only
works today, but if in the future intermediate levels (such as scan
filtering level) are implemented in the core, this logic will need to be
updated. This would imply replacing ->set_promiscuous() by something
more fine grained anyway, so we are probably safe with this assumption.

Once saved in the PIB structure, we can use this value instead of trying
to access the PHY structure to know what hardware filtering level has
been advertised.

Suggested-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Alexander Aring <aahringo@redhat.com>
Link: https://lore.kernel.org/r/20221019134423.877169-3-miquel.raynal@bootlin.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
drivers/net/ieee802154/mac802154_hwsim.c