From patchwork Tue Jul 17 00:48:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 10527827 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4B670603ED for ; Tue, 17 Jul 2018 00:49:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CD9D28CC7 for ; Tue, 17 Jul 2018 00:49:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30EAC28CD3; Tue, 17 Jul 2018 00:49:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D49A728CC7 for ; Tue, 17 Jul 2018 00:49:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=mlAgnPJ5tM/d4NL0LdH8FVVxPGot91vdxpiSwjefEpU=; b=EzP Qp9pxaOX0mFjSP/2C8PeY/akpKNXaFXyVgqTHdkfogLywoJCmGmoDx3ITbOxRixhCmYUuVZe+PiZx lXI5VkHXqHvUy+g9Iw2TluFQbk/hqJ7a4R8q0mn1lDRywTlQAlDrKKw9CGAmpGlPJYemXo1kWcL/t R6Dz5EzBHgtol/y/X3AYXJZKvWK9/fmzFjY+aCQxVrtp56LH4WHLWvK/6bRNf8RwrTuSSD3Ctcqxd pFJ3mwoxq4G9bExGSMJwJgI1z47MdgdrhmozyzcJIZri8r9kE/Pupst5DAOV0gNkVQ5u7oSa5desv vloIalBiuviZwITLEcnjOKpvrj6eNiw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffEB7-0007Ks-7p; Tue, 17 Jul 2018 00:49:21 +0000 Received: from mail2.candelatech.com ([208.74.158.173]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffEB3-0007KA-Id for ath10k@lists.infradead.org; Tue, 17 Jul 2018 00:49:18 +0000 Received: from ben-dt3.candelatech.com (firewall.candelatech.com [50.251.239.81]) by mail2.candelatech.com (Postfix) with ESMTP id 0316940A539; Mon, 16 Jul 2018 17:49:02 -0700 (PDT) From: greearb@candelatech.com To: ath10k@lists.infradead.org Subject: [RFC] ath10k: Support configuring firmware tx-retry counter. Date: Mon, 16 Jul 2018 17:48:59 -0700 Message-Id: <1531788539-17937-1-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 2.4.11 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180716_174917_669172_D6879814 X-CRM114-Status: GOOD ( 10.80 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ben Greear , linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ben Greear Firmware already supports this, so just enable the path to configure the vdev parameter. One potential issue: The firmware (10.1 at least) defaults to 2, and the mac80211 stack defaults to 4. So applying this patch would change the firmware behaviour regardless of user settings. I verified this tweaked the proper firmware setting when I ran this command: iw phy wiphy0 set retry short 2 long 2 Signed-off-by: Ben Greear --- drivers/net/wireless/ath/ath10k/mac.c | 31 +++++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath10k/wmi.c | 2 +- drivers/net/wireless/ath/ath10k/wmi.h | 2 ++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index c90c8bb..b458e5b 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -2027,6 +2027,16 @@ static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif) return 0; } +static int ath10k_mac_vif_config_retry_limit(struct ath10k_vif *arvif, int limit) +{ + struct ath10k *ar = arvif->ar; + int vdev_param = ar->wmi.vdev_param->rc_num_retries; + + lockdep_assert_held(&arvif->ar->conf_mutex); + + return ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, limit); +} + static int ath10k_mac_vif_disable_keepalive(struct ath10k_vif *arvif) { struct ath10k *ar = arvif->ar; @@ -5516,6 +5526,24 @@ static int ath10k_config_ps(struct ath10k *ar) return ret; } +static int ath10k_config_retry_limit(struct ath10k *ar, int limit) +{ + struct ath10k_vif *arvif; + int ret = 0; + + lockdep_assert_held(&ar->conf_mutex); + + list_for_each_entry(arvif, &ar->arvifs, list) { + ret = ath10k_mac_vif_config_retry_limit(arvif, limit); + if (ret) { + ath10k_warn(ar, "failed to setup retry-limit: %d\n", ret); + break; + } + } + + return ret; +} + static int ath10k_mac_txpower_setup(struct ath10k *ar, int txpower) { int ret; @@ -5592,6 +5620,9 @@ static int ath10k_config(struct ieee80211_hw *hw, u32 changed) ath10k_warn(ar, "failed to recalc monitor: %d\n", ret); } + if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS) + ret = ath10k_config_retry_limit(ar, conf->long_frame_max_tx_count); + mutex_unlock(&ar->conf_mutex); return ret; } diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 6aaa439..816883d 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -874,7 +874,7 @@ static struct wmi_vdev_param_map wmi_10x_vdev_param_map = { .tx_encap_type = WMI_VDEV_PARAM_UNSUPPORTED, .ap_detect_out_of_sync_sleeping_sta_time_secs = WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS, - .rc_num_retries = WMI_VDEV_PARAM_UNSUPPORTED, + .rc_num_retries = WMI_10X_VDEV_PARAM_RC_NUM_RETRIES, .cabq_maxdur = WMI_VDEV_PARAM_UNSUPPORTED, .mfptest_set = WMI_VDEV_PARAM_UNSUPPORTED, .rts_fixed_rate = WMI_VDEV_PARAM_UNSUPPORTED, diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index 95ff280..b01778e 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -5369,6 +5369,8 @@ enum wmi_10x_vdev_param { WMI_10X_VDEV_PARAM_MCAST2UCAST_SET, /* Enable/Disable RTS-CTS */ WMI_10X_VDEV_PARAM_ENABLE_RTSCTS, + /** Total number of HW retries */ + WMI_10X_VDEV_PARAM_RC_NUM_RETRIES, WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,