From patchwork Wed Jan 8 10:27:47 2014 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: 308185 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 B22162C0089 for ; Wed, 8 Jan 2014 21:28:16 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 0B7F79D252; Wed, 8 Jan 2014 05:28:14 -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 2iNMm2q1aKt6; Wed, 8 Jan 2014 05:28:13 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 269F99CD9E; Wed, 8 Jan 2014 05:28:09 -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 A96919D235 for ; Wed, 8 Jan 2014 05:28: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 GZu3QFoVWtQ7 for ; Wed, 8 Jan 2014 05:28:02 -0500 (EST) Received: from mail-ee0-f48.google.com (mail-ee0-f48.google.com [74.125.83.48]) (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 978FE9C1C4 for ; Wed, 8 Jan 2014 05:28:02 -0500 (EST) Received: by mail-ee0-f48.google.com with SMTP id e49so577751eek.7 for ; Wed, 08 Jan 2014 02:28:01 -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=H6b/WOKUHojQpsdYaNK31Uz0u3QHifn87wYX4k2oq7c=; b=TqqL0tUJ+1UD0dLewjB+HaJ3XLUc6ajAOMDL/gPla+9vohFMsfoY0AID9H8iQXzV/c NZavKjkPt6fHvtbNGSBXr2eIuyWITlHk3CZPgjahHxOwnyeqnKFei02NDrVlNNNlb6Jp 67ZC6U+8/OhK1vcP2CiCmgApfuS9KAYnih7OY= 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=H6b/WOKUHojQpsdYaNK31Uz0u3QHifn87wYX4k2oq7c=; b=ISeV4QKHeuDdlLPPFbB2QT8NNbLZYEjHb5CLcYlNtPzYf1w69cfpbh2odQA/7cwdJU 8wQZTpA+l+yBMbTgd8oxxPpV0GQwOROmVnM2RJpMD3JUou5Cna6XkMuEGJU4j85Atuth U9puD4FuqZBghjjFMM6yIl5mgCcwFft8nhDh92ZnggGgnxLr2EO8nW9JFxYS00FnVt/M HcwTIne1YqVHLuwxtHLj/xe0d1ccN6cpmanv0AuIXNLpB5cRJgOfaWitVMjM2qlz4Alx 0Pb5BWfxXrLXstMENYXEA11tgfX8bVQjMgdv/kWEzvDU0etEIDS5YVcax/ZjdwTuRB7j RTkg== X-Gm-Message-State: ALoCoQmkEK0FVhiZgA3xa8x3vzSt84v+AMERnzD4XUmu0A1bsiLbemywF0YBlPam9bP5VovHj3cHcxWV+4sJOYOxCv3EsjFExyt+hVAJIANET/JTNv2wX7g= X-Received: by 10.15.45.135 with SMTP id b7mr26304339eew.88.1389176881332; Wed, 08 Jan 2014 02:28:01 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id a51sm188064766eeh.8.2014.01.08.02.27.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Jan 2014 02:28:00 -0800 (PST) From: Janusz Dziedzic To: hostap@lists.shmoo.com Subject: [PATCH 1/2] hostapd: DFS/CSA check if CSA in progress Date: Wed, 8 Jan 2014 11:27:47 +0100 Message-Id: <1389176868-6610-1-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.7.9.5 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 Check if CSA is already in progress, before trigger new channel switch. Signed-hostap: Janusz Dziedzic --- src/ap/dfs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ap/dfs.c b/src/ap/dfs.c index caf4092..7ee829a 100644 --- a/src/ap/dfs.c +++ b/src/ap/dfs.c @@ -680,14 +680,17 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface) struct hostapd_data *hapd = iface->bss[0]; int err = 1; - wpa_printf(MSG_DEBUG, "%s called (CAC active: %s)", __func__, - iface->cac_started ? "yes" : "no"); + wpa_printf(MSG_DEBUG, "%s called (CAC active: %s, CSA active: %s)", __func__, + iface->cac_started ? "yes" : "no", iface->csa_in_progress ? "yes" : "no"); + + /* Check if CSA in progress */ + if (iface->csa_in_progress) + return 0; /* Check if active CAC */ if (iface->cac_started) return hostapd_dfs_start_channel_switch_cac(iface); - /* Perform channel switch/CSA */ channel = dfs_get_valid_channel(iface, &secondary_channel, &vht_oper_centr_freq_seg0_idx,