提交 7c2b9bff 编写于 作者: A Alexander Aring 提交者: Marcel Holtmann

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: NAlexander Aring <aar@pengutronix.de>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 048e7f7e
...@@ -112,6 +112,12 @@ static void fakelb_hw_stop(struct ieee802154_hw *hw) ...@@ -112,6 +112,12 @@ static void fakelb_hw_stop(struct ieee802154_hw *hw)
write_unlock_bh(&fakelb_ifup_phys_lock); write_unlock_bh(&fakelb_ifup_phys_lock);
} }
static int
fakelb_set_promiscuous_mode(struct ieee802154_hw *hw, const bool on)
{
return 0;
}
static const struct ieee802154_ops fakelb_ops = { static const struct ieee802154_ops fakelb_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.xmit_async = fakelb_hw_xmit, .xmit_async = fakelb_hw_xmit,
...@@ -119,6 +125,7 @@ static const struct ieee802154_ops fakelb_ops = { ...@@ -119,6 +125,7 @@ static const struct ieee802154_ops fakelb_ops = {
.set_channel = fakelb_hw_channel, .set_channel = fakelb_hw_channel,
.start = fakelb_hw_start, .start = fakelb_hw_start,
.stop = fakelb_hw_stop, .stop = fakelb_hw_stop,
.set_promiscuous_mode = fakelb_set_promiscuous_mode,
}; };
/* Number of dummy devices to be set up by this module. */ /* Number of dummy devices to be set up by this module. */
...@@ -174,6 +181,7 @@ static int fakelb_add_one(struct device *dev) ...@@ -174,6 +181,7 @@ static int fakelb_add_one(struct device *dev)
hw->phy->current_channel = 13; hw->phy->current_channel = 13;
phy->channel = hw->phy->current_channel; phy->channel = hw->phy->current_channel;
hw->flags = IEEE802154_HW_PROMISCUOUS;
hw->parent = dev; hw->parent = dev;
err = ieee802154_register_hw(hw); err = ieee802154_register_hw(hw);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册