Alexander Aring | a5dd1d7 | 2014-11-02 04:18:35 +0100 | [diff] [blame] | 1 | #ifndef __IEEE802154_CORE_H |
| 2 | #define __IEEE802154_CORE_H |
| 3 | |
| 4 | #include <net/cfg802154.h> |
| 5 | |
| 6 | struct cfg802154_registered_device { |
| 7 | const struct cfg802154_ops *ops; |
| 8 | |
Alexander Aring | 53f9ee61 | 2014-11-05 20:51:12 +0100 | [diff] [blame] | 9 | /* wpan_phy index, internal only */ |
| 10 | int wpan_phy_idx; |
| 11 | |
Alexander Aring | a5dd1d7 | 2014-11-02 04:18:35 +0100 | [diff] [blame] | 12 | /* must be last because of the way we do wpan_phy_priv(), |
| 13 | * and it should at least be aligned to NETDEV_ALIGN |
| 14 | */ |
| 15 | struct wpan_phy wpan_phy __aligned(NETDEV_ALIGN); |
| 16 | }; |
| 17 | |
Alexander Aring | ea4dcd3 | 2014-11-02 04:18:37 +0100 | [diff] [blame] | 18 | static inline struct cfg802154_registered_device * |
| 19 | wpan_phy_to_rdev(struct wpan_phy *wpan_phy) |
| 20 | { |
| 21 | BUG_ON(!wpan_phy); |
| 22 | return container_of(wpan_phy, struct cfg802154_registered_device, |
| 23 | wpan_phy); |
| 24 | } |
| 25 | |
Alexander Aring | a5dd1d7 | 2014-11-02 04:18:35 +0100 | [diff] [blame] | 26 | /* free object */ |
| 27 | void cfg802154_dev_free(struct cfg802154_registered_device *rdev); |
| 28 | |
| 29 | #endif /* __IEEE802154_CORE_H */ |