linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@open-mesh.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org,
	Julian Calaby <julian.calaby@gmail.com>,
	Sven Eckelmann <sven@open-mesh.com>
Subject: [PATCH v3 3/4] iw: use get_cf1 and struct chanmode for ocb
Date: Wed, 25 Nov 2015 14:59:17 +0100	[thread overview]
Message-ID: <1448459959-23641-3-git-send-email-sven@open-mesh.com> (raw)
In-Reply-To: <1448459959-23641-1-git-send-email-sven@open-mesh.com>

The struct chanmode and the function get_cf1 is already used by ibss and
mesh. Also use it for ocb to make it consistent for for all join functions.

Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
---
v3:
 * split patch into two different patches (0001/0002) as request by
   Julian Calaby <julian.calaby@gmail.com>
 * change join_ocb to also use get_cf1
 * move NOHT to the last entry in the mesh/ibss join usage texts as
   requested by Julian Calaby <julian.calaby@gmail.com>
v2:
 * rebase from v4.3-ish version to current master

 ocb.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/ocb.c b/ocb.c
index 767eb82..bcf0474 100644
--- a/ocb.c
+++ b/ocb.c
@@ -13,14 +13,16 @@ static int join_ocb(struct nl80211_state *state,
 	unsigned long freq;
 	char *end;
 	unsigned int i;
-	static const struct {
-		const char *name;
-		unsigned int width;
-	} *chanmode_selected, chanmode[] = {
+	const struct chanmode *chanmode_selected = NULL;
+	static const struct chanmode chanmode[] = {
 		{ .name = "5MHz",
-		  .width = NL80211_CHAN_WIDTH_5	},
+		  .width = NL80211_CHAN_WIDTH_5,
+		  .freq1_diff = 0,
+		  .chantype = -1 },
 		{ .name = "10MHz",
-		  .width = NL80211_CHAN_WIDTH_10 },
+		  .width = NL80211_CHAN_WIDTH_10,
+		  .freq1_diff = 0,
+		  .chantype = -1 },
 	};
 
 	if (argc < 2)
@@ -45,7 +47,8 @@ static int join_ocb(struct nl80211_state *state,
 	if (chanmode_selected) {
 		NLA_PUT_U32(msg, NL80211_ATTR_CHANNEL_WIDTH,
 			    chanmode_selected->width);
-		NLA_PUT_U32(msg, NL80211_ATTR_CENTER_FREQ1, freq);
+		NLA_PUT_U32(msg, NL80211_ATTR_CENTER_FREQ1,
+			    get_cf1(chanmode_selected, freq));
 
 		argv++;
 		argc--;
-- 
2.6.2


  parent reply	other threads:[~2015-11-25 13:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 13:59 [PATCH v3 1/4] iw: prepare get_cf1 for use in join_* functions Sven Eckelmann
2015-11-25 13:59 ` [PATCH v3 2/4] iw: add VHT80 support for 802.11s Sven Eckelmann
2015-11-25 13:59 ` Sven Eckelmann [this message]
2015-11-25 13:59 ` [PATCH v3 4/4] iw: print NOHT always as last in usage texts Sven Eckelmann

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=1448459959-23641-3-git-send-email-sven@open-mesh.com \
    --to=sven@open-mesh.com \
    --cc=johannes@sipsolutions.net \
    --cc=julian.calaby@gmail.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 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).