summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-05-17 15:45:01 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-05-19 05:44:45 -0400
commit9f8b97f888445b737ea3716ca53498663e18d971 (patch)
treed87b7281cc84e661fa3ca124addec7be8917cba2 /drivers/net
parentdb3f5d0df9af1e5965e64595595a6a719c42fcf3 (diff)
fakelb: don't deliver when one phy
A real phy don't transmit the transmitted frame back to the phy. This behaviour will confuse the 6LoWPAN and the upper IPv6 neighbour discovery cache. We need now at least two virtual phy's to creating a virtual wpan network. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ieee802154/fakelb.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c
index 5c4fbb861eb0..d5fb77678349 100644
--- a/drivers/net/ieee802154/fakelb.c
+++ b/drivers/net/ieee802154/fakelb.c
@@ -80,20 +80,16 @@ fakelb_hw_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
80{ 80{
81 struct fakelb_phy *current_phy = hw->priv; 81 struct fakelb_phy *current_phy = hw->priv;
82 struct fakelb_priv *fake = current_phy->fake; 82 struct fakelb_priv *fake = current_phy->fake;
83 struct fakelb_phy *phy;
83 84
84 read_lock_bh(&fake->lock); 85 read_lock_bh(&fake->lock);
85 if (current_phy->list.next == current_phy->list.prev) { 86 list_for_each_entry(phy, &current_phy->fake->list, list) {
86 /* we are the only one device */ 87 if (current_phy == phy)
87 fakelb_hw_deliver(current_phy, skb); 88 continue;
88 } else { 89
89 struct fakelb_phy *phy; 90 if (phy->hw->phy->current_channel ==
90 91 current_phy->hw->phy->current_channel)
91 list_for_each_entry(phy, &current_phy->fake->list, list) { 92 fakelb_hw_deliver(phy, skb);
92 if (current_phy != phy &&
93 (phy->hw->phy->current_channel ==
94 current_phy->hw->phy->current_channel))
95 fakelb_hw_deliver(phy, skb);
96 }
97 } 93 }
98 read_unlock_bh(&fake->lock); 94 read_unlock_bh(&fake->lock);
99 95