0001
0002 #ifndef __IEEE802154_CORE_H
0003 #define __IEEE802154_CORE_H
0004
0005 #include <net/cfg802154.h>
0006
0007 struct cfg802154_registered_device {
0008 const struct cfg802154_ops *ops;
0009 struct list_head list;
0010
0011
0012 int wpan_phy_idx;
0013
0014
0015 int opencount;
0016 wait_queue_head_t dev_wait;
0017
0018
0019 int num_running_ifaces;
0020
0021
0022 struct list_head wpan_dev_list;
0023 int devlist_generation, wpan_dev_id;
0024
0025
0026
0027
0028 struct wpan_phy wpan_phy __aligned(NETDEV_ALIGN);
0029 };
0030
0031 static inline struct cfg802154_registered_device *
0032 wpan_phy_to_rdev(struct wpan_phy *wpan_phy)
0033 {
0034 BUG_ON(!wpan_phy);
0035 return container_of(wpan_phy, struct cfg802154_registered_device,
0036 wpan_phy);
0037 }
0038
0039 extern struct list_head cfg802154_rdev_list;
0040 extern int cfg802154_rdev_list_generation;
0041
0042 int cfg802154_switch_netns(struct cfg802154_registered_device *rdev,
0043 struct net *net);
0044
0045 void cfg802154_dev_free(struct cfg802154_registered_device *rdev);
0046 struct cfg802154_registered_device *
0047 cfg802154_rdev_by_wpan_phy_idx(int wpan_phy_idx);
0048 struct wpan_phy *wpan_phy_idx_to_wpan_phy(int wpan_phy_idx);
0049
0050 #endif