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: 5878171 Return-Path: X-Original-To: patchwork-ath10k@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 E53EBBF440 for ; Wed, 25 Feb 2015 07:54:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 218542034F for ; Wed, 25 Feb 2015 07:54:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2179B2037A for ; Wed, 25 Feb 2015 07:54:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YQWnF-0004yu-LF; Wed, 25 Feb 2015 07:54:05 +0000 Received: from mail-lb0-x22c.google.com ([2a00:1450:4010:c04::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YQWn0-0004lg-6d for ath10k@lists.infradead.org; Wed, 25 Feb 2015 07:53:51 +0000 Received: by lbiw7 with SMTP id w7so2067611lbi.9 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=Df8fuE5rTRwK7bYGQRWiCp3evxDkkju/6PjifDOlHw//iumasHrS+MxpTBYqs7m0jc Ia3Q1ix3DYqhLpcR/mcqti6wzLksCucMBlMCBwMBQ26PiqzsABnxTOCs79g5Q4VpIlrP 5DwQAIx6+Ug9oJVWax766UhzJoV8cQ+avaTr6u70errsRS8hSFfNnPjpNHyhXHd3D6Rb YnkEwacqziCXZoYJMmJqQpJJqOnz9QKQzVukmV2ZB4czggEMt46b9/hdRM9s1LUIIm/R eKEDPhNpizxiKYtx2hHMp4wYIGRiTUMWPPzS/eX3RyxYaUU5vW/IRAPUINlKUzmG//O7 NvlA== X-Gm-Message-State: ALoCoQmMCAFNmbCmQQ4DbliMEAnNx9H18m3jLiRt+RG9XeomHjK8CKPPh1SOSYkhQL0ovzd9JgVpS7Y9eiJnUun/O/XQdzpkLdlRA2mA93DH0TzzYY+cVxbqbJN1pJOH+NseFqkv1S9/ 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150224_235350_456921_EEACE3D9 X-CRM114-Status: GOOD ( 10.64 ) X-Spam-Score: -0.8 (/) Cc: Marek Puzyniak X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, 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 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 ||