From patchwork Wed Jan 11 22:33:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 9511575 X-Patchwork-Delegate: johannes@sipsolutions.net 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 B316D60231 for ; Wed, 11 Jan 2017 22:33:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A47B528696 for ; Wed, 11 Jan 2017 22:33:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9985C2869A; Wed, 11 Jan 2017 22:33:31 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04C4628696 for ; Wed, 11 Jan 2017 22:33:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935531AbdAKWd3 (ORCPT ); Wed, 11 Jan 2017 17:33:29 -0500 Received: from nbd.name ([46.4.11.11]:36786 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934241AbdAKWd2 (ORCPT ); Wed, 11 Jan 2017 17:33:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Message-Id:Date:Subject:Cc:To:From; bh=d1IXrgtSVZG8lzqqdBt6bpbxHc6Ssuqfd5H46SCYGt0=; b=iNV+gpD7BMgpF7EUXAbUcfguApFSu5QBK/ZWKyVxvu/0iUl1Xyo9lXyUiatx6drpEcuwr614bnn1oe9j8E0lHjDwpZjOZWMcUw+gT1EqEzZZAKYQztd2JrxOViu6YiN0z+BWmIDeYSh4UMpMV+BwTyWuwCq30ukvfVW8FoPk80g=; Received: by nf-4.local (Postfix, from userid 501) id 1FBFC1821BAD5; Wed, 11 Jan 2017 23:33:22 +0100 (CET) From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, onelektra@gmx.net Subject: [PATCH] mac80211: initialize SMPS field in HT capabilities Date: Wed, 11 Jan 2017 23:33:22 +0100 Message-Id: <20170111223322.14698-1-nbd@nbd.name> X-Mailer: git-send-email 2.11.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ibss and mesh modes copy the ht capabilites from the band without overriding the SMPS state. Unfortunately the default value 0 for the SMPS field means static SMPS instead of disabled. This results in HT ibss and mesh setups using only single-stream rates, even though SMPS is not supposed to be active. Initialize SMPS to disabled for all bands on ieee80211_hw_register to ensure that the value is sane where it is not overriden with the real SMPS state. Reported-by: Elektra Wagenrad Signed-off-by: Felix Fietkau --- net/mac80211/main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 1822c77f2b1c..c269046aa02b 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -913,10 +913,15 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) supp_ht = supp_ht || sband->ht_cap.ht_supported; supp_vht = supp_vht || sband->vht_cap.vht_supported; - if (sband->ht_cap.ht_supported) - local->rx_chains = - max(ieee80211_mcs_to_chains(&sband->ht_cap.mcs), - local->rx_chains); + if (!sband->ht_cap.ht_supported) + continue; + + local->rx_chains = + max(ieee80211_mcs_to_chains(&sband->ht_cap.mcs), + local->rx_chains); + + sband->ht_cap.cap |= WLAN_HT_CAP_SM_PS_DISABLED << + IEEE80211_HT_CAP_SM_PS_SHIFT; /* TODO: consider VHT for RX chains, hopefully it's the same */ }