linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH 1/2] iw: Allow setting RSSI threshold for peering
@ 2012-04-12 23:46 Ashok Nagarajan
  2012-04-12 23:46 ` [RESEND PATCH 2/2] iw: Show Toffset on station dump Ashok Nagarajan
  2012-04-18  1:57 ` [RESEND PATCH 1/2] iw: Allow setting RSSI threshold for peering Johannes Berg
  0 siblings, 2 replies; 4+ messages in thread
From: Ashok Nagarajan @ 2012-04-12 23:46 UTC (permalink / raw)
  To: linux-wireless, johannes; +Cc: javier, devel, Ashok Nagarajan

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
---
 Forgot to include Johannes in original submissions

 mesh.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/mesh.c b/mesh.c
index b2c7208..3f5a572 100644
--- a/mesh.c
+++ b/mesh.c
@@ -17,6 +17,7 @@ SECTION(mesh);
 typedef struct _any_t {
 	union {
 		uint32_t as_32;
+		int32_t as_s32;
 		uint16_t as_16;
 		uint8_t as_8;
 	} u;
@@ -96,6 +97,19 @@ static uint32_t _parse_u32(const char *str, _any *ret)
 	return 0;
 }
 
+static uint32_t _parse_s32(const char *str, _any *ret)
+{
+	char *endptr = NULL;
+	long int v = strtol(str, &endptr, 10);
+	if (*endptr != '\0')
+		return 0xffffffff;
+	if (v > 0xff)
+		return 0xffffffff;
+	ret->u.as_s32 = (int32_t)v;
+	return 0;
+}
+
+
 static void _print_u8(struct nlattr *a)
 {
 	printf("%d", nla_get_u8(a));
@@ -126,6 +140,12 @@ static void _print_u32_in_TUs(struct nlattr *a)
 	printf("%d TUs", nla_get_u32(a));
 }
 
+static void _print_s32_in_dBm(struct nlattr *a)
+{
+	printf("%d dBm", (int32_t) nla_get_u32(a));
+}
+
+
 /* The current mesh parameters */
 const static struct mesh_param_descr _mesh_param_descrs[] =
 {
@@ -179,6 +199,8 @@ const static struct mesh_param_descr _mesh_param_descrs[] =
 	_my_nla_put_u8, _parse_u8, _print_u8},
 	{"mesh_fwding", NL80211_MESHCONF_FORWARDING,
 	_my_nla_put_u8, _parse_u8_as_bool, _print_u8},
+	{"mesh_rssi_threshold", NL80211_MESHCONF_RSSI_THRESHOLD,
+	_my_nla_put_u32, _parse_s32, _print_s32_in_dBm},
 };
 
 static void print_all_mesh_param_descr(void)
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [RESEND PATCH 2/2] iw: Show Toffset on station dump
  2012-04-12 23:46 [RESEND PATCH 1/2] iw: Allow setting RSSI threshold for peering Ashok Nagarajan
@ 2012-04-12 23:46 ` Ashok Nagarajan
  2012-04-18  1:57   ` Johannes Berg
  2012-04-18  1:57 ` [RESEND PATCH 1/2] iw: Allow setting RSSI threshold for peering Johannes Berg
  1 sibling, 1 reply; 4+ messages in thread
From: Ashok Nagarajan @ 2012-04-12 23:46 UTC (permalink / raw)
  To: linux-wireless, johannes; +Cc: javier, devel, Ashok Nagarajan

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
---
 station.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/station.c b/station.c
index ef69ea5..75e2369 100644
--- a/station.c
+++ b/station.c
@@ -45,6 +45,7 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)
 		[NL80211_STA_INFO_RX_PACKETS] = { .type = NLA_U32 },
 		[NL80211_STA_INFO_TX_PACKETS] = { .type = NLA_U32 },
 		[NL80211_STA_INFO_SIGNAL] = { .type = NLA_U8 },
+		[NL80211_STA_INFO_T_OFFSET] = { .type = NLA_U64 },
 		[NL80211_STA_INFO_TX_BITRATE] = { .type = NLA_NESTED },
 		[NL80211_STA_INFO_LLID] = { .type = NLA_U16 },
 		[NL80211_STA_INFO_PLID] = { .type = NLA_U16 },
@@ -113,6 +114,9 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)
 	if (sinfo[NL80211_STA_INFO_SIGNAL_AVG])
 		printf("\n\tsignal avg:\t%d dBm",
 			(int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL_AVG]));
+	if (sinfo[NL80211_STA_INFO_T_OFFSET])
+		printf("\n\tToffset:\t%lld us",
+			(int64_t)nla_get_u64(sinfo[NL80211_STA_INFO_T_OFFSET]));
 
 	if (sinfo[NL80211_STA_INFO_TX_BITRATE]) {
 		if (nla_parse_nested(rinfo, NL80211_RATE_INFO_MAX,
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RESEND PATCH 1/2] iw: Allow setting RSSI threshold for peering
  2012-04-12 23:46 [RESEND PATCH 1/2] iw: Allow setting RSSI threshold for peering Ashok Nagarajan
  2012-04-12 23:46 ` [RESEND PATCH 2/2] iw: Show Toffset on station dump Ashok Nagarajan
@ 2012-04-18  1:57 ` Johannes Berg
  1 sibling, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2012-04-18  1:57 UTC (permalink / raw)
  To: Ashok Nagarajan; +Cc: linux-wireless, javier, devel

On Thu, 2012-04-12 at 16:46 -0700, Ashok Nagarajan wrote:
> Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
> ---
>  Forgot to include Johannes in original submissions

I don't quite remember but something here caused a compiler warning for
me.

johannes



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RESEND PATCH 2/2] iw: Show Toffset on station dump
  2012-04-12 23:46 ` [RESEND PATCH 2/2] iw: Show Toffset on station dump Ashok Nagarajan
@ 2012-04-18  1:57   ` Johannes Berg
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2012-04-18  1:57 UTC (permalink / raw)
  To: Ashok Nagarajan; +Cc: linux-wireless, javier, devel

On Thu, 2012-04-12 at 16:46 -0700, Ashok Nagarajan wrote:
> Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
> ---
>  station.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/station.c b/station.c
> index ef69ea5..75e2369 100644
> --- a/station.c
> +++ b/station.c
> @@ -45,6 +45,7 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)
>  		[NL80211_STA_INFO_RX_PACKETS] = { .type = NLA_U32 },
>  		[NL80211_STA_INFO_TX_PACKETS] = { .type = NLA_U32 },
>  		[NL80211_STA_INFO_SIGNAL] = { .type = NLA_U8 },
> +		[NL80211_STA_INFO_T_OFFSET] = { .type = NLA_U64 },
>  		[NL80211_STA_INFO_TX_BITRATE] = { .type = NLA_NESTED },
>  		[NL80211_STA_INFO_LLID] = { .type = NLA_U16 },
>  		[NL80211_STA_INFO_PLID] = { .type = NLA_U16 },
> @@ -113,6 +114,9 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)
>  	if (sinfo[NL80211_STA_INFO_SIGNAL_AVG])
>  		printf("\n\tsignal avg:\t%d dBm",
>  			(int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL_AVG]));
> +	if (sinfo[NL80211_STA_INFO_T_OFFSET])
> +		printf("\n\tToffset:\t%lld us",
> +			(int64_t)nla_get_u64(sinfo[NL80211_STA_INFO_T_OFFSET]));

Or maybe this did, that seems more likely.

johannes


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-04-18  1:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-12 23:46 [RESEND PATCH 1/2] iw: Allow setting RSSI threshold for peering Ashok Nagarajan
2012-04-12 23:46 ` [RESEND PATCH 2/2] iw: Show Toffset on station dump Ashok Nagarajan
2012-04-18  1:57   ` Johannes Berg
2012-04-18  1:57 ` [RESEND PATCH 1/2] iw: Allow setting RSSI threshold for peering Johannes Berg

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).