All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] iw: Add support for connection quality monitor configuation
Date: Thu, 25 Mar 2010 23:07:29 -0700	[thread overview]
Message-ID: <1269583649.4581.4.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1269582379-10253-1-git-send-email-juuso.oikarinen@nokia.com>

On Fri, 2010-03-26 at 07:46 +0200, Juuso Oikarinen wrote:
> This patch adds the cqm option to iw allowing enabling/disabling the
> rssi connection quality monitoring mode, and configuring rssi threshold and
> hysteresis.
> 
> Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
> ---
>  Makefile  |    2 +-
>  cqm.c     |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  event.c   |   33 +++++++++++++++++++++++++++++++++
>  nl80211.h |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 138 insertions(+), 1 deletions(-)
>  create mode 100644 cqm.c
> 
> diff --git a/Makefile b/Makefile
> index c51706b..e21900a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -17,7 +17,7 @@ CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
>  OBJS = iw.o genl.o event.o info.o phy.o \
>  	interface.o ibss.o station.o survey.o util.o \
>  	mesh.o mpath.o scan.o reg.o version.o \
> -	reason.o status.o connect.o link.o offch.o ps.o
> +	reason.o status.o connect.o link.o offch.o ps.o cqm.c
>  OBJS += sections.o
>  ALL = iw
>  
> diff --git a/cqm.c b/cqm.c
> new file mode 100644
> index 0000000..3da2b54
> --- /dev/null
> +++ b/cqm.c
> @@ -0,0 +1,54 @@
> +#include <errno.h>
> +
> +#include <netlink/genl/genl.h>
> +#include <netlink/genl/family.h>
> +#include <netlink/genl/ctrl.h>
> +#include <netlink/msg.h>
> +#include <netlink/attr.h>
> +
> +#include "nl80211.h"
> +#include "iw.h"
> +
> +static int iw_cqm_rssi(struct nl80211_state *state, struct nl_cb *cb,
> +		       struct nl_msg *msg, int argc, char **argv)
> +{
> +	struct nl_msg *cqm = NULL;
> +	int thold = 0;
> +	int hyst = 0;
> +	int ret = -ENOSPC;
> +
> +	/* get the required args */
> +	if (argc < 1 || argc > 2)
> +		return 1;
> +
> +	if (strcmp(argv[0], "off")) {
> +		thold = atoi(argv[0]);
> +
> +		if (thold == 0)
> +			return -EINVAL;
> +
> +		if (argc == 2)
> +			hyst = atoi(argv[1]);
> +	}
> +
> +	/* connection quality monitor attributes */
> +	cqm = nlmsg_alloc();
> +
> +	NLA_PUT_U32(cqm, NL80211_ATTR_CQM_RSSI_THOLD, thold);
> +	NLA_PUT_U32(cqm, NL80211_ATTR_CQM_RSSI_HYST, hyst);

Hmm. guess I missed that in the kernel side review, but should we change
the API so that leaving them out means disabling?

johannes


  reply	other threads:[~2010-03-26  6:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26  5:46 [PATCH] iw: Add support for connection quality monitor configuation Juuso Oikarinen
2010-03-26  6:07 ` Johannes Berg [this message]
2010-03-26  6:14   ` Juuso Oikarinen
2010-03-26  6:21     ` Johannes Berg
2010-03-26  6:23       ` Juuso Oikarinen
2010-03-31  4:53       ` Juuso Oikarinen
2010-03-31  5:23         ` Johannes Berg
2010-03-31  5:24           ` Juuso Oikarinen
2010-03-31  5:36             ` Johannes Berg
2010-03-31  5:45               ` Juuso Oikarinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1269583649.4581.4.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=juuso.oikarinen@nokia.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.