Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux...
[linux/fpc-iii.git] / net / ieee802154 / core.h
blob231fade959f39c1f2e1ce6c174b98306a08faa35
1 #ifndef __IEEE802154_CORE_H
2 #define __IEEE802154_CORE_H
4 #include <net/cfg802154.h>
6 struct cfg802154_registered_device {
7 const struct cfg802154_ops *ops;
8 struct list_head list;
10 /* wpan_phy index, internal only */
11 int wpan_phy_idx;
13 /* also protected by devlist_mtx */
14 int opencount;
15 wait_queue_head_t dev_wait;
17 /* protected by RTNL only */
18 int num_running_ifaces;
20 /* associated wpan interfaces, protected by rtnl or RCU */
21 struct list_head wpan_dev_list;
22 int devlist_generation, wpan_dev_id;
24 /* must be last because of the way we do wpan_phy_priv(),
25 * and it should at least be aligned to NETDEV_ALIGN
27 struct wpan_phy wpan_phy __aligned(NETDEV_ALIGN);
30 static inline struct cfg802154_registered_device *
31 wpan_phy_to_rdev(struct wpan_phy *wpan_phy)
33 BUG_ON(!wpan_phy);
34 return container_of(wpan_phy, struct cfg802154_registered_device,
35 wpan_phy);
38 extern struct list_head cfg802154_rdev_list;
39 extern int cfg802154_rdev_list_generation;
41 /* free object */
42 void cfg802154_dev_free(struct cfg802154_registered_device *rdev);
43 struct cfg802154_registered_device *
44 cfg802154_rdev_by_wpan_phy_idx(int wpan_phy_idx);
45 struct wpan_phy *wpan_phy_idx_to_wpan_phy(int wpan_phy_idx);
47 #endif /* __IEEE802154_CORE_H */