From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-eopbgr690114.outbound.protection.outlook.com ([40.107.69.114]:33005 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733120AbeIXUvk (ORCPT ); Mon, 24 Sep 2018 16:51:40 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "Dreyfuss, Haim" , Luca Coelho , Johannes Berg , Sasha Levin Subject: [PATCH AUTOSEL 4.18 59/76] mac80211: fix WMM TXOP calculation Date: Mon, 24 Sep 2018 14:48:37 +0000 Message-ID: <20180924144751.164410-58-alexander.levin@microsoft.com> References: <20180924144751.164410-1-alexander.levin@microsoft.com> In-Reply-To: <20180924144751.164410-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: "Dreyfuss, Haim" [ Upstream commit abd76d255d69d70206c01b9cb19ba36a9c1df6a1 ] In commit 9236c4523e5b ("mac80211: limit wmm params to comply with ETSI requirements"), we have limited the WMM parameters to comply with 802.11 and ETSI standard. Mistakenly the TXOP value was caluclated wrong. Fix it by taking the minimum between 802.11 to ETSI to make sure we are not violating both. Fixes: e552af058148 ("mac80211: limit wmm params to comply with ETSI requir= ements") Signed-off-by: Haim Dreyfuss Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/mac80211/util.c b/net/mac80211/util.c index c80187d6e6bb..93b5bb849ad7 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1151,8 +1151,7 @@ void ieee80211_regulatory_limit_wmm_params(struct iee= e80211_sub_if_data *sdata, qparam->cw_min =3D max_t(u16, qparam->cw_min, wmm_ac->cw_min); qparam->cw_max =3D max_t(u16, qparam->cw_max, wmm_ac->cw_max); qparam->aifs =3D max_t(u8, qparam->aifs, wmm_ac->aifsn); - qparam->txop =3D !qparam->txop ? wmm_ac->cot / 32 : - min_t(u16, qparam->txop, wmm_ac->cot / 32); + qparam->txop =3D min_t(u16, qparam->txop, wmm_ac->cot / 32); rcu_read_unlock(); } =20 --=20 2.17.1