From 69d9ab96f983720b7794e91437bd9c5f83bae9f7 Mon Sep 17 00:00:00 2001 From: Dmitry Eremin-Solenikov Date: Mon, 14 Sep 2009 18:11:03 +0400 Subject: wpan-phy: add a helper to put the wpan_phy device Signed-off-by: Dmitry Eremin-Solenikov --- include/net/wpan-phy.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/net/wpan-phy.h') diff --git a/include/net/wpan-phy.h b/include/net/wpan-phy.h index 547b1e271ac..5e803a0e4e7 100644 --- a/include/net/wpan-phy.h +++ b/include/net/wpan-phy.h @@ -56,6 +56,12 @@ static inline void *wpan_phy_priv(struct wpan_phy *phy) } struct wpan_phy *wpan_phy_find(const char *str); + +static inline void wpan_phy_put(struct wpan_phy *phy) +{ + put_device(&phy->dev); +} + static inline const char *wpan_phy_name(struct wpan_phy *phy) { return dev_name(&phy->dev); -- cgit v1.2.3-18-g5258 From 1c889f4db6b2f8f8429e62011ba622642faba019 Mon Sep 17 00:00:00 2001 From: Dmitry Eremin-Solenikov Date: Tue, 15 Sep 2009 16:57:04 +0400 Subject: wpan-phy: add wpan-phy iteration functions Add API to iterate over the wpan-phy instances. Signed-off-by: Dmitry Eremin-Solenikov --- include/net/wpan-phy.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/net/wpan-phy.h') diff --git a/include/net/wpan-phy.h b/include/net/wpan-phy.h index 5e803a0e4e7..3367dd95cf8 100644 --- a/include/net/wpan-phy.h +++ b/include/net/wpan-phy.h @@ -48,6 +48,8 @@ struct wpan_phy *wpan_phy_alloc(size_t priv_size); int wpan_phy_register(struct device *parent, struct wpan_phy *phy); void wpan_phy_unregister(struct wpan_phy *phy); void wpan_phy_free(struct wpan_phy *phy); +/* Same semantics as for class_for_each_device */ +int wpan_phy_for_each(int (*fn)(struct wpan_phy *phy, void *data), void *data); static inline void *wpan_phy_priv(struct wpan_phy *phy) { -- cgit v1.2.3-18-g5258 From a0b4a738e0e03f5e0d6ca366560f9a48e5adf83a Mon Sep 17 00:00:00 2001 From: Dmitry Eremin-Solenikov Date: Tue, 22 Sep 2009 15:26:48 +0400 Subject: wpan-phy: allow specifying a per-page channel mask IEEE 802.15.4-2006 defines channel pages that hold channels (max 32 pages, 27 channels per page). Allow the driver to specify supported channels on pages, other than the first one. Signed-off-by: Dmitry Eremin-Solenikov --- include/net/wpan-phy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/net/wpan-phy.h') diff --git a/include/net/wpan-phy.h b/include/net/wpan-phy.h index 3367dd95cf8..7b7fc581e67 100644 --- a/include/net/wpan-phy.h +++ b/include/net/wpan-phy.h @@ -34,7 +34,7 @@ struct wpan_phy { */ u8 current_channel; u8 current_page; - u32 channels_supported; + u32 channels_supported[32]; u8 transmit_power; u8 cca_mode; -- cgit v1.2.3-18-g5258 From e9cf356c0c6b975fda84b15a5abdd1db88d74f84 Mon Sep 17 00:00:00 2001 From: Dmitry Eremin-Solenikov Date: Mon, 28 Sep 2009 19:01:20 +0400 Subject: wpan-phy: follow usual patter of devices registration Follow the usual pattern of devices registration by adding new function (wpan_phy_set_dev) that sets child->parent relationship and removing parent argument from wpan_phy_register call. Signed-off-by: Dmitry Eremin-Solenikov --- include/net/wpan-phy.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/net/wpan-phy.h') diff --git a/include/net/wpan-phy.h b/include/net/wpan-phy.h index 7b7fc581e67..f63537c1736 100644 --- a/include/net/wpan-phy.h +++ b/include/net/wpan-phy.h @@ -45,7 +45,11 @@ struct wpan_phy { }; struct wpan_phy *wpan_phy_alloc(size_t priv_size); -int wpan_phy_register(struct device *parent, struct wpan_phy *phy); +static inline void wpan_phy_set_dev(struct wpan_phy *phy, struct device *dev) +{ + phy->dev.parent = dev; +} +int wpan_phy_register(struct wpan_phy *phy); void wpan_phy_unregister(struct wpan_phy *phy); void wpan_phy_free(struct wpan_phy *phy); /* Same semantics as for class_for_each_device */ -- cgit v1.2.3-18-g5258 From 42723448b8bacf60c96812196d7725d8d605d0c4 Mon Sep 17 00:00:00 2001 From: Dmitry Eremin-Solenikov Date: Wed, 4 Nov 2009 17:53:23 +0300 Subject: 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 --- include/net/wpan-phy.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/net/wpan-phy.h') diff --git a/include/net/wpan-phy.h b/include/net/wpan-phy.h index f63537c1736..a65e98509fb 100644 --- a/include/net/wpan-phy.h +++ b/include/net/wpan-phy.h @@ -44,6 +44,8 @@ struct wpan_phy { char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); }; +#define to_phy(_dev) container_of(_dev, struct wpan_phy, dev) + struct wpan_phy *wpan_phy_alloc(size_t priv_size); static inline void wpan_phy_set_dev(struct wpan_phy *phy, struct device *dev) { -- cgit v1.2.3-18-g5258 From bb1cafb8fc414d6dbe933f888df6540c2ef02101 Mon Sep 17 00:00:00 2001 From: Dmitry Eremin-Solenikov Date: Thu, 5 Nov 2009 16:56:23 +0300 Subject: ieee802154: add support for creation/removal of logic interfaces Add support for two more NL802154 commands: ADD_IFACE and DEL_IFACE, thus allowing creation and removal of logic WPAN interfaces on the top of wpan-phy. Signed-off-by: Dmitry Eremin-Solenikov --- include/net/wpan-phy.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/net/wpan-phy.h') diff --git a/include/net/wpan-phy.h b/include/net/wpan-phy.h index a65e98509fb..85926231c07 100644 --- a/include/net/wpan-phy.h +++ b/include/net/wpan-phy.h @@ -41,6 +41,10 @@ struct wpan_phy { struct device dev; int idx; + struct net_device *(*add_iface)(struct wpan_phy *phy, + const char *name); + void (*del_iface)(struct wpan_phy *phy, struct net_device *dev); + char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); }; -- cgit v1.2.3-18-g5258