core.h 735 B

123456789101112131415161718192021222324252627282930
  1. #ifndef __IEEE802154_CORE_H
  2. #define __IEEE802154_CORE_H
  3. #include <net/cfg802154.h>
  4. struct cfg802154_registered_device {
  5. const struct cfg802154_ops *ops;
  6. struct list_head list;
  7. /* wpan_phy index, internal only */
  8. int wpan_phy_idx;
  9. /* must be last because of the way we do wpan_phy_priv(),
  10. * and it should at least be aligned to NETDEV_ALIGN
  11. */
  12. struct wpan_phy wpan_phy __aligned(NETDEV_ALIGN);
  13. };
  14. static inline struct cfg802154_registered_device *
  15. wpan_phy_to_rdev(struct wpan_phy *wpan_phy)
  16. {
  17. BUG_ON(!wpan_phy);
  18. return container_of(wpan_phy, struct cfg802154_registered_device,
  19. wpan_phy);
  20. }
  21. /* free object */
  22. void cfg802154_dev_free(struct cfg802154_registered_device *rdev);
  23. #endif /* __IEEE802154_CORE_H */