Define light-weight mlme interface. Signed-off-by: Alexander Smirnov <alex.bluesman.smir...@gmail.com> --- include/net/ieee802154_netdev.h | 11 +++++++++++ net/ieee802154/nl-mac.c | 2 +- 2 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/include/net/ieee802154_netdev.h b/include/net/ieee802154_netdev.h index 12a7ee4..5264b00 100644 --- a/include/net/ieee802154_netdev.h +++ b/include/net/ieee802154_netdev.h @@ -83,7 +83,12 @@ struct wpan_phy; * get_phy should increment the reference counting on returned phy. * Use wpan_wpy_put to put that reference. */ +struct simple_mlme_ops { + struct wpan_phy *(*get_phy)(const struct net_device *dev); +}; struct ieee802154_mlme_ops { + struct simple_mlme_ops wpan_ops; + int (*assoc_req)(struct net_device *dev, struct ieee802154_addr *addr, u8 channel, u8 page, u8 cap); @@ -112,6 +117,12 @@ struct ieee802154_mlme_ops { u8 (*get_bsn)(const struct net_device *dev); }; +static inline struct simple_mlme_ops *simple_mlme_ops( + const struct net_device *dev) +{ + return dev->ml_priv; +} + static inline struct ieee802154_mlme_ops *ieee802154_mlme_ops( const struct net_device *dev) { diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c index adaf462..1d23aa6 100644 --- a/net/ieee802154/nl-mac.c +++ b/net/ieee802154/nl-mac.c @@ -263,7 +263,7 @@ static int ieee802154_nl_fill_iface(struct sk_buff *msg, u32 pid, if (!hdr) goto out; - phy = ieee802154_mlme_ops(dev)->get_phy(dev); + phy = simple_mlme_ops(dev)->get_phy(dev); BUG_ON(!phy); NLA_PUT_STRING(msg, IEEE802154_ATTR_DEV_NAME, dev->name); -- 1.7.2.3 ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ Linux-zigbee-devel mailing list Linux-zigbee-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel