From patchwork Mon Apr 14 09:51:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gang ZHAO X-Patchwork-Id: 3979131 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1CEF1BFF02 for ; Mon, 14 Apr 2014 09:54:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 562F12012B for ; Mon, 14 Apr 2014 09:54:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 95657201BF for ; Mon, 14 Apr 2014 09:54:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754713AbaDNJxw (ORCPT ); Mon, 14 Apr 2014 05:53:52 -0400 Received: from mail-pb0-f42.google.com ([209.85.160.42]:45792 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751952AbaDNJwA (ORCPT ); Mon, 14 Apr 2014 05:52:00 -0400 Received: by mail-pb0-f42.google.com with SMTP id rr13so8075741pbb.15 for ; Mon, 14 Apr 2014 02:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=c5wd5wKSqZ+lwzUn8WmbkDFReu8qAZCRhGEFEmaVbnQ=; b=xc7yDHffieuzzHf2EbAQtLaCX27wbTUBWhSapLQrAlTV3tBYrpoSnR8EAF2I1e3+Tx MY09kl6o5giqhT05IuJPno0iA65Aqgowot05L+MJgmfuSM87V+bsFSJ1c6FfVwovQQaW jdLCOVSPihjZL4cP0K2emNR8kt9gqKi/lod5KJL7aMVm4xmrrgc+D5ruxUgry/rjKUWq pbIJnUq+IDGwtIpYDoOa0TRHosGWd3jAmja4O09Dz5lDJZ7SkeR0qXeLIkTJh7iVGN/d GKElW6jB1Jv1XoudZY26hq/mW3tGoqRvhaavj654p+mENGXj9TGLWcsLp+/CMKg2Ewie lxcw== X-Received: by 10.68.164.229 with SMTP id yt5mr43057724pbb.28.1397469119658; Mon, 14 Apr 2014 02:51:59 -0700 (PDT) Received: from localhost.localdomain ([175.153.40.114]) by mx.google.com with ESMTPSA id j3sm32747430pbh.38.2014.04.14.02.51.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Apr 2014 02:51:59 -0700 (PDT) From: "Zhao, Gang" To: Cc: Johannes Berg Subject: [PATCH 3/6] mac80211: minor changes to ieee80211_reconfig() Date: Mon, 14 Apr 2014 17:51:32 +0800 Message-Id: <14b385a08ccf4d9ca90d54acb84e7414aed761a8.1397469036.git.gamerh2o@gmail.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <8b5c4a61ae1f49400478b030fa7ae4e3a5ca2bcb.1397469035.git.gamerh2o@gmail.com> References: <8b5c4a61ae1f49400478b030fa7ae4e3a5ca2bcb.1397469035.git.gamerh2o@gmail.com> In-Reply-To: <8b5c4a61ae1f49400478b030fa7ae4e3a5ca2bcb.1397469035.git.gamerh2o@gmail.com> References: <8b5c4a61ae1f49400478b030fa7ae4e3a5ca2bcb.1397469035.git.gamerh2o@gmail.com> 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.8 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 Try to update chanctx only if local->use_chanctx is true. P2P_DEVICE doesn't support ieee80211_bss_info_change_notify() for now, so it's not needed to set changed flags for P2P_DEVICE. Besides, flag BSS_CHANGED_IDLE is already set in the common change flags. Signed-off-by: Zhao, Gang --- net/mac80211/util.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 275c94f..191e558 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1565,17 +1565,17 @@ int ieee80211_reconfig(struct ieee80211_local *local) list_for_each_entry(ctx, &local->chanctx_list, list) WARN_ON(drv_add_chanctx(local, ctx)); mutex_unlock(&local->chanctx_mtx); - } - list_for_each_entry(sdata, &local->interfaces, list) { - if (!ieee80211_sdata_running(sdata)) - continue; - ieee80211_assign_chanctx(local, sdata); - } + list_for_each_entry(sdata, &local->interfaces, list) { + if (!ieee80211_sdata_running(sdata)) + continue; + ieee80211_assign_chanctx(local, sdata); + } - sdata = rtnl_dereference(local->monitor_sdata); - if (sdata && ieee80211_sdata_running(sdata)) - ieee80211_assign_chanctx(local, sdata); + sdata = rtnl_dereference(local->monitor_sdata); + if (sdata && ieee80211_sdata_running(sdata)) + ieee80211_assign_chanctx(local, sdata); + } /* add STAs back */ mutex_lock(&local->sta_mtx); @@ -1671,13 +1671,10 @@ int ieee80211_reconfig(struct ieee80211_local *local) } break; case NL80211_IFTYPE_WDS: - break; case NL80211_IFTYPE_AP_VLAN: case NL80211_IFTYPE_MONITOR: - /* ignore virtual */ - break; case NL80211_IFTYPE_P2P_DEVICE: - changed = BSS_CHANGED_IDLE; + /* nothing to do */ break; case NL80211_IFTYPE_UNSPECIFIED: case NUM_NL80211_IFTYPES: