From patchwork Wed Jun 25 11:20:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 363944 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]) by ozlabs.org (Postfix) with ESMTP id 37C8C1400A7 for ; Wed, 25 Jun 2014 21:29:23 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 8E6149C22B; Wed, 25 Jun 2014 07:29:17 -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 Ee47glG7UZ4b; Wed, 25 Jun 2014 07:29:17 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 876F29C330; Wed, 25 Jun 2014 07:28:39 -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 636DB9C240 for ; Wed, 25 Jun 2014 07:28:38 -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 qOk4XMlyjsY3 for ; Wed, 25 Jun 2014 07:28:32 -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 4E63C9C1ED for ; Wed, 25 Jun 2014 07:28:30 -0400 (EDT) Received: by mail-we0-f174.google.com with SMTP id u57so1919744wes.33 for ; Wed, 25 Jun 2014 04:28:29 -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=0i2JkfQAX7KuN18/M430r7Ziz1RJTF4+JSS9uyBLJko=; b=MUnHP1G1lSVl1QSOC3Z1tSevaMlO0+5n7JhIgy70+TZtYAdF8tFroYQYZowfpFhpy4 /q7AtO/+Ts3aLjY/Vh+bbdFX2RBAcOOrUXMtzzPZArBcasZE8p1ZUpCIKt8lauCTU5vr PFPMs+PeBUacQZsCeBD/7x1UAkonCgRsawUoE= 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=0i2JkfQAX7KuN18/M430r7Ziz1RJTF4+JSS9uyBLJko=; b=kwJHn0G08IqPf6d/mu5WE6ZiN2orYdvL/UJS+h3B7AE7sZ8AVMtj2R3XcBKXVxvYQ/ F7Bs7NfR9EpiTsFXtJW3vLyVo7LrO9BBVqYLm9Z1wLGghTU7DaewhE9Hgo10bdhV8EFY iPB4LsBUAOyhKSdx3/+XibQ2KT17/6Kfo1w9zdvGngNevTp6EFkYf4owJTuYoBAieu1W MxlHnz4j+uK7KOes97yc/OhWkj98lCEQXIO6GpwcUgckPejz9JsbESTuAIynebzYy163 A46YGELuI4Lvf2nyNv77EexxW7M2mRlNOYJAMQfcyzJ/V3+1ktksPvRzyOXCc8dEkKhx 7PPg== X-Gm-Message-State: ALoCoQn91MdcvZvCv1uZlRoN8mq4tlfrJoYfyZuOrIjM43zVyxpNnvudHytc8Xmq2221yHhiVkCr8s83cehjTzvb9MecvLMyLblAADEDD96BBdq6zngThoU= X-Received: by 10.180.73.70 with SMTP id j6mr4920421wiv.64.1403695709090; Wed, 25 Jun 2014 04:28:29 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id lo18sm11382382wic.1.2014.06.25.04.28.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jun 2014 04:28:28 -0700 (PDT) From: Michal Kazior To: j@w1.fi Subject: [PATCH 3/4] hostapd: Perform multi-BSS CSA for DFS properly Date: Wed, 25 Jun 2014 13:20:25 +0200 Message-Id: <1403695226-29139-4-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1403695226-29139-1-git-send-email-michal.kazior@tieto.com> References: <1403695226-29139-1-git-send-email-michal.kazior@tieto.com> 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 Currently hostapd data structures aren't ready for multi-channel BSSes so make DFS work now at least with single-channel multi-BSS channel switching. Signed-off-by: Michal Kazior --- src/ap/dfs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ap/dfs.c b/src/ap/dfs.c index 9190ff6..c2d1940 100644 --- a/src/ap/dfs.c +++ b/src/ap/dfs.c @@ -774,8 +774,7 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface) u8 vht_oper_centr_freq_seg1_idx; int skip_radar = 1; struct csa_settings csa_settings; - struct hostapd_data *hapd = iface->bss[0]; - int err = 1; + int i, err = 1; wpa_printf(MSG_DEBUG, "%s called (CAC active: %s, CSA active: %s)", __func__, iface->cac_started ? "yes" : "no", @@ -853,7 +852,12 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface) return err; } - err = hostapd_switch_channel(hapd, &csa_settings); + for (i = 0; i < iface->num_bss; i++) { + err = hostapd_switch_channel(iface->bss[i], &csa_settings); + if (err) + break; + } + if (err) { wpa_printf(MSG_WARNING, "DFS failed to schedule CSA (%d) - trying fallback", err);