From patchwork Wed Nov 25 13:59:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 7699641 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DD59F9F2EC for ; Wed, 25 Nov 2015 13:59:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 13110208E5 for ; Wed, 25 Nov 2015 13:59:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A63C20854 for ; Wed, 25 Nov 2015 13:59:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754317AbbKYN7d (ORCPT ); Wed, 25 Nov 2015 08:59:33 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:38549 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754295AbbKYN7c (ORCPT ); Wed, 25 Nov 2015 08:59:32 -0500 Received: by wmec201 with SMTP id c201so71307218wme.1 for ; Wed, 25 Nov 2015 05:59:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=open-mesh-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=geENKk0wFn4cMapmNYxuVuSi28e8pZWPzt459Y4DG0s=; b=hZjn7H1nVTo0zNsMoxsag+AjwWMuqQrywwsq2KnhzTeoefWBCVs1WLmSfDEPoEVk9g juYfAtiJRkicRxQKtKp5FwXS8bDvkB0s2CKIOIyTZtNK9UkwXH9ZbQ7u+jmBtA/iyWCy XvwUcvUN8L8nuN+nsM/06i1XITxE7F70p30Sy8dbw1w270CmE13YhGrcCanWMWdGWGyQ JHJx96ex4sa2C6lFtcVe9xm5fWVm5Ymh02I2j2nEftwsQrXzBiaZxl8i+lcej1t+FCPo MdixOVyga3cM7P1jYNfCLFPBksTkx/mgvDnrZeyA2JqSrhwQJ5YfOwjTi++bZTcEwzDP vcaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=geENKk0wFn4cMapmNYxuVuSi28e8pZWPzt459Y4DG0s=; b=erpEN2EV7Hydw7j+7TNEjL+d5JptiFPPcCeGlOFzrXm9H9jWgDeoe5ZoyYvCUi/3pW kStZz/javYqAUNny0Hh6sV0qrmu80EPpDKc+O9ngven2891CX/HHDXZfCpyRswPQdIQm W416CNU9Ai8dmozCtN26iqOxvIDDXgS2HOrRYzDWEZGdQDKx6tUXHCIT87wQqldmXETn p0Foh/+KsTY+z/LNOVm6zx4Bz6t0s1lnPxKDfVTZ3j8slrxn5nkodKctMmVIpHsOg6p5 RMkfWF3A0uAodO3dp84vCABvmsCRw/Hqk050+D9v3+dSkpe6scfjGJ4Bhl7bBouC/BPq /s7A== X-Gm-Message-State: ALoCoQlEHfvi2dxElg5Rp5gZsacewJzG21lfNMnAf4VgA8ongjM9MYRCqAQKvSwx9dGPeBenF2Uj X-Received: by 10.28.195.10 with SMTP id t10mr4465831wmf.11.1448459971902; Wed, 25 Nov 2015 05:59:31 -0800 (PST) Received: from sven-desktop.home.narfation.org (x4d05aec6.dyn.telefonica.de. [77.5.174.198]) by smtp.gmail.com with ESMTPSA id jt9sm23397714wjc.24.2015.11.25.05.59.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Nov 2015 05:59:31 -0800 (PST) From: Sven Eckelmann To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Julian Calaby , Sven Eckelmann Subject: [PATCH v3 3/4] iw: use get_cf1 and struct chanmode for ocb Date: Wed, 25 Nov 2015 14:59:17 +0100 Message-Id: <1448459959-23641-3-git-send-email-sven@open-mesh.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1448459959-23641-1-git-send-email-sven@open-mesh.com> References: <1448459959-23641-1-git-send-email-sven@open-mesh.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- v3: * split patch into two different patches (0001/0002) as request by Julian Calaby * 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 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--;