From patchwork Fri Feb 28 14:19:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 325230 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 514582C00B0 for ; Sat, 1 Mar 2014 01:25:10 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id AB75A9C152; Fri, 28 Feb 2014 09:25:07 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7N6MhKw7RPrz; Fri, 28 Feb 2014 09:25:07 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B65FF9C158; Fri, 28 Feb 2014 09:25:02 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 888A89C158 for ; Fri, 28 Feb 2014 09:25:01 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1na8xKbZdenG for ; Fri, 28 Feb 2014 09:24:56 -0500 (EST) Received: from mail-ee0-f47.google.com (mail-ee0-f47.google.com [74.125.83.47]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 6FCA69C152 for ; Fri, 28 Feb 2014 09:24:56 -0500 (EST) Received: by mail-ee0-f47.google.com with SMTP id e49so2297451eek.34 for ; Fri, 28 Feb 2014 06:24:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=4Q4Hk8Sr+Sp1Dcb11bAg7BtOsKulXatTKCHkFRrjnhU=; b=3Ib4UTYM+AipsK/ubH4K0FQK5bmfPJ/MxaMAtBBCZuFTrh+rb1qeAazP82rWQ2kEgM WrsKXfhWtwMFUNSeZZlaP/LQPhxflJtO+KerYmqTJBLdQFI6OxamVCSlkbbrIDim1P37 BLQRbog6XoeuBLCwpsJjgPfwk+ITAVRCI4Klw= 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; bh=4Q4Hk8Sr+Sp1Dcb11bAg7BtOsKulXatTKCHkFRrjnhU=; b=O62JCqtVAQfit0sXhRKwpOoO5clrF5UpsBorg1HKI64TuhKckT3kkCdeRL0ft4LVJY fpSqkkkHsQ1bd+h77ibfzh3QoPmeqJHB+9QNLN+PSso68xgUGOLXb2KBhEhky99M8JvE QFQQPk26AwueXU40DtqaVOoOH8JGfN+QrygHE69VXfma5je0iKyvEYnSzt6fbGSJEMzF 1lbLZyqEpXu78ux5OKT7SayIaEyZASyS/BuBDx9XUoJYGvpRBtoSStQAM6ePIC6c2fMC 8fn++rY455JeMlcvnbFiVXwXp9U/wQi4ILPiPojveECsldzV7415MYy1FCfOWuxdSXoo h3Sg== X-Gm-Message-State: ALoCoQlqPhlYDskYAFp++gp4osdMJUnr9mdM1yc9TpkEs2ZmyxpgE1f9cqy1deiPI2Fudjab1cN7pvfASPaZ4GjNuLRVWWnFHKO/+gjEhMczMHBVMbBIBXk= X-Received: by 10.15.98.73 with SMTP id bi49mr1271328eeb.110.1393597493923; Fri, 28 Feb 2014 06:24:53 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id y51sm11057462eeu.0.2014.02.28.06.24.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2014 06:24:53 -0800 (PST) From: Michal Kazior To: j@w1.fi Subject: [PATCH] ACS: fix VHT20 Date: Fri, 28 Feb 2014 15:19:42 +0100 Message-Id: <1393597182-27218-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 X-DomainID: tieto.com Cc: hostap@lists.shmoo.com X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com The center segment0 calculation for VHT20 ACS was incorrect. This caused ACS to fail with: "Could not set channel for kernel driver". Signed-off-by: Michal Kazior --- src/ap/acs.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ap/acs.c b/src/ap/acs.c index f58b091..acb13b4 100644 --- a/src/ap/acs.c +++ b/src/ap/acs.c @@ -616,23 +616,26 @@ acs_find_ideal_chan(struct hostapd_iface *iface) static void acs_adjust_vht_center_freq(struct hostapd_iface *iface) { + int offset; + wpa_printf(MSG_DEBUG, "ACS: Adjusting VHT center frequency"); switch (iface->conf->vht_oper_chwidth) { case VHT_CHANWIDTH_USE_HT: - iface->conf->vht_oper_centr_freq_seg0_idx = - iface->conf->channel + 2; + offset = 2 * iface->conf->secondary_channel; break; case VHT_CHANWIDTH_80MHZ: - iface->conf->vht_oper_centr_freq_seg0_idx = - iface->conf->channel + 6; + offset = 6; break; default: /* TODO: How can this be calculated? Adjust * acs_find_ideal_chan() */ wpa_printf(MSG_INFO, "ACS: Only VHT20/40/80 is supported now"); - break; + return; } + + iface->conf->vht_oper_centr_freq_seg0_idx = + iface->conf->channel + offset; }