From patchwork Wed Feb 25 07:55:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Puzyniak X-Patchwork-Id: 5878131 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 AB0969F693 for ; Wed, 25 Feb 2015 07:53:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CF70D2034F for ; Wed, 25 Feb 2015 07:53:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C2CAE2037A for ; Wed, 25 Feb 2015 07:53:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752580AbbBYHxa (ORCPT ); Wed, 25 Feb 2015 02:53:30 -0500 Received: from mail-la0-f52.google.com ([209.85.215.52]:38204 "EHLO mail-la0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752416AbbBYHx3 (ORCPT ); Wed, 25 Feb 2015 02:53:29 -0500 Received: by lamq1 with SMTP id q1so2109452lam.5 for ; Tue, 24 Feb 2015 23:53:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=InwSPg8IJW9wtxNUBUp+zVD6m5WY/xiLAMK7FQWjI/M=; b=sYIIldZW+J1iOFOprg5wJUvKkU3yyDAlgknH7fbvxjB0UCnDc77/AXr+qk0d1+Xo5G xFCTP6dMWKsRrLYzhnmANfqfF96wZhWXp6clO0mH9sOrlOpN5xQ+IgNwlP4FOehOl1Pg jo18XaJq5tTDeKLXp9kfubRxH0o90fLNuclqk= 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:in-reply-to :references; bh=InwSPg8IJW9wtxNUBUp+zVD6m5WY/xiLAMK7FQWjI/M=; b=jlBKSB/CM9IVCX2k2Bre8sIVeR3Qqw97JhOSmWrwI0j6jPRaGvE85gpXp8nrHM/6pb UmGHXN83KFXquvsvV03Q4Bx+EaelNSfd6CpQVddKSTtwS39FgZr9K247kEG+ORN2MRV7 MnyBIZpeQGjAqIB+WD8KUEQkU3klTgN7wLjik/KZ92T7Sk/Zgxg8gATPuZI+rwmGZbYU tO7U+yPY0k4UuTqpgkuJqjTw1K/NSbbsXBK5f2wxECJOuxrsiBnEMHEPAvHKY3T1iKre swE7IrR+U7txygHHHmLbmySt43apOowVMrOVbS7BLSUn029wW40g4jMIbs3dXGcYn231 DMlw== X-Gm-Message-State: ALoCoQl1+wa1L4u3duKqCt0r0B/j5VWmjwgAve43EURBdF0zfDv64Y0BW8bG2AnCCAprmldM4GpbBvUQNHrKmK9S9b+EoF33bigG6cm8GiPwpW3kGe02W2IDpiDPU9MJurpIlsn/Pp2lQw+BmT9fymPy9xBXENf9Q98po2coZDG602uN8k7MoFp0fTgf4KjtTSUdhOZG+x65 X-Received: by 10.152.43.228 with SMTP id z4mr1495126lal.111.1424850807947; Tue, 24 Feb 2015 23:53:27 -0800 (PST) Received: from dell-lap.com (apn-77-113-114-198.dynamic.gprs.plus.pl. [77.113.114.198]) by mx.google.com with ESMTPSA id o9sm2471630laa.19.2015.02.24.23.53.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Feb 2015 23:53:27 -0800 (PST) From: Marek Puzyniak To: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Cc: Marek Puzyniak Subject: [PATCH v2 3/4] mac80211: initialize rate control earlier for tdls station Date: Wed, 25 Feb 2015 08:55:10 +0100 Message-Id: <1424850911-21017-4-git-send-email-marek.puzyniak@tieto.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1424850911-21017-1-git-send-email-marek.puzyniak@tieto.com> References: <1424850911-21017-1-git-send-email-marek.puzyniak@tieto.com> X-DomainID: tieto.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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 Currently when TDLS station in driver goes from assoc to authorized 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 authorized state. It can be done by initializing rate control after station transition to authorized state but before notifying driver about that. Signed-off-by: Marek Puzyniak --- net/mac80211/cfg.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index dd4ff36..ae24ed3 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -983,12 +983,21 @@ static int sta_apply_auth_flags(struct ieee80211_local *local, } if (mask & BIT(NL80211_STA_FLAG_AUTHORIZED)) { - if (set & BIT(NL80211_STA_FLAG_AUTHORIZED)) + if (set & BIT(NL80211_STA_FLAG_AUTHORIZED)) { + /* + * 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_AUTHORIZED); - else if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) + } else if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) { ret = sta_info_move_state(sta, IEEE80211_STA_ASSOC); - else + } else { ret = 0; + } if (ret) return ret; } @@ -1377,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 ||