summaryrefslogtreecommitdiffstats
path: root/drivers/net/ieee802154/fakelb.c
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-06-14 16:48:44 +0200
committerMarcel Holtmann <marcel@holtmann.org>2015-06-15 01:25:06 +0200
commit789a99ecb9cb700eb8f07b9d106b99e705e99471 (patch)
tree63f00885c30260aa5761039915972c3240319fa1 /drivers/net/ieee802154/fakelb.c
parentat86rf230: add support for sleep state (diff)
downloadlinux-789a99ecb9cb700eb8f07b9d106b99e705e99471.tar.xz
linux-789a99ecb9cb700eb8f07b9d106b99e705e99471.zip
fakelb: add xmit_async after stop testcase
This patch adds a suspended testcase into the xmit_async functionality. In the hope that we can found race conditions when xmit_async is called after an ieee802154_ops stop. This should never happen. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to '')
-rw-r--r--drivers/net/ieee802154/fakelb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c
index 9d0da4ec3e8c..860d4aed8274 100644
--- a/drivers/net/ieee802154/fakelb.c
+++ b/drivers/net/ieee802154/fakelb.c
@@ -41,6 +41,8 @@ struct fakelb_phy {
u8 page;
u8 channel;
+ bool suspended;
+
struct list_head list;
struct list_head list_ifup;
};
@@ -69,6 +71,7 @@ static int fakelb_hw_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
struct fakelb_phy *current_phy = hw->priv, *phy;
read_lock_bh(&fakelb_ifup_phys_lock);
+ WARN_ON(current_phy->suspended);
list_for_each_entry(phy, &fakelb_ifup_phys, list_ifup) {
if (current_phy == phy)
continue;
@@ -92,6 +95,7 @@ static int fakelb_hw_start(struct ieee802154_hw *hw)
struct fakelb_phy *phy = hw->priv;
write_lock_bh(&fakelb_ifup_phys_lock);
+ phy->suspended = false;
list_add(&phy->list_ifup, &fakelb_ifup_phys);
write_unlock_bh(&fakelb_ifup_phys_lock);
@@ -103,6 +107,7 @@ static void fakelb_hw_stop(struct ieee802154_hw *hw)
struct fakelb_phy *phy = hw->priv;
write_lock_bh(&fakelb_ifup_phys_lock);
+ phy->suspended = true;
list_del(&phy->list_ifup);
write_unlock_bh(&fakelb_ifup_phys_lock);
}