From patchwork Thu Jan 23 10:38:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 3527871 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BDA9B9F2D6 for ; Thu, 23 Jan 2014 10:43:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 48D8F201B6 for ; Thu, 23 Jan 2014 10:43:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F6B4201BB for ; Thu, 23 Jan 2014 10:43:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754452AbaAWKns (ORCPT ); Thu, 23 Jan 2014 05:43:48 -0500 Received: from mail-ea0-f180.google.com ([209.85.215.180]:33605 "EHLO mail-ea0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754041AbaAWKnp (ORCPT ); Thu, 23 Jan 2014 05:43:45 -0500 Received: by mail-ea0-f180.google.com with SMTP id f15so331880eak.39 for ; Thu, 23 Jan 2014 02:43:44 -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:in-reply-to:references; bh=5gkyhg0WI3xKHuLMce+i+wvAuKO52svOHnnB+nsc0AQ=; b=t+GF+YsBL94sn2rKYhqSmOF+sPH9JTIeMnO8VfYAIPuNE1A1rk5EiHb7O3KCqqFhAY 9Q4FQXU7FZAoTsYyp38FPd0VUs32cuc6b8c1VPQ4M/HqYWiHHW9jG/m6XpR0jmVOzLvF amkLdx6Ho8ZVPv3T5dTyI0czpJIKOVXUb10to= 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=5gkyhg0WI3xKHuLMce+i+wvAuKO52svOHnnB+nsc0AQ=; b=gTRkmyhJHtqOZQjSnxqAVlw3E/JAbrllKTyYRl1zTEnEcVChH3wCaUXsoZOxALiXSI 6Ejl1kzrMYLXKSGk5TLwEzAJQxzowt64TnYJpnSFVzsLfhY6PKtWxK1Zri3nTP0WL/ia Fv5ryv+yzippfWm/gIsJj+dZzdwslRshR8Doyq0MPEZOmPds5vDxaeNJwdKyJh806R88 pnYfbTy8M4LdoXy5b1gHZVq9kP6bBBugMqf8J6lsWLlCzz2f67G+1P+zDVYfbcYGeoLj 5A271ZEZ4clxXBxpSaTVP5sjJQJiiU+F+LRFqjrnXfNg8tpYx1yxDpzjHEc2OqCVH1Uc 0V7w== X-Gm-Message-State: ALoCoQnic3P6bY6Xw0fnCDFEiWMHgYx3A6Fd25TfbHKZqoFfPJy9+cKr/K/NwpWkzisyn51V5RxxrXuMuTb5/tsFEWfmZ17PDOvigViaXPdTZY8xaHLnZy8= X-Received: by 10.15.50.129 with SMTP id l1mr29275eew.114.1390473824781; Thu, 23 Jan 2014 02:43:44 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id m47sm38084944eey.7.2014.01.23.02.43.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2014 02:43:44 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Michal Kazior Subject: [PATCH 2/2] ath10k: implement AP CSA Date: Thu, 23 Jan 2014 11:38:26 +0100 Message-Id: <1390473506-15677-3-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1390473506-15677-1-git-send-email-michal.kazior@tieto.com> References: <1390473506-15677-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Most channel switching logic has been implemented already so this patch is pretty small. The patch makes use of mac80211's vif->csa_active for AP CSA handling. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 10 ++++++++++ drivers/net/wireless/ath/ath10k/wmi.c | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 323c886..ebaa8ad 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3760,6 +3760,14 @@ static int ath10k_set_bitrate_mask(struct ieee80211_hw *hw, return ath10k_set_fixed_rate_param(arvif, fixed_rate, fixed_nss); } +static void ath10k_channel_switch_beacon(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct cfg80211_chan_def *chandef) +{ + /* there's no need to do anything here. vif->csa_active is enough */ + return; +} + static const struct ieee80211_ops ath10k_ops = { .tx = ath10k_tx, .start = ath10k_start, @@ -3783,6 +3791,7 @@ static const struct ieee80211_ops ath10k_ops = { .restart_complete = ath10k_restart_complete, .get_survey = ath10k_get_survey, .set_bitrate_mask = ath10k_set_bitrate_mask, + .channel_switch_beacon = ath10k_channel_switch_beacon, #ifdef CONFIG_PM .suspend = ath10k_suspend, .resume = ath10k_resume, @@ -4162,6 +4171,7 @@ int ath10k_mac_register(struct ath10k *ar) ar->hw->max_listen_interval = ATH10K_MAX_HW_LISTEN_INTERVAL; ar->hw->wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; + ar->hw->wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH; ar->hw->wiphy->max_remain_on_channel_duration = 5000; ar->hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 712a606..67e91a4 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -1385,6 +1385,17 @@ static void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb) continue; } + /* There are no completions for beacons so wait for next SWBA + * before telling mac80211 to decrement CSA counter + * + * Once CSA counter is completed stop sending beacons until + * actual channel switch is done */ + if (arvif->vif->csa_active && + ieee80211_csa_is_complete(arvif->vif)) { + ieee80211_csa_finish(arvif->vif); + continue; + } + bcn = ieee80211_beacon_get(ar->hw, arvif->vif); if (!bcn) { ath10k_warn("could not get mac80211 beacon\n");