From patchwork Thu Aug 27 23:34:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reinette Chatre X-Patchwork-Id: 44359 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7RNZ3DX026065 for ; Thu, 27 Aug 2009 23:35:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751619AbZH0Xe7 (ORCPT ); Thu, 27 Aug 2009 19:34:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751605AbZH0Xe6 (ORCPT ); Thu, 27 Aug 2009 19:34:58 -0400 Received: from mga09.intel.com ([134.134.136.24]:46986 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751527AbZH0Xe6 (ORCPT ); Thu, 27 Aug 2009 19:34:58 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 27 Aug 2009 16:20:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.44,288,1249282800"; d="scan'208";a="443386206" Received: from rc-desk.jf.intel.com (HELO localhost.localdomain) ([134.134.15.187]) by orsmga002.jf.intel.com with ESMTP; 27 Aug 2009 16:41:20 -0700 From: Reinette Chatre To: johannes@sipsolutions.net, linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, Reinette Chatre Subject: [PATCH 1/2] cfg80211: initialize rate control after station inserted Date: Thu, 27 Aug 2009 16:34:53 -0700 Message-Id: <1251416094-10420-1-git-send-email-reinette.chatre@intel.com> X-Mailer: git-send-email 1.5.6.3 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Reinette Chatre Station information may be needed by rate control algorithms, so call rate scaling initialization after adding the station. Signed-off-by: Reinette Chatre --- net/mac80211/cfg.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 5608f6c..598db11 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -729,8 +729,6 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, sta_apply_parameters(local, sta, params); - rate_control_rate_init(sta); - layer2_update = sdata->vif.type == NL80211_IFTYPE_AP_VLAN || sdata->vif.type == NL80211_IFTYPE_AP; @@ -742,13 +740,17 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, if (err == -EEXIST && layer2_update) { /* Need to update layer 2 devices on reassociation */ sta = sta_info_get(local, mac); - if (sta) + if (sta) { + rate_control_rate_init(sta); ieee80211_send_layer2_update(sta); + } } rcu_read_unlock(); return err; } + rate_control_rate_init(sta); + if (layer2_update) ieee80211_send_layer2_update(sta);