From patchwork Tue Feb 3 10:41:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Puzyniak X-Patchwork-Id: 5767401 Return-Path: X-Original-To: patchwork-ath10k@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 4F07F9F2ED for ; Tue, 3 Feb 2015 10:41:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B8C520C35 for ; Tue, 3 Feb 2015 10:41:02 +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 9261C20C30 for ; Tue, 3 Feb 2015 10:41:01 +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 1YIaua-0007Xg-QG; Tue, 03 Feb 2015 10:40:52 +0000 Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YIauZ-0007P7-Bt for ath10k@lists.infradead.org; Tue, 03 Feb 2015 10:40:52 +0000 Received: by mail-wi0-f179.google.com with SMTP id l15so20787460wiw.0 for ; Tue, 03 Feb 2015 02:40:29 -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=rjsgmyntlvUHJabGrYRcRzrUVjc2KnsuoYAzdZnKpuU=; b=lnJDiK6L07DORN6wiwmtVRnh8f1efD7eNFva/mI19TMxi/jjhZs9p8cYb6Nw4k0uhk JDhg5iPO4DGd+8BIaUvTVkelZy/QcHqgzzaQ+GbBU7HfnN3mBedUHsFFSM+zl894ehDn 4vfEYSaWjaoAXlu+FIlilnOfk72bDiuQ7Ny14= 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=rjsgmyntlvUHJabGrYRcRzrUVjc2KnsuoYAzdZnKpuU=; b=jOH/XujMRk5B/NZwdCqY+WuJVK2MCPacNzh5SetEaoy5RMZEGmbuXtd456wUEA/ll7 4D2fOGPixVbjTeVBA3PfkT0KnYJC2KXJVEIDF11ln18coPbIQs1loi73kdubBHTpONi/ lPhxVINSBtI5vVw3EG5EdIwdhUMvB7ch/isqYqcrTxbdYdAeVZu62zFblzVkihjCETJQ /mM+VQqUNLBwDaEx5haA3x4NpPctIhYJJHGIP5boqHXJKk8gNpnIgIRAvwuU5LNBV+HZ h0QSbC5LT9i8A4vJXJDSUBvLtSzEJIkZVPxeAsx22v01K0dE+CPnAk96VDfsNq5r9+cK JQxA== X-Gm-Message-State: ALoCoQkYuvjpDGPNZztFtrlaEI2Q7S4D6E7cwd7SsmuriLckpO6zuHBHXzYiH/fu4O4uYoamXJA6f7ZL5msmZZE3812o7KXqsURB55gx8Vy2yCVJkqfZhcdIUDumwojVGmTb93jAFDzXAhBImepQ51daomnKJBFEbl+NkDjzu88SNF/LooWDyUE= X-Received: by 10.180.105.10 with SMTP id gi10mr33019580wib.24.1422960029446; Tue, 03 Feb 2015 02:40:29 -0800 (PST) Received: from dell-lap.com (apn-31-1-134-151.dynamic.gprs.plus.pl. [31.1.134.151]) by mx.google.com with ESMTPSA id v7sm23981339wib.5.2015.02.03.02.40.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Feb 2015 02:40:28 -0800 (PST) From: Marek Puzyniak To: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [RFC 3/4] mac80211: initialize rate control earlier for tdls station Date: Tue, 3 Feb 2015 11:41:53 +0100 Message-Id: <1422960114-25137-4-git-send-email-marek.puzyniak@tieto.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1422960114-25137-1-git-send-email-marek.puzyniak@tieto.com> References: <1422960114-25137-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-20150203_024051_556167_69898844 X-CRM114-Status: GOOD ( 10.56 ) 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 a777114..3849054 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -952,12 +952,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; } @@ -1346,11 +1355,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 ||