blob: 38887cb2eaf4df1267e2f63aa5bea8c9b7a7426b [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;
Alexander Aringf3ada642014-11-09 08:36:48 +01008 struct list_head list;
Alexander Aringa5dd1d72014-11-02 04:18:35 +01009
Alexander Aring53f9ee612014-11-05 20:51:12 +010010 /* wpan_phy index, internal only */
11 int wpan_phy_idx;
12
Alexander Aringa5dd1d72014-11-02 04:18:35 +010013 /* must be last because of the way we do wpan_phy_priv(),
14 * and it should at least be aligned to NETDEV_ALIGN
15 */
16 struct wpan_phy wpan_phy __aligned(NETDEV_ALIGN);
17};
18
Alexander Aringea4dcd32014-11-02 04:18:37 +010019static inline struct cfg802154_registered_device *
20wpan_phy_to_rdev(struct wpan_phy *wpan_phy)
21{
22 BUG_ON(!wpan_phy);
23 return container_of(wpan_phy, struct cfg802154_registered_device,
24 wpan_phy);
25}
26
Alexander Aringa5dd1d72014-11-02 04:18:35 +010027/* free object */
28void cfg802154_dev_free(struct cfg802154_registered_device *rdev);
29
30#endif /* __IEEE802154_CORE_H */