From patchwork Fri Apr 17 07:06:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 6228461 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5AC8DBF4A6 for ; Fri, 17 Apr 2015 07:08:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 51FC520306 for ; Fri, 17 Apr 2015 07:08:09 +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 5F6C9201F4 for ; Fri, 17 Apr 2015 07:08:08 +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 1Yj0Mf-0006ia-To; Fri, 17 Apr 2015 07:07:01 +0000 Received: from wolverine01.qualcomm.com ([199.106.114.254]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yj0Md-0006e8-2J for ath10k@lists.infradead.org; Fri, 17 Apr 2015 07:06:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1429254420; x=1460790420; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=BNLbqzC+UzHk6hJ/DridaO6O3h86JqaQ1uYpGz4CGao=; b=irzqbc/cwBxTrfoyL2DwBDWKAoFJXzH73NEI2Afqc2oQ3QjLInyykaQK 5R62OffGcaHQmtBNsq8UlF5lHd5wy/Z7/b5GYOGJ+hLncajF7288z5vz9 Bupq52e0CJxL7kthi94YQYngnLok2oD4EyL+97Q+QP1rf0VR/Svv4C1fM I=; X-IronPort-AV: E=McAfee;i="5700,7163,7773"; a="113787096" Received: from ironmsg03-l.qualcomm.com ([172.30.48.18]) by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 17 Apr 2015 00:06:39 -0700 X-IronPort-AV: E=Sophos;i="5.11,592,1422950400"; d="scan'208";a="889514179" Received: from nasanexm01g.na.qualcomm.com ([10.85.0.33]) by Ironmsg03-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 17 Apr 2015 00:06:37 -0700 Received: from potku.adurom.net (10.80.80.8) by NASANEXM01G.na.qualcomm.com (10.85.0.33) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Fri, 17 Apr 2015 00:06:35 -0700 From: Kalle Valo To: Michal Kazior Subject: Re: [PATCH] ath10k: implement more versatile set_bitrate_mask References: <1428672772-9275-1-git-send-email-michal.kazior@tieto.com> Date: Fri, 17 Apr 2015 10:06:28 +0300 In-Reply-To: <1428672772-9275-1-git-send-email-michal.kazior@tieto.com> (Michal Kazior's message of "Fri, 10 Apr 2015 13:32:52 +0000") Message-ID: <87618v44jv.fsf@kamboji.qca.qualcomm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01C.na.qualcomm.com (10.85.0.83) To NASANEXM01G.na.qualcomm.com (10.85.0.33) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150417_000659_156151_018FEA2F X-CRM114-Status: GOOD ( 19.76 ) X-Spam-Score: -5.1 (-----) Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org 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: , 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 Michal Kazior writes: > Until now only a single fixed tx rate or nss was > allowed to be set. > > The patch attempts to improve this by allowing > most bitrate masks. The limitation is VHT MCS > rates cannot be expressed separately using > existing firmware interfaces and only the > following VHT MCS ranges are supported: none, 0-7, > 0-8, and 0-9. > > This keeps the old behaviour when requesting > single tx rate or single nss. The new bitrate mask > logic is only applied to other cases that would > return -EINVAL until now. > > Depending on firmware revisions some combinations > may crash firmware so use with care, please. > > This depends on "ath10k: don't use reassoc flag". > Without it key cache would effectively be > invalidated upon bitrate change leading to > communication being no longer possible. > > Signed-off-by: Michal Kazior To reduce support questions from the users it would be nice to give few good examples how to use this with iw. And also it makes it easier to test the patch. If you could send something I can add it to the commit log. > +static u16 > +ath10k_peer_assoc_h_vht_limit(u16 tx_mcs_set, > + const u16 vht_mcs_limit[NL80211_VHT_NSS_MAX]) > +{ > + int idx_limit; > + int nss; > + u16 mcs_map; > + u16 mcs; > + > + for (nss = 0; nss < NL80211_VHT_NSS_MAX; nss++) { > + mcs_map = ath10k_mac_get_max_vht_mcs_map(tx_mcs_set, nss) & > + vht_mcs_limit[nss]; > + > + if (mcs_map) > + idx_limit = fls(mcs_map) - 1; > + else > + idx_limit = -1; > + > + switch (idx_limit) { > + case 0: /* fall through */ > + case 1: /* fall through */ > + case 2: /* fall through */ > + case 3: /* fall through */ > + case 4: /* fall through */ > + case 5: /* fall through */ > + case 6: /* fall through */ > + default: > + /* see ath10k_mac_can_set_bitrate_mask() */ > + WARN_ON(1); > + /* fall through */ > + case -1: > + mcs = IEEE80211_VHT_MCS_NOT_SUPPORTED; break; > + case 7: > + mcs = IEEE80211_VHT_MCS_SUPPORT_0_7; break; > + case 8: > + mcs = IEEE80211_VHT_MCS_SUPPORT_0_8; break; > + case 9: > + mcs = IEEE80211_VHT_MCS_SUPPORT_0_9; break; > + } I moved the breaks into their own lines, I think that just easier to read. This is the diff: diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index ace273f7ec73..069f399e4c25 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -2277,13 +2277,17 @@ ath10k_peer_assoc_h_vht_limit(u16 tx_mcs_set, WARN_ON(1); /* fall through */ case -1: - mcs = IEEE80211_VHT_MCS_NOT_SUPPORTED; break; + mcs = IEEE80211_VHT_MCS_NOT_SUPPORTED; + break; case 7: - mcs = IEEE80211_VHT_MCS_SUPPORT_0_7; break; + mcs = IEEE80211_VHT_MCS_SUPPORT_0_7; + break; case 8: - mcs = IEEE80211_VHT_MCS_SUPPORT_0_8; break; + mcs = IEEE80211_VHT_MCS_SUPPORT_0_8; + break; case 9: - mcs = IEEE80211_VHT_MCS_SUPPORT_0_9; break; + mcs = IEEE80211_VHT_MCS_SUPPORT_0_9; + break; } tx_mcs_set &= ~(0x3 << (nss * 2));