From patchwork Wed Mar 5 08:12:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 326629 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 EAE352C0096 for ; Wed, 5 Mar 2014 19:17:46 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 916859D1E7; Wed, 5 Mar 2014 03:17:42 -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 V1M30W4pjlf2; Wed, 5 Mar 2014 03:17:42 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 998D99D1ED; Wed, 5 Mar 2014 03:17:37 -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 04A099D1ED for ; Wed, 5 Mar 2014 03:17:36 -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 NE8UnNXWySYx for ; Wed, 5 Mar 2014 03:17:31 -0500 (EST) Received: from mail-ea0-f171.google.com (mail-ea0-f171.google.com [209.85.215.171]) (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 E09B59D1E7 for ; Wed, 5 Mar 2014 03:17:30 -0500 (EST) Received: by mail-ea0-f171.google.com with SMTP id n15so829436ead.2 for ; Wed, 05 Mar 2014 00:17:28 -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=okWGhAG45kdOT8gpXfvsQbfHFGqA6g+8ohsexaPkhMI=; b=gQ0fSDtqYfMhtat+kXdY8X9+28M922jlZzI5Rm0jC/VbcSrnWAIr6nY5c+wTvpTTJL HJYnK1fWhftdYvmK3zpTHZpk1sewwF+dpj0GkkqovZlgzKk5PEhpYh8t7IJ1BNI+gVuP bZIifSKRca864Ab6FysdLJRBclLJ9IY4oH5lg= 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=okWGhAG45kdOT8gpXfvsQbfHFGqA6g+8ohsexaPkhMI=; b=S3E2EBj/NXQU6/6G/bIG0IuwNAkdWkjtbdaMC4x8jGTte9JOd1aUuER+tnWrOgfVTx nFNxTAGVoyaTz/uART+0a7GbRANXqpExb6kW+0TkxKigLxofLHc1UdEFoOmsbdH6JNIT h26EY82SV6HddHbo0snJbLPAMQkMyVycvvdtiuL1pWAScx0MnD6CEGW4FRQc1Y9MsRwc uku82d8CtMDONMtVH1R//g4fVgwXJCINCldQO9aeWFnj1fdYm9PjTk6U3p4p2hVLbMGG nG8OSBzxFB5X550BgSkkPM9DIWcCR1eAC6G33v5I+lge6wepX7BWwsQFHvaFcrDFRsoR +nfw== X-Gm-Message-State: ALoCoQkgaTiNW03ucC1LVXARfmXHoA8idxEJO2emmkzq8V2UbMleLbYBih4gZS1PNiKtf13cnD1+uXCV+3jvs9AMFX74m/arwusHRpErBXHqBFp1w9A9uGE= X-Received: by 10.15.50.131 with SMTP id l3mr471163eew.110.1394007448185; Wed, 05 Mar 2014 00:17:28 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id x6sm5872970eew.20.2014.03.05.00.17.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Mar 2014 00:17:26 -0800 (PST) From: Michal Kazior To: j@w1.fi Subject: [PATCH] ACS: fix VHT80 segment picking Date: Wed, 5 Mar 2014 09:12:11 +0100 Message-Id: <1394007131-6845-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 code considered, e.g. [44, 48, 52, 56] as a valid VHT80 -- which is not. This resulted in, e.g. failure to start CAC when channels overlapped segments included DFS channels. This adds a check similar to the HT40 one to prevent that. The check is performed the way it is as the ACS code assumes primary channel to be the first channel in a given segment. Signed-off-by: Michal Kazior --- src/ap/acs.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/ap/acs.c b/src/ap/acs.c index f58b091..60b7580 100644 --- a/src/ap/acs.c +++ b/src/ap/acs.c @@ -367,6 +367,19 @@ static int acs_usable_ht40_chan(struct hostapd_channel_data *chan) } +static int acs_usable_vht80_chan(struct hostapd_channel_data *chan) +{ + const int allowed[] = { 36, 52, 100, 116, 132, 149 }; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(allowed); i++) + if (chan->chan == allowed[i]) + return 1; + + return 0; +} + + static int acs_survey_is_sufficient(struct freq_survey *survey) { if (!(survey->filled & SURVEY_HAS_NF)) { @@ -541,6 +554,15 @@ acs_find_ideal_chan(struct hostapd_iface *iface) continue; } + if (iface->current_mode->mode == HOSTAPD_MODE_IEEE80211A && + iface->conf->ieee80211ac && + iface->conf->vht_oper_chwidth == 1 && + !acs_usable_vht80_chan(chan)) { + wpa_printf(MSG_DEBUG, "ACS: Channel %d: not allowed as primary channel for VHT80", + chan->chan); + continue; + } + factor = 0; if (acs_usable_chan(chan)) factor = chan->interference_factor;