From patchwork Sat Jan 4 21:24:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya X-Patchwork-Id: 3434411 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6E96B9F2E9 for ; Sat, 4 Jan 2014 21:24:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6F2A420138 for ; Sat, 4 Jan 2014 21:24:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A1B0A200ED for ; Sat, 4 Jan 2014 21:24:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754800AbaADVY1 (ORCPT ); Sat, 4 Jan 2014 16:24:27 -0500 Received: from mail-pd0-f179.google.com ([209.85.192.179]:46606 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754861AbaADVY0 (ORCPT ); Sat, 4 Jan 2014 16:24:26 -0500 Received: by mail-pd0-f179.google.com with SMTP id r10so16713995pdi.10 for ; Sat, 04 Jan 2014 13:24:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=E5tSSslEq0VbNVGlBh3zaBo42v3CWy1YsX7GsW0y3qg=; b=mfnyQl+BNmW0OEttpgM9nFPS+1P6ByMK5Hf48IXTPJZ+iNKiU8g25xRuMldU09JPZN NYwsVtShAz1U9ahXp/wVQsTio7Q14pp8Xq1PNPtrFcyZLbj8htXek1MyKcb5qOdU8PXP 5xlwP+/dcDn+xBwUE+G34aXF3KM5qF3bvebSLk3WLz1jrGlHrD3adgz3pL0P0OlG49y2 FuaS4NVGbxUYzIgY1I9aUcQYHzKHpG0nLFkcSB4gAdZce/1lX5Nv6WIm2i0/JSgTU0cV GN/PGU62fzV3rJgYccS/Is7nwKLFdSBy8M4s9X+1STBsrPgyvX1kJCAvZ4mGK8A8x5nc QM2g== X-Received: by 10.68.204.136 with SMTP id ky8mr109152228pbc.33.1388870665542; Sat, 04 Jan 2014 13:24:25 -0800 (PST) Received: from localhost.localdomain ([49.206.155.104]) by mx.google.com with ESMTPSA id by1sm117908915pbd.25.2014.01.04.13.24.22 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 04 Jan 2014 13:24:24 -0800 (PST) From: Chaitanya T K To: johannes@sipsolutions.net, linux-wireless@vger.kernel.org Cc: Chaitanya T K Subject: [PATCH] mac80211: SMPS: Fix the overwrite of rx_chains in the interface loop. Date: Sun, 5 Jan 2014 02:54:13 +0530 Message-Id: <1388870653-3507-1-git-send-email-chaitanya.mgit@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 The interface loop identifies the no of static and dynamic smps chains, but overwrites their values across the VIF's (assuming there are more than one, in my case its AP and STA loopback), so the driver might not intimated about this update of SMPS mode, is the value is same. So inform driver for every VIF. For Ex: STA's SMPS state is changed, but in the loop AP appears at the last, SMPS state of AP is unchanged hence not intimated to the driver. Signed-off-by: Chaitanya T K --- net/mac80211/chan.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index f43613a..e153a7e 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -483,26 +483,26 @@ void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local, rx_chains_static = max(rx_chains_static, needed_static); rx_chains_dynamic = max(rx_chains_dynamic, needed_dynamic); - } - rcu_read_unlock(); + if (!local->use_chanctx) { + if (rx_chains_static > 1) + local->smps_mode = IEEE80211_SMPS_OFF; + else if (rx_chains_dynamic > 1) + local->smps_mode = IEEE80211_SMPS_DYNAMIC; + else + local->smps_mode = IEEE80211_SMPS_STATIC; + ieee80211_hw_config(local, 0); + } - if (!local->use_chanctx) { - if (rx_chains_static > 1) - local->smps_mode = IEEE80211_SMPS_OFF; - else if (rx_chains_dynamic > 1) - local->smps_mode = IEEE80211_SMPS_DYNAMIC; - else - local->smps_mode = IEEE80211_SMPS_STATIC; - ieee80211_hw_config(local, 0); - } + if (rx_chains_static == chanctx->conf.rx_chains_static && + rx_chains_dynamic == chanctx->conf.rx_chains_dynamic) + return; - if (rx_chains_static == chanctx->conf.rx_chains_static && - rx_chains_dynamic == chanctx->conf.rx_chains_dynamic) - return; + chanctx->conf.rx_chains_static = rx_chains_static; + chanctx->conf.rx_chains_dynamic = rx_chains_dynamic; + drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RX_CHAINS); + } + rcu_read_unlock(); - chanctx->conf.rx_chains_static = rx_chains_static; - chanctx->conf.rx_chains_dynamic = rx_chains_dynamic; - drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RX_CHAINS); } int ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata,