blob: 1bc1725871573f95368fd69a65728b137e548981 [file] [log] [blame]
Alexander Aringa5dd1d72014-11-02 04:18:35 +01001#ifndef __IEEE802154_CORE_H
2#define __IEEE802154_CORE_H
3
4#include <net/cfg802154.h>
5
6struct cfg802154_registered_device {
7 const struct cfg802154_ops *ops;
8
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
Alexander Aringea4dcd32014-11-02 04:18:37 +010015static inline struct cfg802154_registered_device *
16wpan_phy_to_rdev(struct wpan_phy *wpan_phy)
17{
18 BUG_ON(!wpan_phy);
19 return container_of(wpan_phy, struct cfg802154_registered_device,
20 wpan_phy);
21}
22
Alexander Aringa5dd1d72014-11-02 04:18:35 +010023/* free object */
24void cfg802154_dev_free(struct cfg802154_registered_device *rdev);
25
26#endif /* __IEEE802154_CORE_H */