From patchwork Sun Aug 12 16:24:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1309921 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 554B43FC33 for ; Sun, 12 Aug 2012 16:25:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751858Ab2HLQZV (ORCPT ); Sun, 12 Aug 2012 12:25:21 -0400 Received: from latitanza.investici.org ([82.94.249.234]:53528 "EHLO latitanza.investici.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751105Ab2HLQZU (ORCPT ); Sun, 12 Aug 2012 12:25:20 -0400 Received: from [82.94.249.234] (latitanza [82.94.249.234]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 259199805F; Sun, 12 Aug 2012 16:25:17 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 latitanza.investici.org 259199805F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1344788718; bh=JbOv/xNkJnUd5+KdWpjDGj4R5iLIFx4J4+hvKsE4ip0=; h=From:To:Cc:Subject:Date:Message-Id; b=XaWcUzdDQPXcvGAyDnVIpnWhtQgMIsF9rx1YGYOjfQ0VVE2WeXPMQhKiFtm1seTTM PbusB9PFqCAAAvEGd4j6khkXoaYQuyQs1XEK1YtdrVSWz3GtOPyFhh0uB040VeZk3Z SkFf39pDGmjdgxTZJ5eTVMAzbBCGlKVRAqqIahkA= From: Antonio Quartulli To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Antonio Quartulli Subject: [PATCH] mac80211: add supported rates change notification in IBSS Date: Sun, 12 Aug 2012 18:24:55 +0200 Message-Id: <1344788695-1458-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.9.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In IBSS it is possible that the supported rates set for a station changes over time (e.g. it gets first initialised as an empty set because of no available information about rates and updated later). In this case the driver has to be notified about the change in order to update its internal table accordingly (if needed). This behaviour is needed by all those drivers that handle rc internally but leave stations management to mac80211 Reported-by: Gui Iribarren Signed-off-by: Antonio Quartulli --- include/net/mac80211.h | 1 + net/mac80211/ibss.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index bb86aa6..9b0f71f 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -1888,6 +1888,7 @@ enum ieee80211_frame_release_type { enum ieee80211_rate_control_changed { IEEE80211_RC_BW_CHANGED = BIT(0), IEEE80211_RC_SMPS_CHANGED = BIT(1), + IEEE80211_RC_SUPP_RATES_CHANGED = BIT(2), }; /** diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 37e71a3..590cf19 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c @@ -467,8 +467,11 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, } } - if (sta && rates_updated) + if (sta && rates_updated) { + drv_sta_rc_update(&local->hw, &sdata->vif, &sta->sta, + IEEE80211_RC_SUPP_RATES_CHANGED); rate_control_rate_init(sta); + } rcu_read_unlock(); }