core.h 654 B

1234567891011121314151617181920212223242526
  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. /* must be last because of the way we do wpan_phy_priv(),
  7. * and it should at least be aligned to NETDEV_ALIGN
  8. */
  9. struct wpan_phy wpan_phy __aligned(NETDEV_ALIGN);
  10. };
  11. static inline struct cfg802154_registered_device *
  12. wpan_phy_to_rdev(struct wpan_phy *wpan_phy)
  13. {
  14. BUG_ON(!wpan_phy);
  15. return container_of(wpan_phy, struct cfg802154_registered_device,
  16. wpan_phy);
  17. }
  18. /* free object */
  19. void cfg802154_dev_free(struct cfg802154_registered_device *rdev);
  20. #endif /* __IEEE802154_CORE_H */