From patchwork Sun Mar 8 16:04:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arik Nemtsov X-Patchwork-Id: 5962401 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 BE9789F318 for ; Sun, 8 Mar 2015 16:05:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C3062026D for ; Sun, 8 Mar 2015 16:04:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0B183201B9 for ; Sun, 8 Mar 2015 16:04:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752823AbbCHQE2 (ORCPT ); Sun, 8 Mar 2015 12:04:28 -0400 Received: from mail-wg0-f52.google.com ([74.125.82.52]:44586 "EHLO mail-wg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752564AbbCHQE2 (ORCPT ); Sun, 8 Mar 2015 12:04:28 -0400 Received: by wghl18 with SMTP id l18so15778691wgh.11 for ; Sun, 08 Mar 2015 09:04:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ptSBwEgV6NNSfMV9IDMY2uDcOG91JVQtseaaJfAF4tc=; b=JqwWFYhW41XB5LdQdB52m1hLpaqRaPBHQuPMm3NAc9hupJzLM9r+qIShIoDc6HTFRw 3f3QlhlhArqB2LdYqKqEBUK6NXQ0F3OGZqxbomASWW0/+qDPND+ZKSeaDt/c1VWQAKXa vkQ0U+93U5KVLls+Hsb54WIeVLgfmjo+wU6hZ9xH62LVqqEi4AIxj08foyShBvzjI/5B 1KodBKa97hTqk2Sf5GZm+ny/nyfCLmmC2DMYrK/T6QIcYhp8PNIZmsBKsev+G+KiMGmx /Zk0thdPjFsxTAJUt9o+r+eAiZZVsEvs2gomqyk8jCOB/nwrM1pIcL9cUVEx6hbSlkvJ +ckg== X-Gm-Message-State: ALoCoQnTiR3/GOM6yZgjIxrttTl+3OD4VmQ/09Ms7UAZuwABZXMUJyZ7kxWus69XWDIL1ABPULLk X-Received: by 10.194.223.103 with SMTP id qt7mr47378358wjc.35.1425830666690; Sun, 08 Mar 2015 09:04:26 -0700 (PDT) Received: from athena.ger.corp.intel.com ([89.139.55.99]) by mx.google.com with ESMTPSA id m4sm24296201wjb.25.2015.03.08.09.04.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Mar 2015 09:04:25 -0700 (PDT) From: Arik Nemtsov To: Cc: Johannes Berg Subject: [PATCH] mac80211: initialize rate control earlier for tdls station Date: Sun, 8 Mar 2015 18:04:22 +0200 Message-Id: <1425830662-24803-1-git-send-email-arik@wizery.com> X-Mailer: git-send-email 2.1.0 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=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 From: Marek Puzyniak Currently when TDLS station in driver goes from authorized to associated state it can not use rate control parameters because rate control is not initialized yet. Some drivers require parameters already initialized by rate control when entering associated state. It can be done by initializing rate control after station transition to associated state but before notifying driver about that. Signed-off-by: Marek Puzyniak Signed-off-by: Arik Nemtsov --- net/mac80211/cfg.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 94889de..0e43e6e 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -977,6 +977,14 @@ static int sta_apply_auth_flags(struct ieee80211_local *local, if (mask & BIT(NL80211_STA_FLAG_ASSOCIATED) && set & BIT(NL80211_STA_FLAG_ASSOCIATED) && !test_sta_flag(sta, WLAN_STA_ASSOC)) { + /* + * When peer becomes authorized, init rate control as + * well. Some drivers require rate control initialized + * before drv_sta_state() is called. + */ + if (test_sta_flag(sta, WLAN_STA_TDLS_PEER)) + rate_control_rate_init(sta); + ret = sta_info_move_state(sta, IEEE80211_STA_ASSOC); if (ret) return ret; @@ -1378,11 +1386,6 @@ static int ieee80211_change_station(struct wiphy *wiphy, if (err) goto out_err; - /* When peer becomes authorized, init rate control as well */ - if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) && - test_sta_flag(sta, WLAN_STA_AUTHORIZED)) - rate_control_rate_init(sta); - mutex_unlock(&local->sta_mtx); if ((sdata->vif.type == NL80211_IFTYPE_AP ||