From patchwork Fri Jan 13 10:28:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 9514983 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 97D22601E5 for ; Fri, 13 Jan 2017 10:28:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E17E285ED for ; Fri, 13 Jan 2017 10:28:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 811BE28607; Fri, 13 Jan 2017 10:28:37 +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 0E486285ED for ; Fri, 13 Jan 2017 10:28:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751440AbdAMK2f (ORCPT ); Fri, 13 Jan 2017 05:28:35 -0500 Received: from nbd.name ([46.4.11.11]:51098 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751419AbdAMK2c (ORCPT ); Fri, 13 Jan 2017 05:28:32 -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=BSsOTtSN5Q+YZ4zbRfIuyOGl1awPOnwConY0UXOyST4=; b=NHri7ElLI2jTard/b1BzYs5Ii3agzNdgK70BmoDO/exHqQJnsf+jLvyLHxTj7Zsiy+WhlWj3SmgTKvFunKiBbmClQ9X6glAo8Xd4OL3guJ+Rd+/B+cQ6i3VHwVAq5Q0AsaeqOrGfjzA6rgj/HraKSQ09uGJGYYi6pjA7iCDYquc=; Received: by nf-4.local (Postfix, from userid 501) id D197818249102; Fri, 13 Jan 2017 11:28:25 +0100 (CET) From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, onelektra@gmx.net Subject: [PATCH v2] mac80211: initialize SMPS field in HT capabilities Date: Fri, 13 Jan 2017 11:28:25 +0100 Message-Id: <20170113102825.72047-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 --- v2: add comment about OR'ing the PS_DISABLED value net/mac80211/main.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 1822c77f2b1c..d253ce71d472 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -913,10 +913,16 @@ 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); + + /* no need to mask, SM_PS_DISABLED has all bits set */ + 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 */ }