From patchwork Wed Jun 3 18:22:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya X-Patchwork-Id: 6540531 X-Patchwork-Delegate: johannes@sipsolutions.net 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CAE9E9F3D1 for ; Wed, 3 Jun 2015 18:22:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E56B5206BA for ; Wed, 3 Jun 2015 18:22:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0C79C2069B for ; Wed, 3 Jun 2015 18:22:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753031AbbFCSWh (ORCPT ); Wed, 3 Jun 2015 14:22:37 -0400 Received: from mail-pd0-f178.google.com ([209.85.192.178]:33230 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751558AbbFCSWf (ORCPT ); Wed, 3 Jun 2015 14:22:35 -0400 Received: by pdbqa5 with SMTP id qa5so12931608pdb.0 for ; Wed, 03 Jun 2015 11:22:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=J0Wb3hVVBQ8y4raUrBJNJDLgvkgEiLK+1ZiyEkB2eoY=; b=O1zJ4DuNbsJ1UccfNfq4eRVmQT3Tg79fAeNhozbOAaW8Gk4bDEpR90fN4wIJyNAQ2x FpFeP/MWfBH8HkphTwvSo+fgMoPfHgPvrDIyXOYmepWfn5JbznSby/okL9iO2Ez8GCnZ 9dTsG8ZMDnoH7Uq/EbmnEmrpkgPSPjOmrDg/lAyAjyA81WkNAag9Umb4jxG7SAe2bak6 KXio+9BF5EzmDNJkq/HTpa0qM744nB2OLAkQCyD+Qb3G44wvf/GFrsYYs1L13VVnpjzq FJn/v36IwHXl3aS7rYefoJ48A9FEvpXBpkfR/WwTbbUeE4lnzkNweV3jWdiV6d6U0Xtj HiYg== X-Received: by 10.70.119.36 with SMTP id kr4mr62743642pdb.39.1433355754572; Wed, 03 Jun 2015 11:22:34 -0700 (PDT) Received: from localhost.localdomain ([183.82.211.120]) by mx.google.com with ESMTPSA id nt15sm1481679pdb.14.2015.06.03.11.22.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Jun 2015 11:22:34 -0700 (PDT) From: Chaitanya T K To: Felix Fietkau , johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Chaitanya T K Subject: [PATCH V3] mac80211: minstrel_ht: Handle Dynamic SMPS state of the peer. Date: Wed, 3 Jun 2015 23:52:12 +0530 Message-Id: <1433355732-7604-1-git-send-email-chaitanya.mgit@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 In case of Dynamic SMPS enable RTS/CTS for all rates. Signed-off-by: Chaitanya T K --- V3: Moved the check to set_rate. V2: Fix indent and add signoff. --- net/mac80211/rc80211_minstrel_ht.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 7430a1d..600208f 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c @@ -867,7 +867,15 @@ minstrel_ht_set_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi, else idx = index % MCS_GROUP_RATES + (group->streams - 1) * 8; - if (offset > 0) { + /* Enable RTS/CTS for below cases. + * 1) Handle STA's SMPS State, if Nss > 1. + * a. Use RTS_CTS, if STA is in Dynamic SMPS Mode + * b. Mark Nss > 1 as unsupported, if STA is in static SMPS mode + * 2) 2nd and 3rd Rates, as 1st Rate Failed. + */ + if ((mi->sta->smps_mode == IEEE80211_SMPS_DYNAMIC && + group->streams > 1) || + offset > 0) { ratetbl->rate[offset].count = ratetbl->rate[offset].count_rts; flags |= IEEE80211_TX_RC_USE_RTS_CTS; }