From patchwork Thu Oct 24 15:40:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz.Dziedzic@tieto.com X-Patchwork-Id: 285952 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 DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 4D8D82C009F for ; Fri, 25 Oct 2013 02:41:23 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id BD15B9C148; Thu, 24 Oct 2013 11:41:18 -0400 (EDT) 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 hPUA60-nVeUb; Thu, 24 Oct 2013 11:41:18 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 088739C16F; Thu, 24 Oct 2013 11:41:08 -0400 (EDT) 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 A84219C16E for ; Thu, 24 Oct 2013 11:41:06 -0400 (EDT) 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 gpY0PXVfn1AM for ; Thu, 24 Oct 2013 11:41:01 -0400 (EDT) Received: from mail-we0-f174.google.com (mail-we0-f174.google.com [74.125.82.174]) (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 9859F9C10C for ; Thu, 24 Oct 2013 11:41:01 -0400 (EDT) Received: by mail-we0-f174.google.com with SMTP id u56so2521504wes.19 for ; Thu, 24 Oct 2013 08:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2IdQqEH5z+r97mZmmWbq4LMPu0uKd3lSeimHRc7YNTk=; b=pi5dYywiSnuZxy+azHmQhPQguEsvq4UL9vHtUwaI/jcJvFns2XXrsDGVdPHEDfdnP+ tp3WXt+pNI/ueOiG5IQuMCsdfO0ikJ0/PDtd5pPh7fQyBxvR2pGN0NbDZxAbwSfUJ9E/ 3mLRdJo9mQvJ2grmboLt2k77CzxSwTeOolmLk= 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=2IdQqEH5z+r97mZmmWbq4LMPu0uKd3lSeimHRc7YNTk=; b=GDan2PvsooecO5WrS76+8CpLHO6B4Rk35FupHcg8ofmLkIkLODW1SoHCUAP09FTgqZ fyhPK4VmQUpXf/f8lvj/aCQNmwLRU6piNuHGp1coWxGAFGhh0w70zI6UGY6Vtv50Fn7H pUWvz+Q9fnn9h38YXhh6GOaANza7lqZxVwX9W8uXLJ3GoqzxIEkTrr3Ug8XQxRMeDkLi I7WzUB1UcKyITpj7V/DlZV8oy15+RPa0HkTCfIdtTWKUekBuRomOm4u2ciAFjNwMDj2D xSzSZ9fHmkMfuz9EYnC3A914VLrVR99uzV/+/5VSeTED2iB+XTGDPtZh6Hb9so+kxSp8 2k8Q== X-Gm-Message-State: ALoCoQnjfZse9SIIiQ4HDkloKSWkjZe86K2/1LISsAAmiuwu3PM5VW2hPfyscAhg3xTh5Z45wW+MJdwg7RhfBOxtkCbIiMfnVicwFHIxtMTyqDEQPiiLVvo= X-Received: by 10.180.187.169 with SMTP id ft9mr2872839wic.14.1382629260312; Thu, 24 Oct 2013 08:41:00 -0700 (PDT) Received: from dell.eicc.co.uk (ed03490-ge-0-0-0.mgdfwr.lumison.net. [212.20.242.100]) by mx.google.com with ESMTPSA id c10sm28194410wie.11.2013.10.24.08.40.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Oct 2013 08:40:59 -0700 (PDT) From: Janusz Dziedzic To: hostap@lists.shmoo.com Subject: [PATCH 2/4] hostapd: DFS adjust center freq correctly for VHT20/VHT40 Date: Thu, 24 Oct 2013 17:40:26 +0200 Message-Id: <1382629228-8895-2-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1382629228-8895-1-git-send-email-janusz.dziedzic@tieto.com> References: <1382629228-8895-1-git-send-email-janusz.dziedzic@tieto.com> X-DomainID: tieto.com Cc: j@w1.fi 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 Setup correct seg0 when VHT and width 20/40 MHz (VHT_CHANWIDTH_USE_HT). Signed-hostap: Janusz Dziedzic --- src/ap/dfs.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ap/dfs.c b/src/ap/dfs.c index 70696cd..10e7e48 100644 --- a/src/ap/dfs.c +++ b/src/ap/dfs.c @@ -150,7 +150,13 @@ static void dfs_adjust_vht_center_freq(struct hostapd_data *hapd, switch (hapd->iconf->vht_oper_chwidth) { case VHT_CHANWIDTH_USE_HT: - hapd->iconf->vht_oper_centr_freq_seg0_idx = chan->chan + 2; + if (hapd->iconf->secondary_channel == 1) + hapd->iconf->vht_oper_centr_freq_seg0_idx = chan->chan + 2; + else if (hapd->iconf->secondary_channel == -1) + hapd->iconf->vht_oper_centr_freq_seg0_idx = chan->chan - 2; + else + hapd->iconf->vht_oper_centr_freq_seg0_idx = chan->chan; + break; case VHT_CHANWIDTH_80MHZ: hapd->iconf->vht_oper_centr_freq_seg0_idx = chan->chan + 6;