Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fakelb: allow to run as monitor

For my RIOT-OS in userspace experiments I need to create a fakelb
monitor interface. The fakelb doesn't filter anything on L2 and is a
purely raw interface. Because nl802154 checks on promiscuous mode which
need to supported by creating monitors this patch adds some no-op
promiscuous mode setting and the promiscuous flag.

Signed-off-by: Alexander Aring <aar@pengutronix.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by

Alexander Aring and committed by
Marcel Holtmann
7c2b9bff 048e7f7e

+8
+8
drivers/net/ieee802154/fakelb.c
··· 112 112 write_unlock_bh(&fakelb_ifup_phys_lock); 113 113 } 114 114 115 + static int 116 + fakelb_set_promiscuous_mode(struct ieee802154_hw *hw, const bool on) 117 + { 118 + return 0; 119 + } 120 + 115 121 static const struct ieee802154_ops fakelb_ops = { 116 122 .owner = THIS_MODULE, 117 123 .xmit_async = fakelb_hw_xmit, ··· 125 119 .set_channel = fakelb_hw_channel, 126 120 .start = fakelb_hw_start, 127 121 .stop = fakelb_hw_stop, 122 + .set_promiscuous_mode = fakelb_set_promiscuous_mode, 128 123 }; 129 124 130 125 /* Number of dummy devices to be set up by this module. */ ··· 181 174 hw->phy->current_channel = 13; 182 175 phy->channel = hw->phy->current_channel; 183 176 177 + hw->flags = IEEE802154_HW_PROMISCUOUS; 184 178 hw->parent = dev; 185 179 186 180 err = ieee802154_register_hw(hw);