diff options
author | Alexander Aring <alex.aring@gmail.com> | 2015-05-17 15:45:06 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-05-19 05:44:46 -0400 |
commit | 12da8d97ab3239101077a415c2587bfbf6725216 (patch) | |
tree | 611a7bcf159d52478943e1223deea56ead29d887 /drivers/net | |
parent | e369dc8f1aa95cd490e1ab75043dcf50d2190453 (diff) |
fakelb: use own channel and page attributes
This patch adds an own phy attribute for page and channel into
fakelb_phy. The current way is to use the internal mac802154 stored phy
pib values which can occur in locking issues while using it inside the
driver layer.
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.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c index 83957de47243..c60837e0df25 100644 --- a/drivers/net/ieee802154/fakelb.c +++ b/drivers/net/ieee802154/fakelb.c | |||
@@ -38,6 +38,9 @@ static DEFINE_RWLOCK(fakelb_ifup_phys_lock); | |||
38 | struct fakelb_phy { | 38 | struct fakelb_phy { |
39 | struct ieee802154_hw *hw; | 39 | struct ieee802154_hw *hw; |
40 | 40 | ||
41 | u8 page; | ||
42 | u8 channel; | ||
43 | |||
41 | struct list_head list; | 44 | struct list_head list; |
42 | struct list_head list_ifup; | 45 | struct list_head list_ifup; |
43 | }; | 46 | }; |
@@ -54,8 +57,12 @@ fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level) | |||
54 | static int | 57 | static int |
55 | fakelb_hw_channel(struct ieee802154_hw *hw, u8 page, u8 channel) | 58 | fakelb_hw_channel(struct ieee802154_hw *hw, u8 page, u8 channel) |
56 | { | 59 | { |
57 | pr_debug("set channel to %d\n", channel); | 60 | struct fakelb_phy *phy = hw->priv; |
58 | 61 | ||
62 | write_lock_bh(&fakelb_ifup_phys_lock); | ||
63 | phy->page = page; | ||
64 | phy->channel = channel; | ||
65 | write_unlock_bh(&fakelb_ifup_phys_lock); | ||
59 | return 0; | 66 | return 0; |
60 | } | 67 | } |
61 | 68 | ||
@@ -80,8 +87,8 @@ fakelb_hw_xmit(struct ieee802154_hw *hw, struct sk_buff *skb) | |||
80 | if (current_phy == phy) | 87 | if (current_phy == phy) |
81 | continue; | 88 | continue; |
82 | 89 | ||
83 | if (phy->hw->phy->current_channel == | 90 | if (current_phy->page == phy->page && |
84 | current_phy->hw->phy->current_channel) | 91 | current_phy->channel == phy->channel) |
85 | fakelb_hw_deliver(phy, skb); | 92 | fakelb_hw_deliver(phy, skb); |
86 | } | 93 | } |
87 | read_unlock_bh(&fakelb_ifup_phys_lock); | 94 | read_unlock_bh(&fakelb_ifup_phys_lock); |