* [RFC bluetooth-next 0/4] ieee802154: UAPI changes
@ 2015-01-20 20:57 Alexander Aring
2015-01-20 20:57 ` [RFC bluetooth-next 1/4] ieee802154: set wpan netdev devtype Alexander Aring
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Alexander Aring @ 2015-01-20 20:57 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring
Hi,
this patch series contains various UAPI changes. It's a RFC for now, to be sure
nobody will scream when I send real patches for this.
In my opnion patch "ieee802154: 6lowpan: fix ARPHRD to ARPHRD_6LOWPAN" is the
is the most important part of this series. I know this issue a long time
and some already used application really checks on this, but we need to change that.
Patch "ieee802154: change wpan-phy name to phy" will change that you will not type
"wpan-phy0" anymore on iwpan phy settings. After this patch it's "phy0" only. This
makes the handling similar like iw.
Patch "ieee802154: remove deprecated sysfs entries" will breaks some scripts if
somebody really use these sysfs entries.
So I would like her others opinions according to these changes.
- Alex
Alexander Aring (4):
ieee802154: set wpan netdev devtype
ieee802154: 6lowpan: fix ARPHRD to ARPHRD_6LOWPAN
ieee802154: change wpan-phy name to phy
ieee802154: remove deprecated sysfs entries
net/ieee802154/6lowpan/core.c | 2 +-
net/ieee802154/core.c | 13 ++++++++++--
net/ieee802154/sysfs.c | 49 -------------------------------------------
3 files changed, 12 insertions(+), 52 deletions(-)
--
2.2.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RFC bluetooth-next 1/4] ieee802154: set wpan netdev devtype
2015-01-20 20:57 [RFC bluetooth-next 0/4] ieee802154: UAPI changes Alexander Aring
@ 2015-01-20 20:57 ` Alexander Aring
2015-01-20 20:57 ` [RFC bluetooth-next 2/4] ieee802154: 6lowpan: fix ARPHRD to ARPHRD_6LOWPAN Alexander Aring
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Alexander Aring @ 2015-01-20 20:57 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring
This patch adds the setting for the netdev devtype. Like wireless which
sets this value to "wlan", this patch will set this value to "wpan".
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
net/ieee802154/core.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/net/ieee802154/core.c b/net/ieee802154/core.c
index 18bc7e7..b99971f 100644
--- a/net/ieee802154/core.c
+++ b/net/ieee802154/core.c
@@ -199,6 +199,10 @@ void cfg802154_dev_free(struct cfg802154_registered_device *rdev)
kfree(rdev);
}
+static const struct device_type wpan_phy_type = {
+ .name = "wpan",
+};
+
static void
cfg802154_update_iface_num(struct cfg802154_registered_device *rdev,
int iftype, int num)
@@ -223,7 +227,9 @@ static int cfg802154_netdev_notifier_call(struct notifier_block *nb,
/* TODO WARN_ON unspec type */
switch (state) {
- /* TODO NETDEV_DEVTYPE */
+ case NETDEV_POST_INIT:
+ SET_NETDEV_DEVTYPE(dev, &wpan_phy_type);
+ break;
case NETDEV_REGISTER:
wpan_dev->identifier = ++rdev->wpan_dev_id;
list_add_rcu(&wpan_dev->list, &rdev->wpan_dev_list);
--
2.2.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RFC bluetooth-next 2/4] ieee802154: 6lowpan: fix ARPHRD to ARPHRD_6LOWPAN
2015-01-20 20:57 [RFC bluetooth-next 0/4] ieee802154: UAPI changes Alexander Aring
2015-01-20 20:57 ` [RFC bluetooth-next 1/4] ieee802154: set wpan netdev devtype Alexander Aring
@ 2015-01-20 20:57 ` Alexander Aring
2015-01-21 20:24 ` Alexander Aring
2015-01-20 20:57 ` [RFC bluetooth-next 3/4] ieee802154: change wpan-phy name to phy Alexander Aring
2015-01-20 20:57 ` [RFC bluetooth-next 4/4] ieee802154: remove deprecated sysfs entries Alexander Aring
3 siblings, 1 reply; 6+ messages in thread
From: Alexander Aring @ 2015-01-20 20:57 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring
Currently there exists two interface types with ARPHRD_IEEE802154. These
are the 802.15.4 interfaces and 802.15.4 6LoWPAN interfaces. This is
more a bug because some userspace applications checks on this value like
wireshark. This occurs that wireshark will always try to parse a lowpan
interface as 802.15.4 frames. With ARPHRD_6LOWPAN wireshark will parse
it as IPv6 frames which is correct.
Much applications checks on this value to readout the EUI64 mac address
which should be the same for ARPHRD_6LOWPAN. BTLE 6LoWPAN and ieee802154
6LoWPAN will share now the same ARPHRD.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
net/ieee802154/6lowpan/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c
index 055fbb7..9dbe0d69 100644
--- a/net/ieee802154/6lowpan/core.c
+++ b/net/ieee802154/6lowpan/core.c
@@ -113,7 +113,7 @@ static void lowpan_setup(struct net_device *dev)
{
dev->addr_len = IEEE802154_ADDR_LEN;
memset(dev->broadcast, 0xff, IEEE802154_ADDR_LEN);
- dev->type = ARPHRD_IEEE802154;
+ dev->type = ARPHRD_6LOWPAN;
/* Frame Control + Sequence Number + Address fields + Security Header */
dev->hard_header_len = 2 + 1 + 20 + 14;
dev->needed_tailroom = 2; /* FCS */
--
2.2.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RFC bluetooth-next 3/4] ieee802154: change wpan-phy name to phy
2015-01-20 20:57 [RFC bluetooth-next 0/4] ieee802154: UAPI changes Alexander Aring
2015-01-20 20:57 ` [RFC bluetooth-next 1/4] ieee802154: set wpan netdev devtype Alexander Aring
2015-01-20 20:57 ` [RFC bluetooth-next 2/4] ieee802154: 6lowpan: fix ARPHRD to ARPHRD_6LOWPAN Alexander Aring
@ 2015-01-20 20:57 ` Alexander Aring
2015-01-20 20:57 ` [RFC bluetooth-next 4/4] ieee802154: remove deprecated sysfs entries Alexander Aring
3 siblings, 0 replies; 6+ messages in thread
From: Alexander Aring @ 2015-01-20 20:57 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring
Currently the wpan_phy under /sys/class/ieee802154/ is named as
"wpan-phy#", this patch will change the name to phy. This will
introduce the same naming convention like wireless.
Note: wpan-tools users will not type "wpan-phy#" anymore, just a simple
"phy#" is enough.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
net/ieee802154/core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/ieee802154/core.c b/net/ieee802154/core.c
index b99971f..005df61 100644
--- a/net/ieee802154/core.c
+++ b/net/ieee802154/core.c
@@ -25,6 +25,9 @@
#include "sysfs.h"
#include "core.h"
+/* name for sysfs, %d is appended */
+#define PHY_NAME "phy"
+
/* RCU-protected (and RTNL for writers) */
LIST_HEAD(cfg802154_rdev_list);
int cfg802154_rdev_list_generation;
@@ -122,7 +125,7 @@ wpan_phy_new(const struct cfg802154_ops *ops, size_t priv_size)
INIT_LIST_HEAD(&rdev->wpan_dev_list);
device_initialize(&rdev->wpan_phy.dev);
- dev_set_name(&rdev->wpan_phy.dev, "wpan-phy%d", rdev->wpan_phy_idx);
+ dev_set_name(&rdev->wpan_phy.dev, PHY_NAME "%d", rdev->wpan_phy_idx);
rdev->wpan_phy.dev.class = &wpan_phy_class;
rdev->wpan_phy.dev.platform_data = rdev;
--
2.2.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RFC bluetooth-next 4/4] ieee802154: remove deprecated sysfs entries
2015-01-20 20:57 [RFC bluetooth-next 0/4] ieee802154: UAPI changes Alexander Aring
` (2 preceding siblings ...)
2015-01-20 20:57 ` [RFC bluetooth-next 3/4] ieee802154: change wpan-phy name to phy Alexander Aring
@ 2015-01-20 20:57 ` Alexander Aring
3 siblings, 0 replies; 6+ messages in thread
From: Alexander Aring @ 2015-01-20 20:57 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring
It's only necessary to offer the name and index, others value are
available over netlink.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
net/ieee802154/sysfs.c | 49 -------------------------------------------------
1 file changed, 49 deletions(-)
diff --git a/net/ieee802154/sysfs.c b/net/ieee802154/sysfs.c
index dff55c2..133b428 100644
--- a/net/ieee802154/sysfs.c
+++ b/net/ieee802154/sysfs.c
@@ -48,49 +48,6 @@ static ssize_t name_show(struct device *dev,
}
static DEVICE_ATTR_RO(name);
-#define MASTER_SHOW_COMPLEX(name, format_string, args...) \
-static ssize_t name ## _show(struct device *dev, \
- struct device_attribute *attr, char *buf) \
-{ \
- struct wpan_phy *phy = container_of(dev, struct wpan_phy, dev); \
- int ret; \
- \
- mutex_lock(&phy->pib_lock); \
- ret = snprintf(buf, PAGE_SIZE, format_string "\n", args); \
- mutex_unlock(&phy->pib_lock); \
- return ret; \
-} \
-static DEVICE_ATTR_RO(name)
-
-#define MASTER_SHOW(field, format_string) \
- MASTER_SHOW_COMPLEX(field, format_string, phy->field)
-
-MASTER_SHOW(current_channel, "%d");
-MASTER_SHOW(current_page, "%d");
-MASTER_SHOW(transmit_power, "%d +- 1 dB");
-MASTER_SHOW_COMPLEX(cca_mode, "%d", phy->cca.mode);
-
-static ssize_t channels_supported_show(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- struct wpan_phy *phy = container_of(dev, struct wpan_phy, dev);
- int ret;
- int i, len = 0;
-
- mutex_lock(&phy->pib_lock);
- for (i = 0; i < 32; i++) {
- ret = snprintf(buf + len, PAGE_SIZE - len,
- "%#09x\n", phy->channels_supported[i]);
- if (ret < 0)
- break;
- len += ret;
- }
- mutex_unlock(&phy->pib_lock);
- return len;
-}
-static DEVICE_ATTR_RO(channels_supported);
-
static void wpan_phy_release(struct device *dev)
{
struct cfg802154_registered_device *rdev = dev_to_rdev(dev);
@@ -101,12 +58,6 @@ static void wpan_phy_release(struct device *dev)
static struct attribute *pmib_attrs[] = {
&dev_attr_index.attr,
&dev_attr_name.attr,
- /* below will be removed soon */
- &dev_attr_current_channel.attr,
- &dev_attr_current_page.attr,
- &dev_attr_channels_supported.attr,
- &dev_attr_transmit_power.attr,
- &dev_attr_cca_mode.attr,
NULL,
};
ATTRIBUTE_GROUPS(pmib);
--
2.2.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [RFC bluetooth-next 2/4] ieee802154: 6lowpan: fix ARPHRD to ARPHRD_6LOWPAN
2015-01-20 20:57 ` [RFC bluetooth-next 2/4] ieee802154: 6lowpan: fix ARPHRD to ARPHRD_6LOWPAN Alexander Aring
@ 2015-01-21 20:24 ` Alexander Aring
0 siblings, 0 replies; 6+ messages in thread
From: Alexander Aring @ 2015-01-21 20:24 UTC (permalink / raw)
To: linux-wpan
Hi,
On Tue, Jan 20, 2015 at 09:57:40PM +0100, Alexander Aring wrote:
> Currently there exists two interface types with ARPHRD_IEEE802154. These
> are the 802.15.4 interfaces and 802.15.4 6LoWPAN interfaces. This is
> more a bug because some userspace applications checks on this value like
> wireshark. This occurs that wireshark will always try to parse a lowpan
> interface as 802.15.4 frames. With ARPHRD_6LOWPAN wireshark will parse
> it as IPv6 frames which is correct.
>
> Much applications checks on this value to readout the EUI64 mac address
> which should be the same for ARPHRD_6LOWPAN. BTLE 6LoWPAN and ieee802154
> 6LoWPAN will share now the same ARPHRD.
>
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> ---
> net/ieee802154/6lowpan/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c
> index 055fbb7..9dbe0d69 100644
> --- a/net/ieee802154/6lowpan/core.c
> +++ b/net/ieee802154/6lowpan/core.c
> @@ -113,7 +113,7 @@ static void lowpan_setup(struct net_device *dev)
> {
> dev->addr_len = IEEE802154_ADDR_LEN;
> memset(dev->broadcast, 0xff, IEEE802154_ADDR_LEN);
> - dev->type = ARPHRD_IEEE802154;
> + dev->type = ARPHRD_6LOWPAN;
> /* Frame Control + Sequence Number + Address fields + Security Header */
> dev->hard_header_len = 2 + 1 + 20 + 14;
> dev->needed_tailroom = 2; /* FCS */
> --
> 2.2.2
>
A little list of applications which need to update afterwards this patch:
- radvd [0]
- unstrung [1]
I know this will break the above software, but we need really to do this
step. Any complaints here according to this patch?
- Alex
[0] https://github.com/reubenhwk/radvd/blob/master/device-linux.c#L82
[1] https://github.com/mcr/unstrung/blob/5e7c4060730ab4f81ddcd75657d87ec78da91bd6/lib/libndmgmt/netlink.cpp#L358
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-01-21 20:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-20 20:57 [RFC bluetooth-next 0/4] ieee802154: UAPI changes Alexander Aring
2015-01-20 20:57 ` [RFC bluetooth-next 1/4] ieee802154: set wpan netdev devtype Alexander Aring
2015-01-20 20:57 ` [RFC bluetooth-next 2/4] ieee802154: 6lowpan: fix ARPHRD to ARPHRD_6LOWPAN Alexander Aring
2015-01-21 20:24 ` Alexander Aring
2015-01-20 20:57 ` [RFC bluetooth-next 3/4] ieee802154: change wpan-phy name to phy Alexander Aring
2015-01-20 20:57 ` [RFC bluetooth-next 4/4] ieee802154: remove deprecated sysfs entries Alexander Aring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox