* [PATCH wpan-tools 1/5] phy: remove split dump feature
@ 2014-11-08 17:00 Alexander Aring
2014-11-08 17:00 ` [PATCH wpan-tools 2/5] interface: backoff exponents print human readable Alexander Aring
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Alexander Aring @ 2014-11-08 17:00 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring
This patch removes the split dump feature. We don't use this right now
in kernelspace and was copy&pasted from iw tool.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
src/info.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/src/info.c b/src/info.c
index 6bbe3f0..50a7bba 100644
--- a/src/info.c
+++ b/src/info.c
@@ -79,8 +79,6 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
return 0;
}
-static bool nl802154_has_split_wiphy = false;
-
static int handle_info(struct nl802154_state *state,
struct nl_cb *cb,
struct nl_msg *msg,
@@ -88,13 +86,8 @@ static int handle_info(struct nl802154_state *state,
enum id_input id)
{
char *feat_args[] = { "features", "-q" };
- int err;
- err = handle_cmd(state, CIB_NONE, 2, feat_args);
- if (!err && nl802154_has_split_wiphy) {
- nla_put_flag(msg, NL802154_ATTR_SPLIT_WPAN_PHY_DUMP);
- nlmsg_hdr(msg)->nlmsg_flags |= NLM_F_DUMP;
- }
+ handle_cmd(state, CIB_NONE, 2, feat_args);
nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_phy_handler, NULL);
--
2.1.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH wpan-tools 2/5] interface: backoff exponents print human readable
2014-11-08 17:00 [PATCH wpan-tools 1/5] phy: remove split dump feature Alexander Aring
@ 2014-11-08 17:00 ` Alexander Aring
2014-11-08 17:00 ` [PATCH wpan-tools 3/5] mac: do backoff_exponent into one cmd Alexander Aring
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Aring @ 2014-11-08 17:00 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring
First print the minumum then the maxmimum backoff exponent attributes.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
src/interface.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/interface.c b/src/interface.c
index 808b246..40c18ef 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -160,12 +160,12 @@ static int print_iface_handler(struct nl_msg *msg, void *arg)
printf("%s\twpan_phy %d\n", indent, nla_get_u32(tb_msg[NL802154_ATTR_WPAN_PHY]));
if (tb_msg[NL802154_ATTR_MAX_FRAME_RETRIES])
printf("%s\tmax_frame_retries %d\n", indent, nla_get_s8(tb_msg[NL802154_ATTR_MAX_FRAME_RETRIES]));
+ if (tb_msg[NL802154_ATTR_MIN_BE])
+ printf("%s\tmin_be %d\n", indent, nla_get_u8(tb_msg[NL802154_ATTR_MIN_BE]));
if (tb_msg[NL802154_ATTR_MAX_BE])
printf("%s\tmax_be %d\n", indent, nla_get_u8(tb_msg[NL802154_ATTR_MAX_BE]));
if (tb_msg[NL802154_ATTR_MAX_CSMA_BACKOFFS])
printf("%s\tmax_csma_backoffs %d\n", indent, nla_get_u8(tb_msg[NL802154_ATTR_MAX_CSMA_BACKOFFS]));
- if (tb_msg[NL802154_ATTR_MIN_BE])
- printf("%s\tmin_be %d\n", indent, nla_get_u8(tb_msg[NL802154_ATTR_MIN_BE]));
if (tb_msg[NL802154_ATTR_LBT_MODE])
printf("%s\tlbt %d\n", indent, nla_get_u8(tb_msg[NL802154_ATTR_LBT_MODE]));
@@ -181,7 +181,6 @@ static int handle_interface_info(struct nl802154_state *state,
nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_iface_handler, NULL);
return 0;
}
-
TOPLEVEL(info, NULL, NL802154_CMD_GET_INTERFACE, 0, CIB_NETDEV, handle_interface_info,
"Show information for this interface.");
--
2.1.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH wpan-tools 3/5] mac: do backoff_exponent into one cmd
2014-11-08 17:00 [PATCH wpan-tools 1/5] phy: remove split dump feature Alexander Aring
2014-11-08 17:00 ` [PATCH wpan-tools 2/5] interface: backoff exponents print human readable Alexander Aring
@ 2014-11-08 17:00 ` Alexander Aring
2014-11-08 17:00 ` [PATCH wpan-tools 4/5] phy: do page and channel setting " Alexander Aring
2014-11-08 17:00 ` [PATCH wpan-tools 5/5] nl802154: update nl802154 header Alexander Aring
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Aring @ 2014-11-08 17:00 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring
This patch do the backoff exponent setting in one netlink cmd. These
parameters depends on each other and should be set in one cmd.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
src/mac.c | 54 +++++++++++++++++-------------------------------------
1 file changed, 17 insertions(+), 37 deletions(-)
diff --git a/src/mac.c b/src/mac.c
index a6c456f..3f2dfc8 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -95,23 +95,30 @@ COMMAND(set, max_frame_retries, "<retries>",
NL802154_CMD_SET_MAX_FRAME_RETRIES, 0, CIB_NETDEV,
handle_max_frame_retries_set, NULL);
-static int handle_max_be(struct nl802154_state *state,
- struct nl_cb *cb,
- struct nl_msg *msg,
- int argc, char **argv,
- enum id_input id)
+static int handle_backoff_exponent(struct nl802154_state *state,
+ struct nl_cb *cb,
+ struct nl_msg *msg,
+ int argc, char **argv,
+ enum id_input id)
{
unsigned long max_be;
+ unsigned long min_be;
char *end;
- if (argc < 1)
+ if (argc < 2)
+ return 1;
+
+ /* MIN_BE */
+ min_be = strtoul(argv[0], &end, 0);
+ if (*end != '\0')
return 1;
/* MAX_BE */
- max_be = strtoul(argv[0], &end, 0);
+ max_be = strtoul(argv[1], &end, 0);
if (*end != '\0')
return 1;
+ NLA_PUT_U8(msg, NL802154_ATTR_MIN_BE, min_be);
NLA_PUT_U8(msg, NL802154_ATTR_MAX_BE, max_be);
return 0;
@@ -119,9 +126,9 @@ static int handle_max_be(struct nl802154_state *state,
nla_put_failure:
return -ENOBUFS;
}
-COMMAND(set, max_be, "<max_be>",
- NL802154_CMD_SET_MAX_BE, 0, CIB_NETDEV,
- handle_max_be, NULL);
+COMMAND(set, backoff_exponents, "<min_be> <max_be>",
+ NL802154_CMD_SET_BACKOFF_EXPONENT, 0, CIB_NETDEV,
+ handle_backoff_exponent, NULL);
static int handle_max_csma_backoffs(struct nl802154_state *state,
struct nl_cb *cb,
@@ -151,33 +158,6 @@ COMMAND(set, max_csma_backoffs, "<backoffs>",
NL802154_CMD_SET_MAX_CSMA_BACKOFFS, 0, CIB_NETDEV,
handle_max_csma_backoffs, NULL);
-static int handle_min_be(struct nl802154_state *state,
- struct nl_cb *cb,
- struct nl_msg *msg,
- int argc, char **argv,
- enum id_input id)
-{
- unsigned long min_be;
- char *end;
-
- if (argc < 1)
- return 1;
-
- /* MIN_BE */
- min_be = strtoul(argv[0], &end, 0);
- if (*end != '\0')
- return 1;
-
- NLA_PUT_U8(msg, NL802154_ATTR_MIN_BE, min_be);
-
- return 0;
-
-nla_put_failure:
- return -ENOBUFS;
-}
-COMMAND(set, min_be, "<min_be>",
- NL802154_CMD_SET_MIN_BE, 0, CIB_NETDEV,
- handle_min_be, NULL);
static int handle_lbt_mode(struct nl802154_state *state,
struct nl_cb *cb,
--
2.1.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH wpan-tools 4/5] phy: do page and channel setting into one cmd
2014-11-08 17:00 [PATCH wpan-tools 1/5] phy: remove split dump feature Alexander Aring
2014-11-08 17:00 ` [PATCH wpan-tools 2/5] interface: backoff exponents print human readable Alexander Aring
2014-11-08 17:00 ` [PATCH wpan-tools 3/5] mac: do backoff_exponent into one cmd Alexander Aring
@ 2014-11-08 17:00 ` Alexander Aring
2014-11-08 17:00 ` [PATCH wpan-tools 5/5] nl802154: update nl802154 header Alexander Aring
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Aring @ 2014-11-08 17:00 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring
This patch puts the page and channel setting in one cmd. These
parameters depends on each other and should be set in one cmd.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
src/phy.c | 40 ++++++++++------------------------------
1 file changed, 10 insertions(+), 30 deletions(-)
diff --git a/src/phy.c b/src/phy.c
index e57ad6a..8379786 100644
--- a/src/phy.c
+++ b/src/phy.c
@@ -13,33 +13,6 @@
#include "nl802154.h"
#include "iwpan.h"
-static int handle_page_set(struct nl802154_state *state,
- struct nl_cb *cb,
- struct nl_msg *msg,
- int argc, char **argv,
- enum id_input id)
-{
- unsigned long page;
- char *end;
-
- if (argc < 1)
- return 1;
-
- /* PAGE */
- page = strtoul(argv[0], &end, 10);
- if (*end != '\0')
- return 1;
-
- NLA_PUT_U8(msg, NL802154_ATTR_PAGE, page);
-
- return 0;
-
-nla_put_failure:
- return -ENOBUFS;
-}
-COMMAND(set, page, "<page>",
- NL802154_CMD_SET_PAGE, 0, CIB_PHY, handle_page_set, NULL);
-
static int handle_channel_set(struct nl802154_state *state,
struct nl_cb *cb,
struct nl_msg *msg,
@@ -47,16 +20,23 @@ static int handle_channel_set(struct nl802154_state *state,
enum id_input id)
{
unsigned long channel;
+ unsigned long page;
char *end;
- if (argc < 1)
+ if (argc < 2)
+ return 1;
+
+ /* PAGE */
+ page = strtoul(argv[0], &end, 10);
+ if (*end != '\0')
return 1;
/* CHANNEL */
- channel = strtoul(argv[0], &end, 10);
+ channel = strtoul(argv[1], &end, 10);
if (*end != '\0')
return 1;
+ NLA_PUT_U8(msg, NL802154_ATTR_PAGE, page);
NLA_PUT_U8(msg, NL802154_ATTR_CHANNEL, channel);
return 0;
@@ -64,7 +44,7 @@ static int handle_channel_set(struct nl802154_state *state,
nla_put_failure:
return -ENOBUFS;
}
-COMMAND(set, channel, "<channel>",
+COMMAND(set, channel, "<page> <channel>",
NL802154_CMD_SET_CHANNEL, 0, CIB_PHY, handle_channel_set, NULL);
static int handle_tx_power_set(struct nl802154_state *state,
--
2.1.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH wpan-tools 5/5] nl802154: update nl802154 header
2014-11-08 17:00 [PATCH wpan-tools 1/5] phy: remove split dump feature Alexander Aring
` (2 preceding siblings ...)
2014-11-08 17:00 ` [PATCH wpan-tools 4/5] phy: do page and channel setting " Alexander Aring
@ 2014-11-08 17:00 ` Alexander Aring
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Aring @ 2014-11-08 17:00 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
src/nl802154.h | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/src/nl802154.h b/src/nl802154.h
index f799d59..0f86ef8 100644
--- a/src/nl802154.h
+++ b/src/nl802154.h
@@ -38,7 +38,6 @@ enum nl802154_commands {
NL802154_CMD_NEW_INTERFACE,
NL802154_CMD_DEL_INTERFACE,
- NL802154_CMD_SET_PAGE,
NL802154_CMD_SET_CHANNEL,
NL802154_CMD_SET_PAN_ID,
@@ -50,9 +49,8 @@ enum nl802154_commands {
NL802154_CMD_SET_MAX_FRAME_RETRIES,
- NL802154_CMD_SET_MAX_BE,
+ NL802154_CMD_SET_BACKOFF_EXPONENT,
NL802154_CMD_SET_MAX_CSMA_BACKOFFS,
- NL802154_CMD_SET_MIN_BE,
NL802154_CMD_SET_LBT_MODE,
@@ -77,10 +75,6 @@ enum nl802154_attrs {
NL802154_ATTR_WPAN_DEV,
- NL802154_ATTR_IFACE_SOCKET_OWNER,
-
- NL802154_ATTR_SPLIT_WPAN_PHY_DUMP,
-
NL802154_ATTR_PAGE,
NL802154_ATTR_CHANNEL,
@@ -96,8 +90,8 @@ enum nl802154_attrs {
NL802154_ATTR_MAX_FRAME_RETRIES,
NL802154_ATTR_MAX_BE,
- NL802154_ATTR_MAX_CSMA_BACKOFFS,
NL802154_ATTR_MIN_BE,
+ NL802154_ATTR_MAX_CSMA_BACKOFFS,
NL802154_ATTR_LBT_MODE,
--
2.1.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-11-08 17:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-08 17:00 [PATCH wpan-tools 1/5] phy: remove split dump feature Alexander Aring
2014-11-08 17:00 ` [PATCH wpan-tools 2/5] interface: backoff exponents print human readable Alexander Aring
2014-11-08 17:00 ` [PATCH wpan-tools 3/5] mac: do backoff_exponent into one cmd Alexander Aring
2014-11-08 17:00 ` [PATCH wpan-tools 4/5] phy: do page and channel setting " Alexander Aring
2014-11-08 17:00 ` [PATCH wpan-tools 5/5] nl802154: update nl802154 header Alexander Aring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).