mac802154: add wpan_phy priv id
[linux-2.6-block.git] / net / mac802154 / util.c
CommitLineData
c2085103
AA
1/* This program is free software; you can redistribute it and/or modify
2 * it under the terms of the GNU General Public License version 2
3 * as published by the Free Software Foundation.
4 *
5 * This program is distributed in the hope that it will be useful,
6 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8 * GNU General Public License for more details.
9 *
10 * Authors:
11 * Alexander Aring <aar@pengutronix.de>
12 *
13 * Based on: net/mac80211/util.c
14 */
15
16#include "ieee802154_i.h"
17
6322d50d
AA
18/* privid for wpan_phys to determine whether they belong to us or not */
19const void *const mac802154_wpan_phy_privid = &mac802154_wpan_phy_privid;
20
c2085103
AA
21void ieee802154_wake_queue(struct ieee802154_hw *hw)
22{
23 struct ieee802154_local *local = hw_to_local(hw);
24 struct ieee802154_sub_if_data *sdata;
25
26 rcu_read_lock();
27 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
28 if (!sdata->dev)
29 continue;
30
31 netif_wake_queue(sdata->dev);
32 }
33 rcu_read_unlock();
34}
35EXPORT_SYMBOL(ieee802154_wake_queue);
36
37void ieee802154_stop_queue(struct ieee802154_hw *hw)
38{
39 struct ieee802154_local *local = hw_to_local(hw);
40 struct ieee802154_sub_if_data *sdata;
41
42 rcu_read_lock();
43 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
44 if (!sdata->dev)
45 continue;
46
47 netif_stop_queue(sdata->dev);
48 }
49 rcu_read_unlock();
50}
51EXPORT_SYMBOL(ieee802154_stop_queue);
52
53void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb)
54{
55 ieee802154_wake_queue(hw);
56 consume_skb(skb);
57}
58EXPORT_SYMBOL(ieee802154_xmit_complete);