diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2009-11-04 09:53:23 -0500 |
---|---|---|
committer | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2009-11-06 06:32:18 -0500 |
commit | 42723448b8bacf60c96812196d7725d8d605d0c4 (patch) | |
tree | bd1e1ac9900869139003cfdbae4e88e4b3f22457 | |
parent | 478e87c23340e88e909aa749f4772838bc96a20b (diff) |
ieee802154: add an mlme_ops call to retrieve PHY object
ops->get_phy should increment reference to wpan-phy. As we return
the external structure, we should do refcounting correctly.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
-rw-r--r-- | include/net/ieee802154_netdev.h | 6 | ||||
-rw-r--r-- | include/net/wpan-phy.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/net/ieee802154_netdev.h b/include/net/ieee802154_netdev.h index d23fb5a94c96..57430555487a 100644 --- a/include/net/ieee802154_netdev.h +++ b/include/net/ieee802154_netdev.h | |||
@@ -74,8 +74,12 @@ static inline int mac_cb_type(struct sk_buff *skb) | |||
74 | #define IEEE802154_MAC_SCAN_PASSIVE 2 | 74 | #define IEEE802154_MAC_SCAN_PASSIVE 2 |
75 | #define IEEE802154_MAC_SCAN_ORPHAN 3 | 75 | #define IEEE802154_MAC_SCAN_ORPHAN 3 |
76 | 76 | ||
77 | struct wpan_phy; | ||
77 | /* | 78 | /* |
78 | * This should be located at net_device->ml_priv | 79 | * This should be located at net_device->ml_priv |
80 | * | ||
81 | * get_phy should increment the reference counting on returned phy. | ||
82 | * Use wpan_wpy_put to put that reference. | ||
79 | */ | 83 | */ |
80 | struct ieee802154_mlme_ops { | 84 | struct ieee802154_mlme_ops { |
81 | int (*assoc_req)(struct net_device *dev, | 85 | int (*assoc_req)(struct net_device *dev, |
@@ -94,6 +98,8 @@ struct ieee802154_mlme_ops { | |||
94 | int (*scan_req)(struct net_device *dev, | 98 | int (*scan_req)(struct net_device *dev, |
95 | u8 type, u32 channels, u8 page, u8 duration); | 99 | u8 type, u32 channels, u8 page, u8 duration); |
96 | 100 | ||
101 | struct wpan_phy *(*get_phy)(const struct net_device *dev); | ||
102 | |||
97 | /* | 103 | /* |
98 | * FIXME: these should become the part of PIB/MIB interface. | 104 | * FIXME: these should become the part of PIB/MIB interface. |
99 | * However we still don't have IB interface of any kind | 105 | * However we still don't have IB interface of any kind |
diff --git a/include/net/wpan-phy.h b/include/net/wpan-phy.h index f63537c17363..a65e98509fbc 100644 --- a/include/net/wpan-phy.h +++ b/include/net/wpan-phy.h | |||
@@ -44,6 +44,8 @@ struct wpan_phy { | |||
44 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); | 44 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); |
45 | }; | 45 | }; |
46 | 46 | ||
47 | #define to_phy(_dev) container_of(_dev, struct wpan_phy, dev) | ||
48 | |||
47 | struct wpan_phy *wpan_phy_alloc(size_t priv_size); | 49 | struct wpan_phy *wpan_phy_alloc(size_t priv_size); |
48 | static inline void wpan_phy_set_dev(struct wpan_phy *phy, struct device *dev) | 50 | static inline void wpan_phy_set_dev(struct wpan_phy *phy, struct device *dev) |
49 | { | 51 | { |