blob: fea60b3a884609eca84c012610f83f93562e708b [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
Alexander Aring53f9ee612014-11-05 20:51:12 +01009 /* wpan_phy index, internal only */
10 int wpan_phy_idx;
11
Alexander Aringa5dd1d72014-11-02 04:18:35 +010012 /* 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 Aringea4dcd32014-11-02 04:18:37 +010018static inline struct cfg802154_registered_device *
19wpan_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 Aringa5dd1d72014-11-02 04:18:35 +010026/* free object */
27void cfg802154_dev_free(struct cfg802154_registered_device *rdev);
28
29#endif /* __IEEE802154_CORE_H */