From patchwork Sun Mar 1 07:10:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 5907141 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@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 643FBBF440 for ; Sun, 1 Mar 2015 07:10:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 87C842041A for ; Sun, 1 Mar 2015 07:10:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9621A203DF for ; Sun, 1 Mar 2015 07:10:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751781AbbCAHKu (ORCPT ); Sun, 1 Mar 2015 02:10:50 -0500 Received: from mga14.intel.com ([192.55.52.115]:49636 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751584AbbCAHKs (ORCPT ); Sun, 1 Mar 2015 02:10:48 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 28 Feb 2015 23:06:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,670,1418112000"; d="scan'208";a="692231992" Received: from egrumbacbox.jer.intel.com ([10.12.125.42]) by orsmga002.jf.intel.com with ESMTP; 28 Feb 2015 23:10:47 -0800 From: Emmanuel Grumbach To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Arik Nemtsov , Arik Nemtsov , Emmanuel Grumbach Subject: [PATCH 12/16] mac80211: update TDLS sta spatial streams before auth Date: Sun, 1 Mar 2015 09:10:11 +0200 Message-Id: <1425193815-17785-13-git-send-email-emmanuel.grumbach@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1425193815-17785-1-git-send-email-emmanuel.grumbach@intel.com> References: <1425193815-17785-1-git-send-email-emmanuel.grumbach@intel.com> 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 From: Arik Nemtsov Make sure the number of spatial streams is correctly updated for a TDLS station. Usually this is done during rate control init, during the add_station nl80211 command. Unfortunately TDLS stations only get valid HT/VHT-cap information in the change_station nl80211 command, and rate-control init is delayed accordingly. Some drivers (iwlwifi) assume the nss will be appropriately during the sta_state(assoc) callback, and this doesn't hold for TDLS. Initialize the nss earlier for TDLS peers, which also has the benefit of making sta_state behavior more consistent. Signed-off-by: Arik Nemtsov Signed-off-by: Emmanuel Grumbach --- net/mac80211/cfg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 02f1125..bc33911 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1126,6 +1126,10 @@ static int sta_apply_parameters(struct ieee80211_local *local, ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband, params->vht_capa, sta); + if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) && + (params->ht_capa || params->vht_capa)) + ieee80211_sta_set_rx_nss(sta); + if (params->opmode_notif_used) { /* returned value is only needed for rc update, but the * rc isn't initialized here yet, so ignore it