From patchwork Tue Mar 31 11:03:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 6128751 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1D4089F32E for ; Tue, 31 Mar 2015 11:08:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42E2B20160 for ; Tue, 31 Mar 2015 11:08:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D04220155 for ; Tue, 31 Mar 2015 11:08:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ycu1k-0007qh-0x; Tue, 31 Mar 2015 11:08:12 +0000 Received: from mail-la0-x230.google.com ([2a00:1450:4010:c03::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ycu1h-0007iw-6v for ath10k@lists.infradead.org; Tue, 31 Mar 2015 11:08:10 +0000 Received: by lagg8 with SMTP id g8so9792382lag.1 for ; Tue, 31 Mar 2015 04:07:47 -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; bh=wX9ZvFz0HA8O3QOJOKRfKDrnsFOl0dGFQHD220m/0KU=; b=PGiy1uPDdkNez5wH9yyImc8Xu5RPoiTMp9O/mgU/HsZkpRBQW2mCjMylPo1recREu+ 181+4LSnOmyYhMuWyvj5dQHxnk4KnTVxd+IVdGkQwDdTov0ZU3/nAZUe+JtZytOYQc18 qBYNaaxRKGPB0ToUw+eUMCx53ozBbEctOE8W4= 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=wX9ZvFz0HA8O3QOJOKRfKDrnsFOl0dGFQHD220m/0KU=; b=UC8+1yMAwvmFmOTPg8gqITuEZI/USXhdeydJxp0s3ugwX30vGOWum3DAZrlhdZ6tiF O/+liWLxO+6Vp3qscqwuXbRJQL1GIxoVxm/T+ONK5a8DZ495omKq6JxEkMMbaw55wILl Xwh1ycatJQEenoMMW+OHjE01WHkbSTrhOtRThNkK2BnWZ2phoUirJ1Hn3FKSNfD64cSQ S3J8Gg7vvQqeOvW7Q6U4sJl9BrHKKHhoyd9xAkPRZMpwusjW8DVXTaSfWnH1JJhOGkav 6ztaNZyl9iwi1ounPv/B46moRqbA8c5tohYvhpU6Mj13bEwYuRQay85yVIZbLj9tapHo D1Cw== X-Gm-Message-State: ALoCoQlYhCuAA+nesQnM9LLvIh/ESf+OSga0ezAFSTW/4DeKX7x6zKQWNOfW6dRQ+4ZZo91VsjePLbg9HvLJTh5RKrl/yrQ70ov5efRZhFiqj4QwVnajMjRknqRKifmgSQO60N5NPK+kPY0x2lfbMoTNXVviWmDNvgmF1zolg6hU7EUHYMMzdvU= X-Received: by 10.152.26.34 with SMTP id i2mr9258252lag.117.1427800067459; Tue, 31 Mar 2015 04:07:47 -0700 (PDT) Received: from bob.homerouter.cpe (apn-46-169-246-95.dynamic.gprs.plus.pl. [46.169.246.95]) by mx.google.com with ESMTPSA id mm7sm2570296lbb.30.2015.03.31.04.07.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Mar 2015 04:07:46 -0700 (PDT) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH 1/2] ath10k: fix hw roc expiration Date: Tue, 31 Mar 2015 11:03:47 +0000 Message-Id: <1427799828-9539-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150331_040809_446267_B65F87A9 X-CRM114-Status: UNSURE ( 7.98 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: linux-wireless@vger.kernel.org, Michal Kazior X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 It is not guaranteed firmware will switch to foreign channel immediately after starting scan sequence. To account for that don't use duration parameter for scan time. Instead request insanely long scan and use timeout worker to cancel it from driver. This should improve P2P reliability a bit. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 9206b109e1ce..cb5d253e87d9 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -5029,6 +5029,7 @@ static int ath10k_remain_on_channel(struct ieee80211_hw *hw, struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif); struct wmi_start_scan_arg arg; int ret = 0; + u32 scan_time_msec; mutex_lock(&ar->conf_mutex); @@ -5055,7 +5056,7 @@ static int ath10k_remain_on_channel(struct ieee80211_hw *hw, if (ret) goto exit; - duration = max(duration, WMI_SCAN_CHAN_MIN_TIME_MSEC); + scan_time_msec = ar->hw->wiphy->max_remain_on_channel_duration * 2; memset(&arg, 0, sizeof(arg)); ath10k_wmi_start_scan_init(ar, &arg); @@ -5063,9 +5064,9 @@ static int ath10k_remain_on_channel(struct ieee80211_hw *hw, arg.scan_id = ATH10K_SCAN_ID; arg.n_channels = 1; arg.channels[0] = chan->center_freq; - arg.dwell_time_active = duration; - arg.dwell_time_passive = duration; - arg.max_scan_time = 2 * duration; + arg.dwell_time_active = scan_time_msec; + arg.dwell_time_passive = scan_time_msec; + arg.max_scan_time = scan_time_msec; arg.scan_ctrl_flags |= WMI_SCAN_FLAG_PASSIVE; arg.scan_ctrl_flags |= WMI_SCAN_FILTER_PROBE_REQ; @@ -5090,6 +5091,9 @@ static int ath10k_remain_on_channel(struct ieee80211_hw *hw, goto exit; } + ieee80211_queue_delayed_work(ar->hw, &ar->scan.timeout, + msecs_to_jiffies(duration)); + ret = 0; exit: mutex_unlock(&ar->conf_mutex);